/* BOOPANG MUSIC - Design D: Design A refined (Midnight Hall, denser rhythm, one Korean zone) */

:root {
  --color-bg: #0D0F1E;
  --color-surface: #151933;
  --color-surface-raised: #1D2244;
  --color-border: #2F356B;
  --color-text: #F4EFE6;
  --color-muted: #A9ADC8;
  --color-primary: #F0B45A;
  --color-on-primary: #1A1208;
  --color-accent: #D96C8B;
  --color-success: #5FCB9A;
  --color-warning: #E7C25E;
  --color-error: #F27B73;
  --color-focus: #FFFFFF;

  --font-sans: system-ui, -apple-system, "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --font-display: "Noto Serif KR", "Nanum Myeongjo", "Batang", "AppleMyungjo", "Times New Roman", serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.416rem;
  --fs-xl: 1.9rem;
  --fs-2xl: 2.53rem;
  --fs-display: clamp(2.75rem, 1.5rem + 5.5vw, 5.75rem);
  --fs-studio-title: clamp(2.1rem, 1rem + 3.6vw, 3.75rem);
  --fs-cta: clamp(2.1rem, 1rem + 3.4vw, 3.5rem);
  --fw-body: 400;
  --fw-strong: 600;
  --fw-display: 400;
  --lh-body: 1.75;
  --lh-tight: 1.15;

  --space-1: 0.375rem;
  --space-2: 0.75rem;
  --space-3: 1.25rem;
  --space-4: 2rem;
  --space-5: 2.25rem;
  --space-6: 3.25rem;

  /* vertical rhythm: A used 7.5rem (120px) / 4.5rem (72px); D is about 27% / 22% smaller */
  --section-pad-y: 5.5rem;
  --section-pad-y-mobile: 3.5rem;
  --hero-pad-bottom: 7rem;
  --prompt-overlap: 5.5rem;

  --radius-sm: 10px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 14px 38px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.45);
  --border-width: 1px;

  --motion-fast: 180ms;
  --motion-base: 600ms;
  --motion-slow: 1100ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --line: rgba(244, 239, 230, 0.12);
  --glow: inset 0 0 40px rgba(240, 180, 90, 0.06);
  --cool: #7C8CFF;
  --header-h: 72px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --beat-min: 5.5rem;
  --row-h: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: var(--fs-md);
  font-weight: var(--fw-body);
  line-height: var(--lh-body);
  word-break: keep-all;
  overflow-wrap: anywhere;
  overflow-x: clip;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, textarea, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }

h1, h2, .studio__title {
  font-family: var(--font-display);
  font-weight: var(--fw-display);
  line-height: var(--lh-tight);
  letter-spacing: -0.02em;
}
h3 { font-weight: var(--fw-strong); line-height: 1.35; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(240, 180, 90, 0.95);
}

.skip-link {
  position: absolute; left: var(--space-2); top: -4rem; z-index: 200;
  padding: 0.75rem 1.25rem; min-height: 44px;
  background: var(--color-primary); color: var(--color-on-primary);
  border-radius: var(--radius-pill); font-weight: var(--fw-strong); text-decoration: none;
}
.skip-link:focus { top: var(--space-2); }

