/* ---------- Design tokens ---------- */
:root {
  /* Pulled directly from the app's Colors.ts (dark theme) and Layout.ts so the site matches Thriill! Train Your Ear */
  --bg: #131f24;
  --bg-alt: #0f181d;
  --surface: #122e44;
  --surface-2: #1a3d59;
  --text: #ffffff;
  --text-dim: #9bb9c0;
  --border: #4c6772;
  --accent: #0075ff;
  --accent-dark: #005fd1;
  --icon-a: #fb923c;
  --icon-b: #00ba3c;
  --icon-c: #d94a4a;
  --icon-d: #0075ff;
  /* Exact correct/wrong colors from Colors.ts (dark theme): successAccent, errorAccent,
     successBackground, errorBackground — used for answer reveal states and result banners. */
  --success-accent: #4caf82;
  --error-accent: #d94a4a;
  --success-bg: rgba(17, 45, 18, 0.9);
  --error-bg: rgba(64, 0, 0, 0.9);
  /* Real button treatment from TourSplash.tsx: translucent tinted fill + solid border
     of the same hue, not a solid-fill button. */
  --highlight: rgba(0, 117, 255, 0.2);
  --highlight-border: #0075ffff;
  --card-shadow: 0 2px 2.62px rgba(0, 0, 0, 0.23);
  --radius: 20px;
  --container: 1120px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.5);
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
/* The [hidden] attribute must always win over any element's own `display` rule
   (e.g. .btn sets display:inline-flex unconditionally) — otherwise hiding an
   element via the hidden attribute silently does nothing. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Raleway", system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
/* Real headline treatment (Layout.fontFamily.extraLight, weight 200) — big but thin,
   not bold. Small caption/label text stays bold+uppercase+wide-tracked separately. */
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; font-weight: 200; }
p { margin: 0 0 1em; color: var(--text-dim); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 18px;
  border-radius: 0 0 8px 0;
  z-index: 200;
}
.skip-link:focus { left: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* Real button treatment (TourSplash.tsx): translucent tinted fill, solid border of
   the same hue — not a solid-fill button. */
.btn-primary {
  background: var(--highlight);
  border: 1px solid var(--highlight-border);
  color: var(--text);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(0, 117, 255, 0.35); }
.btn-small { padding: 10px 20px; font-size: 0.9rem; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(19, 31, 36, 0.85);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
  margin-right: auto;
}
.main-nav ul { display: flex; gap: 28px; }
.main-nav a {
  font-weight: 600;
  color: var(--text-dim);
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--text); }
.header-cta { white-space: nowrap; }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text);
  border-radius: 2px;
}

/* ---------- Hero ---------- */
.hero { padding: clamp(16px, 4vh, 32px) 0 40px; position: relative; overflow: hidden; }
.hero-video-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}
.hero-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg) 0%, rgba(19, 31, 36, 0.88) 45%, var(--bg) 100%);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 48px;
  text-align: center;
}
.hero-copy { max-width: 640px; margin: 0 auto; }
.hero-copy .hero-sub { margin-left: auto; margin-right: auto; }
.hero-copy .store-badges { justify-content: center; }

.hero-visual {
  display: flex;
  justify-content: center;
  margin-top: -32px;
}
/* Device-frame convention already used for feature mockups
   (earTraining/docs/features/reveal-correct-answer/mockup.html .phone), reused
   here at hero scale to hold the app-in-action video. */
