/* Paper & Ink, from design/tokens/colors.json and docs/17 §6.
   Serif means German (docs/13 §3.1): only text with lang="de" and class .de gets it. */

:root {
  --paper: #F8F3EA;
  --surface: #FFFFFF;
  --item-face: #FBF7F0;
  --ink: #151F2B;
  --ink-2: #515D6D;
  --ink-3: #5F6976;
  --hairline: #DFD8CC;
  --brand: #115299;
  --brand-soft: #DCEBFF;
  --on-brand-soft: #00356E;
  --reading: #007176;
  --writing: #7C4D90;
  --speaking: #92446C;
  --listening: #6D6600;
  --good: #2F7D55;
  --good-soft: #E3F2E9;
  --hard: #9A5B00;
  --hard-soft: #FBEBD2;
  --shadow: 0 1px 2px rgba(21, 31, 43, .06), 0 8px 24px rgba(21, 31, 43, .08);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", Georgia, "Times New Roman", serif;
  --measure: 36rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A121C;
    --surface: #161F2B;
    --item-face: #212B37;
    --ink: #F4EFE7;
    --ink-2: #AEB7C1;
    --ink-3: #8A929D;
    --hairline: #2B3541;
    --brand: #76ACF1;
    --brand-soft: #1A2D46;
    --on-brand-soft: #A2CAFF;
    --reading: #5EC9CE;
    --writing: #CEA3E1;
    --speaking: #E69CBF;
    --listening: #BFBA6E;
    --good: #6BC495;
    --good-soft: #17301F;
    --hard: #F0B95F;
    --hard-soft: #36280F;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--display); color: var(--ink); margin: 0; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.de { font-family: var(--serif); }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.wrap {
  width: 100%;
  max-width: 68rem;
  margin: 0 auto;
  padding: 0 1rem;
}
@media (min-width: 40rem) { .wrap { padding: 0 2rem; } }

/* Header */

.site-header { border-bottom: 1px solid var(--hairline); }
.header-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 4rem;
}
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 2rem; height: 2rem; }
.wordmark { font: 600 1.375rem/1 var(--display); letter-spacing: -0.02em; }
.status-pill {
  font-size: .8125rem; font-weight: 600; color: var(--on-brand-soft);
  background: var(--brand-soft); border-radius: 999px; padding: .375rem .75rem;
  white-space: nowrap;
}
@media (max-width: 22rem) { .status-pill { display: none; } }

/* Hero */

.hero { padding: 3rem 0 3.5rem; }
@media (min-width: 56rem) { .hero { padding: 5rem 0 5.5rem; } }

.hero-grid { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: 1.1fr 1fr; gap: 4rem; } }

.eyebrow {
  font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); margin-bottom: .75rem;
}
h1 {
  font-size: clamp(2.5rem, 7vw, 4.25rem); line-height: 1.02; font-weight: 700;
  letter-spacing: -0.03em; margin-bottom: 1.25rem;
}
.lede { font-size: clamp(1.125rem, 2.2vw, 1.3125rem); color: var(--ink-2); max-width: var(--measure); }
.note { font-size: .9375rem; color: var(--ink-3); margin-top: 1.5rem; }

/* The speaking card — word-level feedback only; German gets no per-sound claim (docs/11 §1.6.3). */

.speak-card {
  margin: 0; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 1.25rem; padding: 1.5rem; box-shadow: var(--shadow);
}
@media (min-width: 40rem) { .speak-card { padding: 2rem; } }

.card-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--speaking); margin-bottom: 1rem;
}
.dot { width: .625rem; height: .625rem; border-radius: 50%; }
.dot-speaking { background: var(--speaking); }

.de-large { font-size: clamp(1.625rem, 4vw, 2.125rem); line-height: 1.2; margin-bottom: 1.25rem; }

