/* ============================================================
   BetterTuner — landing page
   Brand tokens lifted verbatim from the app (Color.kt / shared.css)
   ============================================================ */

:root {
  --bg:              #060608;
  /* Two flat surface tones — no gradients on chrome. */
  --surface-1:       #0d0d11;   /* cards / panels */
  --surface-2:       #15151a;   /* raised: inputs, chips, hover */
  --surface:         #0d0d11;   /* legacy alias */
  --surface-elevated:#15151a;   /* legacy alias */
  --surface-card:    #0d0d11;   /* legacy alias */

  --text-primary:    #ECECEE;
  --text-secondary:  #9b9ba2;
  --text-tertiary:   #62626a;

  /* One hairline border, everywhere. Hover lifts it one step. */
  --hairline:        rgba(255,255,255,.07);
  --hairline-2:      rgba(255,255,255,.14);
  --wire:            #24242A;   /* product-internal lines only (ladders, ticks) */

  --cyan:            #00E5FF;
  --magenta:         #FF2D9D;
  --amber:           #FFB300;
  --lime:            #A6FF00;
  --violet:          #B18BFF;

  /* Single chrome accent. Neon hues live inside the product visuals only. */
  --accent:          var(--cyan);
  --shadow:          0 16px 40px rgba(0,0,0,.45);

  --font-display: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-sans:    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:    ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --maxw: 1140px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; }

/* ---------- Ambient background ---------- */
.bg-mesh {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 50% -8%, rgba(0,229,255,.05), transparent 70%),
    var(--bg);
}
.blob { display: none; } /* retired the drifting colored blobs */
.grid-overlay {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.015) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 0%, #000, transparent 70%);
}

/* ---------- Reusable bits ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: .76rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-tertiary);
}
.eyebrow__dot {
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
@keyframes pulse { 50% { opacity: .4; } }

/* Monochrome sheen on the hero headline — no rainbow gradient text. */
.grad-text {
  background: linear-gradient(180deg, #ffffff, #b6b6bd);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 600; font-size: .96rem;
  padding: 12px 22px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; transition: transform .2s var(--ease), background .2s, border-color .2s, color .2s;
}
.btn--primary { color: #04181c; background: var(--cyan); }
.btn--primary:hover { background: #5cecff; transform: translateY(-1px); }
.btn--ghost { color: var(--text-primary); border-color: var(--hairline); background: transparent; }
.btn--ghost:hover { border-color: var(--hairline-2); transform: translateY(-1px); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  max-width: var(--maxw); margin: 0 auto;
  padding: 18px 28px;
  transition: padding .3s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.nav.is-stuck {
  background: rgba(8,8,11,.7);
  backdrop-filter: saturate(140%) blur(16px);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom-color: var(--hairline);
  padding: 12px 28px;
}
.nav__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.nav__logo { width: 24px; height: 24px; color: var(--cyan); display: inline-block; }
.nav__logo svg { width: 100%; height: 100%; display: block; }
.nav__logo--lg { width: 56px; height: 56px; }
.nav__links { display: flex; gap: 26px; margin-left: auto; font-size: .95rem; color: var(--text-secondary); }
.nav__links a { position: relative; transition: color .2s; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -5px; width: 0; height: 2px; background: var(--cyan); transition: width .25s var(--ease); }
.nav__links a:hover { color: var(--text-primary); }
.nav__links a:hover::after { width: 100%; }
.nav__cta { margin-left: 4px; padding: 9px 18px; }

/* Mobile hamburger + dropdown menu (shown ≤920px) */
.nav__toggle {
  display: none; margin-left: auto; width: 40px; height: 40px; flex-shrink: 0;
  border: 1px solid var(--hairline); border-radius: 10px; background: transparent; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav__toggle span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--text-primary); transition: transform .22s var(--ease), opacity .15s; }
.nav.is-menu-open .nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav.is-menu-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-menu-open .nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav__menu {
  position: absolute; top: 100%; left: 0; right: 0;
  background: rgba(8,8,11,.97); backdrop-filter: saturate(140%) blur(16px); -webkit-backdrop-filter: saturate(140%) blur(16px);
  border-bottom: 1px solid var(--hairline);
  padding: 8px 28px 22px; display: flex; flex-direction: column;
}
.nav__menu[hidden] { display: none; }
.nav__menu a:not(.nav__menu-cta) { padding: 14px 2px; color: var(--text-secondary); font-size: 1.02rem; border-bottom: 1px solid var(--hairline); }
.nav__menu a:not(.nav__menu-cta):active { color: var(--text-primary); }
.nav__menu-cta { margin-top: 16px; justify-content: center; }
@media (min-width: 921px) { .nav__menu { display: none !important; } }

/* ---------- Layout ---------- */
main { display: block; }
.section { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px, 12vw, 140px) 28px; }
.section__head { max-width: 680px; margin: 0 auto clamp(40px, 6vw, 72px); text-align: center; }
.section__title { font-size: clamp(2rem, 4.5vw, 3.2rem); margin: 18px 0 14px; }
.section__sub { color: var(--text-secondary); font-size: 1.1rem; }

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: clamp(40px, 8vw, 90px) 28px clamp(50px, 8vw, 100px);
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center;
}
.hero__title { font-size: clamp(2.6rem, 6vw, 4.6rem); margin: 22px 0; }
.hero__lede { color: var(--text-secondary); font-size: clamp(1.05rem, 1.6vw, 1.22rem); max-width: 540px; }
.hero__actions { display: flex; gap: 14px; margin: 32px 0 40px; flex-wrap: wrap; }
.hero__stats { list-style: none; display: flex; gap: clamp(20px, 4vw, 44px); flex-wrap: wrap; }
.hero__stats li { display: flex; flex-direction: column; }
.hero__stats strong { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.3rem); font-weight: 700; color: var(--text-primary); }
.hero__stats span { font-size: .82rem; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Phone mockup ---------- */
.hero__device { position: relative; display: flex; justify-content: center; perspective: 1400px; }
.phone {
  position: relative;
  width: 300px; height: 620px;
  background: #0a0a0d;
  border-radius: 44px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,255,255,.03);
  transform: rotateY(-14deg) rotateX(6deg) rotateZ(1deg);
  transform-style: preserve-3d;
  transition: transform .4s var(--ease);
  animation: floaty 7s ease-in-out infinite;
}
@keyframes floaty { 50% { transform: rotateY(-14deg) rotateX(6deg) translateY(-14px); } }
.phone__notch { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); width: 92px; height: 22px; background: #050507; border-radius: 0 0 14px 14px; z-index: 3; }
.phone__screen {
  position: relative; height: 100%; border-radius: 34px; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #101018, #050507 70%);
  display: flex; flex-direction: column;
}
.device-glow {
  position: absolute; inset: 14% -6% -16% -6%; z-index: -1;
  background: radial-gradient(closest-side, rgba(0,229,255,.16), transparent 70%);
  filter: blur(50px);
}

