/* Midhull web player. Liner Notes direction: Archivo only, upright, dark first, colour from the song cover.
   Token values mirror brand/system/dist/tokens.css. Archivo is licensed under the SIL Open Font License 1.1. */

@font-face { font-family: Archivo; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/archivo-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Archivo; font-style: normal; font-weight: 400 800; font-display: swap; src: url("/assets/fonts/archivo-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  color-scheme: dark;
  --bg: #0c0c10; --surface: #15151b; --raised: #1e1e26; --pressed: #26262f;
  --text: #f3efe8; --muted: #a29e97; --subtle: #76726c; --line: #2a2a33; --border: #77737b;
  --action: #ff6a3d; --on-action: #0c0c10; --answered: #5ed3b3;
  --wave: #77737b; --wave-played: #f3efe8; --overlay: rgba(0, 0, 0, .64);
  --song-wash: var(--song-wash-d, #292116); --song-accent: var(--song-accent-d, #ff6a3d);
  --font: Archivo, "Noto Sans JP", "Noto Sans KR", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1); --wash-ease: cubic-bezier(.3, 0, .2, 1);
  --t-micro: 120ms; --t-base: 220ms; --t-screen: 360ms;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: #f3efe8; --surface: #fbf8f3; --raised: #fbf8f3; --pressed: #e5dfd5;
    --text: #0c0c10; --muted: #5f5b55; --subtle: #857f77; --line: #e2dcd1; --border: #868075;
    --action: #ff6a3d; --on-action: #0c0c10; --answered: #17735c;
    --wave: #868075; --wave-played: #0c0c10; --overlay: rgba(12, 12, 16, .4);
    --song-wash: var(--song-wash-l, #e8dcce); --song-accent: var(--song-accent-l, #b83a12);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3efe8; --surface: #fbf8f3; --raised: #fbf8f3; --pressed: #e5dfd5;
  --text: #0c0c10; --muted: #5f5b55; --subtle: #857f77; --line: #e2dcd1; --border: #868075;
  --action: #ff6a3d; --on-action: #0c0c10; --answered: #17735c;
  --wave: #868075; --wave-played: #0c0c10; --overlay: rgba(12, 12, 16, .4);
  --song-wash: var(--song-wash-l, #e8dcce); --song-accent: var(--song-accent-l, #b83a12);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; }
body { min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; overflow-x: hidden; }
:lang(ja) body, body:lang(ja) { --font: Archivo, "Noto Sans JP", system-ui, sans-serif; }
:lang(ko) body, body:lang(ko) { --font: Archivo, "Noto Sans KR", system-ui, sans-serif; }
h1, h2, h3, p, b, blockquote { word-break: auto-phrase; overflow-wrap: anywhere; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.ic { width: 24px; height: 24px; flex: none; }
.ic.s { width: 20px; height: 20px; }
.small { font-size: 13px; color: var(--muted); }
.wordmark { font-weight: 800; font-size: 18px; letter-spacing: -.03em; text-decoration: none; }

/* Buttons and chips (kit) */
.btn { height: 52px; border-radius: 26px; border: 0; padding: 0 24px; font-weight: 700; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; background: var(--raised); color: var(--text); transition: transform var(--t-micro) var(--ease), background var(--t-micro) var(--ease); white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--action); color: var(--on-action); }
.btn.secondary { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.btn.block { width: 100%; }
.chip { height: 44px; padding: 0 14px; border-radius: 22px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 500; font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease); }
.chip .ic { width: 18px; height: 18px; }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); box-shadow: none; }
.play-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--text); color: var(--bg); display: grid; place-items: center; flex: none; transition: transform var(--t-micro) var(--ease); }
.play-btn:active { transform: scale(.96); }
.play-btn.s { width: 40px; height: 40px; }
.play-btn.s .ic { width: 20px; height: 20px; }
.play-btn .ic { grid-area: 1 / 1; }
.play-btn .ic:last-child { display: none; }
.play-btn[aria-pressed="true"] .ic:first-child { display: none; }
.play-btn[aria-pressed="true"] .ic:last-child { display: block; }
.icon-btn { width: 40px; height: 40px; border-radius: 20px; border: 0; background: transparent; display: grid; place-items: center; color: inherit; }
.icon-btn:active { background: var(--pressed); }

