/* ═══════════════════════════════════════════════════════
   KEYGLOW — same structure as YarnTrailWeb, PiClimbWeb and HairDiaryWeb, in the app's look
   (Keyglow/DesignSystem/Theme.swift): glowing light falling onto keys, a night sky behind the
   falling notes, blue right hand and orange left hand. Headings use the system's rounded face
   (SF Pro Rounded on Apple devices); text uses the system sans. No web fonts.
   ═══════════════════════════════════════════════════════ */

/* 1. VARIABLES
   ─────────────────────────────────────────────────────── */
:root {
  --bg:        #f5f5fb;
  --bg-2:      #ecebf7;
  --bg-3:      #e2e0f2;
  --surface:   #ffffff;
  --header-bg: rgba(245, 245, 251, 0.86);

  --accent:      #6a4fd6;   /* glow, darkened for text on light backgrounds */
  --accent-dk:   #5639c2;
  --accent-soft: #ebe6fc;
  --accent-line: rgba(106, 79, 214, 0.24);
  --accent-glow: rgba(106, 79, 214, 0.30);
  --link:        #6a4fd6;
  --on-accent:   #ffffff;

  --text:      #17162b;
  --text-2:    #45435f;
  --text-3:    #6a6884;
  --border:    rgba(23, 22, 43, 0.09);
  --error:     #b3263a;

  /* The app's fixed colours (Theme.swift). */
  --night:     #0d0d24;
  --night-top: #170f38;
  --glow:      #b38cff;
  --right:     #4da8ff;
  --left:      #ff9e42;
  --star:      #ffd14d;
  --good:      #73f29e;

  --display: ui-rounded, 'SF Pro Rounded', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Hiragino Sans', 'Apple SD Gothic Neo', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --sans:    -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', 'Hiragino Sans', 'Apple SD Gothic Neo', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --pad:   clamp(16px, 5vw, 80px);
  --max-w: 1200px;

  --r1: 12px;
  --r2: 16px;
  --r3: 22px;

  --sh1: 0 1px 3px rgba(23,22,43,.06), 0 2px 8px rgba(23,22,43,.04);
  --sh3: 0 12px 48px rgba(23,22,43,.12), 0 4px 16px rgba(23,22,43,.06);

  --gradient: linear-gradient(135deg, #7a5cf0 0%, #5639c2 100%);
  --sky:      linear-gradient(180deg, var(--night-top) 0%, var(--night) 100%);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #0d0d24;
    --bg-2:      #13122e;
    --bg-3:      #1b1a3c;
    --surface:   #17163a;
    --header-bg: rgba(13, 13, 36, 0.84);

    --accent:      #b38cff;
    --accent-dk:   #9f74fa;
    --accent-soft: #261f52;
    --accent-line: rgba(179, 140, 255, 0.28);
    --accent-glow: rgba(179, 140, 255, 0.35);
    --link:        #c3a6ff;
    --on-accent:   #120c2c;

    --text:      #f0eefb;
    --text-2:    #c4c1df;
    --text-3:    #9a97ba;
    --border:    rgba(255, 255, 255, 0.10);
    --error:     #ff8f9a;

    --sh1: 0 1px 3px rgba(0,0,0,.3);
    --sh3: 0 12px 48px rgba(0,0,0,.45);

    --gradient: linear-gradient(135deg, #c3a6ff 0%, #9f74fa 100%);
  }
}

/* 2. RESET & BASE
   ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; }
textarea { resize: vertical; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 4px; }

.visually-hidden-focusable {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
.visually-hidden-focusable:focus {
  position: static; width: auto; height: auto;
  overflow: visible; clip: auto; white-space: normal;
  background: var(--accent); color: var(--on-accent);
  padding: 8px 16px; border-radius: 4px; z-index: 9999;
}

/* 3. HEADER
   ─────────────────────────────────────────────────────── */
body > header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; gap: 20px;
  padding: 0 var(--pad);
  height: 64px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.header-brand {
  display: flex; align-items: center; gap: 9px;
  flex-shrink: 0;
}
.brand-logo {
  border-radius: 8px;
  box-shadow: var(--sh1);
}
.brand-name {
  font-family: var(--display);
  font-size: 21px; font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.header-nav {
  display: flex; align-items: center; gap: 2px;
  flex: 1;
}
.nav-link {
  padding: 7px 13px;
  border-radius: 100px;
  font-size: 14px; font-weight: 500;
  color: var(--text-2);
  transition: color .15s, background .15s;
  white-space: nowrap;
}
.nav-link:hover      { color: var(--link); background: var(--accent-soft); }
.nav-link--active    { color: var(--link); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none;
  padding: 8px; border-radius: var(--r1);
  color: var(--text);
  margin-left: auto;
  transition: background .15s;
}
.nav-toggle:hover { background: var(--accent-soft); }

/* Language Picker */
.lang-picker { position: relative; flex-shrink: 0; }
.lang-trigger {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 100px;
  font-size: 13px; font-weight: 500;
  color: var(--text-2);
  cursor: pointer; background: none; border: none;
  list-style: none;
  transition: color .15s, background .15s;
  user-select: none;
}
.lang-trigger::-webkit-details-marker { display: none; }
.lang-trigger:hover { color: var(--link); background: var(--accent-soft); }
.lang-code { font-weight: 600; font-size: 12px; letter-spacing: .04em; }
.lang-chevron { transition: transform .2s; }
details[open] .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  box-shadow: var(--sh3);
  padding: 8px; min-width: 300px; z-index: 200;
}
.lang-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
  list-style: none;
}
.lang-option {
  display: block;
  padding: 8px 10px; border-radius: var(--r1);
  font-size: 13px; color: var(--text-2);
  transition: color .15s, background .15s; white-space: nowrap;
}
.lang-option:hover          { color: var(--link); background: var(--accent-soft); }
.lang-option--active        { color: var(--link); font-weight: 600; background: var(--accent-soft); }