.phone-frame {
  position: relative;
  width: 300px;
  aspect-ratio: 340 / 720;
  background: #000;
  border-radius: 36px;
  border: 4px solid #1d2c33;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.phone-screen { position: absolute; inset: 0; }
.phone-screen iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Blocks hover/mouse from ever reaching the YouTube iframe, so its native
   play/pause/next chrome never appears — our own unmute button (higher
   z-index) is the only control. */
.phone-click-shield {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.unmute-btn {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(5, 10, 15, 0.7);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.72rem;
  cursor: pointer;
}
.unmute-btn .icon-unmuted { display: none; }
.unmute-btn.is-unmuted .icon-muted { display: none; }
.unmute-btn.is-unmuted .icon-unmuted { display: block; }
@media (min-width: 861px) {
  .hero-inner {
    grid-template-columns: 1.1fr 0.9fr;
    text-align: left;
  }
  .hero-copy { margin: 0; }
  .hero-copy .hero-sub { margin-left: 0; margin-right: 0; }
  .hero-copy .store-badges { justify-content: flex-start; }
  .phone-frame { width: 340px; }
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  max-width: 16ch;
}
.hero-sub {
  font-size: 1.15rem;
  max-width: 42ch;
  margin-bottom: 28px;
}
.hero-cta { margin-bottom: 20px; }
.store-badges {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.store-badges img { height: 48px; width: auto; border-radius: 8px; }
.store-badges a.is-primary-store img {
  box-shadow: 0 0 0 2px var(--accent), 0 6px 18px -6px rgba(0, 117, 255, 0.6);
  border-radius: 8px;
}
.hero-note {
  margin: 16px 0 0;
  font-size: 0.85rem;
  font-weight: 200;
  color: var(--text-dim);
}

/* ---------- Section shells ---------- */
section { padding: 88px 0; }
/* Each of these reads as its own "page" while scrolling — a full screen, not a
   sliver blending into the next section. Download + Contact are deliberately
   excluded so they share one screen together.
   Deliberately NOT flex+align-items:center: centering short content in a
   min-height box leaves empty space above AND below it (the gap bug before
   Download), and centering tall content clips it above the fold (the hero
   needing a scroll to see fully). Plain min-height lets content sit at its
   natural top-down flow: short content leaves one clean gap at the bottom,
   tall content simply grows the section past 100vh instead of clipping. */
.hero,
#teaser,
#features,
#repertoire,
#premium {
  min-height: 100vh;
}
.hero > .container,
#teaser > .container,
#features > .container,
#repertoire > .container,
#premium > .container {
  width: 100%;
}
section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  text-align: center;
  max-width: 24ch;
  margin: 0 auto 48px;
}

/* This heading is real intro prose, not a short punchy title — give it room
   to breathe as a paragraph instead of wrapping narrowly at heading size. */
#features h2 {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-dim);
  max-width: 62ch;
  line-height: 1.6;
}

/* ---------- Features ---------- */
.features { background: var(--bg-alt); position: relative; overflow: hidden; }
.features .container { position: relative; z-index: 1; }
/* Fills the empty space below the 4 feature cards with the real wordmark
   logo (LogoFull in Icon.tsx), full-color, not a faint background texture. */
.features-bg {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 40px;
  z-index: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.features-bg-logo {
  width: min(440px, 85vw);
  animation: teaser-float 6s ease-in-out infinite;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 36px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--card-shadow);
}
.feature-card h3 { font-size: 1.05rem; }
.feature-card p { font-size: 0.92rem; margin-bottom: 0; }

.feature-icon {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  margin-bottom: 18px;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 22px;
  mask-size: 22px;
  transition: transform 0.2s ease;
}
.feature-card:hover .feature-icon { transform: scale(1.12) rotate(-4deg); }
/* Real icon art extracted from the app's own Icon.tsx (BattleIconSm, MusicIconSm,
   TrebleClefIcon, LessonsIconSm) — not generic stock glyphs. */
.icon-quiz { background: var(--icon-d); -webkit-mask-image: url("../img/icon-battle.svg"); mask-image: url("../img/icon-battle.svg"); }
.icon-play { background: var(--icon-a); -webkit-mask-image: url("../img/icon-music.svg"); mask-image: url("../img/icon-music.svg"); }
.icon-video { background: var(--icon-b); -webkit-mask-image: url("../img/icon-clef.svg"); mask-image: url("../img/icon-clef.svg"); }
.icon-read { background: var(--icon-c); -webkit-mask-image: url("../img/icon-lessons.svg"); mask-image: url("../img/icon-lessons.svg"); }

/* ---------- Teaser (interactive demo) ---------- */
.teaser { position: relative; overflow: hidden; }
.teaser .container { position: relative; z-index: 1; }
/* Real illustration pulled from the app's own Icon.tsx (Lesson1Big) — the isometric
   piano-key artwork, not a stock graphic — used big and faint as a background,
   the same way the hero uses its video. */
