/* Pickoo website. Colors and type follow design/tokens/pickoo-tokens.json:
   neutrals with a slight purple bias, sky blue as the only interface accent,
   pink / butter / mint only in Echo, stickers and grammatical-gender fills.
   Layout: one centered "home screen" hero, then left-aligned sections on alternating white and soft bands. */
/* Fonts are self-hosted (SIL OFL 1.1, see assets/fonts/), so no visitor data goes to a font CDN. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(assets/fonts/fredoka-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 300 700; font-display: swap; src: url(assets/fonts/fredoka-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(assets/fonts/nunito-vietnamese.woff2) format('woff2'); unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(assets/fonts/nunito-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Nunito'; font-style: normal; font-weight: 200 1000; font-display: swap; src: url(assets/fonts/nunito-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --bg: #FFFFFF;
  --band: #F7F6FA;
  --surface: #FFFFFF;
  --surface-2: #F7F6FA;
  --line: #E2DFE8;
  --line-strong: #CBC7D3;
  --text: #22202B;
  --text-2: #5E596B;
  --text-3: #736E81;
  --sky: #56BCEE;
  --sky-press: #3DA6D7;
  --sky-soft: #EDF8FE;
  --sky-100: #C4E6FA;
  --on-sky: #FFFFFF;
  --g-m: #C4E6FA;
  --g-f: #FBD1E2;
  --g-n: #FDEABD;
  --g-m-bar: #7DCAF2;
  --g-f-bar: #F4A3C6;
  --g-n-bar: #F8D274;
  --model: #56BCEE;
  --mine: #EF8DB9;
  --warn: #E0901F;
  --yes: #3BAA6A;
  --yes-bg: #EDF8F1;
  --no: #E5484D;
  --no-bg: #FEF1F1;
  --cover-butter: #FDEABD;
  --cover-pink: #FBD1E2;
  --cover-mint: #C3F5E7;
  --cover-lilac: #EAD0FD;
  --header-bg: rgba(255, 255, 255, 0.86);
  --shadow: 0 1px 2px rgba(34, 32, 43, 0.05), 0 10px 30px rgba(34, 32, 43, 0.07);
  --sticker-shadow: drop-shadow(0 2px 4px rgba(34, 32, 43, 0.14));

  --font-display: "Fredoka", ui-rounded, "Nunito", system-ui, sans-serif;
  --font-body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;
  --gutter: 20px;
  --max: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1821;
    --band: #201E28;
    --surface: #24212D;
    --surface-2: #2B2836;
    --line: #363240;
    --line-strong: #4B4658;
    --text: #F7F6FA;
    --text-2: #CBC7D3;
    --text-3: #A7A2B2;
    --sky-soft: #1E3240;
    --sky-100: #2A4A60;
    --g-m: #24445A;
    --g-f: #4E2C40;
    --g-n: #4A3D1C;
    --yes-bg: #1F3628;
    --no-bg: #3D2427;
    --cover-butter: #4A3D1C;
    --cover-pink: #4E2C40;
    --cover-mint: #1E4740;
    --cover-lilac: #3C2C52;
    --header-bg: rgba(26, 24, 33, 0.86);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.28);
    --sticker-shadow: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1821;
  --band: #201E28;
  --surface: #24212D;
  --surface-2: #2B2836;
  --line: #363240;
  --line-strong: #4B4658;
  --text: #F7F6FA;
  --text-2: #CBC7D3;
  --text-3: #A7A2B2;
  --sky-soft: #1E3240;
  --sky-100: #2A4A60;
  --g-m: #24445A;
  --g-f: #4E2C40;
  --g-n: #4A3D1C;
  --yes-bg: #1F3628;
  --no-bg: #3D2427;
  --cover-butter: #4A3D1C;
  --cover-pink: #4E2C40;
  --cover-mint: #1E4740;
  --cover-lilac: #3C2C52;
  --header-bg: rgba(26, 24, 33, 0.86);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 30px rgba(0, 0, 0, 0.28);
  --sticker-shadow: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* Paints the band above the sticky header on phones with a notch. */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem); line-height: 1.04; letter-spacing: -0.01em; }
