/*
  Oppward design tokens.
  Direction (docs/BRAND.md): deep ink base, an earned money-green accent, warm
  off-white paper tones, one alert color for deadlines. Editorial type contrast.
  Numbers are the hero of this product, so the body/number face carries real
  tabular figures (Archivo, feature "tnum" enabled below).

  Theme model: dark "ink" is the primary voice (ambient, premium, lets the green
  glow land) with light "paper" bands used deliberately for tonal contrast between
  sections, editorial-magazine style, not a flat single-color page. Both a true
  light theme (prefers-color-scheme / [data-theme]) and the alternating in-page
  bands are built from the same semantic tokens below.

  NEVER use filter: blur() or backdrop-filter: blur() anywhere in this system --
  it breaks headless rendering for the video pipeline and screenshot QA. Use
  radial-gradient soft shapes for ambient/glow effects instead.
*/

:root {
  color-scheme: dark;

  /* ---- raw palette --------------------------------------------------- */
  --ink-950: #0b0d10;
  --ink-900: #101318;
  --ink-800: #171b21;
  --ink-700: #20252d;
  --ink-600: #2b323c;
  --ink-500: #3c4552;

  --paper-50: #faf7ef;
  --paper-100: #f4eee0;
  --paper-200: #e9dfc8;
  --paper-300: #d8caa6;

  --green-900: #0d2b1e;
  --green-700: #14512f;
  --green-600: #1c6b3c;
  --green-500: #2c8a4d;
  --green-400: #45a862;
  --green-300: #86c99a;
  --green-200: #c3e6ce;

  --rust-600: #a83f24;
  --rust-500: #c94f2c;
  --rust-400: #e2683f;
  --rust-200: #f2c3ac;

  --ink-text-hi: #f4f1e8;
  --ink-text-lo: #a7ac9a;

  /* ---- semantic tokens (dark / ink, default) -------------------------- */
  --bg: var(--ink-950);
  --bg-inverse: var(--paper-50);
  --surface: var(--ink-900);
  --surface-raised: var(--ink-800);
  --surface-alt: var(--paper-100);
  --border: var(--ink-600);
  --border-soft: rgba(244, 241, 232, 0.1);

  --text: var(--ink-text-hi);
  --text-muted: var(--ink-text-lo);
  --text-on-alt: var(--ink-950);
  --text-on-alt-muted: #5b5744;

  --accent: var(--green-400);
  --accent-strong: var(--green-300);
  --accent-ink: var(--green-900);
  --accent-tint: var(--green-900);
  --accent-on-accent: var(--ink-950);
  /* Accent tuned for whatever the .band--alt surface actually renders as,
     which is the OPPOSITE tone of the theme's primary .band (paper here,
     since this root block is the dark/ink theme) -- --accent itself stays
     tuned for the primary band and is too bright/low-contrast on a light alt
     surface. Same reasoning as --ink-on-paper above, just for accent-colored
     text/icons instead of body text. */
  --accent-on-alt: var(--green-700);

  --alert: var(--rust-400);
  --alert-strong: var(--rust-200);
  --alert-tint: rgba(226, 104, 63, 0.14);

  --focus-ring: #dfe86a;

  /* Fixed (non-theme-flipping) ink-on-paper text pair for the white "paper"
     surfaces (.card, .opp-card, .ticker, form fields) that float on top of a
     .band--alt section. Those surfaces are hardcoded white in both themes, so
     their text must stay dark regardless of which way the surrounding band's
     --text-on-alt is currently flipped. See components.css / marketing.css
     ".band--alt .card" etc. */
  --ink-on-paper: var(--ink-900);
  --ink-on-paper-muted: #5b5744;

  /* ---- typography ------------------------------------------------------ */
  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-number: "Archivo", -apple-system, sans-serif;

  --fs-2xs: 0.75rem;
  --fs-xs: 0.8125rem;
  --fs-sm: 0.9375rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.25rem;
  --fs-lg: 1.5rem;
  --fs-xl: clamp(1.875rem, 1.6rem + 1.2vw, 2.75rem);
  --fs-2xl: clamp(2.5rem, 2rem + 2.2vw, 4rem);
  --fs-3xl: clamp(3rem, 2.2rem + 3.6vw, 5.75rem);
  --fs-hero: clamp(3.25rem, 2.1rem + 5vw, 7rem);

  --lh-tight: 1.02;
  --lh-snug: 1.15;
  --lh-normal: 1.45;
  --lh-relaxed: 1.65;

  --ls-tight: -0.03em;
  --ls-snug: -0.015em;
  --ls-wide: 0.08em;
  --ls-wider: 0.14em;

  /* ---- spacing (4px base) ---------------------------------------------- */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 3rem;
  --space-9: 4rem;
  --space-10: 5.5rem;
  --space-11: 7.5rem;
  --space-12: 10rem;

  --content-max: 78rem;
  --content-narrow: 42rem;

  /* ---- radii / borders --------------------------------------------------- */
  --radius-sm: 4px;
  --radius: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --border-w: 1px;

  /* ---- shadow (box-shadow blur is fine; filter/backdrop-filter blur is not) */
  --shadow-sm: 0 1px 2px rgba(4, 6, 8, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(4, 6, 8, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(4, 6, 8, 0.65);
  --shadow-glow: 0 0 0 1px rgba(69, 168, 98, 0.25), 0 20px 60px -18px rgba(44, 138, 77, 0.45);

  /* ---- motion ---------------------------------------------------------- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-base: 260ms;
  --dur-slow: 520ms;
}

/* True light theme: OS preference or an explicit override. Paper becomes the
   base, ink becomes the inverse band, accent/alert stay legible on both. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --bg: var(--paper-50);
    --bg-inverse: var(--ink-950);
    --surface: #ffffff;
    --surface-raised: var(--paper-100);
    --surface-alt: var(--ink-950);
    --border: var(--paper-300);
    --border-soft: rgba(11, 13, 16, 0.1);

    --text: #1b1f17;
    --text-muted: #63604e;
    --text-on-alt: var(--ink-text-hi);
    --text-on-alt-muted: var(--ink-text-lo);

    --accent: var(--green-600);
    --accent-strong: var(--green-700);
    --accent-ink: var(--green-200);
    --accent-tint: var(--green-200);
    --accent-on-accent: #fdfdf9;
    /* This block IS the light/paper theme, so .band--alt renders as dark ink
       -- accent needs the bright dark-theme green here, the mirror of the
       root block's choice above. */
    --accent-on-alt: var(--green-400);

    --alert: var(--rust-600);
    --alert-strong: var(--rust-500);
    --alert-tint: rgba(168, 63, 36, 0.1);
  }
}

[data-theme="light"] {
  color-scheme: light;
  --bg: var(--paper-50);
  --bg-inverse: var(--ink-950);
  --surface: #ffffff;
  --surface-raised: var(--paper-100);
  --surface-alt: var(--ink-950);
  --border: var(--paper-300);
  --border-soft: rgba(11, 13, 16, 0.1);
  --text: #1b1f17;
  --text-muted: #63604e;
  --text-on-alt: var(--ink-text-hi);
  --text-on-alt-muted: var(--ink-text-lo);
  --accent: var(--green-600);
  --accent-strong: var(--green-700);
  --accent-ink: var(--green-200);
  --accent-tint: var(--green-200);
  --accent-on-accent: #fdfdf9;
  --accent-on-alt: var(--green-400);
  --alert: var(--rust-600);
  --alert-strong: var(--rust-500);
  --alert-tint: rgba(168, 63, 36, 0.1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: var(--ink-950);
  --bg-inverse: var(--paper-50);
  --surface: var(--ink-900);
  --surface-raised: var(--ink-800);
  --surface-alt: var(--paper-100);
  --border: var(--ink-600);
  --border-soft: rgba(244, 241, 232, 0.1);
  --text: var(--ink-text-hi);
  --text-muted: var(--ink-text-lo);
  --text-on-alt: var(--ink-950);
  --text-on-alt-muted: #5b5744;
  --accent: var(--green-400);
  --accent-strong: var(--green-300);
  --accent-ink: var(--green-900);
  --accent-tint: var(--green-900);
  --accent-on-accent: var(--ink-950);
  --accent-on-alt: var(--green-700);
  --alert: var(--rust-400);
  --alert-strong: var(--rust-200);
  --alert-tint: rgba(226, 104, 63, 0.14);
}
