/* NoTip brand v3.0 (design/brand/README.md, design/brand/v3/tokens.json).
   Self-hosted latin variable woff2 from Fontsource (OFL texts beside the
   files in /fonts): Nunito for headlines (700-800), Figtree for everything
   else, with tabular Figtree for numbers (no monospace anywhere).
   A glyph outside the range falls through to the system stack. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("/fonts/nunito-latin-wght-normal.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;
}

@font-face {
  font-family: "Figtree";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-normal.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;
}

@font-face {
  font-family: "Figtree";
  font-style: italic;
  font-weight: 300 900;
  font-display: swap;
  src: url("/fonts/figtree-latin-wght-italic.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;
}

:root {
  color-scheme: dark;

  /* The brand, v3.0 fixed values (design/brand/v3/tokens.json). Clay is the
     action fill; text on Clay is Slate, never white (5.9:1 vs 3.1:1). Clay
     is never a text colour on light grounds — that is primary-text.
     Sky and Olive are fills with Slate text, never text on light grounds. */
  --brand-clay: #d97757;
  --brand-stone: #e8e6dc;
  --brand-slate: #141413;
  --brand-ivory: #faf9f5;
  --brand-sky: #6a9bcc;
  --brand-olive: #788c5d;
  --brand-cloud: #b0aea5;
  --brand-white: #ffffff;

  /* Legacy Visual Identity names, re-pointed at v3 so the hundreds of
     rules reading them keep working. --brand-slate is now Slate itself
     (the shut storefront dot reads as shut). */
  --brand-teal: var(--brand-clay);
  --brand-ink: var(--brand-slate);
  --brand-coral: var(--brand-clay);
  --brand-paper: var(--brand-ivory);
  --brand-mist: var(--brand-stone);
  --brand-teal-tint: #f7e4dc;
  --brand-coral-tint: #f7e4dc;

  --font-text:
    "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display:
    "Nunito", "Arial Rounded MT Bold", ui-rounded, system-ui, sans-serif;

  /* v3 dark theme (the night canvas). --ink stays the page ground and
     --paper the body text here, as every stylesheet reads them; the values
     are v3 surface-dark (#141413) and v3 ink-dark (#faf9f5). */
  --surface: #141413;
  --surface-raised: #1f1e1d;
  --surface-sunken: #0d0d0c;
  --ink: var(--brand-slate);
  --paper: var(--brand-ivory);
  --ink-muted: #b0aea5; /* secondary text on all three dark surfaces */
  --ink-faint: #b0aea5;
  --muted: #b0aea5;
  --faint: #b0aea5;
  --line: #2e2d2b;
  --line-soft: #242423;
  --line-strong: #787670;
  --card: var(--surface-raised);
  --well: var(--surface-sunken);

  /* Clay is the action fill. Its fills carry Slate text (--on-accent,
     5.9:1); white on Clay is 3.1:1, so nothing white ever sits on it. As
     text on dark grounds Clay reads as --accent-text, the light clay the
     guide prints for dark mode. */
  --primary: var(--brand-clay);
  --primary-hover: #e39a80;
  --primary-pressed: #f0b8a3;
  --on-primary: var(--brand-slate);
  --primary-text: #e39a80;
  --primary-tint: #3a2219;
  --primary-ink: #f2c3b1;
  --accent: var(--brand-clay);
  --accent-soft: var(--primary-hover); /* hover and pressed fills */
  --on-accent: var(--brand-slate);
  --accent-glow: var(--brand-clay);
  --accent-text: var(--primary-text);
  --accent-ink: var(--primary-text);
  --accent-wash: var(--primary-tint);
  /* Sky as a fill only (v3 accent): text on it is Slate via --info-ink's
     pairing rules; --info-ink carries the v3 accent-ink value. */
  --accent-tint: #1d2b38;
  --info: #8fb6dd;
  --info-ink: #bcd4ec;
  --highlight: #9db383;
  --on-highlight: var(--brand-slate);
  --highlight-tint: #232a1b;
  --highlight-ink: #c9d8b6;
  --success: #9db383;
  --success-tint: #232a1b;
  /* Warning (interim, decided 2026-11-14): amber, distinct from Clay so a
     warning never reads as a button. Dark-theme values; the rooms' light
     values live on body.room in app-tokens.css. */
  --warning: #f2c14e;
  --on-warning: #141413;
  --warning-text: #f5d67b;
  --warning-tint: #3a2c10;
  --danger: #ff9b9b;
  --danger-tint: #3a1e22;
  --error: var(--danger);
  --error-ink: var(--danger);
  --error-ink-hover: #ffc4c4;

  --r-control: 10px;
  --r-card: 16px;

  /* The site header's bar (base.css): the same 56px as /order's top bar
     (--order-top-h in app-tokens.css), so the two read as one product. */
  --site-header-h: 3.5rem;

  /* Expansion map basemap only — a dark inset off the card, so the map
     reads as an inset rather than a flat continuation. */
  --map-land: #172422;
  --map-water: #173532;

  /* Paper surfaces — light cards on the night canvas, in white. Cards and
     input fields are the same white; fields stand out by their outlines
     (--ink-faint). */
  --paper-bright: var(--brand-white); /* input fields; badge/chip hover lift */

  /* Ink text tiers on paper ("text on paper is ink") — legacy names kept:
     every sheet reads --ink-muted/--paper-line, so they stay on the root. */
  --paper-well: var(--brand-stone); /* recessed fills on paper (quote, tiles, idle chips) */
  --paper-line: #787670; /* control outlines on paper (ghost, pills, step dots) */
  --paper-line-soft: var(--brand-stone); /* hairline dividers on paper; popover edge */

  --focus-ring: #e39a80;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, 0.5); /* floating layers only */

  /* Numbers in Figtree with tabular figures (no monospace anywhere):
     font-variant-numeric: tabular-nums wherever a number paints. */
  --font-mono:
    "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ── The campaign scope ──────────────────────────────────────────────────
   Worn by `/`, `/vote` and `/support` (a `.campaign` class on `<body>`):
   the glow, the grid and the page ground and text that `.campaign.paper`
   (and `.campaign.theme-auto` in light mode) reassigns below. */