.teaser-visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}
.teaser-visual img {
  width: min(360px, 55vw);
  max-width: none;
  opacity: 0.16;
  margin-right: -40px;
  animation: teaser-float 6s ease-in-out infinite;
}
.teaser-visual-dice {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  pointer-events: none;
}
.teaser-visual-dice img {
  width: min(220px, 40vw);
  max-width: none;
  opacity: 0.16;
  margin: 0 0 -30px -30px;
  animation: teaser-float 7s ease-in-out infinite;
  animation-delay: -2s;
}
@keyframes teaser-float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(-3deg); }
}
@media (prefers-reduced-motion: reduce) {
  .teaser-visual img { animation: none; }
}
.teaser-intro {
  text-align: center;
  max-width: 46ch;
  margin: -24px auto 40px;
}
.teaser-divider {
  text-align: center;
  max-width: 46ch;
  margin: 56px auto 8px;
  font-weight: 700;
  color: var(--text);
}
.teaser-divider + .teaser-intro { margin-top: 8px; }
.teaser-widget {
  max-width: 420px;
  margin: -24px auto 0;
  background: var(--bg);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius);
  padding: 24px 24px 28px;
  text-align: center;
  overflow: hidden;
  box-shadow: var(--card-shadow);
}
.teaser-progress {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 20px 0 0;
}

.drill-header {
  text-align: left;
  margin-bottom: 18px;
}
/* Matches MusicTestRendererScreen.tsx's headerTitle/headerSubTitle exactly:
   title is bold (not extraLight) at Layout.font.lg (25px); subtitle is bold,
   uppercase, Layout.font.sm (10px) with letterSpacing 3 (0.3em), color c.baseSecondary. */
.drill-header h3 { font-size: 1.5625rem; font-weight: 700; margin-bottom: 2px; }
.drill-tag {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--border);
  margin: 0;
}

.prompt-ring-wrap {
  position: relative;
  width: 180px;
  height: 180px;
  margin: 8px auto 20px;
}
.progress-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 3;
}
.progress-ring-arc {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 339.3;
  stroke-dashoffset: 288.4;
  transition: stroke 0.2s ease;
}
.progress-ring-arc.is-correct { stroke: var(--success-accent); }
.progress-ring-arc.is-wrong { stroke: var(--error-accent); }
.prompt-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--bg-alt);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
/* Matches the real app's big-prompt text style exactly (QuestionFragment.tsx
   questionText_INSTRUMENT: fontSize 60, fontFamily extraLight, color c.text). */
