/* Approba design tokens: the one source of fonts, colours, sizes, spacing and motion for app.approba.de and
   approba.de (docs/DESIGN.md, direction B "Lehrbuch"). The app links this file before style.css; the website's build
   copies it (Phase 4). Only :root custom properties and the font faces live here, and every colour literal of the
   app lives here (app/tests/test_design.py). Light first; dark follows the system setting on screens. */

/* Self-hosted OFL subsets, Latin plus Latin Extended (scripts/design/subset_fonts.py; licences next to the files).
   swap: the text is readable at once; the fallbacks below are sized to the brand fonts, so the swap moves nothing. */
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/ahn-400-700.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Literata";
  src: url("fonts/literata-24-400-750.woff2") format("woff2");
  font-weight: 400 750;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Approba Text Fallback";
  src: local("Arial"), local("ArialMT"), local("Roboto");
  size-adjust: 98.34%;
  ascent-override: 100.06%;
  descent-override: 32.13%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "Approba Display Fallback";
  src: local("Georgia"), local("Noto Serif");
  size-adjust: 107.91%;
  ascent-override: 109.07%;
  descent-override: 28.54%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;

  /* type: Literata speaks (headings, the patient's lines, stage directions), Atkinson Hyperlegible Next explains */
  --font-text: "Atkinson Hyperlegible Next", "Approba Text Fallback", sans-serif;
  --font-display: "Literata", "Approba Display Fallback", serif;
  --fs-small: 1rem;            /* 16 px: meta lines, labels, the footer; nothing is smaller */
  --fs-text: 1.125rem;         /* 18 px body: AHN's x-height is 0.496 em */
  --fs-say: 1.1875rem;         /* 19 px: the patient's lines */
  --fs-say-now: 1.375rem;      /* 22 px: the patient's newest line, read like a caption */
  --fs-h3: 1.25rem;
  --fs-h2: 1.625rem;
  --fs-h1: clamp(2rem, 1.55rem + 1.9vw, 2.75rem);
  --fs-display: clamp(2.375rem, 1.5rem + 3.6vw, 4.25rem);
  --lh-text: 1.5;
  --lh-say: 1.42;
  --lh-heading: 1.15;
  --lh-display: 1.04;
  --fw-text: 400;
  --fw-strong: 650;
  --fw-heading: 700;
  --fw-brand: 750;
  --measure: 36rem;            /* at most about 70 characters per line */

  /* space: a rhythm, not one step: tight inside a group, wide between sections */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2.25rem;
  --space-7: 3.5rem;
  --space-8: 5rem;
  --gutter: 2.25rem;           /* the line-number column of transcripts and report items */
  --page-pad: 1rem;            /* 16 px at the sides on phones */
  --app-width: 44rem;
  --site-width: 78rem;

  /* shape: square paper; hairlines and rules instead of boxes and shadows */
  --radius: 0;
  --radius-mark: 0.28em 0.5em 0.32em 0.55em / 0.5em 0.3em 0.55em 0.35em;  /* the highlighter's drawn edge */
  --hairline: 1px;
  --control-border: 1.5px;
  --target: 2.75rem;           /* 44 px, every control */
  --target-main: 3.5rem;       /* the one main action at the bottom of the simulation */
  --focus-width: 3px;

  /* motion: only to show a state; ease out, never overshoot */
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur: 200ms;

  /* colour, light. Ink dominates, the highlighter is the accent; green, red and blue carry a meaning */
  --paper: #f4f5f7;            /* page */
  --raised: #fbfbfc;           /* fields and the surfaces that hold input */
  --ink: #1d222b;              /* text, rules, the primary button */
  --muted: #555c68;            /* secondary text, 6.2:1 on paper */
  --line: #dadde3;             /* hairlines between items (decoration only) */
  --rule: #1d222b;             /* the strong rule above a dock or a chapter */
  --control: #6b7280;          /* borders of fields and secondary buttons, 4.4:1 on paper */
  --primary: #1d222b;
  --primary-hover: #343b47;
  --on-primary: #f4f5f7;
  --you: #e3e8f0;              /* your own lines in the conversation, on the right (owner 05.11.2026) */
  --marker: #fce58a;           /* the highlighter: a term, the words that change, the current line */
  --on-marker: #1d222b;
  --ok: #21673a;               /* the better sentence, done, saved */
  --err: #8c2f1c;              /* an error, a lost connection */
  --rec: #c8102e;              /* the recording dot only (owner 09.11.2026: recording must be visible), 5.3:1 */
  --notice: #7a5200;           /* a hint's mark */
  --focus: #1d4ed8;            /* the focus ring, 6.1:1 on paper */
}

@media screen and (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #15181d;
    --raised: #1c2027;
    --ink: #e9ecf1;
    --muted: #a9b0bc;
    --line: #2e333c;
    --rule: #e9ecf1;
    --control: #8b93a1;
    --primary: #e9ecf1;
    --primary-hover: #d3d8e0;
    --on-primary: #15181d;
    --you: #232b37;
    --marker: #5c4a0e;
    --on-marker: #fff4cf;
    --ok: #8cd3a0;
    --err: #f2a08c;
    --rec: #ff6b6b;
    --notice: #e9c46a;
    --focus: #8ab4ff;
  }
}