.campaign {
  /* Campaign sections only: the glow on the hero's and the card's primary
     buttons, and the grid behind the hero and the video frame. */
  --glow:
    0 0 0 1px rgba(217, 119, 87, 0.45),
    0 0 24px rgba(217, 119, 87, 0.18);
  --grid:
    repeating-linear-gradient(0deg, rgba(217, 119, 87, 0.07) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(217, 119, 87, 0.07) 0 1px, transparent 1px 48px);

  /* ── Page roles ──────────────────────────────────────────────────────
     --ink and --paper can't simply swap: --ink is the page background in
     dark mode and --paper is both the body text and the vote card's
     background. So the page ground and the page text get their own roles,
     as does the accent as text. Dark values first; the paper block below
     reassigns them by role, only where the page opts in with `.paper`.
     Fills keep Clay in both modes. */
  --page: var(--brand-slate); /* the page ground in dark mode */
  --page-ink: #faf9f5; /* the page text in dark mode */
  --bg-alt: #0d0d0c; /* the alt band in dark mode */
}

/* ── Always-paper pages ──────────────────────────────────────────────────
   Opt-in per page with a `paper` class on `<body>`: the page renders on
   Ivory in every color scheme. The seven Rolling R2 pages (/, /vote,
   /support, /support/cancellations, /press, /press/crumbl-pilot,
   /participate/google) keep following the device with `theme-auto`
   instead: their light mode reuses these same values through the block
   below. :root stays dark, so every page without either class is unchanged.
   Only one role changes meaning: --paper becomes the page text (Slate), so
   the white-on-canvas text rules flip with it. --ink stays Slate, so Slate
   text on light surfaces and deliberate dark fills keep working untouched.
   What must pin absolute tokens instead is white *surfaces*: anything
   painting `background: var(--paper)` to mean "white card" pins
   var(--brand-white), and white text inside a kept-dark subtree pins
   var(--brand-white) too. */
