/* Self-hosted brand fonts (SIL Open Font License; see public/fonts/LICENSE-*).
   Latin subsets only, woff2, no third-party font requests. */
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/fonts/inter-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/space-grotesk-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------
   Rezinet design tokens + base element styles.

   One system for the whole site: pages never carry their own CSS, they use
   these tokens, the shared classes in global.css, and component styles.

   Surface variables (--surface-*) are the contrast contract: a band sets them
   once (see .section--dark / .section--tint in global.css) and every component
   inside inherits readable colours instead of hard-coding navy or white.
   --------------------------------------------------------------------------- */

:root {
  /* Brand palette — deep navy, one accent, warm neutrals */
  --color-navy: #0e1a2b;
  --color-navy-light: #1b2a41;
  --color-navy-deep: #091220;
  --color-accent: #1b5fa8;
  --color-accent-hover: #15497f;
  --color-accent-on-dark: #9cc2ec;
  --color-white: #ffffff;
  --color-gray-50: #f7f7f5;
  --color-gray-100: #f0f0ed;
  --color-gray-200: #e4e4df;
  --color-gray-300: #cdcdc6;
  --color-gray-400: #9a9a92;
  --color-gray-500: #6f7177;
  --color-gray-600: #55585f;
  --color-gray-700: #3b3f47;
  --color-gray-900: #1a1d22;

  /* Vivid accents for illustration panels and charts. The five categorical
     hues were checked with the data-viz validator (light surface: lightness
     band, chroma, colour-blind separation of neighbours, contrast). Use them
     in this order. Amber sits under 3:1 on white, so every amber mark ships
     with a label or a table, as the validator requires. */
  --color-amber: #e89b0c;
  --color-teal: #12a095;
  --color-coral: #ec6a5c;
  --color-violet: #7b5bdc;
  --color-amber-light: #f7c85a;
  --color-teal-light: #6fd6c9;
  --color-coral-light: #ffa597;
  --color-violet-light: #a894f0;
  --color-teal-deep: #0b7f76;
  --color-violet-deep: #4b3aa6;

  /* Hero gradients for illustration panels */
  --gradient-blue-violet: linear-gradient(135deg, #1b5fa8 0%, #4f43c2 58%, #7b5bdc 100%);
  --gradient-teal-blue: linear-gradient(135deg, #0b7f76 0%, #12a095 38%, #1b5fa8 100%);
  --gradient-amber-coral: linear-gradient(135deg, #f2b233 0%, #ec8a4c 52%, #ec6a5c 100%);

  /* Light surface (the default band) */
  --surface-bg: var(--color-white);
  --surface-fg: var(--color-navy);
  --surface-body: var(--color-gray-700);
  --surface-muted: var(--color-gray-600);
  --surface-rule: var(--color-gray-200);
  --surface-raised: var(--color-gray-50);
  --surface-link: var(--color-accent);
  --surface-marker: var(--color-accent);

  /* Type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
    Arial, sans-serif;
  --font-display: "Space Grotesk", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, "Courier New", monospace;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 2.75rem;
  --text-6xl: 3.25rem;

  --line-height-tight: 1.15;
  --line-height-snug: 1.3;
  --line-height-normal: 1.55;
  --line-height-relaxed: 1.7;

  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  /* Reading measure */
  --measure: 68ch;
  --measure-narrow: 56ch;

  /* Spacing */
  --space-0: 0;
  --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;

  /* Radius — restrained, nothing pill-shaped except tags */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-base: 3px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --radius-xl: 8px;
  --radius-full: 9999px;
  --radius-panel: 14px;

  --shadow-sm: 0 1px 2px 0 rgb(14 26 43 / 0.06);
  --shadow-base: 0 1px 3px 0 rgb(14 26 43 / 0.08);
  --shadow-md: 0 6px 16px -6px rgb(14 26 43 / 0.12);
  --shadow-panel: 0 30px 50px -22px rgb(9 18 32 / 0.6), 0 12px 24px -14px rgb(9 18 32 / 0.4);

  --transition-fast: 120ms ease-in-out;
  --transition-base: 180ms ease-in-out;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
ul,
ol,
dl,
dd {
  margin: 0;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--line-height-normal);
  color: var(--surface-body);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
}

/* Headings inherit the band's foreground colour, so a heading is never
   navy-on-navy. Size comes from the element, colour from the surface. */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--surface-fg);
  font-weight: var(--font-weight-semibold);
  font-family: var(--font-display);
  line-height: var(--line-height-tight);
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-3xl);
}

h3 {
  font-size: var(--text-xl);
}

h4 {
  font-size: var(--text-lg);
}

h5,
h6 {
  font-size: var(--text-base);
}

@media (min-width: 768px) {
  h1 {
    font-size: var(--text-5xl);
  }

  h2 {
    font-size: var(--text-4xl);
  }

  h3 {
    font-size: var(--text-2xl);
  }
}

p {
  margin-bottom: var(--space-4);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--surface-link);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

ul,
ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

strong {
  font-weight: var(--font-weight-semibold);
}

hr {
  border: 0;
  border-top: 1px solid var(--surface-rule);
  margin: var(--space-12) 0;
}

code {
  font-family: var(--font-mono);
  background-color: var(--color-gray-100);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

pre {
  background-color: var(--color-gray-100);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--space-4);
}

pre code {
  background-color: transparent;
  padding: 0;
}

/* Forms inherit the type system rather than the browser default */
input,
textarea,
select,
button {
  font: inherit;
  color: inherit;
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--color-navy);
  color: var(--color-white);
  padding: var(--space-3) var(--space-4);
}

.skip-link:focus {
  left: var(--space-4);
  top: var(--space-2);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
