/* Earsona website. Colors are the app's ListeningTheme tokens (design/branding/earsona/brand-tokens.css).
   Funnel Display / Funnel Sans are self-hosted under the SIL Open Font License (fonts/OFL-funnel.txt). */
@font-face {
  font-family: "Funnel Display";
  src: url("/fonts/funnel-display-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: "Funnel Sans";
  src: url("/fonts/funnel-sans-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --charcoal: #151a18;
  --raised: #202823;
  --inset: #2a3530;
  --emerald: #22c17a;
  --emerald-ink: #0b2718;
  --mint: #c4efda;
  --warm: #f6f5ee;
  --sage: #abc1b4;
  --accent: #52d397;
  --line: #34463c;
  --deep: #11683f;
  --forest: #15251d;

  --bg: var(--charcoal);
  --ink: var(--warm);
  --muted: var(--sage);
  --link: var(--accent);
  --rule: var(--line);
  --surface: var(--raised);

  --display: "Funnel Display", "Funnel Sans", ui-sans-serif, system-ui, sans-serif;
  --text: "Funnel Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --max: 1200px;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.03em; line-height: 1.02; text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 20; background: var(--emerald); color: var(--emerald-ink); padding: 10px 16px; border-radius: 10px; font-weight: 700; }
.skip:focus { top: 16px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

/* Header */
.site-header { position: relative; z-index: 2; padding: 22px 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-family: var(--display); font-weight: 550; font-size: 1.3rem; letter-spacing: 0; }
.brand img { width: 34px; height: 34px; border-radius: 23%; }
.nav { display: flex; gap: 2px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; padding: 8px 12px; border-radius: 999px; transition: color .2s, background-color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }

/* ---------- Home: mode-driven ground ---------- */
.home { transition: background-color .7s var(--ease), color .7s var(--ease); }
.home[data-mode="learn"] {
  color-scheme: light;
  --bg: var(--mint);
  --ink: var(--forest);
  --muted: #2f5544;
  --link: var(--deep);
  --rule: #9fd4ba;
}
.home[data-mode="learn"] .site-header .brand img { box-shadow: 0 0 0 1px #15251d22; }
.when-learn { display: none; }
.home[data-mode="learn"] .when-learn { display: revert; }
.home[data-mode="learn"] .when-guess { display: none; }

/* Stage */
.stage { padding: clamp(4px, 1.5vw, 16px) 0 clamp(48px, 6vw, 80px); overflow-x: clip; }
.stage-grid { display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 72px); align-items: center; }

.mode-switch {
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 5px; margin-bottom: clamp(24px, 3vw, 36px);
  border-radius: 999px; background: color-mix(in srgb, var(--ink) 9%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 12%, transparent);
}
.mode-switch button {
  position: relative; z-index: 1; appearance: none; border: 0; background: none; cursor: pointer;
  font: 600 1rem/1 var(--text); color: var(--muted); padding: 13px 26px; border-radius: 999px; min-width: 9.5rem;
  transition: color .4s var(--ease);
}
.mode-switch button[aria-checked="true"] { color: var(--emerald-ink); }
.mode-switch button:hover:not([aria-checked="true"]) { color: var(--ink); }
.mode-thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px;
  background: var(--emerald); box-shadow: 0 6px 18px -6px #0b271880;
  transition: transform .55s var(--ease);
}
.home[data-mode="learn"] .mode-thumb { transform: translateX(100%); }

.stage h1 { font-size: clamp(2.9rem, 5.2vw, 4.8rem); letter-spacing: -.03em; line-height: .96; max-width: 100%; }
.lede { font-size: clamp(1.1rem, 1.7vw, 1.3rem); line-height: 1.5; color: var(--muted); max-width: 31em; margin: 26px 0 36px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; }
.store { display: inline-flex; align-items: center; gap: 10px; margin: 0; font-weight: 600; font-size: 1.05rem; color: var(--ink); }
.store svg { width: 22px; height: 22px; fill: none; stroke: var(--emerald); stroke-width: 1.8; stroke-linecap: round; }

/* Demo */
.demo { margin: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0; position: relative; }
.phone {
  --w: clamp(250px, 21vw, 292px);
  width: var(--w); aspect-ratio: 318 / 636; border-radius: calc(var(--w) * .16); padding: calc(var(--w) * .035);
  background: linear-gradient(145deg, #3a403d, #0c0f0e 40%, #262b29);
  box-shadow: 0 50px 80px -30px rgba(5, 12, 9, .7), 0 18px 30px -18px rgba(5, 12, 9, .6), inset 0 0 0 1.5px #4a514e;
  position: relative; z-index: 1; grid-row: 1; grid-column: 1;
}
.screen {
  height: 100%; border-radius: calc(var(--w) * .13); background: #151a18; color: #f6f5ee; overflow: hidden;
  display: flex; flex-direction: column; padding: calc(var(--w) * .045) calc(var(--w) * .07) calc(var(--w) * .04);
  font-family: var(--text); font-size: calc(var(--w) * .043);
}
.status { display: flex; align-items: center; justify-content: space-between; font-weight: 650; font-size: 1em; height: 2.1em; }
.status svg { width: 2.6em; fill: currentColor; color: #f6f5ee; }
.island { width: 30%; height: 1.75em; background: #000; border-radius: 99px; }
.app-bar { display: flex; justify-content: space-between; align-items: center; color: #abc1b4; margin-top: 1em; font-size: .9em; }
.app-bar svg { width: 1.3em; fill: #abc1b4; }
.playlist { font-family: var(--display); font-weight: 600; font-size: 1.85em; letter-spacing: -.02em; margin: .25em 0 .5em; line-height: 1.1; }
.art { border-radius: .8em; overflow: hidden; aspect-ratio: 380 / 322; background: #202823; }
.art img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 1.2s var(--ease); }
.demo[data-phase="hidden"] .art img { filter: saturate(.55) brightness(.8); }
.now { text-align: center; margin-top: .95em; min-height: 3.1em; }
.now p { margin: 0; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .5s var(--ease), opacity .5s var(--ease), transform .6s var(--ease), filter .6s var(--ease); }
.now-title { font-family: var(--display); font-size: 1.32em; font-weight: 600; letter-spacing: -.01em; }
.now-artist { color: #abc1b4; font-size: .98em; margin-top: .15em !important; }
.now [data-hidden="true"] { color: #abc1b4; }
.now .now-artist[data-hidden="true"] { color: #8aa094; }
.now .just { animation: arrive .7s var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(.4em); filter: blur(4px); } }
.pill {
  align-self: center; display: inline-flex; align-items: center; gap: .45em; margin: .7em 0 0;
  padding: .42em .95em; border-radius: 99px; background: #22352b; color: #c4efda; font-size: .86em; font-weight: 550; white-space: nowrap;
  transition: background-color .4s, color .4s;
}
.pill .bell { width: 1.05em; fill: none; stroke: currentColor; stroke-width: 1.4; display: none; }
.demo[data-chime="true"] .pill { background: #22c17a; color: #0b2718; }
.demo[data-chime="true"] .pill .bell { display: block; animation: ring .5s ease-in-out 2; }
@keyframes ring { 25% { transform: rotate(14deg); } 75% { transform: rotate(-14deg); } }
.scrub { margin-top: auto; padding-top: .9em; position: relative; }
.thumb { position: absolute; top: calc(.9em - .22em); left: calc(var(--p, .2) * 100%); width: .66em; height: .66em; margin-left: -.33em; border-radius: 50%; background: #22c17a; box-shadow: 0 1px 3px rgba(0,0,0,.4); transition: left .5s linear; }
.bar { display: block; height: .22em; border-radius: 9px; background: #34463c; overflow: hidden; }
.fill { display: block; height: 100%; width: 100%; background: #22c17a; border-radius: inherit; transform-origin: left; transform: scaleX(.2); transition: transform .5s linear; }
.times { display: flex; justify-content: space-between; color: #abc1b4; font-size: .78em; margin-top: .45em; font-variant-numeric: tabular-nums; }
.controls { display: flex; justify-content: space-between; align-items: center; margin: .7em 0 .9em; }
.controls svg { width: 1.6em; fill: none; stroke: #f6f5ee; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.controls .dim { stroke: #7f958a; width: 1.35em; }
.play { width: 3.4em; height: 3.4em; border-radius: 50%; background: #22c17a; display: grid; place-items: center; }
.play svg { stroke: #0b2718; stroke-width: 2.6; width: 1.3em; }
.tabs { display: flex; justify-content: space-between; color: #abc1b4; font-size: .82em; padding: 0 .6em; }
.screen::after { content: ""; display: block; width: 36%; height: .3em; margin: .8em auto 0; border-radius: 9px; background: #f6f5ee; opacity: .85; }

.voice {
  margin: clamp(20px, 2.5vw, 32px) 0 0; padding: 0; font-family: var(--display); font-weight: 650; color: var(--ink);
  font-size: clamp(2.3rem, 5vw, 4.6rem); letter-spacing: -.035em; line-height: 1.02; min-height: 1.05em; max-width: 15em;
}
.voice p { margin: 0; text-wrap: balance; }
.home[data-mode="learn"] .voice { font-size: clamp(1.9rem, 3.6vw, 3.3rem); max-width: 22em; min-height: 2.1em; }
.voice.idle .w { opacity: .3; }
.voice .w { transition: opacity .35s var(--ease), color .35s var(--ease); }
.voice .w.off { opacity: .3; }
.voice.speaking p::before { content: ""; display: block; width: 1.6em; height: .18em; margin-bottom: .35em; border-radius: 9px; background: repeating-linear-gradient(90deg, var(--emerald) 0 .22em, transparent .22em .42em); animation: talk .5s steps(3) infinite; }
@keyframes talk { 50% { clip-path: inset(0 35% 0 0); } }
.demo figcaption { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 18px; font-size: .85rem; color: var(--muted); }
.demo-toggle { appearance: none; font: 600 .85rem var(--text); color: var(--ink); background: none; border: 1px solid var(--rule); border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.demo-toggle:hover { border-color: var(--ink); }

/* Timing band: emerald owns this region */
.timing { background: var(--emerald); color: var(--emerald-ink); padding: clamp(72px, 10vw, 136px) 0; --link: var(--emerald-ink); }
.timing-head { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px clamp(32px, 6vw, 96px); align-items: end; }
.timing h2 { font-size: clamp(2.4rem, 5.4vw, 4.6rem); letter-spacing: -.04em; }
.timing-head p { margin: 0; font-size: 1.15rem; max-width: 30em; color: #123d27; }
.track { margin: clamp(56px, 8vw, 96px) 0 clamp(48px, 7vw, 80px); position: relative; }
.ruler { position: relative; height: 2rem; border-bottom: 2px solid var(--emerald-ink); background: repeating-linear-gradient(90deg, var(--emerald-ink) 0 1px, transparent 1px calc(100% / 24)) bottom / 100% 9px no-repeat; }
.ruler span { position: absolute; left: calc(var(--at) * 100%); top: 0; transform: translateX(-50%); font-size: .85rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ruler span:nth-child(1) { --at: 0; } .ruler span:nth-child(2) { --at: .25; } .ruler span:nth-child(3) { --at: .5; } .ruler span:nth-child(4) { --at: .75; } .ruler span:nth-child(5) { --at: 1; }
.ruler span:first-child { transform: none; }
.ruler span:last-child { transform: translateX(-100%); }
.lane { position: relative; height: 12.5rem; }
.cue { position: absolute; left: calc(var(--at) * 100%); top: 0; bottom: 0; width: 2px; background: var(--emerald-ink); }
.cue::before { content: ""; position: absolute; top: -7px; left: -7px; width: 12px; height: 12px; border-radius: 50%; background: var(--emerald-ink); }
.cue b { position: absolute; left: 14px; top: 1.6rem; width: max-content; max-width: 15em; font-family: var(--display); font-weight: 650; font-size: clamp(1.15rem, 2vw, 1.6rem); line-height: 1.1; letter-spacing: -.02em; }
.cue.late b { top: 6.4rem; }
.cue.first { --at: .25; } .cue.late { --at: .5; }
.cue.chime { --at: .21; background: repeating-linear-gradient(var(--emerald-ink) 0 5px, transparent 5px 9px); }
.cue.chime::before { background: var(--mint); box-shadow: 0 0 0 2px var(--emerald-ink); }
.cue.chime b { top: auto; bottom: 0; left: auto; right: 14px; font-family: var(--text); font-size: .95rem; font-weight: 650; letter-spacing: 0; }
.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 56px); margin: 0; border-top: 2px solid var(--emerald-ink); }
.settings div { padding-top: 22px; }
.settings dt { font-family: var(--display); font-weight: 700; font-size: 1.5rem; letter-spacing: -.02em; }
.settings dd { margin: 6px 0 0; color: #123d27; }

/* Facts */
.facts { padding: clamp(80px, 11vw, 150px) 0; }
.facts-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 40px clamp(40px, 7vw, 110px); align-items: start; }
.facts h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); letter-spacing: -.04em; position: sticky; top: 32px; }
.said { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 3.4vw, 2.9rem); line-height: 1.08; letter-spacing: -.03em; margin: 0; color: var(--ink); }
.said.unsaid { color: var(--muted); margin-top: clamp(48px, 6vw, 80px); }
.said s { text-decoration-thickness: .08em; text-decoration-color: var(--emerald); }
.source { color: var(--muted); margin: 14px 0 0; max-width: 32em; }

/* Listen */
.listen { padding: 0 0 clamp(80px, 11vw, 150px); }
.listen-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px clamp(40px, 7vw, 110px); border-top: 1px solid var(--rule); padding-top: clamp(40px, 6vw, 72px); }
.listen h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
.listen p { margin: 0; color: var(--muted); max-width: 34em; }
.listen-grid > div > p { margin-top: 16px; }
.services { margin: 0; display: grid; }
.services > div { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 4px 24px; padding: 18px 0; border-top: 1px solid var(--rule); }
.services > div:last-child { border-bottom: 1px solid var(--rule); }
.services dt { font-family: var(--display); font-weight: 650; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.15; }
.services dd { margin: 0; color: var(--muted); }
.services dd strong { color: var(--ink); font-weight: 600; }
.services .unsupported dt { color: var(--muted); font-weight: 550; }
.listen .fine { grid-column: 1 / -1; font-size: .92rem; max-width: 46em; }
.needs { flex-basis: 100%; margin: 0; font-size: .95rem; color: var(--muted); }
.needs a { white-space: nowrap; }

/* Close */
.close { background: var(--raised); padding: clamp(72px, 10vw, 128px) 0; color: var(--warm); --link: var(--accent); }
.close-grid { display: grid; grid-template-columns: minmax(160px, 300px) minmax(0, 1fr); gap: clamp(32px, 6vw, 88px); align-items: center; }
.close-icon { width: 100%; border-radius: 23%; box-shadow: 0 40px 70px -30px rgba(0,0,0,.75); }
.close h2 { font-size: clamp(2.6rem, 6vw, 5rem); letter-spacing: -.045em; }
.close p { color: var(--sage); max-width: 34em; margin: 18px 0 0; }
.close .close-contact { margin-top: 30px; color: var(--warm); }

/* ---------- Long-form pages ---------- */
.doc { padding: clamp(28px, 6vw, 72px) 0 clamp(64px, 9vw, 112px); }
.doc .wrap { max-width: 800px; }
.doc h1 { font-size: clamp(2.6rem, 6.5vw, 4.2rem); letter-spacing: -.04em; }
.doc .meta { color: var(--muted); font-size: 1rem; margin: 14px 0 40px; }
.doc h2 { font-size: clamp(1.4rem, 2.6vw, 1.8rem); margin: 52px 0 12px; letter-spacing: -.025em; }
.doc p, .doc li { color: var(--muted); }
.doc p strong, .doc li strong { color: var(--ink); }
.doc ul { padding-left: 1.2em; }
.doc li { margin-bottom: 8px; }
.summary { background: var(--surface); border-radius: 18px; padding: 22px 26px; margin: 28px 0; }
.summary p { margin: 0; }
.contact { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 32px; align-items: center; background: var(--surface); border-radius: 24px; padding: clamp(24px, 4vw, 40px); margin: 8px 0 24px; }
.doc .contact h2 { margin: 0 0 8px; }
.contact p { margin: 0; }
.mail { display: inline-flex; align-items: center; min-height: 54px; padding: 0 24px; border-radius: 14px; background: var(--emerald); color: var(--emerald-ink); text-decoration: none; font-weight: 700; white-space: nowrap; }
.mail:hover { filter: brightness(1.06); }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding: 32px 0 48px; color: var(--muted); font-size: .92rem; }
.home .site-footer { background: var(--raised); color: var(--sage); border-top-color: var(--line); --link: var(--accent); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer a { color: inherit; }
.home .site-footer strong { color: var(--warm); }
.site-footer a:hover { color: var(--ink); }
.home .site-footer a:hover { color: var(--warm); }
.site-footer .legal { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .stage-grid { grid-template-columns: 1fr; }
  .demo { justify-self: center; max-width: 640px; width: 100%; grid-template-columns: 1fr; justify-items: center; }
  .demo figcaption { justify-content: center; }
  .timing-head, .facts-grid, .listen-grid { grid-template-columns: 1fr; }
  .facts h2 { position: static; }
  .settings { grid-template-columns: 1fr; }
  .settings div + div { margin-top: 8px; }
}
@media (max-width: 640px) {
  .services > div { grid-template-columns: 1fr; }
  .demo { grid-template-columns: 1fr; justify-items: center; }
  .phone { --w: min(72vw, 290px); }
  .demo figcaption { justify-content: center; }
  .mode-switch { display: grid; width: 100%; }
  .mode-switch button { min-width: 0; padding: 13px 10px; }
  .lane { height: 15rem; }
  .cue b { max-width: 8.5em; font-size: 1.05rem; left: 10px; }
  .cue.late b { top: 8.2rem; }
  .cue.chime b { display: none; }
  .close-grid { grid-template-columns: 1fr; }
  .close-icon { max-width: 140px; }
  .contact { grid-template-columns: 1fr; }
  .nav a { padding: 8px 10px; }
}
@media (max-width: 380px) {
  .brand span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