/* Reveal */
.reveal { position: relative; flex: 1; isolation: isolate; overflow: hidden; }
.reveal .col { position: relative; max-width: 460px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 28px 36px; text-align: center; }
.wash { position: absolute; left: 50%; top: 290px; width: 1100px; height: 1100px; margin: -550px 0 0 -550px; border-radius: 50%; pointer-events: none; z-index: -1; background: radial-gradient(closest-side, color-mix(in oklab, var(--song-accent) 55%, transparent), color-mix(in oklab, var(--song-wash) 70%, transparent) 55%, transparent 100%); opacity: 0; transform: scale(0); }
.wash.on, .is-open .wash { opacity: .9; transform: none; }
.wordmark.top { display: inline-block; position: relative; }
.from { margin-top: 18px; }
.from h1 { margin: 0; font-weight: 800; font-size: 34px; letter-spacing: -.025em; line-height: 1.05; text-wrap: balance; }
.from p { margin: 6px 0 0; color: var(--muted); font-size: 16px; }
.art { position: relative; width: min(300px, 100%); aspect-ratio: 1; margin: 22px auto 0; border-radius: 6px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); background: var(--raised); }
.art .img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: blur(24px); transform: scale(1.04); }
.art.sharp .img, .is-open .art .img { filter: none; transform: none; }
.art .veil { position: absolute; inset: 0; background: rgba(243, 239, 232, .18); }
.is-open .art .veil { opacity: 0; }
.art .tap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: #f3efe8; color: #0c0c10; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.art .tap:active { transform: translate(-50%, -50%) scale(.98); }
.art .made-mark { position: absolute; left: 10px; bottom: 10px; z-index: 2; padding: 4px 10px 5px; border-radius: 999px; background: rgba(12, 12, 16, .78); color: #f3efe8; font-weight: 800; font-size: 13px; letter-spacing: -.02em; line-height: 1; pointer-events: none; }
.hint { margin: 14px 0 0; font-size: 14px; color: var(--muted); display: flex; justify-content: center; gap: 6px; align-items: flex-start; text-wrap: balance; }
.hint .ic { width: 16px; height: 16px; margin-top: 2px; }
.quote { margin: 22px 0 0; padding: 18px; border-radius: 16px; background: var(--surface); text-align: left; }
.quote .who { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); font-weight: 600; }
.ava { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--raised); }
.ava.ini { display: grid; place-items: center; font-weight: 700; color: var(--text); }
.quote blockquote { margin: 10px 0 0; font-size: 18px; font-weight: 500; line-height: 1.35; letter-spacing: -.01em; }
.opened { display: none; }
.is-open .opened { display: block; }
.is-open .closed-only { display: none; }
.ttl { margin-top: 22px; text-align: left; display: flex; align-items: center; gap: 14px; }
.ttl .grow { flex: 1; min-width: 0; }
.ttl h1, .ttl h2 { margin: 0; font-weight: 700; font-size: 22px; letter-spacing: -.02em; line-height: 1.15; }
.ttl span { color: var(--muted); font-size: 14px; }
.scrub { margin-top: 14px; cursor: pointer; touch-action: none; }
.scrub .wave { display: flex; align-items: center; gap: 2px; height: 36px; }
.scrub .wave i { flex: 1; min-width: 2px; border-radius: 1px; background: var(--wave); transition: background var(--t-micro) linear; }
.scrub .wave i.on { background: var(--wave-played); }
.scrub .times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.lyr { margin-top: 20px; text-align: left; display: grid; gap: 8px; }
.lyr p { margin: 0; font-weight: 700; font-size: 21px; letter-spacing: -.015em; line-height: 1.25; color: var(--subtle); opacity: .55; transition: opacity var(--t-screen) var(--ease); }
.lyr p.cur { opacity: 1; }
.lyr p i { font-style: normal; transition: color var(--t-micro) var(--ease); }
.lyr p i.on { color: var(--text); }
.vn { margin-top: 20px; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--surface); text-align: left; }
.vn .grow { flex: 1; min-width: 0; }
.vn b { font-size: 14px; font-weight: 600; display: block; }
.vn small { font-size: 12px; color: var(--muted); }
.sec { margin-top: 30px; text-align: left; }
.sec h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.reacts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.answer { margin-top: 30px; padding: 20px; border-radius: 20px; background: var(--text); color: var(--bg); text-align: left; }
.answer h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.answer p { margin: 6px 0 16px; opacity: .72; font-size: 14px; }
.answer .btn { background: var(--action); color: var(--on-action); }
.answer .split { display: flex; margin-bottom: 14px; }
.answer .split .cover { width: 56px; height: 56px; border-radius: 4px; object-fit: cover; }
.answer .split .cover + .cover { margin-left: -14px; box-shadow: -2px 0 0 var(--text); background: var(--muted); display: grid; place-items: center; color: var(--bg); }
.answer .store .btn { background: var(--bg); color: var(--text); }
.answer .store .btn:first-child { background: var(--action); color: var(--on-action); }
.foot { margin-top: 26px; font-size: 13px; color: var(--muted); display: grid; gap: 8px; text-align: left; }
.foot div { display: flex; gap: 8px; align-items: flex-start; }
.foot .ic { width: 16px; height: 16px; margin-top: 2px; }
.foot a { color: var(--text); font-weight: 600; }