h2 { font-size: clamp(2rem, 1.45rem + 2.3vw, 3rem); line-height: 1.1; letter-spacing: -0.005em; }
h3 { font-size: 1.25rem; font-weight: 500; line-height: 1.3; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--text-3); }
.small { font-size: 0.9375rem; color: var(--text-3); }
.center { text-align: center; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }

.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.i-sm { width: 16px; height: 16px; }

.wrap {
  max-width: var(--max);
  margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.wrap.narrow { max-width: 760px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 26px;
  border: 0;
  border-radius: 999px;
  font: 700 1rem/1 var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 120ms ease, transform 120ms ease;
}
.btn-primary { background: var(--sky); color: var(--on-sky); }
.btn-primary:hover { background: var(--sky-press); }
.btn-primary:active { transform: translateY(1px); }
.btn-quiet { background: transparent; color: var(--text); padding: 0 14px; }
.btn-quiet:hover { text-decoration: underline; text-underline-offset: 4px; }
.btn-sm { min-height: 40px; padding: 0 18px; font-size: 0.9375rem; }

/* Header */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.logo { display: inline-flex; color: var(--text); }
.logo svg { height: 34px; width: auto; aspect-ratio: 733.5 / 163.75; }
.logo-sm svg { height: 28px; }
.header-row > .logo { margin-right: auto; }
.nav { display: flex; gap: 4px; }
.nav a { white-space: nowrap; padding: 8px 12px; border-radius: 999px; text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 0.9375rem; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 1000px) {
  .nav { display: none; }
  .header-row { justify-content: space-between; }
}

/* Hero */
.hero { padding-block: clamp(28px, 5vw, 56px) clamp(8px, 2vw, 24px); }
.hero-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hero-echo { width: clamp(200px, 30vw, 300px); margin-bottom: 20px; }
.hero h1 { max-width: 17ch; }
.lede { max-width: 34rem; margin-top: 20px; color: var(--text-2); font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem); }
.echo-float { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }

.composer {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  width: min(560px, 100%);
  min-height: 60px;
  margin-top: 36px;
  padding: 6px 16px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}
.mode-wrap { position: relative; }
.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 48px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.mode-btn:hover { background: var(--line); }
.mode-btn .i-sm { color: var(--text-3); }
.mode-menu {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  z-index: 5;
  min-width: 200px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.mode-menu button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--text);
  font: 600 1rem var(--font-body);
  text-align: left;
  cursor: pointer;
}
.mode-menu button:hover, .mode-menu button[aria-checked="true"] { background: var(--sky-soft); }
.composer-text { flex: 1; min-width: 0; padding-inline: 6px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.composer-text.is-typed { color: var(--text); }
.composer-text.is-typing::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.18em; background: var(--sky); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.composer-mic { display: inline-flex; color: var(--text-2); }
/* The rest of the box is one button: tapping it fills in the sample note (see main.js "Try it"). */
.composer-field { display: flex; flex: 1; align-items: center; gap: 6px; min-width: 0; height: 48px; padding: 0; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; text-align: left; cursor: text; }
.composer:hover { border-color: var(--sky-100); }
.composer-note { margin-top: 14px; font-size: 0.875rem; color: var(--text-3); }
.hero-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 12px; margin-top: 32px; }
.platforms { margin-top: 16px; font-size: 0.875rem; font-weight: 700; letter-spacing: 0.02em; color: var(--text-3); }

/* Sections */
.section { padding-block: clamp(64px, 9vw, 112px); }
.band { background: var(--band); }
.section-head { display: grid; gap: 16px; max-width: 44rem; }
.section-head p, .split-text p { color: var(--text-2); }
.card-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.pill { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 0.8125rem; font-weight: 700; white-space: nowrap; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 48px 0 0; padding: 0; list-style: none; }
.step { display: grid; justify-items: start; gap: 10px; }
.step img { width: 132px; margin-bottom: 6px; }
.step-n { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--sky-soft); font-weight: 800; font-size: 0.875rem; }
.step p { color: var(--text-2); }

