/* Typefaces are the app's own (Young Serif, Archivo), self-hosted from ./fonts
   under the SIL Open Font License. Nothing is loaded from a third-party CDN:
   a page for an app that promises "no tracking" must not leak visitor IPs to a
   font host. */
@font-face { font-family: "Young Serif"; src: url("fonts/YoungSerif-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/Archivo-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/Archivo-SemiBold.ttf") format("truetype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("fonts/Archivo-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  color-scheme: light;

  /* The app's own palette (src/constants/colors.ts). */
  --paper: #F4EDE1;
  --mist: #E8E0D0;
  --rule: #D2C6AE;
  --ink: #1C2A1F;
  --ink-2: #3C4A3A;
  --forest: #2F4A31;
  --clay: #B4633E;
  --ochre: #C69244;
  --grade-a: #4F6F3E;
  --grade-b: #7A9460;
  --grade-c: #C69244;
  --grade-d: #A85A32;
  --grade-f: #7A3027;
  --grade-q: #8A8579; /* "?": not graded. Neutral, never a colour that reads as good or bad. */

  /* Text-safe derivatives. Stone and raw clay fall under 4.5:1 on paper. */
  --muted: color-mix(in oklch, var(--ink) 68%, var(--paper));
  --clay-text: color-mix(in oklch, var(--clay) 78%, var(--ink));
  --paper-muted: color-mix(in oklch, var(--paper) 80%, var(--forest));

  --serif: "Young Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: clamp(1.6rem, 1.25rem + 1.4vw, 2.25rem);
  --step-3: clamp(2.1rem, 1.4rem + 3vw, 3.5rem);
  --step-4: clamp(2.5rem, 1.2rem + 4.2vw, 4.5rem);

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  --gutter: clamp(1rem, 4vw, 2.5rem);
  --section: clamp(3.5rem, 9vw, 7.5rem);
  --measure: 62ch;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0) / 1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { margin: 0; font-family: var(--serif); font-weight: 400; line-height: 1.1; text-wrap: balance; }
p, ul, ol, figure { margin: 0; }
p { text-wrap: pretty; }
a { color: var(--forest); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--ochre); outline-offset: 3px; border-radius: 2px; }

.wrap { width: min(100% - 2 * var(--gutter), 74rem); margin-inline: auto; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: var(--space-sm) var(--space-md);
  border-radius: 0.375rem; text-decoration: none;
}
.skip:focus { top: var(--space-md); }

.label {
  font: 600 var(--step--1) / 1.3 var(--sans);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

h2 { font-size: var(--step-3); letter-spacing: -0.01em; }

/* ── Header ─────────────────────────────────────────── */
/* The heavy bar under the title is the first thing a nutrition label does. */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-md);
  padding-block: var(--space-lg); border-bottom: 0.5rem solid var(--ink);
}
.brand { font: 400 1.25rem / 1 var(--serif); color: var(--ink); text-decoration: none; white-space: nowrap; }
.top .label { text-align: right; }
@media (max-width: 30rem) { .hide-sm { display: none; } }

/* ── Hero ───────────────────────────────────────────── */
.hero {
  display: grid; gap: var(--space-2xl); align-items: center;
  padding-block: var(--space-2xl) var(--space-3xl);
}
@media (min-width: 60rem) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-3xl); }
}
.hero h1 { font-size: var(--step-4); letter-spacing: -0.02em; margin-block: var(--space-md) var(--space-lg); }
.lead { font-size: var(--step-1); line-height: 1.45; color: var(--ink-2); max-width: 34rem; }

.cta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-md) var(--space-lg); margin-top: var(--space-xl); }
.btn {
  display: inline-flex; align-items: center; min-height: 3rem; padding: 0 1.5rem;
  background: var(--forest); color: var(--paper);
  font: 600 1rem / 1 var(--sans); text-decoration: none; border-radius: 0.375rem;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(1px); }
.btn--light { background: var(--paper); color: var(--forest); }
.btn--light:hover { background: var(--mist); color: var(--ink); }
.status { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.9375rem; color: var(--ink-2); }
.status::before { content: ""; flex: none; width: 0.5rem; height: 0.5rem; margin-top: 0.5em; border-radius: 50%; background: var(--ochre); }