.wrap { max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--rail { max-width: 1320px; overflow-x: clip; }

.ico { width: 1.5em; height: 1.5em; flex: none; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 48px; padding: 0 1.75rem;
  border: var(--border-width) solid transparent; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: var(--fs-md); font-weight: var(--fw-strong);
  line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: transform var(--motion-fast) var(--ease), background-color var(--motion-fast), box-shadow var(--motion-fast), border-color var(--motion-fast);
}
.btn:hover { transform: translateY(-2px); }
.btn--lg { min-height: 56px; padding: 0 2.25rem; font-size: 1.125rem; }
.btn--sm { min-height: 44px; padding: 0 1.1rem; font-size: 0.9375rem; }
.btn--primary {
  background: linear-gradient(180deg, #F6C677, var(--color-primary));
  color: var(--color-on-primary);
  box-shadow: 0 10px 30px rgba(240, 180, 90, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}
.btn--primary:hover { box-shadow: 0 14px 38px rgba(240, 180, 90, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4); }
.btn--secondary {
  background: rgba(244, 239, 230, 0.04); color: var(--color-text);
  border-color: rgba(244, 239, 230, 0.34);
}
.btn--secondary:hover { background: rgba(244, 239, 230, 0.1); border-color: rgba(244, 239, 230, 0.6); }
.btn--tertiary {
  background: transparent; color: var(--color-primary); padding: 0 0.5rem;
  min-height: 44px; border-radius: var(--radius-sm); border: 0;
}
.btn--tertiary:hover { color: #FFD9A0; transform: none; }
.btn--tertiary .ico { width: 1.2em; height: 1.2em; transition: transform var(--motion-fast) var(--ease); }
.btn--tertiary:hover .ico { transform: translateX(4px); }

/* status badge: quiet, small, single */
.status {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 0.6rem;
  border: var(--border-width) solid currentColor; border-radius: var(--radius-pill);
  font-family: var(--font-sans); font-size: var(--fs-xs); font-weight: var(--fw-strong);
  line-height: 1.4; letter-spacing: 0.02em; white-space: nowrap; vertical-align: middle;
}
.status[data-status="BETA"] { color: var(--color-warning); background: rgba(231, 194, 94, 0.1); }
.status[data-status="EXPERIMENTAL"] { color: var(--color-accent); background: rgba(217, 108, 139, 0.12); }
.status[data-status="COMING_SOON"] { color: var(--color-muted); background: rgba(169, 173, 200, 0.1); border-style: dashed; }
.status[data-status="RESEARCH"] { color: var(--cool); background: rgba(124, 140, 255, 0.12); }
.status[data-status="VISION"] { color: var(--color-success); background: rgba(95, 203, 154, 0.1); }

.eyebrow {
  font-size: var(--fs-sm); letter-spacing: 0.14em; color: var(--color-primary);
  font-weight: var(--fw-strong);
}

.demo-tag {
  display: flex; flex-wrap: wrap; gap: 0.15rem 0.6rem; align-items: baseline;
  margin-top: var(--space-2); font-size: var(--fs-xs); line-height: 1.5; color: var(--color-muted);
}
.demo-tag strong {
  font-family: var(--font-mono); letter-spacing: 0.06em; color: var(--color-primary); font-weight: var(--fw-strong);
}

/* header */
.site-header {
  position: sticky; top: 0; z-index: 60; height: var(--header-h);
  background: rgba(13, 15, 30, 0.7);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-bottom: var(--border-width) solid rgba(244, 239, 230, 0.06);
}
.site-header__bar {
  display: flex; align-items: center; gap: var(--space-3);
  max-width: 1320px; height: var(--header-h); margin-inline: auto; padding-inline: var(--gutter);
}
.brand {
  display: inline-flex; align-items: center; gap: 0.6rem; text-decoration: none; min-height: 44px;
  font-family: var(--font-display); font-size: 1.2rem; letter-spacing: 0.04em; color: var(--color-text);
}
.brand__mark { width: 30px; height: 30px; color: var(--color-primary); }
.site-header__panel { display: contents; }
.site-nav { margin-inline: auto; }
.site-nav ul { display: flex; gap: 0.25rem; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.9rem;
  border-radius: var(--radius-pill); color: var(--color-muted); text-decoration: none; font-size: 0.9375rem;
  transition: color var(--motion-fast), background-color var(--motion-fast);
}
.site-nav a:hover { color: var(--color-text); background: rgba(244, 239, 230, 0.07); }
.login-btn {
  min-height: 44px; min-width: 44px; padding: 0 1rem; background: none; border: 0;
  color: var(--color-text); border-radius: var(--radius-pill); font-size: 0.9375rem;
}
.login-btn:hover { background: rgba(244, 239, 230, 0.07); }
.menu-btn {
  display: none; align-items: center; gap: 0.5rem; min-height: 44px; min-width: 44px; padding: 0 0.9rem;
  background: rgba(244, 239, 230, 0.06); border: var(--border-width) solid var(--line);
  border-radius: var(--radius-pill); font-size: 0.9375rem;
}
.menu-btn__bars, .menu-btn__bars::before {
  display: block; width: 16px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.menu-btn__bars::before { content: ""; position: absolute; top: 5px; left: 0; }

/* hero: generous space kept from A */
.hero {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 100svh; margin-top: calc(var(--header-h) * -1); padding-top: var(--header-h);
  padding-bottom: var(--hero-pad-bottom);
  display: flex; flex-direction: column;
}
.hero__glow {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(124, 140, 255, 0.26), transparent 62%),
    radial-gradient(700px 480px at 88% 105%, rgba(217, 108, 139, 0.2), transparent 62%),
    radial-gradient(640px 400px at 8% 78%, rgba(240, 180, 90, 0.1), transparent 64%),
    linear-gradient(180deg, #0A0C1A, var(--color-bg));
}
.hero__inner {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between;
  gap: var(--space-4); padding-top: var(--space-4);
}
.hero__text { max-width: 62rem; margin-inline: auto; padding-inline: var(--gutter); text-align: center; }
.hero__title { font-size: var(--fs-display); margin-top: var(--space-2); text-wrap: balance; }
.hero__line { display: block; }
.hero__line:last-child {
  background: linear-gradient(90deg, #C9CEFF, #F6D19B 60%, #F0B45A);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub {
  margin-top: var(--space-3); font-size: 1.1875rem; color: var(--color-muted); line-height: 1.7;
}
.hero__sub span { display: block; }
.hero__flows { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.5rem; margin-top: var(--space-3); }
.hero__flows li {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 38px; padding: 0 1.05rem 0 0.8rem;
  border: var(--border-width) solid var(--line); border-radius: var(--radius-pill);
  background: rgba(244, 239, 230, 0.04); font-size: 0.9375rem; color: var(--color-text);
}
.hero__flows .ico { width: 1.25em; height: 1.25em; color: var(--color-primary); }
.hero__cta { margin-top: var(--space-4); display: flex; justify-content: center; gap: var(--space-2); flex-wrap: wrap; }
.hero__global { margin-top: var(--space-1); display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 0 0.4rem; font-size: var(--fs-sm); color: var(--color-muted); }
.hero__global a { display: inline-flex; align-items: center; min-height: 44px; color: var(--color-muted); text-underline-offset: 3px; }
.hero__global a:hover { color: var(--color-text); }

/* hero stage: sound lands on paper */
.stage {
  --s-notes: 0; --s-lyrics: 0; --s-score: 0; --s-music: 0;
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); align-content: end;
}
.stage.has-notes { --s-notes: 1; }
.stage.has-lyrics { --s-lyrics: 1; }
.stage.has-score { --s-score: 1; }
.stage.has-music { --s-music: 1; }
.stage__field, .stage__row { grid-area: 1 / 1; }
.stage__field { position: relative; align-self: stretch; }
.stage__wave { position: absolute; inset: 0; }
.stage__row {
  position: relative; display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.5fr) auto;
  align-items: center; column-gap: var(--space-3); padding-inline: var(--gutter);
  min-height: clamp(180px, 28vh, 290px);
}
.stage__score { display: flex; flex-direction: column; min-width: 0; }
.score { width: 99.9%; height: auto; overflow: visible; }
.score--m { display: none; }
.stage .staff line { stroke: rgba(244, 239, 230, 0.55); stroke-width: 1.4; opacity: calc(0.16 + var(--s-score) * 0.84); transition: opacity var(--motion-base) var(--ease); }
.stage .measures line { stroke: rgba(244, 239, 230, 0.6); stroke-width: 1.6; opacity: var(--s-score); transition: opacity var(--motion-base) var(--ease) 300ms; }
.stage .measures .m-start, .stage .measures .m-end { stroke-width: 3; }
.stage .note {
  opacity: var(--s-notes); transform: translateY(calc((1 - var(--s-notes)) * 16px)); transform-box: fill-box;
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  transition-delay: calc(var(--i) * 70ms);
}
.stage .note ellipse { fill: var(--color-text); transition: fill var(--motion-fast); }
.stage .note .flag, .stage .slurs path { fill: none; stroke: rgba(244, 239, 230, 0.85); stroke-width: 2; stroke-linecap: round; }
.stage .slurs path { stroke-width: 1.5; stroke: rgba(244, 239, 230, 0.6); opacity: var(--s-score); transition: opacity var(--motion-base) var(--ease) 300ms; }
.stage .beam line { stroke: rgba(244, 239, 230, 0.9); stroke-width: 4.5; stroke-linecap: butt; opacity: var(--s-notes); transition: opacity var(--motion-base) var(--ease), stroke var(--motion-fast); }
.stage .beam.is-past line { stroke: rgba(240, 180, 90, 0.95); }
.stage .beam.is-now line { stroke: #FFF1D6; }
/* from the score step on the sound wave only hints in the background, so the staff and notes stay clear */
.stage__wave { transition: opacity var(--motion-slow) var(--ease); }
.stage.has-score .stage__wave { opacity: 0.12; }
.stage .note .dot { fill: var(--color-text); }
.stage .note .acc { fill: var(--color-text); font-size: 22px; font-family: var(--font-display); }
.stage .note.is-past ellipse { fill: var(--color-primary); }
.stage .note.is-past line, .stage .note.is-past .flag { stroke: rgba(240, 180, 90, 0.9); }
.stage .note.is-now ellipse { fill: #FFF1D6; filter: drop-shadow(0 0 7px rgba(255, 214, 140, 0.95)); }
.stage .note.is-now line, .stage .note.is-now .flag { stroke: #FFF1D6; }
.stage .syl {
  font-family: var(--font-display); font-size: 25px; fill: var(--color-text);
  opacity: var(--s-lyrics); transform: translateY(calc((1 - var(--s-lyrics)) * 10px)); transform-box: fill-box; transform-origin: center;
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-fast) var(--ease), fill var(--motion-fast);
  transition-delay: calc(var(--i) * 80ms), 0ms, 0ms;
}
.stage .syl.is-past { fill: var(--color-primary); }
.stage .syl.is-now { fill: #FFF1D6; font-weight: var(--fw-strong); transform: translateY(-3px) scale(1.18); transition-delay: 0ms; filter: drop-shadow(0 0 6px rgba(255, 214, 140, 0.85)); }
.stage__score.is-follow { overflow: hidden; }
.stage__score.is-follow .score--song { max-width: none; transition: transform 320ms var(--ease); will-change: transform; }
.stage .note line { stroke: rgba(244, 239, 230, 0.85); stroke-width: 2; }
.lyrics { position: relative; height: 2.25rem; margin-top: -0.35rem; }
.lyrics span {
  position: absolute; left: calc(var(--x) * 1%); top: 0; white-space: nowrap;
  font-family: var(--font-display); font-size: 1rem; color: var(--color-text);
  opacity: var(--s-lyrics); transform: translate(-50%, calc((1 - var(--s-lyrics)) * 8px));
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  transition-delay: calc(var(--x) * 9ms);
}
.stage__play { display: flex; justify-content: center; }
.stage__source {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.6rem 0.9rem;
  margin-top: var(--space-1); padding-inline: var(--gutter);
}
.src-now {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 36px; padding: 0 1rem;
  border-radius: var(--radius-pill); font-size: var(--fs-sm); font-weight: var(--fw-strong);
  border: var(--border-width) solid currentColor; transition: color var(--motion-fast), background-color var(--motion-fast);
}
.src-now.is-orig { color: var(--color-primary); background: rgba(240, 180, 90, 0.1); }
.src-now.is-synth { color: #9FB0FF; background: rgba(124, 140, 255, 0.14); }
.src-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.stage.is-playing .src-dot { animation: srcpulse 1.1s ease-in-out infinite; }
@keyframes srcpulse { 50% { opacity: 0.35; } }
.src-btn {
  min-height: 44px; padding: 0 1.2rem; border-radius: var(--radius-pill); cursor: pointer;
  background: none; color: var(--color-text); border: var(--border-width) solid var(--line);
  font-size: var(--fs-sm); font-weight: var(--fw-strong);
  transition: border-color var(--motion-fast), color var(--motion-fast), background-color var(--motion-fast);
}
.src-btn:hover { border-color: rgba(244, 239, 230, 0.4); }
.src-btn[aria-pressed="true"] { color: #9FB0FF; border-color: rgba(124, 140, 255, 0.55); background: rgba(124, 140, 255, 0.1); }
.src-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

.wave {
  display: flex; align-items: center; justify-content: space-between; gap: 2px;
}
.wave i {
  display: block; position: relative; flex: 0 0 auto; align-self: stretch;
  width: var(--bar-w, 4px); border-radius: var(--radius-pill);
  background: var(--wave-off, rgba(124, 140, 255, 0.5));
  transform: scaleY(var(--h, 0.5));
  transition: background-color var(--motion-fast), opacity var(--motion-slow) var(--ease), transform var(--motion-slow) var(--ease);
  transition-delay: 0ms, calc(var(--i) * 6ms), 0ms;
}
.wave i::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--c, var(--color-primary)); opacity: var(--s-music, 0);
  transition: opacity var(--motion-slow) var(--ease);
}
.wave i.is-on::after { background: var(--color-primary); opacity: 1; }
.stage__wave i { --wave-off: var(--cool); --bar-w: clamp(3px, 0.45vw, 6px); }
.stage.has-notes .stage__wave i:nth-child(n+28) { opacity: 0.14; }
.stage.is-playing .stage__wave i { opacity: 0.4; }
.stage.is-playing .stage__wave i.is-on { opacity: 1; }
.stage.is-playing .stage__wave i:nth-child(n+28).is-on { opacity: 1; }

.stage__caps {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem;
  margin-top: var(--space-2); padding-inline: var(--gutter);
}
.cap {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0 0.9rem;
  border: var(--border-width) solid var(--line); border-radius: var(--radius-pill);
  font-size: var(--fs-sm); color: var(--color-muted);
  transition: color var(--motion-fast), border-color var(--motion-fast), background-color var(--motion-fast);
}
.cap.is-done { color: var(--color-text); border-color: rgba(244, 239, 230, 0.3); }
.cap.is-active {
  color: var(--color-on-primary); background: var(--color-primary); border-color: var(--color-primary);
  font-weight: var(--fw-strong); box-shadow: 0 0 22px rgba(240, 180, 90, 0.28);
}
.stage .demo-tag { justify-content: center; padding-inline: var(--gutter); }
.motion-btn {
  justify-self: center; margin-top: var(--space-1); min-height: 44px; padding: 0 1.1rem;
  background: none; border: var(--border-width) solid var(--line); border-radius: var(--radius-pill);
  color: var(--color-muted); font-size: var(--fs-sm);
}
.motion-btn[hidden] { display: none; }
@media (min-width: 1024px) {
  .stage .motion-btn { position: absolute; right: var(--gutter); bottom: -10px; margin: 0; }
}
.motion-btn[aria-pressed="true"] { color: var(--color-primary); border-color: rgba(240, 180, 90, 0.5); }

/* play button (cinema) */
.play {
  display: inline-flex; flex-direction: column; align-items: center; gap: 0.35rem;
  min-width: 44px; min-height: 44px; padding: 0; background: none; border: 0; color: var(--color-text);
  border-radius: var(--radius-md);
}
.play__disc {
  display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%;
  background: linear-gradient(180deg, #F6C677, var(--color-primary)); color: var(--color-on-primary);
  box-shadow: 0 0 calc(var(--s-music, 0) * 40px) rgba(240, 180, 90, calc(var(--s-music, 0) * 0.45)), 0 10px 26px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform var(--motion-fast) var(--ease), box-shadow var(--motion-slow);
}
.play:hover .play__disc { transform: scale(1.06); }
.play .ico { width: 30px; height: 30px; }
.play .ico--pause { display: none; }
.play[aria-pressed="true"] .ico--play { display: none; }
.play[aria-pressed="true"] .ico--pause { display: block; }
.play__text { font-size: var(--fs-sm); color: var(--color-muted); font-weight: var(--fw-strong); }
.play--sm .play__disc { width: 56px; height: 56px; }
.play--sm .ico { width: 24px; height: 24px; }
.audio-fail {
  margin-top: var(--space-2); padding: 0.5rem 0.9rem; border-radius: var(--radius-sm);
  background: rgba(242, 123, 115, 0.12); color: var(--color-error); font-size: var(--fs-sm);
}

/* prompt */
.prompt { position: relative; z-index: 5; margin-top: calc(var(--prompt-overlap) * -1); }
.prompt__glass {
  padding: var(--space-4); border-radius: var(--radius-lg); border: var(--border-width) solid var(--line);
  background: linear-gradient(180deg, rgba(29, 34, 68, 0.78), rgba(21, 25, 51, 0.78));
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.07), var(--glow);
}
.prompt__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.prompt__title { font-size: var(--fs-xl); }
.prompt__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); margin-top: var(--space-3); align-items: stretch; }
.prompt__form textarea {
  min-height: 72px; padding: 1rem 1.25rem; resize: none; border-radius: var(--radius-md);
  background: rgba(8, 10, 22, 0.55); border: var(--border-width) solid rgba(244, 239, 230, 0.2);
  font-size: 1.125rem; line-height: 1.6;
}
.prompt__form textarea::placeholder { color: rgba(169, 173, 200, 0.85); }
.prompt__form textarea:focus-visible { border-color: var(--color-primary); }
.prompt__error { margin-top: var(--space-2); color: var(--color-error); font-weight: var(--fw-strong); }
.prompt__error[hidden] { display: none; }
.prompt__hint { margin-top: var(--space-2); color: var(--color-muted); font-size: 0.9375rem; }

/* quickstart */
.quickstart { padding-block: calc(var(--section-pad-y) * 0.5); }
.qs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.qs {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem;
  align-self: stretch; width: 99.9%; min-height: 8.75rem; padding: var(--space-3);
  text-align: left; background: linear-gradient(160deg, var(--color-surface-raised), var(--color-surface));
  border: var(--border-width) solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm), var(--glow);
  transition: transform var(--motion-fast) var(--ease), border-color var(--motion-fast), box-shadow var(--motion-fast);
}
.qs:hover { transform: translateY(-4px); border-color: rgba(240, 180, 90, 0.45); box-shadow: var(--shadow-md), 0 0 36px rgba(240, 180, 90, 0.1); }
.qs__icon {
  display: grid; place-items: center; width: 52px; height: 52px; margin-bottom: 0.2rem;
  border-radius: 50%; color: var(--color-primary);
  background: radial-gradient(circle at 30% 25%, rgba(240, 180, 90, 0.25), rgba(240, 180, 90, 0.04));
  border: var(--border-width) solid rgba(240, 180, 90, 0.3);
}
.qs__icon .ico { width: 26px; height: 26px; }
.qs__title { font-size: 1.1875rem; font-weight: var(--fw-strong); }
.qs__desc { color: var(--color-muted); font-size: 0.9375rem; line-height: 1.5; }
.qs-grid > li { display: flex; }

/* sections shared */
section { scroll-margin-top: calc(var(--header-h) + 8px); }
.section-head { margin-bottom: var(--space-5); }
.section-title { font-size: var(--fs-2xl); text-wrap: balance; }
.section-lead { margin-top: var(--space-2); color: var(--color-muted); font-size: 1.125rem; max-width: 40rem; }

/* chapters */
.chapter { position: relative; isolation: isolate; padding-block: var(--section-pad-y); overflow: clip; }
.chapter::before {
  content: ""; position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(760px 460px at 82% 40%, rgba(124, 140, 255, 0.13), transparent 64%);
}
.chapter--right::before { background: radial-gradient(760px 460px at 14% 50%, rgba(217, 108, 139, 0.12), transparent 64%); }
.chapter--center::before { background: radial-gradient(900px 480px at 50% 30%, rgba(240, 180, 90, 0.1), transparent 64%); }
.chapter__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: var(--space-6); align-items: center; }
.chapter--right .chapter__visual { order: -1; }
.chapter__no { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: 0.12em; color: var(--color-primary); }
.chapter__no span:first-child { font-family: var(--font-display); font-size: 1.6rem; margin-right: -0.15rem; color: var(--color-accent); }
.chapter__title { margin-top: var(--space-2); font-size: var(--fs-2xl); text-wrap: balance; }
.chapter__lead { margin-top: var(--space-3); font-size: 1.1875rem; color: var(--color-text); opacity: 0.88; max-width: 34rem; }
.chapter__badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.chapter__text--center { text-align: center; margin-inline: auto; max-width: 46rem; }
.chapter__text--center .chapter__no { justify-content: center; }
.chapter__text--center .chapter__lead { margin-inline: auto; }
.chapter__visual {
  padding: var(--space-3); border-radius: var(--radius-lg); border: var(--border-width) solid var(--line);
  background: linear-gradient(160deg, rgba(29, 34, 68, 0.7), rgba(21, 25, 51, 0.5));
  box-shadow: var(--shadow-lg), var(--glow);
}
.chapter__cta { margin-top: var(--space-4); text-align: center; }
.chapter__cta--left { text-align: left; margin-top: var(--space-3); }

/* one-line flow diagrams */
.flow--line { --art: 64px; display: flex; align-items: flex-start; justify-content: space-between; }
.flow--line .flow__step {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
  gap: var(--space-1); padding: var(--space-1) 0.25rem; text-align: center;
}
.flow__art {
  display: grid; place-items: center; width: var(--art, 64px); height: var(--art, 64px); border-radius: 50%; color: var(--color-primary);
  background: radial-gradient(circle at 30% 25%, rgba(240, 180, 90, 0.25), rgba(240, 180, 90, 0.04));
  border: var(--border-width) solid rgba(240, 180, 90, 0.35);
  box-shadow: 0 0 0 6px rgba(240, 180, 90, 0.04);
}
.flow__art .ico { width: 28px; height: 28px; }
.flow__label { font-family: var(--font-display); font-size: 1.0625rem; }
.flow--line .flow__step + .flow__step::before {
  content: ""; position: absolute; z-index: -1; top: calc(var(--space-1) + var(--art) / 2); height: 2px;
  left: calc(-50% + var(--art) / 2 + 10px); width: calc(99.9% - var(--art) - 20px);
  background: linear-gradient(90deg, rgba(240, 180, 90, 0), rgba(240, 180, 90, 0.7));
}
.flow--line { isolation: isolate; }
.flow--three { max-width: 40rem; margin: var(--space-4) auto 0; }

.cap-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-4) auto 0; max-width: 46rem; }
.cap-list__item {
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1);
  padding: var(--space-3); border-radius: var(--radius-md);
  background: rgba(21, 25, 51, 0.6); border: var(--border-width) solid var(--line);
}
.cap-list__item h3 { font-family: var(--font-display); font-weight: var(--fw-strong); font-size: 1.2rem; }
.cap-list__item p { color: var(--color-muted); font-size: 0.9375rem; }