/* Note on the left, story on the right (stacked on narrow screens); the story gets more room for two columns. */
.demo { display: grid; grid-template-columns: minmax(0, 0.7fr) auto minmax(0, 1.5fr); align-items: center; gap: 24px; margin-top: 64px; }
.note-card { display: grid; gap: 12px; padding: 28px; border-radius: var(--r-xl); background: var(--surface-2); }
.note-card.is-new { animation: ring 1.4s ease; }
@keyframes ring { 25% { box-shadow: 0 0 0 3px var(--sky); } }
.note-text { font-size: 1.125rem; line-height: 1.55; }
.demo-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--sky-soft); color: var(--text); }
.story-card { position: relative; display: grid; gap: 16px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); }
.story-head, .panel-head, .wordbook-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.story { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
/* One line per sentence: tapping the sentence (outside a word) shows its translation, like the app's reader. */
.story-card { container-type: inline-size; }
/* Speaker on the left; tapping the German sentence (outside a word) also plays it. */
.line { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: 6px; padding: 6px 10px 6px 4px; border-radius: var(--r-md); transition: background-color 120ms ease; }
.line:hover { background: var(--surface-2); }
.line.is-playing { background: var(--sky-soft); }
.line-tools { grid-column: 1; grid-row: 1; display: flex; }
.sentence { grid-column: 2; grid-row: 1; margin: 0; padding-top: 4px; font-weight: 600; font-size: 1.1875rem; line-height: 1.6; cursor: pointer; }
.nb { white-space: nowrap; }
.tr { grid-column: 2; grid-row: 1; padding: 6px 0 0; color: var(--text-2); font-size: 1.0625rem; }
/* Languages to show: both side by side (is-both), German only (is-de, no translation), English only (is-en). */
.story.is-both .line { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
.story.is-both .tr { grid-column: 3; padding: 6px 0 6px 18px; margin-left: 12px; border-left: 1px solid var(--line); }
.story.is-de .tr { display: none; }
.story.is-en .sentence { display: none; }
.story.is-en .tr { padding-top: 4px; color: var(--text); font-weight: 600; font-size: 1.1875rem; }
/* A narrow story card puts the English under its German sentence instead of a second column. */
@container (max-width: 560px) {
  .story.is-both .line { grid-template-columns: auto minmax(0, 1fr); }
  .story.is-both .tr { grid-column: 2; grid-row: 2; padding: 0 0 6px; margin-left: 0; border-left: 0; font-size: 1rem; }
}
/* While Echo writes: grey bars in place of each line, then the line rises in. */
.line.is-pending { pointer-events: none; }
.line.is-pending .sentence, .line.is-pending .tr { color: transparent; background: repeating-linear-gradient(to bottom, transparent 0 0.4em, var(--line) 0.4em 1.2em, transparent 1.2em 1.6em); border-radius: 6px; background-origin: content-box; background-clip: content-box; animation: pulse 1.2s ease-in-out infinite; }
.line.is-pending .w { color: transparent; background: none; text-decoration: none; }
.line.is-pending .line-tools { visibility: hidden; }
.line.is-in { animation: rise 360ms ease both; }
@keyframes pulse { 50% { opacity: 0.5; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.story-status { margin-left: 6px; text-transform: none; letter-spacing: 0; color: var(--sky-press); }
.langs-pick { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.pick { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 0.875rem; font-weight: 700; cursor: pointer; -webkit-user-select: none; user-select: none; }
.pick input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pick .i { width: 18px; height: 18px; padding: 2px; border: 1.5px solid var(--line-strong); border-radius: 6px; color: transparent; }
.pick input:checked + .i { border-color: var(--sky); background: var(--sky); color: var(--on-sky); }
.pick:has(input:checked) { border-color: var(--sky-100); background: var(--sky-soft); }
.pick:has(input:focus-visible) { outline: 2px solid var(--text); outline-offset: 2px; }
.pick b { color: var(--text-2); font-size: 0.75rem; font-weight: 800; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--line); color: var(--text); }
.icon-btn[aria-expanded="true"] { color: var(--text); }
.w { padding: 0 4px; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; line-height: inherit; cursor: pointer; }
.w.m { background: var(--g-m); }
.w.f { background: var(--g-f); }
.w.n { background: var(--g-n); }
.w.v { padding: 0; border-radius: 0; text-decoration: underline dotted var(--line-strong) 2px; text-underline-offset: 5px; }
.w:hover { box-shadow: 0 0 0 2px var(--sky) inset; }
.w.v:hover { box-shadow: none; text-decoration-color: var(--sky); }
.w[aria-expanded="true"] { box-shadow: 0 0 0 2px var(--text) inset; }
.w.v[aria-expanded="true"] { box-shadow: none; text-decoration: underline solid var(--text) 2px; }

/* Word card: the app's tap-a-word sheet (13b), with the sticker right of the meaning when there is one. */
.word-card {
  position: absolute;
  z-index: 4;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100% - 32px));
  padding: 16px 16px 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow), 0 18px 40px rgba(34, 32, 43, 0.12);
}
.word-card::before { content: ""; position: absolute; top: 18px; left: 0; width: 4px; height: 24px; border-radius: 0 4px 4px 0; background: var(--g-bar, var(--line-strong)); }
.word-card.m { --g-bar: var(--g-m-bar); }
.word-card.f { --g-bar: var(--g-f-bar); }
.word-card.n { --g-bar: var(--g-n-bar); }
.wc-head { display: flex; align-items: center; gap: 2px; }
.wc-title { flex: 1; min-width: 0; font-size: 1.375rem; }
.wc-title .art { font-family: var(--font-body); font-weight: 400; color: var(--text-2); font-size: 1.125rem; margin-right: 6px; }
.wc-forms { font-size: 0.9375rem; color: var(--text-3); }
.wc-meaning { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.wc-gloss { font-size: 1.0625rem; font-weight: 600; }
.wc-sticker { width: 72px; height: 72px; flex: none; filter: var(--sticker-shadow); }
.btn-soft { min-height: 44px; padding: 0 18px; background: var(--sky-soft); color: var(--text); font-size: 0.9375rem; justify-self: start; }
.btn-soft:hover { background: var(--sky-100); }
.btn-soft:disabled { cursor: default; background: var(--surface-2); color: var(--text-2); }
.word.is-new { animation: pop 320ms ease; }
@keyframes pop { from { transform: scale(0.92); opacity: 0.4; } }
.story-foot { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; font-size: 0.875rem; color: var(--text-3); }
.audio-note { display: inline-flex; align-items: center; gap: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); list-style: none; font-size: 0.875rem; color: var(--text-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.dot.m { background: var(--g-m-bar); }
.dot.f { background: var(--g-f-bar); }
.dot.n { background: var(--g-n-bar); }
.dot.model { background: var(--model); }
.dot.mine { background: var(--mine); }

/* Words: stickers and the wordbook */
.split { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(32px, 6vw, 80px); align-items: center; }
.split-text { display: grid; gap: 18px; }
.wordbook { overflow: hidden; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.seg-btn { display: inline-grid; place-items: center; width: 40px; height: 34px; border: 0; border-radius: 999px; background: none; color: var(--text-3); cursor: pointer; }
.seg-btn[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(34, 32, 43, 0.12); }
.words { margin: 12px 0 0; padding: 0; list-style: none; }
.words.is-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.word { position: relative; display: grid; justify-items: center; gap: 2px; padding: 16px 10px 14px; border: 1px solid var(--line); border-radius: var(--r-lg); text-align: center; }
.word::before { content: ""; position: absolute; top: 12px; left: 12px; width: 18px; height: 4px; border-radius: 4px; background: var(--g-m-bar); }
.word.f::before { background: var(--g-f-bar); }
.word.n::before { background: var(--g-n-bar); }
.word img { width: 84px; height: 84px; margin-bottom: 6px; filter: var(--sticker-shadow); }
.word.no-sticker::after { content: ""; order: -1; width: 84px; height: 84px; margin-bottom: 6px; }
.lemma { font-weight: 700; }
.art { font-weight: 400; color: var(--text-2); }
.gloss { font-size: 0.9375rem; color: var(--text-3); }
.words.is-list { display: grid; gap: 0; }
.words.is-list .word { grid-template-columns: auto 1fr auto auto; justify-items: start; align-items: center; gap: 12px; padding: 12px 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; text-align: left; }
.words.is-list .word:last-child { border-bottom: 0; }
.words.is-list .word::before { position: static; width: 4px; height: 22px; }
.words.is-list .word img, .words.is-list .word.no-sticker::after { display: none; }
.words.is-list .gloss { justify-self: end; }
.word-play { position: absolute; top: 4px; right: 4px; width: 36px; height: 36px; }
.words.is-list .word-play { position: static; }
.word.is-playing { border-color: var(--sky); background: var(--sky-soft); }

/* Wordbook and review: two panes stacked in one grid cell, so switching never changes the height. */
.tabs { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.tab { min-height: 38px; padding: 0 18px; border: 0; border-radius: 999px; background: none; color: var(--text-2); font: 700 0.9375rem/1 var(--font-body); cursor: pointer; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(34, 32, 43, 0.12); }
.auto-btn { width: 36px; height: 36px; }
.panes { display: grid; margin-top: 14px; }
.pane { grid-area: 1 / 1; min-width: 0; transition: opacity 180ms ease, visibility 0s linear 180ms; }
.pane:not(.is-active) { visibility: hidden; opacity: 0; }
.pane.is-active { transition: opacity 180ms ease; }
.pane-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.rv-count { font-weight: 700; font-size: 0.9375rem; color: var(--text-3); font-variant-numeric: tabular-nums; }
.rv { display: grid; justify-items: center; gap: 18px; padding-top: 16px; }
.rv-stage { position: relative; width: min(100%, 320px); height: 236px; }
/* The card moves (drag, fly out); its inner layer turns over. Whole card in the noun's gender color. */
.rv-card { position: absolute; inset: 0; display: block; padding: 0; border: 0; border-radius: var(--r-xl); background: none; color: inherit; font: inherit; text-align: center; cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; perspective: 1000px; transition: transform 280ms ease, opacity 280ms ease; }
.rv-card:focus-visible { outline-offset: 4px; border-radius: var(--r-xl); }
.rv-card.is-dragging { transition: none; cursor: grabbing; outline: none; }
.rv-card.is-snap, .rv-card.is-snap .rv-inner { transition: none; }
.rv-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 420ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.rv-card.is-flipped .rv-inner { transform: rotateY(180deg); }
.rv-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; border: 2px solid transparent; border-radius: var(--r-xl); background: var(--g, var(--surface-2)); box-shadow: var(--shadow); -webkit-backface-visibility: hidden; backface-visibility: hidden; transition: border-color 120ms ease; }
.rv-back { transform: rotateY(180deg); }
.rv-card.m { --g: var(--g-m); }
.rv-card.f { --g: var(--g-f); }
.rv-card.n { --g: var(--g-n); }
.rv-card[data-lean="yes"] .rv-face { border-color: var(--yes); }
.rv-card[data-lean="no"] .rv-face { border-color: var(--no); }
.rv-word { font-family: var(--font-display); font-weight: 600; font-size: 2rem; line-height: 1.15; }
.rv-word .art { font-family: var(--font-body); font-size: 1.25rem; margin-right: 6px; }
.rv-hint { position: absolute; bottom: 14px; font-size: 0.8125rem; font-weight: 700; color: var(--text-2); opacity: 0.8; }
.rv-sticker { width: 104px; height: 104px; filter: var(--sticker-shadow); }
.rv-gloss { font-weight: 700; font-size: 1.375rem; }
.rv-under { pointer-events: none; transform: translateY(12px) scale(0.94); opacity: 0.55; }
.rv-under.is-rising { transform: none; opacity: 1; }
.rv-under .rv-face { box-shadow: none; }
.rv-actions { display: flex; align-items: center; gap: 20px; }
.rv-btn { position: relative; display: inline-grid; place-items: center; width: 56px; height: 56px; border: 0; border-radius: 50%; cursor: pointer; }
.rv-btn.no { background: var(--no-bg); color: var(--no); }
.rv-btn.yes { background: var(--yes-bg); color: var(--yes); }
.rv-btn:hover { box-shadow: 0 0 0 2px currentColor inset; }
.rv-btn .i { stroke-width: 2.25; }
kbd { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); min-width: 24px; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--text-3); font: 700 0.75rem/1.5 var(--font-body); }
@media (hover: none) { kbd { display: none; } }
.rv-result { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; align-content: center; gap: 12px 40px; min-height: 340px; text-align: center; }
.rv-num { display: grid; gap: 2px; }
.rv-num b { font-family: var(--font-display); font-weight: 600; font-size: 3rem; line-height: 1; }
.rv-num span { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; color: var(--text-2); }
.rv-num span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--yes); }
.rv-num.no span::before { background: var(--no); }
.rv-result .btn { grid-column: 1 / -1; justify-self: center; margin-top: 12px; }

