/* Design tokens. Every value used by the other stylesheets comes from here. */

@font-face {
  font-family: "Schibsted Grotesk";
  src: url("../assets/fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../assets/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* color: 1 dominant (green), 1 accent (saffron), cool paper neutrals */
  --color-green-950: #082219;
  --color-green-900: #0b2e24;
  --color-green-800: #0f3d2e;
  --color-green-700: #17513e;
  --color-green-600: #2a6b54;
  --color-green-300: #9dbfae;
  --color-green-100: #dce8e1;

  --color-accent: #f2a516;
  --color-accent-strong: #dd9208;
  --color-accent-soft: #fdf0d2;

  --color-paper: #f5f7f4;
  --color-paper-2: #ebefea;
  --color-surface: #fcfdfb;
  --color-line: #cfd8d2;
  --color-ink: #10201a;
  --color-ink-2: #3d4f47;
  --color-ink-3: #56675f;

  /* semantic roles: these are the ones the dark theme remaps */
  --color-brand: var(--color-green-800);
  --color-brand-2: var(--color-green-700);
  --color-fill: var(--color-green-800);
  --color-tint: var(--color-green-100);
  --color-on-accent: #10201a;

  --color-on-dark: #f5f7f4;
  --color-on-dark-2: #c3d4cb;
  --color-line-on-dark: #2b5a48;

  --color-error: #a3271b;
  --color-error-soft: #fbe9e6;

  /* typography */
  --font-display: "Schibsted Grotesk", "Atkinson Hyperlegible Next", sans-serif;
  --font-body: "Atkinson Hyperlegible Next", "Schibsted Grotesk", sans-serif;

  /* modular scale 1.25 on an 18px base, chosen for older readers */
  --text-sm: 0.9375rem;
  --text-base: 1.125rem;
  --text-lg: 1.40625rem;
  --text-xl: clamp(1.5rem, 1.2rem + 1vw, 1.758rem);
  --text-2xl: clamp(1.758rem, 1.3rem + 1.6vw, 2.197rem);
  --text-3xl: clamp(2.1rem, 1.4rem + 2.6vw, 2.747rem);
  --text-4xl: clamp(2.4rem, 1.3rem + 3.8vw, 3.433rem);
  --text-hero: clamp(2.5rem, 0.9rem + 3.6vw, 4rem);
  --text-stat: clamp(3.433rem, 1.6rem + 6vw, 5.5rem);

  --leading-tight: 1.04;
  --leading-snug: 1.2;
  --leading-body: 1.6;
  --tracking-display: -0.035em;
  --tracking-heading: -0.02em;
  --tracking-label: 0.08em;

  --weight-body: 400;
  --weight-medium: 550;
  --weight-bold: 700;
  --weight-display: 750;

  /* spacing, 4pt module */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --container: 78rem;
  --measure: 62ch;
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --section-y-tight: clamp(3.5rem, 6vw, 5rem);
  --nav-h: 4.5rem;
  --tap: 3rem;

  /* shape rule: interactive = pill, cards = lg, inputs and small tiles = md */
  --radius-md: 0.75rem;
  --radius-lg: 1.25rem;
  --radius-pill: 999px;

  --border: 1px solid var(--color-line);
  --border-strong: 2px solid var(--color-brand);
  --focus-ring: 3px solid var(--color-accent-strong);
  --focus-offset: 3px;

  /* shadows tinted to the green hue */
  --shadow-card: 0 1px 2px rgb(11 46 36 / 0.06), 0 12px 32px -12px rgb(11 46 36 / 0.18);
  --shadow-float: 0 2px 4px rgb(8 34 25 / 0.12), 0 32px 64px -24px rgb(8 34 25 / 0.45);

  /* timing. Entrances use --ease-primary; micro-interactions stay under 300ms */
  --duration-micro: 160ms;
  --duration-fast: 260ms;
  --duration-base: 600ms;
  --duration-slow: 900ms;
  --ease-primary: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --stagger: 70ms;

  /* layers */
  --z-glyph: 0;
  --z-content: 1;
  --z-nav: 50;
  --z-menu: 60;
  --z-skip: 70;
}

/* Dark theme. Applies only when the reader picks it in the header; light is the default.
   Photo blocks, the lawyer section and the footer keep their greens. */
:root[data-theme="dark"] {
  color-scheme: dark;

  --color-paper: #0a1a14;
  --color-paper-2: #0f241c;
  --color-surface: #143026;
  --color-line: #2f5244;
  --color-ink: #eef4f0;
  --color-ink-2: #c6d6cd;
  --color-ink-3: #a3b9ae;

  --color-brand: #a9dec6;
  --color-brand-2: #86cbab;
  --color-fill: #1c5c47;
  --color-tint: #1a3d30;
  --color-accent-soft: #3d2f0c;

  --color-error: #ffa599;
  --color-error-soft: #3d1813;

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.55);
  --shadow-float: 0 2px 4px rgb(0 0 0 / 0.35), 0 32px 64px -24px rgb(0 0 0 / 0.7);
}

:root[data-theme="light"] {
  color-scheme: light;
}

/* Reader-controlled larger text (the A+ control in the header). */
:root[data-text-size="large"] {
  font-size: 112.5%;
}