/* studio teaser */
.studio { position: relative; isolation: isolate; overflow: clip; padding-block: var(--section-pad-y); background: linear-gradient(180deg, var(--color-bg), #080A16 20%, #080A16 80%, var(--color-bg)); }
.studio__glow {
  position: absolute; z-index: -1; inset: 0;
  background: radial-gradient(900px 520px at 50% 52%, rgba(124, 140, 255, 0.16), transparent 66%), radial-gradient(600px 360px at 85% 80%, rgba(240, 180, 90, 0.1), transparent 66%);
}
.studio__head { text-align: center; max-width: 64rem; margin: 0 auto var(--space-5); }
.studio__head .chapter__no { justify-content: center; }
.studio__title { margin-top: var(--space-2); font-size: var(--fs-studio-title); text-wrap: balance; }
.studio__head .chapter__lead { margin-inline: auto; margin-top: var(--space-2); }
.studio__head .chapter__badges { justify-content: center; }
.console {
  padding: var(--space-3); border-radius: var(--radius-lg); border: var(--border-width) solid var(--line);
  background: linear-gradient(180deg, rgba(29, 34, 68, 0.4), rgba(13, 15, 30, 0.6));
  box-shadow: var(--shadow-lg), var(--glow); min-width: 0;
}
.console > .demo-tag { margin-top: var(--space-3); }
.studio__note { color: var(--color-muted); font-size: 0.9375rem; margin-bottom: var(--space-2); }

/* console bar and version switch */
.console__bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-2); }
.console__hint { color: var(--color-muted); font-size: var(--fs-sm); }
.vswitch { display: inline-flex; padding: 4px; gap: 4px; border-radius: var(--radius-pill); border: var(--border-width) solid var(--line); background: rgba(8, 10, 22, 0.7); }
.vswitch__btn {
  min-height: 44px; min-width: 44px; padding: 0 1.25rem; border: 0; border-radius: var(--radius-pill);
  background: transparent; color: var(--color-muted); font: inherit; font-size: 0.9375rem; font-weight: var(--fw-strong); cursor: pointer;
  transition: background-color var(--motion-fast), color var(--motion-fast);
}
.vswitch__btn:hover { color: var(--color-text); }
.vswitch__btn[aria-pressed="true"] { background: linear-gradient(180deg, #F6C677, var(--color-primary)); color: var(--color-on-primary); }

/* note roll */
.console__main { display: grid; grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr); gap: var(--space-3); align-items: start; }
.roll-wrap { min-width: 0; }
.roll {
  overflow-x: auto; max-width: 100%; border-radius: var(--radius-md); border: var(--border-width) solid var(--line);
  background: rgba(8, 10, 22, 0.78); overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch;
}
.roll__inner { position: relative; min-width: calc(var(--beats) * var(--beat-min)); padding-bottom: var(--space-1); }
.roll__wave { display: flex; align-items: center; gap: 2px; height: 40px; padding: 4px 0 0; }
.roll__wave i {
  flex: 1 1 0; min-width: 0; height: 100%; border-radius: var(--radius-pill);
  background: rgba(124, 140, 255, 0.45); transform: scaleY(var(--h, 0.2));
}
.roll__wave i.is-on { background: var(--color-primary); }
.roll__ruler { position: relative; height: 22px; border-bottom: var(--border-width) solid var(--line); }
.roll__ruler span { position: absolute; top: 3px; padding-left: 4px; font-family: var(--font-mono); font-size: 0.6875rem; color: var(--color-muted); }
.roll__grid { position: relative; height: calc(var(--rows) * var(--row-h) + 44px); }
.roll__lines {
  position: absolute; inset: 22px 0;
  background:
    repeating-linear-gradient(to right, transparent 0, transparent calc(100% / var(--beats) - 1px), rgba(244, 239, 230, 0.1) calc(100% / var(--beats) - 1px), rgba(244, 239, 230, 0.1) calc(100% / var(--beats))),
    repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--row-h) - 1px), rgba(244, 239, 230, 0.05) calc(var(--row-h) - 1px), rgba(244, 239, 230, 0.05) var(--row-h));
}
.note {
  position: absolute; z-index: 1; height: 44px; min-width: 0; padding: 0; margin: 0; border: 0;
  background: transparent; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.note:focus-visible { outline: none; }
.note__bar {
  position: absolute; left: 2px; right: 2px; top: 50%; height: 18px; margin-top: -9px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #F6C677, var(--color-primary)); opacity: 0.72; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  transition: opacity var(--motion-fast), box-shadow var(--motion-fast);
}
.note__name { font-family: var(--font-mono); font-size: 0.6875rem; font-weight: var(--fw-strong); color: var(--color-on-primary); pointer-events: none; }
.note:hover .note__bar { opacity: 0.9; }
.note.is-selected .note__bar { opacity: 1; box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-focus), 0 4px 14px rgba(240, 180, 90, 0.5); }
.note.is-now .note__bar { opacity: 1; background: #FFF1D6; }
.note:focus-visible .note__bar { opacity: 1; box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 5px var(--color-focus), 0 0 0 8px var(--color-primary); }
.note[data-edited="true"] .note__bar::after {
  content: ""; position: absolute; top: -4px; right: -2px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--color-accent); border: 2px solid var(--color-bg);
}
.roll__lyrics { position: relative; height: 2.5rem; border-top: var(--border-width) solid var(--line); }
.roll__lyrics .lyr {
  position: absolute; top: 0.45rem; text-align: center; font-family: var(--font-display); font-size: 1.05rem; line-height: 1.5; color: var(--color-text);
  overflow: hidden; text-overflow: clip; white-space: nowrap;
}
.roll__lyrics .lyr.is-edited { color: var(--color-primary); }
.roll__lyrics .lyr.is-selected { text-decoration: underline; text-decoration-color: var(--color-primary); text-underline-offset: 6px; }
.roll { -webkit-user-select: none; user-select: none; }
.note__bar { cursor: grab; }
.note.is-dragging { z-index: 4; }
.note.is-dragging .note__bar { cursor: grabbing; opacity: 1; box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px var(--color-focus), 0 6px 18px rgba(240, 180, 90, 0.6); transition: none; }
.console[data-dragging="len"] .note__bar { cursor: ew-resize; }
.console[data-dragging="pitch"] .roll { cursor: grabbing; }
/* right end of a bar: drag to change its length (mouse only; the buttons do the same for touch and keyboard) */
.note__grip { position: absolute; top: 0; bottom: 0; right: 0; width: 10px; cursor: ew-resize; border-radius: 0 9px 9px 0; }
.note__grip::after { content: ""; position: absolute; top: 4px; bottom: 4px; right: 3px; width: 2px; border-radius: 2px; background: rgba(30, 20, 5, 0.45); opacity: 0; transition: opacity var(--motion-fast); }
.note:hover .note__grip::after, .note.is-selected .note__grip::after, .note.is-dragging .note__grip::after { opacity: 1; }
@media (pointer: coarse) { .note__grip { display: none; } .note__bar { cursor: pointer; } }
/* notes the transcription was unsure about: yellow dashed outline, gone once the note is fixed */
.note[data-unc="true"] .note__bar { outline: 2px dashed #FFE14D; outline-offset: 3px; }
.studio__unc { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 var(--space-1); font-size: var(--fs-sm); font-weight: var(--fw-strong); color: #FFE14D; }
.studio__unc[data-left="0"] { color: var(--color-muted); }
.studio__unc[data-left="0"] .unc-swatch { display: none; }
.unc-swatch { flex: 0 0 auto; width: 26px; height: 12px; border-radius: 6px; outline: 2px dashed #FFE14D; outline-offset: 2px; background: linear-gradient(180deg, #F6C677, var(--color-primary)); margin: 2px 4px 2px 2px; }
.inspector__unc { font-size: var(--fs-sm); color: #FFE14D; line-height: 1.5; }
.roll__tip {
  position: absolute; z-index: 5; transform: translateX(-50%); pointer-events: none; white-space: nowrap;
  padding: 0.25rem 0.6rem; border-radius: var(--radius-sm); background: #0B0E20; border: var(--border-width) solid var(--color-primary);
  font-family: var(--font-mono); font-size: 0.8125rem; font-weight: var(--fw-strong); color: var(--color-text); box-shadow: var(--shadow-lg);
}
.roll__tip[hidden] { display: none; }
.note { transition: left var(--motion-fast) var(--ease), width var(--motion-fast) var(--ease); }
.note.is-dragging { transition: none; }
.roll__lyrics .lyr { transition: left var(--motion-fast) var(--ease), width var(--motion-fast) var(--ease); }
.studio__cta { margin-top: var(--space-4); text-align: center; }
.roll__playhead {
  position: absolute; z-index: 2; top: 0; bottom: 0; width: 2px; margin-left: -1px; pointer-events: none;
  background: var(--color-primary); box-shadow: 0 0 10px rgba(240, 180, 90, 0.7);
}
.roll__playhead::before {
  content: ""; position: absolute; top: 0; left: -5px; border: 6px solid transparent; border-top-color: var(--color-primary); border-bottom: 0;
}

/* scrub and readout */
.scrub { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); margin-top: var(--space-2); }
.scrub__label { font-size: var(--fs-sm); color: var(--color-muted); }
.scrub__input { width: 100%; height: 44px; margin: 0; accent-color: var(--color-primary); background: transparent; }
.scrub__read { display: flex; gap: var(--space-2); font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--color-muted); white-space: nowrap; }

/* inspector */
.inspector {
  display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; padding: var(--space-3);
  border-radius: var(--radius-md); border: var(--border-width) solid var(--line); background: rgba(21, 25, 51, 0.72);
}
.inspector__sel { font-family: var(--font-display); font-size: 1.2rem; }
.inspector__label { font-size: var(--fs-sm); font-weight: var(--fw-strong); color: var(--color-muted); }
.inspector__input {
  width: 100%; min-height: 48px; padding: 0 1rem; border-radius: var(--radius-sm); border: var(--border-width) solid var(--color-border);
  background: var(--color-bg); color: var(--color-text); font: inherit; font-size: 1.0625rem;
}
.inspector__input:disabled { opacity: 0.5; }
.inspector__lock { font-size: var(--fs-sm); color: var(--color-warning); }
.diff { min-width: 0; }
.diff__head { font-weight: var(--fw-strong); font-size: 0.9375rem; }
.diff__list { margin-top: var(--space-1); max-height: 9.5rem; overflow-y: auto; font-size: 0.875rem; color: var(--color-muted); }
.diff__list li { padding: 0.3rem 0 0.3rem 1rem; position: relative; border-top: var(--border-width) solid var(--line); }
.diff__list li::before { content: ""; position: absolute; left: 0; top: 0.8rem; width: 7px; height: 7px; border-radius: 50%; background: var(--color-accent); }

/* buttons and dock */
.stbtn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; min-height: 48px; min-width: 44px; padding: 0 1rem;
  border-radius: var(--radius-sm); border: var(--border-width) solid rgba(240, 180, 90, 0.35); background: rgba(240, 180, 90, 0.06);
  color: var(--color-text); font: inherit; font-size: 0.9375rem; font-weight: var(--fw-strong); cursor: pointer; touch-action: manipulation;
  transition: background-color var(--motion-fast), border-color var(--motion-fast);
}
.stbtn:hover:not(:disabled) { background: rgba(240, 180, 90, 0.14); border-color: var(--color-primary); }
.stbtn:disabled { opacity: 0.38; cursor: not-allowed; }
.stbtn--play { background: linear-gradient(180deg, #F6C677, var(--color-primary)); color: var(--color-on-primary); border-color: transparent; }
.stbtn--play:hover:not(:disabled) { background: linear-gradient(180deg, #FFD9A0, #F6C677); }
.stbtn--play[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(240, 180, 90, 0.35); }
.stbtn--wide { align-self: flex-start; }
.dock { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.dock .stbtn--play { margin-left: auto; min-width: 7rem; }
.console[data-playing="true"] .roll__playhead { box-shadow: 0 0 16px rgba(240, 180, 90, 0.95); }

/* preview: one panel, one notice */
.preview { padding-block: calc(var(--section-pad-y) * 0.7) var(--section-pad-y); background: linear-gradient(180deg, transparent, rgba(21, 25, 51, 0.5) 40%, transparent); }
.pcard-panel {
  display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.3fr); gap: var(--space-4); padding: var(--space-4);
  border-radius: var(--radius-lg); border: var(--border-width) solid var(--line);
  background: linear-gradient(160deg, var(--color-surface-raised), var(--color-surface));
  box-shadow: var(--shadow-md), var(--glow);
}
.pcard-panel__cover { position: relative; overflow: hidden; border-radius: var(--radius-md); min-height: 14rem; }
.pcard-panel__body { min-width: 0; display: flex; flex-direction: column; }
.pcard-panel__body .demo-tag { margin: 0 0 var(--space-1); }
.tracks { display: flex; flex-direction: column; }
.track {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) auto; align-items: center; gap: var(--space-3);
  padding: var(--space-2) 0; border-top: var(--border-width) solid var(--line);
}
.track:first-child { border-top: 0; }
.track__title { font-family: var(--font-display); font-weight: var(--fw-display); font-size: var(--fs-lg); letter-spacing: -0.01em; line-height: 1.3; }
.track__wave { height: 3.5rem; min-width: 0; --bar-w: 3px; }
.pcard__style { color: var(--color-primary); font-size: var(--fs-sm); letter-spacing: 0.12em; font-weight: var(--fw-strong); }
.time { font-family: var(--font-mono); font-size: var(--fs-sm); color: var(--color-muted); }
.pcard__player { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-1); }
.pcard__player .wave { flex: 1 1 auto; height: 4.5rem; min-width: 0; --bar-w: 3px; }
.art { position: absolute; inset: 0; width: 99.9%; height: 99.9%; }

/* templates */
.templates { padding-block: calc(var(--section-pad-y) * 0.7) var(--section-pad-y); }
.posters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.poster {
  position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 1 / 1; border-radius: var(--radius-lg);
  border: var(--border-width) solid var(--line); box-shadow: var(--shadow-md);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base);
}
.poster:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg), 0 0 40px rgba(240, 180, 90, 0.1); }
.poster__bg { position: absolute; inset: 0; z-index: -2; }
.poster__bg .art { z-index: 0; }
.poster::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, transparent 38%, rgba(8, 9, 20, 0.92));
}
.poster__body { padding: var(--space-3); display: flex; flex-direction: column; gap: 0.2rem; }
.poster__cat { font-size: var(--fs-xs); letter-spacing: 0.14em; color: var(--color-primary); font-weight: var(--fw-strong); display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.poster__name { font-family: var(--font-display); font-weight: var(--fw-display); font-size: 1.6rem; letter-spacing: -0.01em; }
.poster__open {
  all: unset; box-sizing: border-box; cursor: pointer; display: inline; border-radius: var(--radius-sm);
}
.poster__open::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--radius-lg); }
.poster__open:focus-visible { outline: none; box-shadow: none; }
.poster__open:focus-visible::after { outline: 3px solid var(--color-focus); outline-offset: -6px; box-shadow: inset 0 0 0 3px rgba(240, 180, 90, 0.95); }
.poster__mood { color: rgba(244, 239, 230, 0.8); font-size: 0.9375rem; line-height: 1.45; }
.templates__more { margin-top: var(--space-4); text-align: center; }
.templates__more[hidden] { display: none; }