body.paper {
  color-scheme: light;
  background: var(--brand-ivory);
  color: var(--brand-slate);
  --surface: var(--brand-ivory);
  --surface-raised: #ffffff;
  --surface-sunken: var(--brand-stone);
  --paper: var(--brand-slate);
  --ink: var(--brand-slate);
  --ink-muted: #5e5d59;
  --ink-faint: #5e5d59;
  --muted: #5e5d59;
  --faint: #5e5d59;
  --line: #dddad0;
  --line-soft: var(--brand-stone);
  --line-strong: #8a887f;
  --card: #ffffff; /* cards read by their border + shadow on Ivory */
  --well: var(--brand-stone);
  --primary-hover: #e08a6e;
  --primary-pressed: #c4613f;
  --primary-text: #9c4628;
  --primary-tint: #f7e4dc;
  --primary-ink: #7a3a20;
  --accent-soft: var(--primary-hover);
  --accent-text: var(--primary-text);
  --accent-ink: var(--primary-text);
  --accent-wash: var(--primary-tint);
  --accent-tint: #e3ecf5;
  --info: var(--brand-sky);
  --info-ink: #2f5778;
  --highlight: var(--brand-olive);
  --highlight-tint: #e9eee1;
  --highlight-ink: #46553a;
  --success: #4f6b3a;
  --success-tint: #e9eee1;
  --danger: #b4232c;
  --danger-tint: #fde8e8;
  --error: var(--danger);
  --error-ink: var(--danger);
  --error-ink-hover: #8a1d22;
  --accent-text: var(--accent-ink);
  --glow: none;
  --grid:
    repeating-linear-gradient(0deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(90deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 48px);
  --focus-ring: var(--brand-slate);
  --shadow-card: 0 1px 2px rgba(20, 20, 19, 0.06), 0 8px 24px rgba(20, 20, 19, 0.08);
  --shadow-pop: 0 12px 40px rgba(20, 20, 19, 0.16);
  --paper-bright: var(--brand-white);
  --paper-well: var(--brand-stone);
  --paper-line: var(--line-strong);
  --paper-line-soft: var(--brand-stone);
  --ink-muted: #5e5d59;
  --ink-faint: #5e5d59;
}

/* ── The campaign on Paper ───────────────────────────────────────────────
   The light block's roles, unconditional under the paper opt-in. Three
   pieces stay dark on purpose (PRD-59 decision 8 is superseded for the
   homepage bands — see home.css — but the order bar, the hero's route map
   and /vote's map keep their night style on their own tokens). */
.campaign.paper {
  --page: var(--brand-ivory);
  --page-ink: var(--brand-slate);
  --bg-alt: var(--brand-stone);
  --faint: #5e5d59;
}

/* ── The campaign in light mode ──────────────────────────────────────────
   Opt-in per page: only a `.campaign` body that also wears `.theme-auto`
   follows the device. A dark-scheme phone sees exactly the Slate page; a
   light-scheme phone sees the Ivory look. */
@media (prefers-color-scheme: light) {
  .campaign.theme-auto {
    color-scheme: light;
    --page: var(--brand-ivory);
    --page-ink: var(--brand-slate);
    --bg-alt: var(--brand-stone);
    --accent-text: #9c4628;
    --muted: #5e5d59;
    --faint: #5e5d59;
    --line: #dddad0;
    --line-soft: var(--brand-stone);
    --line-strong: #8a887f;
    --card: #ffffff; /* cards read by their border + shadow on Ivory */
    --well: var(--brand-stone);
    --ink-muted: #5e5d59;
    --ink-faint: #5e5d59;

    /* The clay glow drops on Ivory, and the hero grid takes a Slate tint. */
    --glow: none;
    --grid:
      repeating-linear-gradient(0deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 48px);

    --focus-ring: var(--ink);
  }

  /* The paper roles for device-following pages: what `body.paper` does
     unconditionally, `body.theme-auto` gets in light mode only — the Ivory
     ground and Slate page text, and the --paper flip the white-on-canvas
     text rules need. `.campaign.theme-auto` above wins the shared roles by
     specificity, so the campaign pages read exactly the after shots. */
  body.theme-auto {
    background: var(--brand-ivory);
    color: var(--brand-slate);
    --surface: var(--brand-ivory);
    --surface-raised: #ffffff;
    --surface-sunken: var(--brand-stone);
    --paper: var(--brand-slate);
    --ink: var(--brand-slate);
    --ink-muted: #5e5d59;
    --ink-faint: #5e5d59;
    --muted: #5e5d59;
    --faint: #5e5d59;
    --line: #dddad0;
    --line-soft: var(--brand-stone);
    --line-strong: #8a887f;
    --card: #ffffff;
    --well: var(--brand-stone);
    --primary-hover: #e08a6e;
    --primary-pressed: #c4613f;
    --primary-text: #9c4628;
    --primary-tint: #f7e4dc;
    --primary-ink: #7a3a20;
    --accent-soft: var(--primary-hover);
    --accent-text: var(--primary-text);
    --accent-ink: var(--primary-text);
    --accent-wash: var(--primary-tint);
    --accent-tint: #e3ecf5;
    --info: var(--brand-sky);
    --info-ink: #2f5778;
    --highlight: var(--brand-olive);
    --highlight-tint: #e9eee1;
    --highlight-ink: #46553a;
    --success: #4f6b3a;
    --success-tint: #e9eee1;
    --danger: #b4232c;
    --danger-tint: #fde8e8;
    --error: var(--danger);
    --error-ink: var(--danger);
    --error-ink-hover: #8a1d22;
    --glow: none;
    --grid:
      repeating-linear-gradient(0deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 48px),
      repeating-linear-gradient(90deg, rgba(20, 20, 19, 0.045) 0 1px, transparent 1px 48px);
    --focus-ring: var(--brand-slate);
    --shadow-card: 0 1px 2px rgba(20, 20, 19, 0.06), 0 8px 24px rgba(20, 20, 19, 0.08);
    --shadow-pop: 0 12px 40px rgba(20, 20, 19, 0.16);
    --paper-bright: var(--brand-white);
    --paper-well: var(--brand-stone);
    --paper-line: var(--line-strong);
    --paper-line-soft: var(--brand-stone);
  }
}