/* Bookshelf */
.shelf { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 48px); align-items: start; margin-top: 48px; }
.books { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 18px; }
.book { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-height: 196px; padding: 20px 18px 18px 26px; border: 0; border-radius: 8px 18px 18px 8px; background: var(--cover); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease; }
/* Spine on the left, page edges on the right. */
.book::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 10px; border-radius: 8px 0 0 8px; background: var(--spine); }
.book::after { content: ""; position: absolute; top: 10px; bottom: 10px; right: -4px; width: 4px; border-radius: 0 3px 3px 0; background: var(--line); }
.book:hover { transform: translateY(-3px); }
.book[aria-selected="true"] { transform: translateY(-6px); box-shadow: var(--shadow), 0 0 0 2px var(--sky); }
.book.butter { --cover: var(--cover-butter); --spine: #F8D274; }
.book.pink { --cover: var(--cover-pink); --spine: #F4A3C6; }
.book.mint { --cover: var(--cover-mint); --spine: #79E9CE; }
.book.lilac { --cover: var(--cover-lilac); --spine: #D69FFA; }
.book-lang { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; }
.book-level { padding: 2px 10px; border-radius: 999px; background: var(--surface); font-size: 0.8125rem; font-weight: 800; }
.book-count { margin-top: auto; font-size: 0.875rem; font-weight: 700; color: var(--text-2); }
.tree-card { padding: 24px 24px 20px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); }
.tree { animation: fade 160ms ease; }
@keyframes fade { from { opacity: 0; } }
/* A trunk on the left; each month is a knot, each chapter a small branch. */
.month { position: relative; display: flex; align-items: center; gap: 12px; margin: 0; font-family: var(--font-body); font-size: 0.875rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-2); }
.month::before { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--sky); flex: none; }
.chapters { margin: 6px 0 14px 6px; padding: 0 0 0 22px; border-left: 2px solid var(--line); list-style: none; }
.chapter { position: relative; display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; padding: 10px 0; }
.chapter::before { content: ""; position: absolute; left: -22px; top: 21px; width: 14px; height: 2px; background: var(--line); }
.chapter time { font-size: 0.875rem; font-weight: 700; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-text { display: grid; min-width: 0; }
.ch-title { font-weight: 700; }
.ch-tr { font-size: 0.9375rem; color: var(--text-3); }
.ch-src { align-self: center; color: var(--text-3); }
.month-more { text-transform: none; letter-spacing: 0; font-size: 0.9375rem; }
.month-more::before { background: var(--line-strong); }
.shelf-note { margin-top: 20px; }

/* Speaking */
.speak-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-top: 48px; }
.panel { display: grid; align-content: start; gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.speak-sentence { font-weight: 600; font-size: 1.375rem; line-height: 1.5; }
.u-warn { text-decoration: underline; text-decoration-color: var(--warn); text-decoration-thickness: 3px; text-underline-offset: 7px; }
.chunk { text-decoration: underline; text-decoration-color: var(--sky); text-decoration-thickness: 3px; text-underline-offset: 7px; }
/* Recordings on one time scale (data-scale seconds = full width), so a longer try is a longer row. */
.tries { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.try { display: grid; grid-template-columns: 112px minmax(0, 1fr) 40px; align-items: center; gap: 12px; }
.try .listen-btn { justify-content: flex-start; gap: 6px; padding: 0 12px; white-space: nowrap; }
.wave { position: relative; display: grid; grid-template-columns: repeat(96, minmax(0, 1fr)); align-items: center; column-gap: 1px; height: 40px; }
.wave > i { height: var(--h); min-height: 2px; border-radius: 2px; background: var(--model); }
.wave.mine > i { background: var(--mine); }
.wave::after { content: ""; position: absolute; top: -4px; bottom: -4px; left: calc(var(--t, 0) * 100%); width: 2px; border-radius: 2px; background: var(--text); opacity: 0; }
.try.is-playing .wave::after { opacity: 1; }
.gap { position: absolute; top: -4px; bottom: -4px; border-radius: 6px; background: color-mix(in srgb, var(--warn) 18%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--warn) 45%, transparent) inset; }
.gap span { position: absolute; top: 1px; left: 0; right: 0; font-size: 0.6875rem; font-weight: 800; line-height: 1.2; color: var(--text-2); text-align: center; white-space: nowrap; }
.try-len { font-size: 0.875rem; font-weight: 700; color: var(--text-3); text-align: right; font-variant-numeric: tabular-nums; }
.listen-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: 700 0.9375rem/1 var(--font-body); cursor: pointer; }
.listen-btn:hover { background: var(--surface-2); }
.listen-btn.is-playing, .icon-btn.is-playing { border-color: var(--sky); background: var(--sky-soft); color: var(--text); }
.tip-play { justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 7px 12px 7px 10px; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); font: 700 0.875rem/1 var(--font-body); cursor: pointer; }
.tip-play.is-playing { box-shadow: 0 0 0 2px var(--sky) inset; }
/* Conversation with Echo: Echo on the left with its face, the learner on the right. */
.chat { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.bubble { display: flex; align-items: flex-end; gap: 8px; }
.bubble img { width: 44px; flex: none; margin-bottom: 2px; }
.b-body { min-width: 0; padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); transition: box-shadow 120ms ease; }
.b-body p:first-child { font-weight: 600; }
.b-tr { font-size: 0.875rem; color: var(--text-3); }
.bubble.you { justify-content: flex-end; }
.bubble.you .b-body { order: 1; border-radius: 18px 18px 6px 18px; background: var(--sky-soft); }
.bubble.you .b-play { order: 0; }
.b-play { width: 36px; height: 36px; flex: none; }
.bubble.is-playing .b-body { box-shadow: 0 0 0 2px var(--sky) inset; }
.all-btn { justify-self: start; }
.fix-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.fix-line s { color: var(--text-3); text-decoration-color: var(--warn); text-decoration-thickness: 2px; font-weight: 600; }
.speak-note { margin-top: 20px; }
.tip { display: flex; align-items: flex-start; gap: 12px; }
.tip img { width: 64px; flex: none; margin-top: 4px; }
.tip-body { display: grid; gap: 4px; padding: 12px 16px; border-radius: var(--r-lg); background: var(--sky-soft); min-width: 0; }
.tip-what { font-weight: 700; }
.tip-why { color: var(--text-2); font-size: 0.9375rem; }
.tip-plain .tip-icon { margin-top: 12px; color: var(--text-2); }
.metrics { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }
.metric { display: grid; gap: 8px; }
.metric-row { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.metric-row small.muted { margin-left: 4px; font-size: 0.8125rem; font-weight: 600; }
.metric-val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-val small { font-size: 0.8125rem; color: var(--text-3); font-weight: 600; }
.prev { color: var(--text-3); font-weight: 400; }
.prev::after { content: " → "; }
.meter { position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); }
.meter .range { position: absolute; top: 0; bottom: 0; left: var(--lo); width: calc(var(--hi) - var(--lo)); border-radius: 999px; background: var(--sky-100); }
.meter .mark { position: absolute; top: 50%; left: var(--v); width: 16px; height: 16px; border-radius: 50%; background: var(--sky); border: 3px solid var(--surface); transform: translate(-50%, -50%); }
.formats { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 32px 0 0; padding: 0; list-style: none; color: var(--text-2); }
.formats li { display: inline-flex; align-items: center; gap: 10px; }