/* template dialog */
.theatre {
  padding: 0; border: var(--border-width) solid var(--line); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg);
  width: min(960px, calc(100vw - 2rem)); max-height: calc(100svh - 2rem); overflow: auto;
}
.theatre::backdrop { background: rgba(5, 6, 14, 0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.theatre__inner { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr); }
.theatre__art { position: relative; min-height: 24rem; overflow: hidden; }
.theatre__info { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.theatre__info h2 { font-size: var(--fs-xl); }
.theatre__badges { display: flex; gap: var(--space-2); flex-wrap: wrap; align-items: center; color: var(--color-primary); font-size: var(--fs-sm); letter-spacing: 0.1em; }
.theatre dl { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem var(--space-3); margin-top: var(--space-1); }
.theatre dt { color: var(--color-muted); font-size: 0.9375rem; }
.theatre dd { font-size: 0.9375rem; }
.theatre__preview { margin-top: var(--space-1); padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: rgba(8, 10, 22, 0.5); border: var(--border-width) solid var(--line); }
.theatre__preview .pcard__player .wave { height: 3rem; }
.theatre__soon { color: var(--color-muted); }
.theatre__note { padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); background: rgba(169, 173, 200, 0.1); color: var(--color-text); font-size: 0.9375rem; }
.theatre__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: auto; padding-top: var(--space-2); }