/* 5. STATS BAR
   ─────────────────────────────────────────────────────── */
.stats-bar {
  background: var(--gradient);
  padding: 18px var(--pad);
}
.stats-bar-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: 16px 56px; flex-wrap: wrap;
  list-style: none;
}
.stat-item {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.92);
}
.stat-icon {
  width: 34px; height: 34px;
  background: rgba(255,255,255,.14);
  border-radius: var(--r1);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon--pi { font-family: var(--display); font-size: 20px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 14px; font-weight: 500; }

/* 6. FEATURES
   ─────────────────────────────────────────────────────── */
.features {
  padding: 100px var(--pad);
  max-width: var(--max-w); margin: 0 auto;
}
.section-header { text-align: center; margin-bottom: 56px; }
.section-kicker {
  display: inline-block;
  font-size: 11px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--link); margin-bottom: 12px;
}
.section-title {
  font-family: var(--display);
  font-size: clamp(32px, 4vw, 52px);
  font-weight: 700; line-height: 1.1;
  color: var(--text); letter-spacing: -.02em;
}
.section-sub {
  font-size: 16px; color: var(--text-2); line-height: 1.65;
  margin-top: 12px; max-width: 540px;
  margin-left: auto; margin-right: auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 32px 28px;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh3);
  border-color: var(--accent-line);
}
.feature-icon {
  width: 48px; height: 48px;
  background: var(--accent-soft); color: var(--link);
  border-radius: var(--r2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
}
.feature-title {
  font-family: var(--display);
  font-size: 23px; font-weight: 600;
  color: var(--text); margin-bottom: 8px;
  line-height: 1.2;
}
.feature-text {
  font-size: 15px; line-height: 1.65; color: var(--text-2);
}


/* 8. DOWNLOAD CTA
   ─────────────────────────────────────────────────────── */
.download-cta {
  padding: 100px var(--pad);
  text-align: center;
  background: var(--bg-2);
}
.download-cta-inner {
  max-width: 560px; margin: 0 auto;
}
.download-cta-title {
  font-family: var(--display);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--text); margin-bottom: 16px;
}
.download-cta-sub {
  font-size: 17px; color: var(--text-2);
  margin-bottom: 40px; line-height: 1.65;
}