.prompt-letter {
  font-size: 3.75rem;
  font-weight: 200;
  color: var(--text);
  line-height: 1;
}
.prompt-solfege {
  margin-top: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.mini-piano {
  position: relative;
  height: 160px;
  margin: 0 -24px 24px;
  user-select: none;
}
.white-keys {
  display: flex;
  height: 100%;
  gap: 3px;
}
.key.white {
  flex: 1;
  appearance: none;
  -webkit-appearance: none;
  background: #e9edf0;
  border: none;
  border-radius: 0 0 8px 8px;
  color: #132838;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.8rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.key.white:hover:not(:disabled) { background: #fff; }
.key.white:active:not(:disabled) { transform: translateY(1px); }
.key.white:disabled { cursor: default; }
/* box-shadow (not background) fills the key — some browsers force a native
   button background over author `background`/`background-color` here. */
.key.white.correct { box-shadow: inset 0 0 0 999px var(--success-bg); border: 2px solid var(--success-accent); }
.key.white.wrong { box-shadow: inset 0 0 0 999px var(--error-bg); border: 2px solid var(--error-accent); }

.black-keys {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 62%;
  pointer-events: none;
}
.key.black {
  position: absolute;
  top: 0;
  width: 9%;
  height: 100%;
  background: #0a1620;
  border-radius: 0 0 5px 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.teaser-feedback {
  min-height: 1.4em;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}
/* Matches the real app's ResultModal.tsx exactly: a solid colored banner with
   bold white "Correct answer" / "Incorrect answer" text, not just colored text. */
.teaser-feedback.is-correct,
.teaser-feedback.is-wrong {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  text-align: left;
  padding: 18px 20px;
  border-radius: 14px;
}
.teaser-feedback.is-correct { background: var(--success-bg); }
.teaser-feedback.is-wrong { background: var(--error-bg); }
#teaser1-cta { margin: 4px 0; }

/* ---------- Note-reading staff ---------- */
.staff {
  width: 100%;
  max-width: 280px;
  height: auto;
  margin: 0 auto 24px;
  display: block;
}
.staff line { stroke: var(--border); stroke-width: 1; }
.staff .clef { font-size: 46px; fill: var(--text-dim); }
.staff .stem { stroke: var(--text); stroke-width: 1.5; transition: stroke 0.2s ease; }
.staff .stem.correct { stroke: var(--success-accent); }
.staff .stem.wrong { stroke: var(--error-accent); }
.staff .notehead { fill: none; stroke: var(--text); stroke-width: 2; transition: fill 0.2s ease, stroke 0.2s ease; }
.staff .notehead.correct { fill: var(--success-bg); stroke: var(--success-accent); }
.staff .notehead.wrong { fill: var(--error-bg); stroke: var(--error-accent); }

.note-pills {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.pill-row {
  display: flex;
  justify-content: center;
  gap: 10px;
}
.pill {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: none;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.pill-letter { font-size: 1.15rem; font-weight: 200; line-height: 1; }
.pill-solfege { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.04em; opacity: 0.75; line-height: 1; }
.pill:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pill:disabled { cursor: default; }
.pill.correct { box-shadow: inset 0 0 0 999px var(--success-bg); border-color: var(--success-accent); color: #fff; }
.pill.wrong { box-shadow: inset 0 0 0 999px var(--error-bg); border-color: var(--error-accent); color: #fff; }
.pill.correct .pill-solfege, .pill.wrong .pill-solfege { opacity: 0.9; }

.teaser-complete {
  max-width: 420px;
  margin: 32px auto 0;
  text-align: center;
}
.teaser-complete .store-badges { justify-content: center; margin-top: 20px; }

/* ---------- Repertoire ---------- */
.repertoire { background: var(--bg-alt); position: relative; overflow: hidden; }
.repertoire .container { position: relative; z-index: 1; }
/* Background video (muted, looping, no sound) — same treatment as the hero,
   but via a YouTube embed since this one isn't a self-hosted file. The iframe
   is deliberately oversized + centered so it always covers the section like
   object-fit:cover would for a native <video>. */
.repertoire-video-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.repertoire-video-bg iframe {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100vw;
  height: 56.25vw;
  min-height: 100%;
  min-width: 177.78vh;
  transform: translate(-50%, -50%);
  border: 0;
  pointer-events: none;
}
.repertoire-click-shield {
  position: absolute;
  inset: 0;
}
.repertoire-video-overlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(180deg, var(--bg-alt) 0%, rgba(15, 24, 29, 0.88) 40%, var(--bg-alt) 100%);
}
.repertoire-intro { max-width: 50ch; margin: 0 auto 32px; text-align: center; }
.repertoire h2, .repertoire .eyebrow { text-align: center; }

.repertoire-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
}
.repertoire-controls select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
}

.sheet-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 720px;
  margin: 0 auto;
}
.sheet-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--card-shadow);
}
.sheet-card.is-hidden { display: none; }
.sheet-thumb {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-alt);
}
.sheet-body { flex: 1; min-width: 0; }
.sheet-body h3 { font-size: 1rem; margin-bottom: 4px; }
.sheet-meta { font-size: 0.82rem; margin-bottom: 10px; }
.play-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--icon-c);
  color: var(--icon-c);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 6px 16px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.play-btn:hover { background: var(--icon-c); color: #fff; }

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }
.btn-icon.is-copied { color: var(--icon-b); border-color: var(--icon-b); font-weight: 700; }

.btn-icon.locked {
  position: relative;
  color: var(--text-dim);
  border-color: var(--border);
}
.lock-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--icon-c);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}
.btn-icon.locked::after {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 500;
  width: 160px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  z-index: 5;
}
.btn-icon.locked:hover::after,
.btn-icon.locked:focus-visible::after,
.btn-icon.locked.is-tapped::after {
  opacity: 1;
}

.repertoire-empty {
  text-align: center;
  color: var(--text-dim);
  margin: 24px 0 0;
}
.repertoire-note {
  text-align: center;
  font-size: 0.82rem;
  margin: 32px auto 0;
  max-width: 46ch;
}

/* ---------- Download CTA ---------- */
.download-cta {
  background: linear-gradient(135deg, var(--surface-2), var(--bg));
  border-radius: 28px;
  margin: 0 24px;
  padding: 48px 32px;
}
/* Download + Contact combined into one compact section so both fit on one screen.
   Download is the primary CTA (bigger, on top); Contact is secondary (smaller,
   below it) — not two equal-weight columns side by side. */
.final-cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 48px;
}
.final-cta-download { max-width: 560px; }
.final-cta-download h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.final-cta-download .store-badges { justify-content: center; margin-top: 8px; }
.final-cta-download p { max-width: 40ch; margin: 0 auto 20px; }