/* korean zone: the only place with the modern Korean treatment (gold on navy, one motif) */
[data-zone="korean"] {
  --kr-line: rgba(240, 180, 90, 0.35);
  --kr-rule: rgba(240, 180, 90, 0.7);
  --kr-tracking: -0.05em;
  --kr-title-size: clamp(2.25rem, 0.8rem + 3.6vw, 4.125rem);
  padding-block: var(--section-pad-y);
  border-block: 1px solid var(--kr-line);
  background: var(--color-bg);
}
[data-zone="korean"] .status { border-radius: 4px; color: var(--color-primary); background: transparent; }
.kr-wrap {
  max-width: 1200px; margin-inline: auto; padding-inline: var(--gutter);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--space-5); align-items: center;
}
.kr-kicker {
  display: flex; align-items: center; gap: 0.75rem; font-size: var(--fs-sm); font-weight: var(--fw-strong);
  letter-spacing: 0.14em; color: var(--color-primary);
}
.kr-kicker::before { content: ""; width: 28px; height: 1px; background: var(--kr-rule); }
.kr-title {
  margin-top: var(--space-2); font-family: var(--font-display); font-weight: 800; font-size: var(--kr-title-size);
  line-height: 1.12; letter-spacing: var(--kr-tracking);
}
.kr-title span { display: block; }
.kr-title__em { color: var(--color-primary); }
.kr-lead { margin-top: var(--space-3); color: var(--color-muted); font-size: 1.125rem; }
.kr-rule { position: relative; width: min(18rem, 99.9%); height: 1px; margin-top: var(--space-3); background: var(--kr-rule); }
.kr-rule::before { content: ""; position: absolute; left: 0; top: -2px; width: 5px; height: 5px; background: var(--color-primary); }
.kr-body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); min-width: 0; }
.kr-motif svg { width: 144px; height: 144px; fill: none; stroke: var(--color-primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kr-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.kr-chip {
  display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0 1rem;
  border: 1px solid var(--kr-line); border-radius: 4px; font-family: var(--font-display); font-size: 1.0625rem;
}
button.kr-chip { background: none; color: inherit; cursor: pointer; line-height: inherit; transition: border-color var(--motion-base) var(--ease), background var(--motion-base) var(--ease); }
button.kr-chip:hover { border-color: var(--color-primary); background: rgba(240, 180, 90, 0.08); }
button.kr-chip:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.poster.is-picked { border-color: var(--color-primary); box-shadow: var(--shadow-lg), 0 0 0 3px var(--color-primary), 0 0 56px rgba(240, 180, 90, 0.45); transform: translateY(-6px); }
.kr-note { color: var(--color-muted); font-size: 0.9375rem; }

/* signup */
.signup { position: relative; isolation: isolate; overflow: clip; padding-block: calc(var(--section-pad-y) * 1.3); text-align: center; }
.signup__horizon {
  position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: 30rem;
  background:
    radial-gradient(ellipse 60% 70% at 50% bottom, rgba(240, 180, 90, 0.34), transparent 70%),
    radial-gradient(ellipse 80% 60% at 20% bottom, rgba(217, 108, 139, 0.2), transparent 70%),
    radial-gradient(ellipse 80% 60% at 82% bottom, rgba(124, 140, 255, 0.2), transparent 70%);
}
.signup__title { font-size: var(--fs-cta); text-wrap: balance; outline-offset: 8px; }
.signup__sub { margin-top: var(--space-3); font-size: 1.25rem; color: var(--color-muted); }
.signup .btn { margin-top: var(--space-4); }
.signup__status { margin: var(--space-3) auto 0; max-width: 40rem; padding: 0.75rem 1.1rem; border-radius: var(--radius-md); background: rgba(21, 25, 51, 0.7); border: var(--border-width) solid var(--line); color: var(--color-text); font-size: 0.9375rem; }
.signup__saved { margin: var(--space-2) auto 0; max-width: 40rem; color: var(--color-muted); font-size: 0.9375rem; font-family: var(--font-display); }
.signup__saved[hidden] { display: none; }

/* feature status summary (the one place that lists every non-general-availability feature) */
.trust { padding-block: calc(var(--section-pad-y) * 0.75); background: radial-gradient(800px 420px at 50% 0, rgba(124, 140, 255, 0.07), transparent 66%); }
.trust__title { font-size: var(--fs-xl); }
.trust__lead { margin-top: var(--space-2); color: var(--color-muted); max-width: 46rem; font-size: 0.9375rem; }
.summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-5); margin-top: var(--space-4); }
.summary__row {
  display: grid; grid-template-columns: minmax(0, 10rem) auto minmax(0, 1fr); align-items: baseline; gap: 0.25rem var(--space-2);
  padding: var(--space-2) 0; border-top: var(--border-width) solid var(--line);
}
.summary__name { font-family: var(--font-display); font-weight: var(--fw-strong); }
.summary__label {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 0.6rem; border: var(--border-width) solid currentColor;
  border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: var(--fw-strong); white-space: nowrap;
}
.summary__desc { color: var(--color-muted); font-size: 0.875rem; line-height: 1.55; }
[data-status-item="BETA"] .summary__label { color: var(--color-warning); background: rgba(231, 194, 94, 0.1); }
[data-status-item="EXPERIMENTAL"] .summary__label { color: var(--color-accent); background: rgba(217, 108, 139, 0.12); }
[data-status-item="COMING_SOON"] .summary__label { color: var(--color-muted); background: rgba(169, 173, 200, 0.1); border-style: dashed; }
[data-status-item="RESEARCH"] .summary__label { color: var(--cool); background: rgba(124, 140, 255, 0.12); }
[data-status-item="VISION"] .summary__label { color: var(--color-success); background: rgba(95, 203, 154, 0.1); }