.phones { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md); align-items: start; }
@media (min-width: 40rem) { .phones { gap: var(--space-lg); } }
.phone:nth-child(2) { margin-top: var(--space-2xl); }
.phone__frame { border: 0.3rem solid var(--ink); border-radius: 1.9rem; overflow: hidden; background: var(--paper); }
.phone figcaption {
  display: flex; gap: 0.6rem; align-items: flex-start;
  margin-top: var(--space-sm); font-size: 0.875rem; line-height: 1.4; color: var(--ink-2);
}
.chip {
  flex: none; display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem;
  border-radius: 0.3rem; background: var(--grade-a); color: var(--paper); font: 400 1.25rem / 1 var(--serif);
}
.chip--f { background: var(--grade-f); }

/* ── Ledger: what it does when it doesn't know ──────── */
.ledger-section { background: var(--mist); padding-block: var(--section); }
.section-head { display: grid; gap: var(--space-md); margin-bottom: var(--space-2xl); }
@media (min-width: 60rem) {
  .section-head { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3xl); align-items: end; }
}
.section-head p { max-width: var(--measure); color: var(--ink-2); }

/* A table set like the back of a packet: heavy outer bars, a medium bar under the column heads, hairlines between rows. */
.ledger {
  list-style: none; margin: 0; padding: 0; counter-reset: row;
  border-top: 0.5rem solid var(--ink); border-bottom: 0.5rem solid var(--ink);
  font-variant-numeric: tabular-nums;
}
.ledger__head { display: none; }
.ledger__rows { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: grid; gap: var(--space-sm); padding-block: var(--space-lg);
  border-bottom: 1px solid var(--ink-2); counter-increment: row;
}
.ledger li:last-child { border-bottom: 0; }
.ledger li::before {
  content: counter(row, decimal-leading-zero);
  font: 400 var(--step-1) / 1 var(--serif); color: var(--clay-text);
}
@media (min-width: 48rem) {
  .ledger__head, .ledger li { grid-template-columns: 3.5rem minmax(0, 1fr) minmax(0, 1.3fr); gap: var(--space-xl); }
  .ledger__head {
    display: grid; padding-block: var(--space-sm); border-bottom: 0.25rem solid var(--ink);
    font: 600 var(--step--1) / 1.3 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2);
  }
  .ledger__head span:first-child { grid-column: 2; }
  .ledger li { align-items: baseline; }
  /* The column heads say "when" and "what it does"; the per-row tags are for narrow screens and screen readers. */
  .ledger .tag { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.ledger .tag { display: block; margin-bottom: 0.15rem; }
.ledger__if { font-weight: 600; }
.ledger__then { color: var(--ink-2); }
.ledger__then strong { color: var(--ink); font-weight: 600; }

/* ── Features ───────────────────────────────────────── */
.features { padding-block: var(--section); }
.features__grid { display: grid; gap: var(--space-2xl); }
/* Two columns only where the right one can still hold text beside a phone. */
@media (min-width: 75rem) {
  .features__grid { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--space-3xl); align-items: start; }
  .features__intro { position: sticky; top: var(--space-xl); }
}
.features__intro p { margin-top: var(--space-md); color: var(--ink-2); max-width: 30rem; }

.feature { padding-block: var(--space-xl); border-top: 1px solid var(--rule); }
.feature:first-child { border-top: 0.5rem solid var(--ink); }
.feature h3 { font-size: var(--step-2); }
.feature h3 + p { margin-top: var(--space-md); }
.feature p { color: var(--ink-2); max-width: var(--measure); }
.feature p + p { margin-top: var(--space-sm); }
.feature--shot { display: grid; gap: var(--space-lg); }
@media (min-width: 40rem) {
  .feature--shot { grid-template-columns: minmax(0, 1fr) 13rem; gap: var(--space-xl); align-items: start; }
}
.feature--shot .phone { max-width: 13rem; }