/* App tuner UI inside phone */
.app-tuner { flex: 1; padding: 44px 18px 10px; display: flex; flex-direction: column; gap: 14px; }
.app-tuner__head { display: flex; justify-content: space-between; }
.app-pill { font-size: .68rem; padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,.05); color: var(--text-secondary); letter-spacing: .03em; }
.app-pill--muted { color: var(--text-tertiary); font-family: var(--font-mono); }

.gauge { position: relative; display: flex; flex-direction: column; align-items: center; padding: 10px 0 4px; }
.gauge__rings { position: absolute; top: 4px; width: 150px; height: 150px; }
.ring { position: absolute; inset: 0; margin: auto; border-radius: 50%; border: 1.5px solid var(--cyan); opacity: 0; }
.ring--1 { animation: ringPulse 2.6s ease-out infinite; }
.ring--2 { animation: ringPulse 2.6s ease-out .7s infinite; }
.ring--3 { animation: ringPulse 2.6s ease-out 1.4s infinite; }
@keyframes ringPulse { 0% { transform: scale(.55); opacity: .55; } 100% { transform: scale(1.15); opacity: 0; } }

.gauge__arc { width: 200px; height: 120px; overflow: visible; }
.gauge__track { fill: none; stroke: var(--wire); stroke-width: 6; stroke-linecap: round; }
.gauge__fill  { fill: none; stroke: var(--cyan); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 264; stroke-dashoffset: 132; filter: drop-shadow(0 0 6px rgba(0,229,255,.7)); animation: gaugeFill 4s var(--ease) infinite; }
@keyframes gaugeFill { 0%,100% { stroke-dashoffset: 150; } 50% { stroke-dashoffset: 120; } }
.gauge__needle { stroke: #fff; stroke-width: 3; stroke-linecap: round; transform-origin: 100px 110px; animation: needle 4s var(--ease) infinite; filter: drop-shadow(0 0 4px rgba(255,255,255,.6)); }
@keyframes needle { 0% { transform: rotate(-34deg); } 20% { transform: rotate(22deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(6deg); } 80%,100% { transform: rotate(0deg); } }
.gauge__hub { fill: var(--cyan); }
.gauge__readout { text-align: center; margin-top: -14px; }
.gauge__note { display: block; font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; }
.gauge__note sub { font-size: .9rem; color: var(--text-tertiary); }
.gauge__cents { font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); letter-spacing: .05em; }

.ladder { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.ladder__row { display: flex; align-items: center; gap: 10px; }
.ladder__row i { width: 18px; font-style: normal; font-family: var(--font-mono); font-size: .82rem; color: var(--text-tertiary); }
.ladder__row b { height: 6px; border-radius: 3px; background: var(--wire); position: relative; flex: 1; overflow: hidden; }
.ladder__row b::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: var(--text-tertiary); border-radius: 3px; }
.ladder__row--lit i { color: var(--cyan); }
.ladder__row--lit b::after { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .6; } }

.app-nav { height: 52px; border-top: 1px solid var(--wire); background: rgba(11,11,14,.8); display: flex; }
.app-nav__item { flex: 1; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); position: relative; }
.app-nav__item svg { width: 19px; height: 19px; }
.app-nav__item--active { color: var(--cyan); }
.app-nav__item--active::before { content: ""; position: absolute; top: 0; width: 22px; height: 2px; border-radius: 1px; background: var(--cyan); }

/* ---------- Trust strip ---------- */
.trust {
  max-width: var(--maxw); margin: 0 auto; padding: 22px 28px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px 26px;
  border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline);
  color: var(--text-tertiary); font-size: .94rem; text-align: center;
}
.trust__item span { color: var(--text-primary); font-weight: 600; }
.trust__sep { width: 4px; height: 4px; border-radius: 50%; background: var(--hairline-2); }

/* ---------- Features ---------- */
.features {
  display: grid; gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}
.feature-card {
  position: relative; padding: 24px 24px 26px; border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  overflow: hidden; transition: transform .25s var(--ease), border-color .25s;
}
.feature-card:hover { transform: translateY(-4px); border-color: var(--hairline-2); }
.feature-card h3 { font-size: 1.22rem; margin-bottom: 9px; }
.feature-card p { color: var(--text-secondary); font-size: .95rem; position: relative; }

/* ---- Feature preview panels ---- */
.feature-card__preview {
  position: relative; height: 96px; margin-bottom: 20px; border-radius: 12px;
  border: 1px solid var(--hairline); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #08080b;
}

/* Tuner needle */
.pv-tuner { position: relative; width: 76%; }
.pv-tuner__bar { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--magenta), #2a2a30 50%, var(--amber)); opacity: .5; }
.pv-tuner__bar::before { content: ""; position: absolute; left: 50%; top: -4px; width: 1px; height: 12px; background: var(--text-tertiary); }
.pv-tuner__dot { position: absolute; top: -3px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); animation: pvTunerDot 4.2s var(--ease) infinite; }
.pv-tuner__cap { display: block; text-align: center; margin-top: 14px; font-family: var(--font-mono); font-size: .64rem; letter-spacing: .06em; color: var(--cyan); }
@keyframes pvTunerDot { 0% { left: 16%; } 18% { left: 76%; } 38% { left: 40%; } 58% { left: 56%; } 78%, 100% { left: 50%; } }

/* String ladder — note rows with a cents dot, the lit row sitting in tune */
.pv-ladder { width: 78%; display: flex; flex-direction: column; gap: 7px; }
.pvl { display: flex; align-items: center; gap: 8px; }
.pvl i { width: 12px; font-style: normal; font-family: var(--font-mono); font-size: .62rem; color: var(--text-tertiary); }
.pvl b { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--wire); }
.pvl b::before { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 9px; background: var(--text-tertiary); opacity: .5; }
.pvl u { position: absolute; top: 50%; left: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--text-tertiary); }
.pvl--in i { color: var(--cyan); }
.pvl--in u { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: pvBreathe 2.2s ease-in-out infinite; }
@keyframes pvBreathe { 50% { opacity: .5; } }