/* footer */
.site-footer { padding-block: calc(var(--section-pad-y) * 0.5); border-top: var(--border-width) solid rgba(244, 239, 230, 0.08); background: #090B18; }
.site-footer__top { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0.25rem var(--space-2); }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.6rem; color: var(--color-muted); text-decoration: none; border-radius: var(--radius-sm); font-size: 0.9375rem; }
.site-footer__links a:hover { color: var(--color-text); }
.site-footer__privacy { margin-top: var(--space-2); color: var(--color-muted); font-size: var(--fs-sm); }
.site-footer__proto { margin-top: 0.25rem; color: var(--color-muted); font-size: var(--fs-sm); }

/* "not open yet" popup */
.notify {
  padding: 0; border: var(--border-width) solid var(--line); border-radius: var(--radius-lg);
  background: var(--color-surface); color: var(--color-text); box-shadow: var(--shadow-lg);
  width: min(26rem, calc(100vw - 2rem));
}
.notify::backdrop { background: rgba(5, 6, 14, 0.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.notify__inner { padding: var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.notify__title { font-size: var(--fs-xl); }
.notify__desc { color: var(--color-muted); font-size: 0.9375rem; line-height: 1.6; }
.notify__done { padding: 0.6rem 0.9rem; border-radius: var(--radius-sm); background: rgba(95, 203, 154, 0.1); color: var(--color-text); font-size: 0.9375rem; }
.notify__actions { display: flex; gap: var(--space-2); flex-wrap: wrap; padding-top: var(--space-1); }
.notify__actions .btn { flex: 1 1 auto; }

/* toast / offline */
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; z-index: 120; width: max-content; max-width: calc(100vw - 2rem);
  padding: 0.9rem 1.25rem; border-radius: var(--radius-md); background: var(--color-surface-raised);
  border: var(--border-width) solid rgba(240, 180, 90, 0.45); box-shadow: var(--shadow-lg);
  font-size: 0.9375rem; opacity: 0; visibility: hidden; transform: translate(-50%, 12px);
  transition: opacity var(--motion-fast), transform var(--motion-fast), visibility 0s linear var(--motion-fast);
}
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); transition-delay: 0s; }
.offline-banner {
  position: fixed; left: 0; right: 0; top: 0; z-index: 130; padding: 0.7rem var(--gutter); text-align: center;
  background: var(--color-warning); color: #1A1208; font-weight: var(--fw-strong); font-size: 0.9375rem;
}
.offline-banner[hidden] { display: none; }