.appstore-badge {
  display: inline-flex; align-items: center; gap: 14px;
  padding: 14px 28px;
  background: #1c1420; color: #FFFFFF;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 18px;
  transition: transform .2s, box-shadow .2s;
  box-shadow: 0 4px 20px rgba(36,27,38,.22);
}
.appstore-badge:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(36,27,38,.30);
}
.appstore-badge-text { text-align: left; }
.appstore-badge-line1 {
  display: block; font-size: 11px; font-weight: 400;
  opacity: .7; letter-spacing: .02em;
}
.appstore-badge-line2 {
  display: block; font-size: 20px; font-weight: 600;
  letter-spacing: -.01em;
}
.download-note {
  margin-top: 16px; font-size: 14px; color: var(--text-3);
}

/* 9. PROSE (Support, Privacy)
   ─────────────────────────────────────────────────────── */
.prose-page {
  max-width: 760px; margin: 0 auto;
  padding: 60px var(--pad) 100px;
}
.prose-header { margin-bottom: 40px; }
.prose-header h1 {
  font-family: var(--display);
  font-size: clamp(36px, 4.5vw, 52px);
  font-weight: 700; line-height: 1.1;
  letter-spacing: -.02em;
  color: var(--text); margin-bottom: 12px;
}
.prose-meta { font-size: 14px; color: var(--text-3); }
.prose-meta a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

.support-intro { font-size: 17px; color: var(--text-2); line-height: 1.65; }
.support-grid  { display: flex; flex-direction: column; gap: 24px; }

.support-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 36px;
  scroll-margin-top: 80px;
}
.support-card h2 {
  font-family: var(--display);
  font-size: 26px; font-weight: 600;
  color: var(--text); margin-bottom: 20px;
}
.contact-row {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-size: 15px; align-items: center;
}
.contact-label { color: var(--text-3); font-weight: 500; }
.contact-row a { color: var(--link); transition: opacity .15s; overflow-wrap: anywhere; }
.contact-row a:hover { opacity: .7; }

/* FAQ */
.faq { display: flex; flex-direction: column; }
.faq-item { border-top: 1px solid var(--border); }
.faq-item:last-child { border-bottom: 1px solid var(--border); }
.faq-item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 16px 0;
  font-size: 16px; font-weight: 600; color: var(--text);
  cursor: pointer; list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 22px; font-weight: 400; line-height: 1;
  color: var(--link); flex-shrink: 0;
  transition: transform .2s;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p {
  padding: 0 0 18px;
  font-size: 15px; line-height: 1.7; color: var(--text-2);
}

/* 10. FORMS
   ─────────────────────────────────────────────────────── */
.form-field {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 20px;
}
.form-field label {
  font-size: 14px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.form-field input,
.form-field textarea {
  padding: 12px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--r1);
  font-family: var(--sans); font-size: 16px; color: var(--text);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--link);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-field textarea { min-height: 140px; }
.form-field--trap {
  position: absolute; left: -10000px;
  width: 1px; height: 1px; overflow: hidden;
}
.form-submit {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 32px;
  background: var(--gradient); color: var(--on-accent);
  border-radius: 100px; font-size: 15px; font-weight: 600;
  border: none;
  transition: transform .15s, filter .2s;
  box-shadow: 0 2px 12px var(--accent-glow);
}
.form-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.field-error { color: var(--error); font-size: 12px; font-weight: 500; }
.alert-success {
  padding: 12px 16px;
  background: rgba(46,160,90,.10);
  border: 1px solid rgba(46,160,90,.28);
  border-radius: var(--r1); font-size: 14px; color: var(--text);
  margin-bottom: 20px;
}
.alert-error {
  padding: 12px 16px;
  background: rgba(176,58,46,.08);
  border: 1px solid rgba(176,58,46,.24);
  border-radius: var(--r1); font-size: 14px; color: var(--error);
  margin-bottom: 20px;
}
.alert-error ul { padding-left: 18px; }

/* 11. PRIVACY
   ─────────────────────────────────────────────────────── */