/* Oscilloscope — scrolling waveform */
.pv-scope { width: 82%; height: 56px; }
.pv-scope .pv-scope-zero { stroke: var(--wire); stroke-width: 1; }
.pv-scope-g { animation: pvScope 2.4s linear infinite; }
.pv-scope-g path { stroke: var(--cyan); stroke-width: 2; }
@keyframes pvScope { to { transform: translateX(-60px); } }

/* Metronome dots — accent on beat 1 (cyan, like the app's sam) */
.pv-metro { display: flex; gap: 13px; }
.pv-metro .bd { width: 15px; height: 15px; border-radius: 50%; background: #24242a; animation: pvBeat 1.6s steps(1) infinite; }
.pv-metro .bd--accent { background: var(--cyan); }
.pv-metro .bd:nth-child(1) { animation-delay: 0s; }
.pv-metro .bd:nth-child(2) { animation-delay: .4s; }
.pv-metro .bd:nth-child(3) { animation-delay: .8s; }
.pv-metro .bd:nth-child(4) { animation-delay: 1.2s; }
@keyframes pvBeat { 0% { transform: scale(1.55); filter: brightness(1.9); } 14%, 100% { transform: scale(1); filter: brightness(1); } }

/* Chord diagram — cyan finger dots, like the app */
.pv-chord { height: 72px; }
.pv-chord__dots circle { filter: drop-shadow(0 0 5px var(--cyan)); animation: pvDot 3.2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
@keyframes pvDot { 0%, 78%, 100% { opacity: 1; transform: scale(1); } 88% { opacity: .45; transform: scale(.72); } }

/* Lesson stars — amber, like the app's 3-star rating */
.pv-ears { display: flex; gap: 9px; font-size: 1.7rem; line-height: 1; }
.pv-ears span { color: var(--amber); opacity: .22; animation: pvStar 3s ease-in-out infinite; }
@keyframes pvStar { 0% { opacity: .22; text-shadow: none; } 16%, 82% { opacity: 1; text-shadow: 0 0 10px var(--amber); } 100% { opacity: .22; text-shadow: none; } }

/* ---------- Showcases ---------- */
.showcase {
  max-width: var(--maxw); margin: 0 auto; padding: clamp(50px, 8vw, 100px) 28px;
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 80px); align-items: center;
}
.showcase--reverse .showcase__media { order: 2; }
.showcase__copy h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); margin: 16px 0 16px; }
.showcase__copy > p { color: var(--text-secondary); font-size: 1.08rem; margin-bottom: 22px; }
.check-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.check-list li { position: relative; padding-left: 32px; color: var(--text-secondary); }
.check-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 19px; height: 19px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
}
.check-list li::after {
  content: ""; position: absolute; left: 6px; top: 8px; width: 7px; height: 4px;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

.showcase__media { display: flex; justify-content: center; }

/* ---------- Views gallery (tuner + visualizers) ---------- */
.views__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  max-width: var(--maxw); margin: 0 auto;
}
.viz-tile {
  border: 1px solid var(--hairline); border-radius: 16px; overflow: hidden;
  background: var(--surface-1);
  transition: transform .25s var(--ease), border-color .25s;
}
.viz-tile:hover { transform: translateY(-4px); border-color: var(--hairline-2); }
.viz-stage {
  position: relative; height: 330px; display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-bottom: 1px solid var(--hairline);
  background: #08080b;
}
.viz-stage--photo { align-items: flex-end; }
.viz-tile figcaption { padding: 16px 18px; }
.viz-tile__name { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.06rem; }
.viz-tile__desc { color: var(--text-tertiary); font-size: .86rem; }

/* ---- In-tune color cycle: flat = magenta, sharp = amber, in tune = cyan ----
   Snapped stops (e.g. 6%→8%) avoid muddy in-between hues. One 5s timeline,
   shared by every visualizer so they sweep and lock in unison. */
@keyframes tuneFill {
  0%,6%    { background: var(--cyan);    box-shadow: 0 0 16px var(--cyan); }
  8%,24%   { background: var(--magenta); box-shadow: 0 0 12px var(--magenta); }
  26%,42%  { background: var(--amber);   box-shadow: 0 0 12px var(--amber); }
  44%,56%  { background: var(--magenta); box-shadow: 0 0 12px var(--magenta); }
  58%,66%  { background: var(--amber);   box-shadow: 0 0 12px var(--amber); }
  68%,100% { background: var(--cyan);    box-shadow: 0 0 16px var(--cyan); }
}
@keyframes tuneColor {
  0%,6%    { color: var(--cyan); }
  8%,24%   { color: var(--magenta); }
  26%,42%  { color: var(--amber); }
  44%,56%  { color: var(--magenta); }
  58%,66%  { color: var(--amber); }
  68%,100% { color: var(--cyan); }
}
@keyframes tuneDotPos {
  0% { left: 50%; } 8% { left: 24%; } 26% { left: 76%; }
  44% { left: 30%; } 58% { left: 70%; } 68% { left: 50%; } 100% { left: 50%; }
}
@keyframes tuneNeedle {
  0% { transform: rotate(2deg); } 8% { transform: rotate(-17deg); } 26% { transform: rotate(16deg); }
  44% { transform: rotate(-10deg); } 58% { transform: rotate(9deg); } 68% { transform: rotate(2deg); } 100% { transform: rotate(2deg); }
}
@keyframes tuneRow {
  0%,6%    { border-top-color: var(--cyan);    background: rgba(0,229,255,.07); color: var(--cyan); }
  8%,24%   { border-top-color: var(--magenta); background: rgba(255,45,157,.08); color: var(--magenta); }
  26%,42%  { border-top-color: var(--amber);   background: rgba(255,179,0,.08);  color: var(--amber); }
  44%,56%  { border-top-color: var(--magenta); background: rgba(255,45,157,.08); color: var(--magenta); }
  58%,66%  { border-top-color: var(--amber);   background: rgba(255,179,0,.08);  color: var(--amber); }
  68%,100% { border-top-color: var(--cyan);    background: rgba(0,229,255,.07); color: var(--cyan); }
}
@keyframes tuneLblOff { 0%,6% { opacity: 0; } 9%,66% { opacity: 1; } 68%,100% { opacity: 0; } }
@keyframes tuneLblIn  { 0%,7% { opacity: 1; } 9%,66% { opacity: 0; } 68%,100% { opacity: 1; } }