.wave { display: flex; align-items: center; gap: .3rem; height: 3rem; margin-bottom: 1.25rem; }
.wave span {
  flex: 1; max-width: .45rem; height: 50%;
  border-radius: 999px; background: var(--speaking); opacity: .85;
}
/* A fixed, decorative trace. Heights live here because the CSP forbids inline styles. */
.wave span:nth-child(1)  { height: 35%; }
.wave span:nth-child(2)  { height: 70%; }
.wave span:nth-child(3)  { height: 100%; }
.wave span:nth-child(4)  { height: 55%; }
.wave span:nth-child(5)  { height: 80%; }
.wave span:nth-child(6)  { height: 40%; }
.wave span:nth-child(7)  { height: 90%; }
.wave span:nth-child(8)  { height: 60%; }
.wave span:nth-child(9)  { height: 30%; }
.wave span:nth-child(10) { height: 75%; }
.wave span:nth-child(11) { height: 50%; }
.wave span:nth-child(12) { height: 85%; }
.wave span:nth-child(13) { height: 45%; }
.wave span:nth-child(14) { height: 65%; }
.wave span:nth-child(15) { height: 25%; }

.words { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.words li {
  display: inline-flex; align-items: baseline; gap: .5rem;
  border-radius: .625rem; padding: .375rem .625rem;
  border-bottom: 3px solid transparent;
}
.words .w { font-family: var(--serif); font-size: 1.125rem; }
.words .s { font-size: .8125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.words .good { background: var(--good-soft); border-bottom-color: var(--good); }
.words .good .s { color: var(--good); }
.words .hard { background: var(--hard-soft); border-bottom-style: dashed; border-bottom-color: var(--hard); }
.words .hard .s { color: var(--hard); }

.speak-card figcaption { font-size: .9375rem; color: var(--ink-2); }
.speak-card figcaption strong { font-family: var(--serif); font-weight: 600; color: var(--ink); }

/* Sections */

.section { padding: 3.5rem 0; border-top: 1px solid var(--hairline); }
@media (min-width: 56rem) { .section { padding: 5rem 0; } }
.section-alt { background: var(--item-face); }

h2 {
  font-size: clamp(1.625rem, 3.6vw, 2.375rem); line-height: 1.15; font-weight: 700;
  letter-spacing: -0.02em; margin-bottom: 1rem; max-width: 40rem;
}
h3 { font-size: 1.125rem; line-height: 1.3; font-weight: 600; margin-bottom: .375rem; }
.section-lede { color: var(--ink-2); max-width: var(--measure); margin-bottom: 2.5rem; }

.section-head { display: grid; gap: 1.5rem; align-items: center; }
.section-head .section-lede { margin-bottom: 0; }
.dial { width: 6rem; height: 6rem; }
@media (min-width: 40rem) {
  .section-head { grid-template-columns: auto 1fr; gap: 2.5rem; margin-bottom: 2.5rem; }
  .dial { width: 9rem; height: 9rem; }
}
@media (max-width: 39.99rem) { .section-head { margin-bottom: 2rem; } }

.skills { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 40rem) { .skills { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem) { .skills { grid-template-columns: repeat(4, 1fr); } }

.skill {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 1rem;
  padding: 1.25rem; border-top: 4px solid var(--skill);
}
.skill-reading   { --skill: var(--reading); }
.skill-writing   { --skill: var(--writing); }
.skill-speaking  { --skill: var(--speaking); }
.skill-listening { --skill: var(--listening); }
.skill h3 { color: var(--skill); }
.skill p { color: var(--ink-2); font-size: 1rem; }

.daily { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; counter-reset: daily; }
@media (min-width: 48rem) { .daily { grid-template-columns: repeat(3, 1fr); } }
.daily li {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 1rem; padding: 1.25rem;
}
.daily-kind {
  font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--brand); margin-bottom: .5rem;
}
.daily li > p:last-child { color: var(--ink-2); font-size: 1rem; }

.two-col { display: grid; gap: 3rem; }
@media (min-width: 48rem) { .two-col { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.two-col p { color: var(--ink-2); max-width: var(--measure); }

.name { text-align: center; }
.name-line { font-size: 1.125rem; color: var(--ink-2); margin: 0 auto; max-width: 40rem; }
.name-line > .de { display: block; font-size: 3rem; line-height: 1.1; color: var(--ink); margin-bottom: .5rem; }
.name-line .gloss .de { color: var(--ink); }

/* Footer */

.site-footer { border-top: 1px solid var(--hairline); padding: 2rem 0; }
.footer-row {
  display: flex; flex-wrap: wrap; gap: .5rem 2rem; justify-content: space-between;
  font-size: .875rem; color: var(--ink-3);
}
.footer-row a { color: var(--brand); }

/* The 404 page */

.lost { min-height: 60vh; display: grid; place-content: center; text-align: center; padding: 4rem 1rem; }
.lost .dial { margin: 0 auto 1.5rem; }
.lost a { color: var(--brand); font-weight: 600; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* The mark's colours, applied by class so every browser resolves them. */
.m-r { stroke: var(--reading); }
.m-w { stroke: var(--writing); }
.m-s { stroke: var(--speaking); }
.m-l { stroke: var(--listening); }
.m-track { stroke-opacity: .18; }
.m-bars { fill: var(--ink); }

/* Footer links (every page) */

.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.footer-links a { color: var(--ink-2); text-decoration: none; }
.footer-links a:hover { color: var(--brand); text-decoration: underline; }

/* Legal pages, generated from content/legal by web/scripts/build-legal.py */

.legal { max-width: 46rem; padding-top: 2.5rem; padding-bottom: 4rem; }
@media (min-width: 40rem) { .legal { padding-top: 4rem; } }
.legal h1 { font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.1; letter-spacing: -0.02em; margin-bottom: 1rem; }
.legal h2 { font-size: 1.375rem; line-height: 1.25; margin: 2.5rem 0 .75rem; scroll-margin-top: 1rem; }
.legal h3 { font-size: 1.0625rem; margin: 1.75rem 0 .5rem; }
.legal p, .legal li { color: var(--ink-2); }
.legal strong { color: var(--ink); }
.legal ul { padding-left: 1.25rem; margin: 0 0 1rem; }
.legal li { margin-bottom: .375rem; }
.legal a { color: var(--brand); overflow-wrap: anywhere; }
.legal .address {
  background: var(--surface); border: 1px solid var(--hairline); border-left: 4px solid var(--brand);
  border-radius: .75rem; padding: 1rem 1.25rem; color: var(--ink); font-style: normal;
}

/* Feature rows: copy beside a real screen from the app */

.feature { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 56rem) {
  .feature { grid-template-columns: 1fr 18rem; gap: 4rem; }
  .feature-flip { grid-template-columns: 18rem 1fr; }
  .feature-flip .phone { order: -1; }
}
.feature-copy .section-lede { margin-bottom: 1.5rem; }
.feature-copy > p { color: var(--ink-2); max-width: var(--measure); }
.feature .daily { grid-template-columns: 1fr; }
@media (min-width: 40rem) and (max-width: 55.99rem) { .feature .daily { grid-template-columns: repeat(3, 1fr); } }

.phone { margin: 0 auto; width: min(18rem, 78vw); }
.phone img {
  display: block; width: 100%; height: auto;
  border-radius: 2rem; border: 1px solid var(--hairline); box-shadow: var(--shadow);
}

.sound-chips { list-style: none; margin: 0 0 1.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.sound-chips li {
  font-size: 1.25rem; padding: .25rem .875rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--speaking);
}

.ticks { list-style: none; margin: 0 0 1.25rem; padding: 0; }
.ticks li { position: relative; padding-left: 1.75rem; margin-bottom: .625rem; color: var(--ink-2); }
.ticks li::before {
  content: ""; position: absolute; left: .25rem; top: .45em; width: .75rem; height: .4rem;
  border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg);
}
.fine { font-size: .875rem; color: var(--ink-3); max-width: var(--measure); }

/* Plans */

.plans { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .plans { grid-template-columns: 1fr 1fr; } }
.plan { background: var(--surface); border: 1px solid var(--hairline); border-radius: 1rem; padding: 1.5rem; }
.plan h3 { font-size: 1.375rem; margin-bottom: 1rem; }
.plan-premium { border-top: 4px solid var(--brand); }
.plan .fine { margin-bottom: 0; }
.plan .fine strong { color: var(--ink); }

/* FAQ, native disclosure: no script needed */

.faq { max-width: 46rem; border-top: 1px solid var(--hairline); }
.faq details { border-bottom: 1px solid var(--hairline); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.125rem 2rem 1.125rem 0; position: relative;
  font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .25rem; top: 50%; transform: translateY(-50%);
  font-size: 1.5rem; font-weight: 400; color: var(--brand);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { color: var(--ink-2); padding: 0 0 1.25rem; margin: 0; max-width: 40rem; }
.faq a { color: var(--brand); }