.also { list-style: none; padding: 0; border-top: 1px solid var(--rule); }
.also li { padding-block: var(--space-lg); border-bottom: 1px solid var(--rule); }
.also h3 { font: 600 var(--step-0) / 1.35 var(--sans); }
.also p { margin-top: 0.25rem; color: var(--ink-2); max-width: var(--measure); }

/* ── Trust: sources + privacy ───────────────────────── */
.trust { padding-block: var(--section); border-top: 1px solid var(--rule); }
.trust__grid { display: grid; gap: var(--space-3xl); }
@media (min-width: 60rem) {
  .trust__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4xl); }
}
.trust h2 { margin-bottom: var(--space-lg); }
.trust p { color: var(--ink-2); max-width: var(--measure); }
.trust p + p { margin-top: var(--space-md); }
.sources { list-style: none; padding: 0; margin-top: var(--space-lg); border-top: 1px solid var(--rule); }
.sources li { display: grid; gap: 0.15rem; padding-block: var(--space-sm); border-bottom: 1px solid var(--rule); }
@media (min-width: 40rem) { .sources li { grid-template-columns: 11rem 1fr; gap: var(--space-md); } }
/* "Privacy Facts": the app's promise set as the one thing everyone already knows how to read. */
.facts {
  border: 1px solid var(--ink); background: var(--paper);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  font-variant-numeric: tabular-nums;
}
.facts__title { font: 700 clamp(2.1rem, 1.5rem + 2.4vw, 3rem) / 1 var(--sans); letter-spacing: -0.035em; color: var(--ink); }
.facts__sub { margin-top: var(--space-xs); padding-bottom: var(--space-xs); border-bottom: 0.5rem solid var(--ink); font-size: 0.9375rem; color: var(--ink-2); }
.facts dl { margin: 0; }
.facts__row { display: flex; justify-content: space-between; gap: var(--space-md); padding-block: 0.5rem; border-bottom: 1px solid var(--ink-2); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; font-weight: 700; }
.facts__sec { margin: 0; padding-top: var(--space-sm); border-top: 0.25rem solid var(--ink); font: 700 var(--step-0) / 1.3 var(--sans); }
.facts ul { list-style: none; margin: 0; padding: 0; }
.facts li { padding-block: 0.5rem; border-bottom: 1px solid var(--ink-2); color: var(--ink-2); }
.facts li:last-child { border-bottom: 0; }
.facts__note { margin-top: var(--space-sm); font-size: 0.875rem; color: var(--muted); }
.trust .facts__link { margin-top: var(--space-md); }

/* ── The scale ──────────────────────────────────────── */
.scale { padding-block: var(--space-xl) var(--section); }
.scale__head { display: grid; gap: var(--space-md); margin-bottom: var(--space-xl); }
@media (min-width: 60rem) {
  .scale__head { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3xl); align-items: end; }
}
.scale__head p { max-width: var(--measure); color: var(--ink-2); }
.scale__bar { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); }
.scale__cell { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: var(--space-md); align-items: center; }
.scale__tile {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 0.25rem;
  font: 400 2.25rem / 1 var(--serif);
}
.scale__name { font-weight: 700; line-height: 1.25; }
.scale__sub { display: block; font-size: 0.8125rem; font-weight: 400; color: var(--muted); }
.scale__tile--a { background: var(--grade-a); color: var(--paper); }
.scale__tile--b { background: var(--grade-b); color: var(--ink); }
.scale__tile--c { background: var(--grade-c); color: var(--ink); }
.scale__tile--d { background: var(--grade-d); color: var(--paper); }
.scale__tile--f { background: var(--grade-f); color: var(--paper); }
.scale__tile--q { background: var(--grade-q); color: var(--ink); }
@media (min-width: 48rem) {
  .scale__bar { grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 1.2fr); gap: 0.25rem; align-items: start; }
  .scale__cell { display: block; }
  .scale__cell:last-child { margin-left: var(--space-lg); }
  .scale__tile { aspect-ratio: auto; height: clamp(5rem, 9vw, 7.5rem); font-size: clamp(2.75rem, 5vw, 4.25rem); }
  .scale__name { margin-top: var(--space-sm); }
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .scale__cell {
      opacity: 0; transform: translateY(14px);
      animation: scale-in 1s var(--ease) both; animation-timeline: view();
      animation-range: entry calc(var(--i, 0) * 7%) entry calc(55% + var(--i, 0) * 7%);
    }
    @keyframes scale-in { to { opacity: 1; transform: none; } }
  }
}