/* Two-state caption that flips between "tuning…" and "in tune" with the cycle. */
.lblwrap { position: relative; display: inline-flex; justify-content: center; }
.lbl--off { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; white-space: nowrap; opacity: 0; color: var(--text-secondary); animation: tuneLblOff 5s linear infinite; }
.lbl--in { opacity: 1; animation: tuneLblIn 5s linear infinite; }

/* Headstock */
.htune {
  position: absolute; top: 14px; left: 16px; right: 16px; z-index: 3;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.htune__track {
  position: relative; width: 100%; height: 4px; border-radius: 2px;
  background: linear-gradient(90deg, var(--magenta), #2a2a30 50%, var(--amber)); opacity: .55;
}
.htune__zone {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 26%; height: 10px; border-radius: 6px; background: rgba(0,229,255,.12);
  box-shadow: inset 0 0 0 1px rgba(0,229,255,.3);
}
.htune__dot {
  position: absolute; top: 50%; left: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px var(--cyan);
  animation: tuneDotPos 5s var(--ease) infinite, tuneFill 5s linear infinite;
}
.htune__labels { height: 14px; }
.htune .lbl { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .05em; }
.htune .lbl--in { color: var(--cyan); }

.viz-headstock { position: relative; height: calc(100% - 42px); display: flex; }
.viz-headstock img { height: 100%; width: auto; max-width: 100%; display: block; object-fit: contain; }
.hpeg {
  position: absolute; top: 93%; transform: translate(-50%, -50%);
  width: 13px; height: 13px; border-radius: 50%; background: var(--text-tertiary);
  box-shadow: 0 0 0 3px rgba(0,0,0,.45);
}
.hpeg--intune { background: var(--cyan); box-shadow: 0 0 0 4px rgba(0,229,255,.14), 0 0 12px var(--cyan); animation: pulse 2s ease-in-out infinite; }
.hpeg--amber { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,179,0,.14), 0 0 12px var(--amber); }

/* Ladder */
.viz-ladder { width: 86%; display: flex; flex-direction: column; gap: 8px; }
.srow {
  height: 34px; display: flex; align-items: center; gap: 12px; padding: 0 14px; border-radius: 10px;
  font-size: .85rem; font-family: var(--font-mono); color: var(--text-tertiary);
  border-top: 1.4px solid var(--wire);
}
.srow__label { width: 22px; flex-shrink: 0; }
.srow__bar { position: relative; flex: 1; height: 4px; border-radius: 2px; background: var(--wire); }
.srow__bar::before { content: ""; position: absolute; left: 50%; top: -3px; width: 1px; height: 10px; background: var(--text-tertiary); opacity: .5; }
.srow__bar i { position: absolute; top: 50%; left: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--text-tertiary); }
.srow--intune { color: var(--cyan); background: rgba(0,229,255,.07); border-top: 2.5px solid var(--cyan); animation: tuneRow 5s linear infinite; }
.srow--intune .srow__bar { background: rgba(255,255,255,.10); }
.srow--intune .srow__bar i { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation: tuneDotPos 5s var(--ease) infinite, tuneFill 5s linear infinite; }

/* Meter */
.viz-meter { width: 248px; height: 248px; }
.viz-meter .meter-color { color: var(--amber); animation: tuneColor 5s linear infinite; }
.viz-meter .needle { transform-origin: 100px 100px; animation: tuneNeedle 5s var(--ease) infinite; }
.viz-meter__cents { position: absolute; bottom: 22px; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .04em; }
.viz-meter__cents .lbl--off { color: var(--amber); }
.viz-meter__cents .lbl--in { color: var(--cyan); }