.privacy-content { line-height: 1.75; }
.privacy-content > p:first-child { font-size: 14px; color: var(--text-3); margin-bottom: 28px; }
.privacy-content h2 {
  font-family: var(--display);
  font-size: 26px; font-weight: 600;
  margin-top: 44px; margin-bottom: 12px; color: var(--text);
  line-height: 1.25;
}
.privacy-content p  { margin-bottom: 16px; font-size: 16px; color: var(--text-2); }
.privacy-content ul { padding-left: 20px; margin-bottom: 16px; font-size: 16px; color: var(--text-2); }
.privacy-content li { margin-bottom: 6px; }
.privacy-content a  { color: var(--link); text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.privacy-content strong { color: var(--text); }

/* 12. ERROR PAGES
   ─────────────────────────────────────────────────────── */
.error-page {
  min-height: calc(100dvh - 64px - 90px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 60px var(--pad);
}
.error-code {
  font-family: var(--display);
  font-size: 96px; font-weight: 700;
  color: var(--accent-line); line-height: 1; margin-bottom: 16px;
}
.error-title {
  font-family: var(--display);
  font-size: 32px; font-weight: 600;
  color: var(--text); margin-bottom: 12px;
}
.error-sub { font-size: 16px; color: var(--text-2); margin-bottom: 32px; }

/* 13. FOOTER
   ─────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 28px var(--pad);
  background: var(--bg);
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.footer-brand {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--display);
  font-size: 17px; font-weight: 600; color: var(--text);
}
.footer-brand img { border-radius: 6px; }
.footer-copy { font-size: 13px; color: var(--text-3); }
.footer-links { display: flex; gap: 20px; list-style: none; }
.footer-links a { font-size: 13px; color: var(--text-2); transition: color .15s; }
.footer-links a:hover { color: var(--link); }

/* 14. SCROLL ANIMATIONS
   ─────────────────────────────────────────────────────── */
[data-animate] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .55s ease, transform .55s ease;
}
[data-animate].is-visible { opacity: 1; transform: none; }
[data-animate][data-delay="1"] { transition-delay: .08s; }
[data-animate][data-delay="2"] { transition-delay: .16s; }
[data-animate][data-delay="3"] { transition-delay: .24s; }
[data-animate][data-delay="4"] { transition-delay: .32s; }
[data-animate][data-delay="5"] { transition-delay: .40s; }
[data-animate][data-delay="6"] { transition-delay: .48s; }

/* ═══════════════════════════ KEYGLOW ═══════════════════════════ */

/* The stats bar's gradient is light in dark mode, so its text follows the accent ink. */
.stat-item { color: var(--on-accent); }
@media (prefers-color-scheme: dark) {
  .stat-icon { background: rgba(18,12,44,.10); }
}

/* HERO — always the night sky, like the play screen
   ─────────────────────────────────────────────────────── */
.hero {
  background:
    radial-gradient(ellipse 60% 50% at 78% 70%, rgba(179,140,255,.22), transparent 70%),
    radial-gradient(ellipse 40% 40% at 10% 0%, rgba(77,168,255,.14), transparent 70%),
    var(--sky);
  color: #f0eefb;
  --text: #f0eefb; --text-2: #c4c1df; --link: #c3a6ff; --accent: #b38cff;
  --accent-soft: rgba(179,140,255,.14); --accent-line: rgba(179,140,255,.34);
  --on-accent: #120c2c; --accent-dk: #c3a6ff;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px 64px;
  align-items: center;
  min-height: min(calc(100dvh - 64px), 860px);
  padding: 60px var(--pad) 80px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.hero-content { max-width: 560px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 5px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  margin-bottom: 28px;
}
.hero-badge-icon { border-radius: 7px; }
.hero-badge-text { font-size: 13px; font-weight: 600; color: var(--link); letter-spacing: .02em; }
.hero-headline {
  font-family: var(--display);
  font-size: clamp(38px, 5.4vw, 66px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -.025em;
  margin-bottom: 18px;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.hero-promise {
  font-family: var(--display);
  font-size: clamp(19px, 2vw, 24px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--glow);
  text-shadow: 0 0 24px rgba(179,140,255,.55);
  margin-bottom: 18px;
}
.hero-sub {
  font-size: clamp(16px, 1.7vw, 19px);
  line-height: 1.65;
  color: var(--text-2);
  margin-bottom: 36px;
  max-width: 500px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 26px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 100px;
  font-size: 15px; font-weight: 600;
  transition: transform .15s, box-shadow .2s, background .2s;
  box-shadow: 0 2px 18px var(--accent-glow);
}
.hero .btn-primary { box-shadow: 0 0 28px rgba(179,140,255,.5); }
.btn-primary:hover { background: var(--accent-dk); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 13px 22px;
  color: var(--link);
  border-radius: 100px; font-size: 15px; font-weight: 500;
  border: 1.5px solid var(--accent-line);
  transition: border-color .2s, background .2s;
}
.btn-ghost:hover { border-color: var(--link); background: var(--accent-soft); }

/* THE PLAY SCREEN (drawn, not a screenshot)
   ─────────────────────────────────────────────────────── */
.tablet {
  width: 420px;
  padding: 14px;
  background: #1d1c33;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 34px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5), 0 0 60px rgba(179,140,255,.18);
}
.tablet-screen {
  background: var(--sky);
  border-radius: 22px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr auto;
  height: 520px;
}
.play-top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 6px;
  font-size: 14px; font-weight: 600; color: #f0eefb;
}
.lane { position: relative; overflow: hidden; }
/* Faint guides on the white keys' edges. */
.lane::before {
  content: ""; position: absolute; inset: 0;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 14 - 1px), rgba(255,255,255,.04) calc(100% / 14 - 1px) calc(100% / 14));
}
.note {
  position: absolute;
  left: calc(100% / 14 * var(--key) + 3px);
  width: calc(100% / 14 - 6px);
  top: var(--top); height: var(--len);
  border-radius: 7px;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 5px;
  font-family: var(--display); font-size: 12px; font-weight: 700; color: #120c2c;
}
.note--right {
  background: linear-gradient(180deg, rgba(77,168,255,.25), var(--right));
  box-shadow: 0 0 16px rgba(77,168,255,.55);
}
/* Left hand: orange plus stripes, as in the app (colour plus pattern for colour-blind players). */
.note--left {
  background:
    repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.22) 6px 9px),
    linear-gradient(180deg, rgba(255,158,66,.25), var(--left));
  box-shadow: 0 0 16px rgba(255,158,66,.5);
}
.hitline {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(255,255,255,.55);
  box-shadow: 0 0 12px rgba(255,255,255,.6);
}