/* entrance: blocks fade up when they enter the screen */
.js-motion .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  transition-delay: calc(var(--r, 0) * 90ms);
}
.js-motion .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: no-preference) {
  .stage.is-looping .stage__wave i { animation: breathe 2.8s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -90ms); }
  @keyframes breathe {
    from { transform: scaleY(calc(var(--h, 0.5) * 0.55)); }
    to { transform: scaleY(var(--h, 0.5)); }
  }
}

@media (min-width: 1024px) and (max-width: 1180px) {
  .site-nav a { padding: 0 0.55rem; font-size: 0.875rem; }
  .login-btn { padding: 0 0.6rem; }
  .site-header__bar { gap: var(--space-2); }
}

/* tablet and below desktop */
@media (max-width: 1023px) {
  .menu-btn { display: inline-flex; }
  .site-header__cta { margin-left: auto; }
  .site-header__panel {
    display: none; position: absolute; left: 0; right: 0; top: var(--header-h);
    flex-direction: column; align-items: stretch; gap: var(--space-1);
    padding: var(--space-3) var(--gutter) var(--space-4);
    background: rgba(13, 15, 30, 0.96); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    border-bottom: var(--border-width) solid var(--line);
  }
  .site-header__panel[data-open="true"] { display: flex; }
  .site-nav { margin: 0; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { min-height: 48px; font-size: 1.0625rem; }
  .login-btn { min-height: 48px; text-align: left; font-size: 1.0625rem; }
  .hero__flows { display: none; }
  .qs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chapter__grid, .kr-wrap { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); }
  .chapter__visual { order: -1; }
  .pcard-panel { grid-template-columns: minmax(0, 1fr); }
  .pcard-panel__cover { min-height: 9rem; }
  .posters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .console__main { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .theatre__inner { grid-template-columns: minmax(0, 1fr); }
  .theatre__art { min-height: 11rem; }
}

/* phone: its own composition, not a shrunken desktop */
@media (max-width: 640px) {
  :root {
    --header-h: 60px; --section-pad-y: var(--section-pad-y-mobile);
    --space-5: 2rem; --space-6: 2.75rem; --fs-2xl: 1.9rem; --fs-xl: 1.55rem;
    --hero-pad-bottom: 3.75rem; --prompt-overlap: 2.5rem; --beat-min: 5.5rem; --row-h: 18px;
  }
  .site-header__bar { gap: var(--space-1); }
  .brand { font-size: 0.95rem; letter-spacing: 0.02em; gap: 0.4rem; min-width: 0; }
  .brand__mark { width: 24px; height: 24px; }
  .site-header__cta.btn--sm { padding: 0 0.7rem; font-size: 0.8125rem; }
  .menu-btn { position: relative; padding: 0; justify-content: center; width: 44px; }
  .menu-btn__text {
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .hero__inner { gap: var(--space-3); padding-top: var(--space-3); }
  .hero__title { font-size: clamp(2.2rem, 9vw, 2.8rem); }
  .hero__sub { font-size: 1rem; margin-top: var(--space-2); }
  .hero__sub span + span { margin-top: 0.15rem; }
  .hero__cta { flex-direction: column; align-items: stretch; margin-top: var(--space-3); gap: var(--space-1); }
  .hero__cta .btn--primary { min-height: 56px; }
  .hero__cta .btn--secondary { min-height: 48px; }
  .stage__row { grid-template-columns: minmax(0, 1fr); min-height: 0; row-gap: var(--space-2); padding-top: var(--space-2); }
  .stage__spacer { display: none; }
  .stage__play { order: 2; }
  .play__disc { width: 84px; height: 84px; }
  .play .ico { width: 36px; height: 36px; }
  .play__text { font-size: 1rem; }
  .src-now { font-size: 0.8125rem; }
  .stage__caps { gap: 0.25rem; }
  .cap { padding: 0 0.6rem; min-height: 30px; }
  .prompt__glass { padding: var(--space-3); }
  .prompt__title { font-size: 1.3rem; }
  .prompt__form { grid-template-columns: minmax(0, 1fr); margin-top: var(--space-2); }
  .prompt__form textarea { min-height: 56px; height: 56px; padding: 0.9rem 1rem; }
  .prompt__form .btn { width: auto; min-height: 56px; }
  .prompt__hint { display: none; }
  .quickstart { padding-block: var(--space-4) var(--space-5); }
  .qs-grid { gap: 10px; }
  .qs { min-height: 7.5rem; padding: var(--space-2) var(--space-2) var(--space-2); border-radius: var(--radius-md); gap: 0.2rem; }
  .qs__icon { width: 44px; height: 44px; }
  .qs__icon .ico { width: 22px; height: 22px; }
  .qs__title { font-size: 1.0625rem; }
  .qs__desc { font-size: 0.8125rem; }
  .chapter__visual { padding: var(--space-2); }
  .flow--line { --art: 48px; }
  .flow--line .flow__step { padding-inline: 0.1rem; }
  .flow__art .ico { width: 22px; height: 22px; }
  .flow__label { font-size: 0.875rem; }
  .flow--line .flow__step + .flow__step::before { left: calc(-50% + var(--art) / 2 + 4px); width: calc(99.9% - var(--art) - 8px); }
  .flow--five { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-1); }
  .flow--five .flow__step { flex-direction: row; justify-content: flex-start; gap: var(--space-2); padding: var(--space-1) var(--space-2); text-align: left; border: var(--border-width) solid var(--line); border-radius: var(--radius-pill); }
  .flow--five .flow__step::before { display: none; }
  .flow--five .flow__art { --art: 36px; box-shadow: none; flex: none; }
  .flow--five .flow__art .ico { width: 18px; height: 18px; }
  .flow--five .flow__label { font-size: 0.8125rem; }
  .flow--five .flow__step:last-child { grid-column: 1 / -1; }
  .cap-list { grid-template-columns: minmax(0, 1fr); }
  .chapter__cta .btn, .chapter__text > .btn { width: auto; }
  .studio__head { text-align: left; }
  .studio__head .chapter__no, .studio__head .chapter__badges { justify-content: flex-start; }
  .studio__title { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .studio__title span { display: block; }
  .console { padding: var(--space-2); }
  .console__hint { display: none; }
  .vswitch { width: 100%; }
  .vswitch__btn { flex: 1 1 0; }
  .scrub { grid-template-columns: minmax(0, 1fr) auto; }
  .scrub__label { grid-column: 1 / -1; }
  .scrub__read { font-size: 0.75rem; gap: var(--space-1); }
  .inspector { padding: var(--space-2); }
  .inspector__input { font-size: 1rem; }
  .stbtn--wide { align-self: stretch; }
  .dock {
    position: sticky; bottom: 8px; z-index: 6; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px;
    margin: var(--space-2) calc(var(--space-1) * -1) 0; padding: 6px; border-radius: var(--radius-md);
    border: var(--border-width) solid var(--line); background: rgba(13, 15, 30, 0.94);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: var(--shadow-md);
  }
  .dock .stbtn { flex-direction: column; gap: 0; min-height: 56px; padding: 0 2px; font-size: 0.6875rem; line-height: 1.25; text-align: center; }
  .dock .stbtn__ico { font-size: 1rem; line-height: 1.2; }
  .dock .stbtn--play { margin-left: 0; min-width: 0; }
  .pcard-panel { padding: var(--space-3); gap: var(--space-2); }
  .pcard-panel__cover { min-height: 7.5rem; }
  .track { grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-1) var(--space-2); }
  .track__wave { grid-column: 1 / -1; grid-row: 2; height: 3rem; }
  .track .play { grid-column: 2; grid-row: 1; }
  .track .play__disc { width: 64px; height: 64px; }
  .play__disc { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); }
  .posters {
    display: flex; gap: var(--space-2); overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    margin-inline: calc(var(--gutter) * -1); padding: var(--space-2) var(--gutter) var(--space-3); scroll-padding-inline: var(--gutter);
    -webkit-overflow-scrolling: touch;
  }
  .poster { flex: 0 0 72vw; aspect-ratio: 4 / 5; scroll-snap-align: start; }
  .kr-motif svg { width: 96px; height: 96px; }
  .kr-chip { padding: 0 0.9rem; font-size: 1rem; }
  .signup__title { font-size: clamp(2.1rem, 9vw, 2.8rem); }
  .signup .btn { width: auto; align-self: stretch; }
  .signup .btn--lg { display: flex; margin-inline: var(--space-1); }
  .summary__row { grid-template-columns: minmax(0, 1fr) auto; }
  .summary__desc { grid-column: 1 / -1; }
  .site-footer__top { flex-direction: column; align-items: flex-start; }
  .theatre { width: calc(100vw - 1rem); max-height: calc(100svh - 1rem); }
  .theatre__info { padding: var(--space-3); }
  .theatre__actions .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .stage { --s-notes: 1; --s-lyrics: 1; --s-score: 1; --s-music: 1; }
}

/* Production wiring: real links instead of the prototype's stub buttons */
a.login-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.signup__actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin: 0; }
.signup__continue { margin: 1rem 0 0; }