/* Strobe */
.viz-strobe { position: relative; width: 240px; height: 240px; border-radius: 50%; color: var(--cyan); box-shadow: 0 0 70px rgba(0,229,255,.12), inset 0 0 50px rgba(0,0,0,.6); animation: tuneColor 5s linear infinite; }
.viz-strobe .sr { position: absolute; border-radius: 50%; border: 2px solid currentColor; }
.viz-strobe .sr1 { inset: 4px;  border-style: dashed; opacity: .3; animation: spin 9s linear infinite; }
.viz-strobe .sr2 { inset: 26px; border-color: var(--violet); opacity: .45; animation: spin 6s linear infinite reverse; }
.viz-strobe .sr3 { inset: 48px; border-style: dotted; animation: spin 4s linear infinite; }
.viz-strobe .sr4 { inset: 70px; animation: spin 12s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.viz-strobe__core { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; z-index: 2; }
.viz-strobe__note { font-family: var(--font-display); font-size: 2.9rem; font-weight: 700; line-height: 1; color: currentColor; text-shadow: 0 0 24px currentColor; }
.viz-strobe .lbl { font-family: var(--font-mono); font-size: .84rem; }
.viz-strobe .lbl--in { color: var(--cyan); }

/* Oscilloscope */
.viz-scope { width: 88%; height: 210px; }
.scope-trace { color: var(--cyan); animation: scopeScroll 3s linear infinite, tuneColor 5s linear infinite; }
@keyframes scopeScroll { to { transform: translateX(-80px); } }
.viz-scope__hz { position: absolute; top: 16px; right: 20px; font-family: var(--font-mono); font-size: .78rem; color: var(--text-secondary); }

/* Spectrum / chroma waterfall */
.viz-spectrum { width: 90%; height: 92%; }
.chroma { opacity: .32; animation: chromaFlow 6s linear infinite; }
@keyframes chromaFlow { to { transform: translateX(-64px); } }
.chroma-active { color: var(--cyan); filter: drop-shadow(0 0 5px currentColor); animation: chromaFlow 6s linear infinite, tuneColor 5s linear infinite; }
.viz-spectrum__badge {
  position: absolute; bottom: 14px; font-family: var(--font-mono); font-size: .72rem; font-weight: 600;
  letter-spacing: .06em; text-shadow: 0 0 14px rgba(0,229,255,.5);
}
.viz-spectrum__badge .lbl--off { color: var(--amber); text-shadow: 0 0 14px rgba(255,179,0,.5); }
.viz-spectrum__badge .lbl--in { color: var(--cyan); }

/* Spec strip under the gallery */
.views__spec {
  list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 34px;
  max-width: var(--maxw); margin: 40px auto 0; padding-top: 28px; border-top: 1px solid var(--wire);
  color: var(--text-secondary); text-align: center;
}
.views__spec strong { color: var(--text-primary); font-family: var(--font-display); }

/* ---------- Metronome slider ---------- */
.mslider { position: relative; max-width: 760px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 6px; }
.mslider__viewport { overflow: hidden; border-radius: 22px; transition: height .45s var(--ease); }
.mslider__track { display: flex; align-items: flex-start; transition: transform .55s var(--ease); }
.mslide { min-width: 100%; padding: 4px; display: flex; flex-direction: column; }
.mslide__cap { text-align: center; color: var(--text-tertiary); font-size: .92rem; margin-top: 16px; padding: 0 10px; }
.mslide__cap b { color: var(--text-primary); font-weight: 600; }

.mslider__arrow {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--wire);
  background: rgba(255,255,255,.03); color: var(--text-secondary); font-size: 1.4rem; line-height: 1;
  cursor: pointer; transition: border-color .2s, color .2s, transform .2s; flex-shrink: 0;
}
.mslider__arrow:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); }
.mslider__dots { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 22px; }
.mdot {
  font-family: var(--font-mono); font-size: .74rem; letter-spacing: .03em; cursor: pointer;
  padding: 7px 14px; border-radius: 999px; border: 1px solid var(--wire);
  background: transparent; color: var(--text-tertiary); transition: all .2s;
}
.mdot:hover { color: var(--text-secondary); border-color: var(--wire-active, #6A6A72); }
.mdot.is-active { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, var(--wire)); background: color-mix(in srgb, var(--accent) 12%, transparent); }

/* Slide card (mimics the app surface) */
.ms-card {
  background: var(--surface-1);
  border: 1px solid var(--hairline); border-radius: 16px; padding: 24px;
  min-height: 320px; display: flex; flex-direction: column; gap: 16px; justify-content: center;
}

/* Western */
.ms-top { display: flex; align-items: baseline; gap: 12px; }
.ms-bpm { display: flex; align-items: baseline; gap: 6px; }
.ms-bpm__num { font-family: var(--font-display); font-size: 3.4rem; font-weight: 700; line-height: 1; }
.ms-bpm__u { color: var(--text-tertiary); font-size: .8rem; letter-spacing: .1em; }
.ms-name { color: var(--text-tertiary); font-size: .9rem; }
.ms-play { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--cyan); color: #04181c; font-size: .9rem; }
.ms-beats { display: flex; gap: 16px; padding: 8px 0; }
.bdot { width: 16px; height: 16px; border-radius: 50%; background: var(--wire); }
.bdot--sam { background: var(--cyan); }
.bdot--tali { background: var(--amber); }
.bdot--khali { background: var(--magenta); opacity: .65; }
.ms-beats--anim .bdot { animation: mbeat 2s steps(1) infinite; }
.ms-beats--anim .bdot:nth-child(1) { animation-delay: 0s; }
.ms-beats--anim .bdot:nth-child(2) { animation-delay: .5s; }
.ms-beats--anim .bdot:nth-child(3) { animation-delay: 1s; }
.ms-beats--anim .bdot:nth-child(4) { animation-delay: 1.5s; }
@keyframes mbeat { 0% { transform: scale(1.5); filter: brightness(1.8); } 14%, 100% { transform: scale(1); filter: brightness(1); } }
.ms-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ms-chips--wrap { gap: 7px; }
.m-chip { font-family: var(--font-mono); font-size: .8rem; padding: 7px 12px; border-radius: 999px; background: var(--surface-elevated); color: var(--text-secondary); border: 1px solid transparent; transition: background .25s, color .25s, border-color .25s; }
.m-chip.is-on { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 35%, transparent); }
.m-chips__suffix { color: var(--text-tertiary); font-family: var(--font-mono); font-size: .8rem; margin-left: 2px; }
.ms-sounds { display: flex; gap: 10px; flex-wrap: wrap; }
.ms-sound { flex: 1; min-width: 110px; background: var(--surface-elevated); border-radius: 12px; padding: 10px 14px; display: flex; flex-direction: column; gap: 3px; }
.ms-sound small { color: var(--text-tertiary); font-size: .72rem; }
.ms-sound b { color: var(--cyan); font-weight: 600; font-size: .92rem; }
.ms-sound--toggle { flex-direction: row; align-items: center; justify-content: space-between; }
.m-switch { width: 40px; height: 24px; border-radius: 999px; background: var(--cyan); position: relative; flex-shrink: 0; }
.m-switch::after { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--bg); top: 3px; right: 3px; }

/* Indian tala + flamenco compás */
.ms-tala { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.vibhag { display: flex; justify-content: space-around; gap: 6px; padding: 10px 8px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--hairline); }
.ms-compas { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; justify-items: center; }
.bcell { display: flex; flex-direction: column; align-items: center; gap: 6px; }
/* Playhead sweep — each mātrā / beat flashes in turn (delays set in main.js). */
.ms-tala .bdot, .ms-compas .bdot { animation: mStep 4s linear infinite; }
.ms-compas .bdot { animation-duration: 3s; }
@keyframes mStep {
  0% { transform: scale(1.55); box-shadow: 0 0 0 3px rgba(255,255,255,.16), 0 0 9px rgba(255,255,255,.3); }
  10%, 100% { transform: scale(1); box-shadow: none; }
}
.bcell i { font-style: normal; font-family: var(--font-mono); font-size: .68rem; color: var(--text-tertiary); }
.ms-legend { display: flex; gap: 18px; font-size: .76rem; color: var(--text-secondary); }
.ms-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dotc--sam { background: var(--cyan); }
.dotc--tali { background: var(--amber); }
.dotc--khali { background: var(--magenta); opacity: .65; }
.ms-toggle { display: inline-flex; align-self: flex-start; background: var(--surface-elevated); border-radius: 999px; padding: 3px; }
.ms-toggle span { font-family: var(--font-mono); font-size: .78rem; padding: 6px 16px; border-radius: 999px; color: var(--text-secondary); }
.ms-toggle .is-on { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }

/* Step sequencer */
.ms-seqbar { display: flex; align-items: center; gap: 10px; }
.ms-seqbar__mid { flex: 1; text-align: center; color: var(--text-secondary); font-size: .82rem; font-family: var(--font-mono); }
.ms-seqbar__mid i { font-style: normal; color: var(--cyan); padding: 0 4px; }
.ms-seqbar__mid b { color: var(--cyan); font-weight: 600; }
.ms-btn { font-family: var(--font-mono); font-size: .78rem; color: var(--cyan); background: var(--surface-elevated); border-radius: 8px; padding: 7px 12px; }
.seqgrid { display: flex; flex-direction: column; gap: 12px; }
.lane { display: flex; flex-direction: column; gap: 6px; }
.lane__name { font-family: var(--font-mono); font-size: .8rem; color: var(--c); }
.lane__steps { display: flex; gap: 6px; height: 26px; }
.beatcol { position: relative; flex: 1; display: flex; gap: 3px; border-radius: 6px; animation: seqChase 2s linear infinite; animation-delay: var(--bd); }
.cell { flex: 1; border-radius: 4px; background: var(--surface-elevated); }
/* Softer fills: blend the lane colour toward the surface, gentle glow. */
.cell.on { background: color-mix(in srgb, var(--c) 82%, #0d0d11); box-shadow: 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); animation: cellFire 2s linear infinite; animation-delay: var(--bd); }
@keyframes seqChase { 0% { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cyan) 70%, transparent); } 25%, 100% { box-shadow: inset 0 0 0 1.5px transparent; } }
/* Lit cells brighten as the playhead column reaches them. */
@keyframes cellFire { 0% { filter: brightness(1.7); } 12%, 100% { filter: brightness(1); } }
.ms-subrow { display: flex; align-items: center; gap: 6px; }
.ms-add { margin-left: auto; font-family: var(--font-mono); font-size: .8rem; color: var(--cyan); }

/* FX calculator */
.fx-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.fx-bpm { color: var(--text-secondary); font-size: .85rem; font-family: var(--font-mono); }
.fx-bpm b { color: var(--text-primary); font-family: var(--font-display); font-size: 1.1rem; }
.fx-unit { display: inline-flex; background: var(--surface-elevated); border-radius: 999px; padding: 3px; }
.fx-unit i { font-style: normal; font-family: var(--font-mono); font-size: .76rem; padding: 5px 13px; border-radius: 999px; color: var(--text-secondary); }
.fx-unit .is-on { background: color-mix(in srgb, var(--cyan) 16%, transparent); color: var(--cyan); }
.fx-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.fx-table { background: var(--surface-2); border: 1px solid var(--hairline); border-radius: 12px; padding: 10px 12px; }
.fx-th, .fx-tr { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 6px; align-items: center; padding: 6px 0; }
.fx-tr--4, .fx-table:last-child .fx-th { grid-template-columns: 1fr 1fr 1fr 1fr; }
.fx-th { color: var(--text-tertiary); font-size: .68rem; font-family: var(--font-mono); border-bottom: 1px solid var(--hairline); text-align: right; }
.fx-th span:first-child { text-align: left; }
.fx-tr { font-family: var(--font-mono); font-size: .82rem; color: var(--text-secondary); text-align: right; border-bottom: 1px solid rgba(255,255,255,.04); }
.fx-tr:last-child { border-bottom: none; }
.fx-tr span:first-child { text-align: left; color: var(--text-primary); }
.fx-tr .fx-note { color: var(--cyan); }
.fx-tr b { color: var(--cyan); font-weight: 600; }

/* ---------- The Chords Helper ---------- */
.chords-bar {
  max-width: 760px; margin: 0 auto 26px; background: var(--surface-1); border: 1px solid var(--hairline);
  border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 10px;
}
.chords-bar__row { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; }