/* ── Where it stops ─────────────────────────────────── */
.stops { background: var(--forest); color: var(--paper); padding-block: var(--section); }
.stops .label { color: var(--paper-muted); }
.stops h2 { margin-top: var(--space-sm); max-width: 18ch; }
.stops__cols { display: grid; gap: var(--space-lg); margin-top: var(--space-2xl); }
@media (min-width: 48rem) { .stops__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3xl); } }
.stops p { color: var(--paper); max-width: 46ch; }

/* ── Close ──────────────────────────────────────────── */
.close { padding-block: var(--section); }
.close__inner { display: grid; gap: var(--space-xl); align-items: end; }
@media (min-width: 60rem) { .close__inner { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--space-3xl); } }
.close p { color: var(--ink-2); max-width: 40ch; margin-top: var(--space-md); }
.close .cta { margin-top: 0; }

footer { border-top: 1px solid var(--rule); padding-block: var(--space-xl) var(--space-2xl); font-size: 0.875rem; color: var(--muted); }
footer .wrap { display: grid; gap: var(--space-md); }
@media (min-width: 48rem) { footer .wrap { grid-template-columns: 1fr auto; align-items: start; } }
footer nav { display: flex; gap: var(--space-lg); flex-wrap: wrap; }
footer a { color: var(--ink-2); }
footer p + p { margin-top: 0.35rem; }

/* ── One orchestrated entrance ──────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .rise { opacity: 0; transform: translateY(14px); animation: rise 0.8s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 90ms); }
  @keyframes rise { to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ── Legal pages (Impressum) ────────────────────────── */
.legal { padding-block: var(--space-xl) var(--section); }
.legal__col { max-width: 44rem; }
.legal h1 { font-size: var(--step-3); letter-spacing: -0.01em; margin-block: var(--space-sm) var(--space-md); }
.legal h2 { font-size: var(--step-2); margin-top: var(--space-2xl); }
.legal h2:first-child { margin-top: 0; }
.legal h2 .hint { font: 400 var(--step-0) / 1 var(--sans); color: var(--muted); }
.legal p, .legal address, .legal dd { color: var(--ink-2); }
.legal p { margin-top: var(--space-sm); max-width: var(--measure); }
.legal address { margin-top: var(--space-sm); font-style: normal; line-height: 1.7; }
.legal__jump { margin-bottom: var(--space-2xl); font-size: 0.9375rem; }
.legal dl { display: grid; gap: 0.15rem var(--space-lg); margin: var(--space-sm) 0 0; }
.legal dt { font-weight: 600; color: var(--ink); }
.legal dd { margin: 0 0 var(--space-sm); }
@media (min-width: 40rem) {
  .legal dl { grid-template-columns: 11rem 1fr; }
  .legal dd { margin: 0; }
}
.legal section + section { margin-top: var(--space-3xl); padding-top: var(--space-xl); border-top: 1px solid var(--ink); }

/* Contact form */
.form { display: grid; gap: var(--space-lg); max-width: 36rem; margin-top: var(--space-lg); }
.field { display: grid; gap: 0.4rem; }
.field label { font-weight: 600; font-size: 0.9375rem; color: var(--ink); }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field textarea {
  width: 100%; min-height: 3rem; padding: 0.75rem 0.875rem;
  font: 400 var(--step-0) / 1.4 var(--sans); color: var(--ink);
  background: var(--paper); border: 1px solid var(--ink-2); border-radius: 0.375rem;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--ochre); outline-offset: 2px; }
.form .trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form .form__note { margin-top: 0; font-size: 0.875rem; color: var(--muted); }
.form button.btn { justify-self: start; border: 0; cursor: pointer; }