/* Falling motion: the lane drifts down a little and back, so the page is calm, not busy. */
@media (prefers-reduced-motion: no-preference) {
  .lane .note { animation: fall 3.2s ease-in-out infinite alternate; }
  .key--lit { animation: pulse 3.2s ease-in-out infinite alternate; }
}
@keyframes fall  { from { transform: translateY(-10px); } to { transform: translateY(0); } }
@keyframes pulse { from { filter: brightness(.85); } to { filter: brightness(1.1); } }

.keys {
  position: relative;
  display: grid; grid-template-columns: repeat(14, 1fr); gap: 2px;
  height: 92px; padding: 0 2px 2px;
  background: #0a0a1c;
}
.key { background: #eeeef7; border-radius: 0 0 5px 5px; }
.key--lit {
  background: linear-gradient(180deg, #ffffff 0%, #d9ccff 100%);
  box-shadow: 0 -10px 24px rgba(255,255,255,.65), inset 0 0 12px rgba(179,140,255,.6);
}
.key-black {
  position: absolute; top: 0;
  left: calc((100% - 4px) / 14 * var(--after) + 2px - (100% / 14) * .3);
  width: calc(100% / 14 * .6); height: 58%;
  background: #15142a; border-radius: 0 0 4px 4px;
}

.stars { display: inline-flex; gap: 2px; padding: 2px 4px; border-radius: 99px; }
.stars svg { width: 14px; height: 14px; }
.star-on  { fill: var(--star); }
.star-off { fill: none; stroke: rgba(160,158,190,.6); stroke-width: 2; }
.stars--glow { background: rgba(179,140,255,.25); box-shadow: 0 0 12px var(--glow); }

/* THE NOTE BRIDGE
   ─────────────────────────────────────────────────────── */
.bridge { padding: 100px var(--pad); max-width: var(--max-w); margin: 0 auto; }
.bridge-steps {
  list-style: none;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
  counter-reset: none;
}
.bridge-step {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 18px 18px 26px;
  display: grid; align-content: start; gap: 6px;
}
.step-view {
  position: relative;
  height: 150px; margin-bottom: 14px;
  border-radius: 14px; overflow: hidden;
  background: var(--sky);
}
.step-staff, .step-blocks { position: absolute; inset: 0; }
.staff-line {
  position: absolute; left: 6%; right: 6%; height: 1.5px;
  top: calc(28px + var(--line) * 12px);
  background: rgba(240,238,251,.8);
}
/* Noteheads: position 0 = the bottom line (E4), each step is half a line gap. */
.head {
  position: absolute;
  left: calc(var(--x) - 7px);
  top: calc(28px + 48px - var(--pos) * 6px - 5px);
  width: 14px; height: 10px; border-radius: 50%;
  background: #f0eefb; transform: rotate(-20deg);
}
.block {
  position: absolute; bottom: 0;
  left: calc(var(--x) - 13px); width: 26px; height: var(--h);
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(77,168,255,.2), var(--right));
  box-shadow: 0 0 14px rgba(77,168,255,.55);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 4px;
  font-family: var(--display); font-size: 11px; font-weight: 700; color: #120c2c;
}
/* Step 1: only glowing blocks with letters. */
.bridge-step--1 .step-staff { display: none; }
/* Step 2: the staff appears above, the blocks shrink below and the letters fade. */
.bridge-step--2 .block { height: calc(var(--h) * .45); opacity: .85; color: rgba(18,12,44,.35); }
/* Step 3: the staff leads; the blocks are only a faint glow, no letters. */
.bridge-step--3 .block { height: calc(var(--h) * .35); opacity: .28; color: transparent; box-shadow: none; }
/* Step 4: only the notes. */
.bridge-step--4 .step-blocks { display: none; }
.bridge-step--4 .step-staff { top: 18px; }

.step-number {
  font-family: var(--display); font-size: 12px; font-weight: 700;
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--link);
}
.step-title { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; }
.step-text  { font-size: 15px; line-height: 1.6; color: var(--text-2); }
.bridge-note {
  max-width: 680px; margin: 36px auto 0; text-align: center;
  font-size: 16px; color: var(--text-2); line-height: 1.65;
}