.chords-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; max-width: var(--maxw); margin: 0 auto; }
.chord-card {
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 16px; padding: 22px;
  transition: transform .25s var(--ease), border-color .25s;
}
.chord-card:hover { transform: translateY(-4px); border-color: var(--hairline-2); }
.chord-stage { height: 220px; display: flex; align-items: center; justify-content: center; transition: opacity .24s var(--ease); }
.chord-stage.swap { opacity: 0; }
.chord-stage svg { width: 100%; height: 100%; }
/* Dots pop in when the chord changes, so it reads like someone playing through it. */
.fretboard .dots circle, .fretboard .dots rect { transform-box: fill-box; transform-origin: center; animation: dotPop .34s var(--ease) both; }
@keyframes dotPop { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.chord-card figcaption { text-align: center; margin-top: 16px; }
.chord-card figcaption b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.chord-card figcaption span { color: var(--text-tertiary); font-size: .85rem; }

/* Fretboard diagram */
.fretboard .strings line { stroke: var(--wire); stroke-width: 1.4; }
.fretboard .nut { stroke: var(--text-secondary); stroke-width: 4; stroke-linecap: round; }
.fretboard .nut--capo { stroke: var(--amber); stroke-width: 7; }
.fretboard .frets line { stroke: var(--wire); stroke-width: 1.2; }
.fretboard .dots circle { fill: var(--cyan); }
.fretboard .fg { fill: #04181c; font-family: var(--font-mono); font-size: 9px; font-weight: 700; text-anchor: middle; }
.fretboard .mk text { fill: var(--text-secondary); font-size: 12px; text-anchor: middle; }
.fretboard .names text { fill: var(--text-tertiary); font-family: var(--font-mono); font-size: 10px; text-anchor: middle; }

/* Piano diagram */
.piano .wk rect { fill: #e9e9ee; stroke: var(--bg); stroke-width: 1.2; }
.piano .wk rect.hl { fill: var(--cyan); }
.piano .bk rect { fill: #141418; }
.piano .pl text { fill: #04181c; font-family: var(--font-mono); font-size: 11px; font-weight: 700; text-anchor: middle; }

/* Capo option */
.chords-capo {
  max-width: 760px; margin: 22px auto 0; display: grid; grid-template-columns: 132px 1fr; gap: 26px; align-items: center;
  background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 16px; padding: 24px;
}
.chords-capo__fig { height: 188px; }
.chords-capo__fig svg { width: 100%; height: 100%; }
.chords-capo__copy h3 { font-size: 1.2rem; margin-bottom: 8px; }
.chords-capo__copy p { color: var(--text-secondary); font-size: .95rem; margin-bottom: 16px; }
.capo-stepper { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: .85rem; color: var(--amber); border: 1px solid color-mix(in srgb, var(--amber) 35%, var(--hairline)); border-radius: 999px; padding: 7px 14px; }
.capo-stepper b { color: var(--amber); font-size: 1rem; }
.capo-stepper i { font-style: normal; color: var(--text-primary); }
.capo-note { margin-left: 12px; font-family: var(--font-mono); font-size: .78rem; color: var(--text-tertiary); letter-spacing: .04em; }

/* ---------- The Vocal & Ear Trainer ---------- */
.trainer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 940px; margin: 0 auto; }
.trainer-card figcaption { text-align: center; margin-top: 16px; }
.trainer-card figcaption b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.trainer-card figcaption span { color: var(--text-tertiary); font-size: .85rem; }

.vt, .et { background: var(--surface-1); border: 1px solid var(--hairline); border-radius: 16px; padding: 20px; min-height: 372px; display: flex; flex-direction: column; }

/* Vocal trainer */
.vt-top { display: flex; align-items: flex-start; }
.vt-top div { flex: 1; }
.vt-top b { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.vt-top span { font-size: .82rem; color: var(--text-secondary); }
.vt-x { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--hairline); color: var(--text-tertiary); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.vt-prog { height: 3px; border-radius: 2px; background: var(--wire); margin: 12px 0 0; overflow: hidden; }
.vt-prog i { display: block; height: 100%; background: var(--cyan); border-radius: 2px; transition: width .3s var(--ease); }
.vt-hero { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.vt-phase { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; color: var(--text-tertiary); text-transform: uppercase; }
.vt-swara { font-family: var(--font-display); font-size: 3.4rem; font-weight: 300; line-height: 1.1; }
.vt-hz { font-family: var(--font-mono); font-size: .76rem; color: var(--text-tertiary); }
.vt-cents { font-family: var(--font-mono); font-size: .9rem; margin-top: 2px; transition: color .2s; }
.vt-cents.is-in { color: var(--cyan); }
.vt-cents.is-sharp { color: var(--amber); }
.vt-cents.is-flat { color: var(--magenta); }
.vt-trace { width: 100%; height: 64px; margin-top: 12px; border-radius: 10px; overflow: hidden; background: #08080b; }
.vt-wave { width: 100%; height: 100%; }
.vt-wave .band { fill: rgba(0,229,255,.08); }
.vt-wave .zero { stroke: var(--wire-active, #6A6A72); stroke-width: 1; }
.vt-wave .vt-trace-g { animation: vtScroll 2.6s linear infinite; }
.vt-wave .vt-trace-g path { stroke: var(--cyan); stroke-width: 2.2; transition: stroke .3s; }
@keyframes vtScroll { to { transform: translateX(-80px); } }
/* The pitch line rides up/down as the "voice" wanders, then settles to centre. */
.vt-pitch { transition: transform .3s ease-out; }
.vt-trace.is-sharp .vt-trace-g path { stroke: var(--amber); }
.vt-trace.is-flat .vt-trace-g path { stroke: var(--magenta); }
.vt-trace.is-in .vt-trace-g path { stroke: var(--cyan); }
.vt-hold { height: 8px; border-radius: 4px; background: var(--wire); margin-top: 12px; overflow: hidden; }
.vt-hold i { display: block; height: 100%; width: 0; background: var(--cyan); border-radius: 4px; }

/* Ear trainer */
.et-top { display: flex; align-items: center; gap: 8px; }
.et-round { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .12em; color: var(--text-tertiary); flex: 1; }
.et-round i { font-style: normal; color: var(--text-primary); }
.et-chip { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em; color: var(--text-tertiary); background: var(--surface-2); border-radius: 8px; padding: 5px 9px; }
.et-chip b { color: var(--cyan); font-size: .8rem; }
.et-pills { display: flex; gap: 6px; margin: 14px 0; }
.et-pills span { flex: 1; text-align: center; font-family: var(--font-mono); font-size: .72rem; padding: 7px 0; border-radius: 999px; border: 1px solid var(--hairline); color: var(--text-secondary); }
.et-pills .is-on { border-color: color-mix(in srgb, var(--cyan) 45%, var(--hairline)); background: color-mix(in srgb, var(--cyan) 12%, transparent); color: var(--cyan); }
.et-banner { text-align: center; font-family: var(--font-mono); font-size: .82rem; letter-spacing: .12em; padding: 14px; border-radius: 10px; border: 1px solid var(--hairline); transition: color .2s, border-color .2s, background .2s; }
.et-banner--cyan { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 45%, var(--hairline)); background: color-mix(in srgb, var(--cyan) 7%, transparent); }
.et-banner--neutral { color: var(--text-primary); }
.et-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; flex: 1; }
.et-choice { display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.6rem; font-weight: 300; color: var(--text-primary); border: 1px solid var(--hairline); border-radius: 12px; min-height: 60px; transition: color .2s, border-color .2s, background .2s; }
.et-choice.sel { color: var(--cyan); border-color: var(--cyan); }
.et-choice.correct { color: var(--cyan); border-color: var(--cyan); background: color-mix(in srgb, var(--cyan) 8%, transparent); }
.et-choice.wrong { color: var(--magenta); border-color: var(--magenta); background: color-mix(in srgb, var(--magenta) 8%, transparent); }
.et-foot { display: flex; justify-content: flex-end; }
.et-replay { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; color: var(--text-secondary); border: 1px solid var(--hairline); border-radius: 10px; padding: 7px 12px; }

/* ---------- Indian classical ---------- */
.classical { position: relative; padding: clamp(60px,9vw,120px) 0; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.classical__inner { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.classical__grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.glass-card {
  padding: 26px; border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid var(--hairline);
  transition: transform .25s var(--ease), border-color .25s;
}
.glass-card:hover { transform: translateY(-4px); border-color: var(--hairline-2); }
.glass-card h3 { font-size: 1.2rem; margin: 18px 0 8px; }
.glass-card p { color: var(--text-secondary); font-size: .95rem; }

/* Shared viz stage for the three classical cards. */
.ic-stage { height: 132px; display: flex; align-items: center; justify-content: center; margin-bottom: 4px; }

/* Tanpura — four strings plucking in the staggered drone cycle + resonance. */
.tanpura { width: 100%; height: 100%; }
.tanpura .s { stroke: var(--wire-active, #6A6A72); stroke-width: 1.4; animation: tpPluck 4s ease-out infinite; }
.tanpura .s0 { animation-delay: 0s; }
.tanpura .s1 { animation-delay: 1s; }
.tanpura .s2 { animation-delay: 2s; }
.tanpura .s3 { animation-delay: 3s; }
@keyframes tpPluck {
  0% { stroke: var(--violet); stroke-width: 2.6; filter: drop-shadow(0 0 4px var(--violet)); }
  18%, 100% { stroke: var(--wire-active, #6A6A72); stroke-width: 1.4; filter: none; }
}
.tanpura .tp-bridge { stroke: var(--text-tertiary); stroke-width: 2; stroke-linecap: round; }
.tanpura .tp-res circle { fill: none; stroke: var(--violet); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; opacity: 0; }
.tanpura .tp-res circle:nth-child(1) { animation: tpRes 4s ease-out infinite; }
.tanpura .tp-res circle:nth-child(2) { animation: tpRes 4s ease-out 1.3s infinite; }
.tanpura .tp-res circle:nth-child(3) { animation: tpRes 4s ease-out 2.6s infinite; }
@keyframes tpRes { 0% { transform: scale(.4); opacity: .45; } 100% { transform: scale(2.2); opacity: 0; } }
.tanpura .tp-lab text { fill: var(--text-tertiary); font-family: var(--font-mono); font-size: 9px; text-anchor: middle; }

/* Sargam — each swara lights as the scale ascends. */
.sargam { display: flex; gap: 8px; align-items: flex-end; justify-content: center; }
.sargam span { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--text-tertiary); animation: saLight 4s ease-in-out infinite; }
.sargam span b { font-family: var(--font-display); font-size: 1.5rem; font-weight: 500; line-height: 1; }
.sargam span i { font-style: normal; font-family: var(--font-mono); font-size: .6rem; }
.sargam span:nth-child(1){animation-delay:0s}.sargam span:nth-child(2){animation-delay:.5s}.sargam span:nth-child(3){animation-delay:1s}.sargam span:nth-child(4){animation-delay:1.5s}.sargam span:nth-child(5){animation-delay:2s}.sargam span:nth-child(6){animation-delay:2.5s}.sargam span:nth-child(7){animation-delay:3s}.sargam span:nth-child(8){animation-delay:3.5s}
@keyframes saLight {
  0% { color: var(--text-tertiary); transform: scale(1); text-shadow: none; }
  5% { color: var(--violet); transform: scale(1.22); text-shadow: 0 0 14px var(--violet); }
  15%, 100% { color: var(--text-tertiary); transform: scale(1); text-shadow: none; }
}

/* Tala — circular cycle with role-coloured mātrās and a sweeping playhead. */
.tala { width: 100%; height: 100%; }
.tala .guide { fill: none; stroke: var(--hairline); }
.tala .m-sam { fill: var(--cyan); }
.tala .m-tali { fill: var(--amber); }
.tala .m-khali { fill: var(--magenta); opacity: .6; }
.tala .m-plain { fill: var(--wire-active, #6A6A72); }
.tala .hub { fill: var(--surface-1); stroke: var(--hairline); }
.tala .tala-hand { transform-box: view-box; transform-origin: 80px 80px; animation: spin 8s linear infinite; }
.tala .tala-hand line { stroke: var(--violet); stroke-width: 2; stroke-linecap: round; }
.tala .tala-hand circle { fill: var(--violet); filter: drop-shadow(0 0 5px var(--violet)); }
.tala-c1 { fill: var(--text-primary); font-family: var(--font-display); font-weight: 600; font-size: 12px; text-anchor: middle; }
.tala-c2 { fill: var(--text-tertiary); font-family: var(--font-mono); font-size: 8px; text-anchor: middle; }

/* ---------- Marquee ---------- */
.marquee-section { padding: clamp(40px,6vw,70px) 0; }
.marquee-label { text-align: center; color: var(--text-tertiary); font-family: var(--font-mono); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 26px; }
.marquee { overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee__track { display: flex; gap: 18px; width: max-content; animation: scroll 40s linear infinite; }
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__track span {
  font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 2.4rem); font-weight: 600;
  color: var(--text-tertiary); white-space: nowrap; padding: 0 6px; transition: color .2s;
}
.marquee__track span:hover { color: var(--text-secondary); }
.marquee__track span::after { content: "·"; margin-left: 24px; color: var(--hairline-2); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* ---------- CTA ---------- */
.cta { max-width: var(--maxw); margin: 0 auto; padding: clamp(70px,10vw,130px) 28px; }
.cta__inner {
  text-align: center; padding: clamp(44px,6vw,72px); border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--surface-1);
}
.cta__inner h2 { font-size: clamp(2rem,4.5vw,3.2rem); margin: 20px 0 14px; }
.cta__inner > p { color: var(--text-secondary); font-size: 1.08rem; max-width: 540px; margin: 0 auto 32px; }
.store-badges { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.store-badge {
  display: inline-flex; align-items: center; gap: 12px; padding: 12px 20px; border-radius: 12px;
  border: 1px solid var(--hairline); background: var(--surface-2); transition: transform .2s var(--ease), border-color .2s;
}
.store-badge:hover { transform: translateY(-2px); border-color: var(--hairline-2); }
.store-badge span { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.store-badge small { font-size: .68rem; color: var(--text-tertiary); }
.store-badge strong { font-family: var(--font-display); font-size: 1.02rem; }

/* ---------- Footer ---------- */
.footer { max-width: var(--maxw); margin: 0 auto; padding: 50px 28px 70px; text-align: center; border-top: 1px solid var(--hairline); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.footer__brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.footer__brand .nav__logo { width: 24px; height: 24px; }
.footer__tag { color: var(--text-secondary); }
.footer__links { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; color: var(--text-tertiary); font-size: .92rem; }
.footer__links a:hover { color: var(--text-primary); }
.footer__copy { color: var(--text-tertiary); font-size: .85rem; margin-top: 6px; }

/* ---------- Scroll reveal ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .views__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero__copy { display: flex; flex-direction: column; align-items: center; }
  .hero__device { order: -1; }
  .showcase, .showcase--reverse { grid-template-columns: 1fr; }
  .showcase--reverse .showcase__media { order: -1; }
  .features, .classical__grid { grid-template-columns: 1fr; }
  .chords-grid { grid-template-columns: 1fr; max-width: 360px; }
  .chords-capo { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .chords-capo__fig { width: 120px; }
  .trainer-grid { grid-template-columns: 1fr; max-width: 420px; }
  .nav__links { display: none; }
  .nav__cta { display: none; }
  .nav__toggle { display: flex; }
  .check-list { text-align: left; }
}
@media (max-width: 600px) {
  .views__grid { grid-template-columns: 1fr; max-width: 380px; }
  .fx-tables { grid-template-columns: 1fr; }
  .ms-card { padding: 16px; min-height: 300px; }
  .mslider__arrow { width: 34px; height: 34px; }
  .ms-bpm__num { font-size: 2.8rem; }
  .ms-tala { grid-template-columns: repeat(2, 1fr); }
  .ms-compas { gap: 2px; }
  .bcell i { font-size: .6rem; }
}
@media (max-width: 560px) {
  .nav__cta { display: none; }
  .hero__stats { justify-content: center; }
  .phone { width: 260px; height: 540px; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}