.final-cta-contact { max-width: 420px; }
.final-cta-contact h2 { font-size: 1.3rem; }
.final-cta-contact p { max-width: 40ch; margin: 0 auto 20px; }
.final-cta-contact .socials { margin-top: 24px; }
.final-cta-contact .socials ul { justify-content: center; }

/* ---------- Premium ---------- */
.premium { position: relative; overflow: hidden; }
.premium .container { position: relative; z-index: 1; }
/* Real lesson illustrations from Icon.tsx (Lesson3Big–Lesson7Big), floating in
   fixed scattered spots — same float treatment as "Try it", no card/background
   behind them, each used once, all the same size. */
.premium-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
.premium-bg-icon {
  position: absolute;
  width: 130px;
  height: 130px;
  opacity: 0.5;
  animation: teaser-float 7s ease-in-out infinite;
}
.premium-bg-icon.pos-1 { top: 6%; left: 8%; animation-delay: 0s; }
.premium-bg-icon.pos-2 { top: 12%; right: 10%; animation-delay: -1.5s; }
.premium-bg-icon.pos-3 { top: 55%; left: 4%; animation-delay: -3s; }
.premium-bg-icon.pos-4 { bottom: 8%; right: 6%; animation-delay: -4.5s; }
.premium-bg-icon.pos-5 { bottom: 10%; left: 40%; animation-delay: -6s; }

.premium-inner {
  max-width: 640px;
  margin: 36px auto 0;
  text-align: center;
}
.premium-sub { max-width: 50ch; margin: 0 auto 32px; }
.premium-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  width: fit-content;
  margin: 0 auto 36px;
}
.premium-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.98rem;
}
.premium-list .tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--icon-b);
  font-size: 0.85rem;
  font-weight: 700;
}
.premium-list .soon { color: var(--text-dim); }
.premium-list .soon .tick {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.55rem;
  letter-spacing: 0.04em;
  width: auto;
  padding: 0 6px;
  border-radius: 999px;
}

/* ---------- Scroll-reveal motion ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.feature-grid .reveal:nth-child(2) { transition-delay: 0.08s; }
.feature-grid .reveal:nth-child(3) { transition-delay: 0.16s; }
.feature-grid .reveal:nth-child(4) { transition-delay: 0.24s; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Contact ---------- */
.socials ul { display: flex; flex-direction: row; flex-wrap: wrap; gap: 18px; margin-top: 12px; }
.socials a { color: var(--text-dim); font-weight: 600; }
.socials a:hover { color: var(--accent); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 32px 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-inner nav { display: flex; gap: 20px; margin-left: auto; }
.footer-inner nav a { font-size: 0.9rem; color: var(--text-dim); }
.footer-inner nav a:hover { color: var(--text); }
.copyright { width: 100%; font-size: 0.8rem; color: var(--text-dim); margin: 0; order: 3; }

/* ---------- Video modal (keeps visitors on the site instead of opening YouTube) ---------- */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.video-modal[hidden] { display: none; }
.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 10, 15, 0.85);
}
.video-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 820px;
}
.video-modal-frame {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.video-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.video-modal-close {
  position: absolute;
  top: -44px;
  right: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-modal-close:hover { border-color: #fff; }

.sheet-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.sheet-modal[hidden] { display: none; }
.sheet-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
}
.sheet-modal-frame {
  position: relative;
  width: 100%;
  height: min(85vh, 720px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sheet-modal-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; text-align: center; }
  .hero h1 { max-width: none; margin-left: auto; margin-right: auto; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .store-badges { justify-content: center; }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .repertoire-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .main-nav ul { display: flex; }
  .header-cta { display: none; }
  .nav-toggle { display: flex; }
  /* Below the feature cards and before Repertoire on mobile, instead of
     floating as a background — desktop keeps the floating version untouched. */
  .features { display: flex; flex-direction: column; }
  .features .container { order: 1; }
  .features { padding-bottom: 20px; }
  .features-bg {
    position: static;
    order: 2;
    margin-top: 28px;
    pointer-events: auto;
  }
  .feature-grid { grid-template-columns: 1fr; }
  .repertoire-grid { grid-template-columns: 1fr; }
  section { padding: 64px 0; }
  .download-cta { margin: 0 16px; padding: 48px 20px; }
  .mini-piano { height: 130px; }
  .teaser-widget { padding: 24px 16px 28px; }
}

.main-nav.open {
  display: flex;
  position: absolute;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 24px 28px;
}
.main-nav.open ul { flex-direction: column; gap: 18px; }