/* Languages */
.langs { display: flex; flex-wrap: wrap; gap: 10px; margin: 40px 0 0; padding: 0; list-style: none; }
.langs li { display: inline-flex; align-items: center; gap: 10px; padding: 8px 8px 8px 16px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-weight: 600; }
.langs li[dir="rtl"] { padding: 8px 16px 8px 8px; }
.langs b { padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 0.75rem; font-weight: 800; }
.cefr { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; max-width: 420px; margin-top: 32px; }
.cefr span { padding: 8px 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); text-align: center; font-weight: 800; font-size: 0.875rem; color: var(--text-3); }
.cefr .on { background: var(--sky); border-color: var(--sky); color: var(--on-sky); }

/* Privacy */
.trust { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; margin: 40px 0 0; padding: 0; list-style: none; }
.trust li { display: grid; gap: 10px; align-content: start; }
.trust .i { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: var(--sky-soft); }
.trust p { color: var(--text-2); }
#privacy .small { margin-top: 48px; }

/* FAQ */
.faq { margin-top: 32px; border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 0; font-weight: 700; font-size: 1.125rem; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--text-3); transition: transform 200ms ease; }
.faq details[open] summary .i { transform: rotate(45deg); }
.faq details p { padding: 0 0 22px; color: var(--text-2); max-width: 40rem; }