/* Sheets */
.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: 90dvh; border: 0; border-radius: 24px 24px 0 0; padding: 8px 20px max(32px, env(safe-area-inset-bottom)); background: var(--raised); color: var(--text); box-shadow: 0 -10px 40px rgba(0, 0, 0, .3); text-align: left; }
.sheet[open] { animation: sheet-in var(--t-screen) var(--ease) both; }
.sheet::backdrop { background: var(--overlay); animation: fade-in var(--t-base) var(--ease) both; }
.sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 16px; opacity: .6; }
.sheet-x { position: absolute; top: 10px; right: 10px; margin: 0; }
.sheet h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; padding-right: 40px; }
.sheet p.small { margin: 0 0 16px; }
.sheet p.desk { margin: 12px 0 0; }
.opt { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; border: 0; background: none; text-align: left; border-bottom: 1px solid var(--line); padding: 0; text-decoration: none; color: inherit; }
.opt:last-child { border-bottom: 0; }
.opt .grow { flex: 1; }
.opt b { display: block; font-weight: 600; font-size: 15px; }
.opt small { color: var(--muted); font-size: 13px; }
.steps { display: grid; gap: 12px; margin: 6px 0 16px; padding: 0; list-style: none; }
.steps li { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; }
.steps .n { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.steps b { display: block; font-weight: 600; }
.steps span { color: var(--muted); }
.store { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 10px; }
.store .btn { height: 48px; font-size: 14px; padding: 0 10px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: min(420px, calc(100% - 32px)); transform: translate(-50%, 20px); z-index: 40; background: var(--text); color: var(--bg); border-radius: 14px; padding: 14px 16px; font-weight: 600; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity var(--t-base) var(--ease), transform var(--t-base) var(--ease); }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* Site footer, plain pages and legal */
.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; max-width: 760px; width: 100%; margin: 0 auto; padding: 20px 28px max(28px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-foot nav a { color: var(--muted); text-decoration: none; }
.site-foot nav a:hover { color: var(--text); }
.plain { flex: 1; max-width: 560px; width: 100%; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 28px 56px; }
.display { margin: 18vh 0 0; font-weight: 800; font-size: clamp(36px, 8vw, 64px); letter-spacing: -.025em; line-height: 1.05; text-wrap: balance; }
.lede { margin: 14px 0 28px; color: var(--muted); font-size: 17px; max-width: 34em; }
.store.two { max-width: 420px; }
.legal { flex: 1; max-width: 720px; width: 100%; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 28px 56px; }
.legal .draft { margin: 28px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; font-weight: 600; }
.legal h1 { margin: 28px 0 0; font-weight: 800; font-size: clamp(32px, 6vw, 48px); letter-spacing: -.025em; line-height: 1.05; }
.legal .updated { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.legal .intro { margin: 22px 0 0; font-size: 18px; line-height: 1.5; }
.legal section { margin-top: 32px; }
.legal h2 { margin: 0 0 10px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.legal p, .legal li { font-size: 16px; line-height: 1.6; color: var(--text); }
.legal p { margin: 0 0 12px; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.legal li::marker { color: var(--muted); }
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; }
.langs a, .langs span { height: 36px; padding: 0 14px; border-radius: 18px; display: inline-flex; align-items: center; font-size: 14px; font-weight: 500; text-decoration: none; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.langs span { background: var(--text); color: var(--bg); box-shadow: none; }

/* Wider screens: the cover grows, the column stays a calm reading width */
@media (min-width: 720px) {
  .reveal .col { max-width: 520px; padding-top: 40px; }
  .from h1 { font-size: 44px; }
  .art { width: 400px; }
  .wash { top: 360px; width: 1500px; height: 1500px; margin: -750px 0 0 -750px; }
}

/* Motion */
[data-enter] { animation: enter var(--t-screen) var(--ease) both; }
[data-enter]:nth-of-type(2) { animation-delay: 60ms; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-in { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; } }

/* Title cover: shown until the API returns the rendered cover image */
.title-cover { display: flex; align-items: flex-end; padding: 22px; background: linear-gradient(160deg, var(--song-accent), var(--song-wash) 75%); color: #f3efe8; text-align: left; }
.title-cover span { font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -.025em; text-wrap: balance; }
.cover.tint { background: linear-gradient(160deg, var(--song-accent), var(--song-wash)); }