/* LIBRARY
   ─────────────────────────────────────────────────────── */
.library { padding: 100px var(--pad); background: var(--bg-2); }
.shelf {
  list-style: none;
  max-width: calc(var(--max-w) - 160px); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.shelf-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 30px 28px;
}
.shelf-count {
  display: block;
  font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  margin-bottom: 10px;
}
.shelf-title { font-family: var(--display); font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.shelf-text  { font-size: 15px; line-height: 1.6; color: var(--text-2); }

/* GAMES + FAMILIES
   ─────────────────────────────────────────────────────── */
.duo {
  max-width: var(--max-w); margin: 0 auto;
  padding: 100px var(--pad);
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
}
.duo-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 40px 36px;
}
.duo-title { font-family: var(--display); font-size: clamp(26px, 2.8vw, 34px); font-weight: 700; line-height: 1.15; margin-bottom: 12px; }
.duo-text { font-size: 16px; color: var(--text-2); line-height: 1.65; }

.board, .report {
  max-width: 340px; margin: 0 auto 32px;
  background: var(--sky); color: #f0eefb;
  border-radius: 20px; padding: 18px 18px 14px;
  box-shadow: var(--sh3);
}
.board-head { display: grid; gap: 2px; margin-bottom: 12px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9a97ba; }
.board-song { font-family: var(--display); font-size: 19px; letter-spacing: 0; text-transform: none; color: #f0eefb; }
.board-rows { list-style: none; display: grid; gap: 6px; }
.board-rows li {
  display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); font-size: 14px;
}
.board-rows li.board-me { background: rgba(179,140,255,.2); box-shadow: inset 0 0 0 1px rgba(179,140,255,.5); }
.board-rank { font-family: var(--display); font-weight: 800; color: #9a97ba; }
.board-name { font-weight: 600; }

.report-kicker { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #9a97ba; }
.report-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0 16px; }
.report-days i { aspect-ratio: 1; border-radius: 50%; background: rgba(255,255,255,.08); }
.report-days i.on { background: var(--glow); box-shadow: 0 0 10px var(--glow); }
.report-stats { display: flex; justify-content: space-between; }
.report-stats dt { font-size: 11px; color: #9a97ba; text-transform: uppercase; letter-spacing: .08em; }
.report-stats dd { font-family: var(--display); font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* FREE AND PRO
   ─────────────────────────────────────────────────────── */
.pricing { padding: 100px var(--pad); background: var(--bg-2); }
.pricing-grid {
  max-width: 940px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start;
}
.plan {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r3); padding: 36px 32px;
}
.plan--pro { border: 1.5px solid var(--accent-line); box-shadow: var(--sh3), 0 0 40px var(--accent-soft); }
.plan-name { font-family: var(--display); font-size: 30px; font-weight: 700; }
.plan-price { font-size: 14px; font-weight: 600; color: var(--accent); margin: 4px 0 18px; text-transform: uppercase; letter-spacing: .08em; }
.plan-lead { font-family: var(--display); font-size: 19px; font-weight: 600; margin-bottom: 14px; }
.plan-points { list-style: none; display: grid; gap: 11px; }
.plan-points li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 15px; line-height: 1.5; color: var(--text-2); }
.check {
  width: 20px; height: 20px; margin-top: 1px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center;
}
.plan-note { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 14px; color: var(--text-3); line-height: 1.6; }
.pricing-always {
  max-width: 640px; margin: 36px auto 0; text-align: center;
  font-family: var(--display); font-weight: 600; font-size: 19px; color: var(--text-2);
}

/* PRIVACY BAND
   ─────────────────────────────────────────────────────── */
.privacy-band { padding: 100px var(--pad); }
.privacy-band-inner { max-width: 640px; margin: 0 auto; text-align: center; }
.privacy-band .btn-ghost { margin-top: 28px; }

.download-cta .keys { max-width: 320px; height: 64px; margin: 0 auto 36px; border-radius: 10px; padding-top: 2px; box-shadow: var(--sh3); }

/* RESPONSIVE
   ─────────────────────────────────────────────────────── */
@media (max-width: 1060px) {
  .bridge-steps { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center; justify-items: center;
    padding-top: 40px; min-height: auto; gap: 48px;
  }
  .hero-content { max-width: 100%; }
  .hero-sub     { max-width: 100%; margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .features-grid { grid-template-columns: 1fr 1fr; }
  .shelf { grid-template-columns: 1fr; max-width: 560px; }
  .duo { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; max-width: 560px; }
}

@media (max-width: 600px) {
  body > header { gap: 8px; }
  .header-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg);
    flex-direction: column; align-items: stretch;
    padding: 8px 0 16px; gap: 0; z-index: 50;
    border-top: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(23,22,43,.10);
  }
  .header-nav.nav-open { display: flex; }
  .nav-toggle { display: flex; align-items: center; justify-content: center; }
  .nav-link { padding: 13px var(--pad); font-size: 16px; width: 100%; border-radius: 0; }
  .lang-dropdown { position: fixed; top: 64px; left: 16px; right: 16px; min-width: 0; }

  .tablet { width: 100%; padding: 10px; border-radius: 26px; }
  .tablet-screen { height: 440px; border-radius: 18px; }
  .note { font-size: 10px; }
  .bridge-steps { grid-template-columns: 1fr; }
  .features, .bridge, .library, .duo, .pricing, .privacy-band, .download-cta { padding-top: 72px; padding-bottom: 72px; }
  .features-grid { grid-template-columns: 1fr; }
  .feature-card  { padding: 24px 20px; }
  .duo-item, .plan { padding: 28px 22px; }
  .support-card { padding: 24px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .footer-links { gap: 14px; flex-wrap: wrap; }
}

/* REDUCED MOTION
   ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  [data-animate] { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