/* Waitlist */
.cta { background: var(--sky-soft); }
.cta-inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.cta-inner img { width: 150px; }
.cta-inner > p { color: var(--text-2); }
.waitlist { display: flex; gap: 10px; width: min(520px, 100%); margin-top: 12px; }
.waitlist input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: 1rem var(--font-body);
}
.waitlist input::placeholder { color: var(--text-3); }
.waitlist input:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.form-msg { min-height: 1.6em; font-weight: 600; color: var(--text); }
.consent { max-width: 30rem; font-size: 0.875rem; color: var(--text-3); }
.consent a { color: var(--text-2); text-underline-offset: 3px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Policy pages */
.prose { display: grid; gap: 14px; }
.prose h1 { font-size: clamp(2.25rem, 1.8rem + 2vw, 3rem); }
.prose h2 { margin-top: 28px; font-size: 1.5rem; }
.prose h3 { margin-top: 8px; font-size: 1.125rem; }
.prose p, .prose li { color: var(--text-2); }
.prose strong { color: var(--text); }
.prose ul { display: grid; gap: 8px; margin: 0; padding-left: 1.25rem; }
.prose a { text-underline-offset: 3px; }
.prose .meta { font-size: 0.9375rem; color: var(--text-3); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.prose table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 0.9375rem; }
.prose th, .prose td { padding: 12px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { background: var(--surface-2); font-weight: 800; color: var(--text); }
.prose tr:last-child td { border-bottom: 0; }
.prose td { color: var(--text-2); }
@media (max-width: 640px) {
  /* Stack each row as a card so the table never needs sideways scrolling on phones. */
  .table-wrap { overflow: visible; }
  .prose table { min-width: 0; }
  .prose thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .prose tr, .prose td { display: block; }
  .prose tr { border-bottom: 1px solid var(--line); padding: 6px 0; }
  .prose tr:last-child { border-bottom: 0; }
  .prose td { border-bottom: 0; padding: 6px 14px; }
  .prose td::before { content: attr(data-label); display: block; font-weight: 800; font-size: 0.8125rem; color: var(--text); }
}

/* Footer */
.site-footer { padding-block: 40px; border-top: 1px solid var(--line); }
.footer-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; font-size: 0.9375rem; color: var(--text-2); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-left: auto; }
.footer-links a { color: var(--text-2); text-underline-offset: 3px; }

/* Narrow screens */
@media (max-width: 860px) {
  .steps, .trust { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .step { grid-template-columns: 96px minmax(0, 1fr); column-gap: 16px; align-items: center; }
  .step img { grid-row: span 3; width: 96px; margin: 0; }
  .split, .speak-grid, .shelf, .demo { grid-template-columns: minmax(0, 1fr); }
  .demo-arrow { justify-self: center; transform: rotate(90deg); }
  .books { display: flex; gap: 14px; margin-inline: calc(-1 * var(--gutter)); padding: 10px var(--gutter) 6px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .books::-webkit-scrollbar { display: none; }
  .book { flex: none; width: 150px; min-height: 176px; scroll-snap-align: start; }
}
@media (max-width: 520px) {
  .words.is-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .waitlist { flex-direction: column; }
  .story-card, .note-card, .panel { padding: 20px; }
  .wordbook, .tree-card { padding: 16px; }
  .try { grid-template-columns: 84px minmax(0, 1fr) 34px; gap: 8px; }
  .try .listen-btn { padding: 0 10px; }
  .try .listen-btn .i, .gap span { display: none; }
  .tab { padding: 0 14px; }
  .footer-links { margin-left: 0; }
  .composer-note { max-width: 18rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .echo-float, .word.is-new, .tree { animation: none; }
  .book:hover, .book[aria-selected="true"] { transform: none; }
  .composer-text.is-typing::after { animation: none; }
  .note-card.is-new, .line.is-in, .line.is-pending .sentence, .line.is-pending .tr { animation: none; }
  * { transition-duration: 0ms !important; }
}
