/* Design tokens: the single source of colour, type and space (docs/design.md).
   AGENTS.md rule 12: no colour literal, font stack or spacing scale exists anywhere
   else. tests/test_theme.py reads this file, computes the contrast of every pairing
   the pages render, and checks the colour-vision separation of the sentiment trio. */

/* One family, self-hosted (static/fonts/README.md). The Latin Extended subset only
   downloads when a page contains a character from it (scraped names, diacritics). */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-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;
}
/* The home page's headlines: Host Grotesk, light (static/fonts/README.md). Only the home page asks for
   it, so no other page downloads it. */
@font-face {
  font-family: "Host Grotesk";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/host-grotesk-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-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Host Grotesk";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/host-grotesk-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;
}
/* Metric-matched stand-in while the font loads, so the swap does not move the layout
   (measured against arial.ttf; static/fonts/README.md says how to recompute). */
@font-face {
  font-family: "Schibsted Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans");
  size-adjust: 103.95%;
  ascent-override: 93.94%;
  descent-override: 24.8%;
  line-gap-override: 0%;
}

:root {
  /* Colour. OKLCH is the design source (docs/design.md §3); hex is what ships, because
     older Android WebViews do not read oklch(). `mark` only ever sits behind text. */
  --ground: #F3F2EF;
  --sheet: #FFFFFF;
  --ink: #0A0A0A;
  --ink-2: #45454A;
  --ink-3: #4D4D52;
  --rule: #DEDDD8;
  --mark: #FFCF52;
  --pos: #09A02B;
  --neg: #B8300A;
  /* The positive green as text (the title's share): --pos is a mark, too light to be read as words. */
  --pos-ink: #0B7324;
  --neu: #868686;
  /* The word cloud's colours: they tell words apart and mean nothing (the sixth is --ink). */
  --cw-1: #1F5FBF;
  --cw-2: #0E7490;
  --cw-3: #6D4AC4;
  --cw-4: #B0237A;
  --cw-5: #9A5B00;

  --font: "Schibsted Grotesk", "Schibsted Fallback", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Host Grotesk", var(--font);

  /* Space: a 4 px unit (docs/design.md §5). */
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s6: 24px;
  --s8: 32px;
  --s12: 48px;
  --s16: 64px;
  --s24: 96px;
  --s32: 128px;

  /* Shape (docs/design.md §6): a tile, a panel that holds tiles, a pill, a control. Only these radii exist. */
  --radius-tile: 16px;
  --radius-panel: 28px;
  --radius-pill: 999px;
  --radius-control: 12px; /* a field, a choice, a row of the sidebar */

  /* Elevation (docs/design.md §6): three heights, and only for what is raised. A chosen control sits on
     the first, a card under the pointer on the second, what floats over the page (a menu, a dialog,
     the run bar) on the third. Ink at low opacity, so the shadow is the page's own tone, never a hue. */
  --lift-1: 0 1px 2px rgba(10, 10, 10, 0.08), 0 1px 1px rgba(10, 10, 10, 0.04);
  --lift-2: 0 6px 16px rgba(10, 10, 10, 0.08), 0 2px 4px rgba(10, 10, 10, 0.06);
  --lift-3: 0 20px 48px rgba(10, 10, 10, 0.18), 0 4px 12px rgba(10, 10, 10, 0.08);

  /* Motion (docs/design.md §7): one easing, two lengths. */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --fast: 160ms;
  --slow: 280ms;

  --pad: clamp(16px, 4vw, 48px);
  --wrap: 1152px;
  --gutter: 24px;
  --measure: 34em;
  --lead-measure: 30em;
  --control: 48px;
  --sidebar: 264px;
  /* The signed-in column beside the sidebar, centred in what is left of the screen: --page for a
     form, a list or a balance; --page-wide for a report and the admin console, whose charts and
     tables are worth the room (docs/design.md §5, "The signed-in column"). Each grows with a very
     wide screen without a breakpoint (one above 1600 px would flip inside the scaled range). */
  --page: clamp(1024px, 55vw, 1200px);
  --page-wide: clamp(1320px, 70vw, 1600px);
  --scale: 0.9; /* how large a wide screen draws the page (docs/design.md §4, "Scale") */
  --scale-desktop: 0.8; /* how large a laptop or a normal desktop screen draws it (the same) */
}

/* A wide screen gets a wider column, not wider text: the measure stays where it is. From 1500 px
   the column is 1320 px, and it keeps growing with a very wide screen, to 1520 px. */
@media (min-width: 1500px) {
  :root { --wrap: clamp(1320px, 60vw, 1520px); }
}
