/* Tabula sites: design tokens.
   Each site has its own light and dark surfaces, so you can tell which site you are on:
   Tabula Speech is pure black and white, Tabula Debate is a cool slate, Tabula Speech Events is a warm cream.
   The marks, fonts and components tie them together. Aff and Neg values match the app's assets/tokens.css.
   Each page sets <html data-site="speech|debate|events">. theme.js sets data-theme before paint.
   Rule: red and blue are data colours (Aff and Neg). They never colour a button, link, menu or text.
   They may appear as small decorative family calls (--call-*), in pictures.css (round data), and on the
   debate format cards (--fmt-*: owner decision 2026-11-20, Policy filled, LD and PF pale tints). */
@font-face { font-family: 'Inter Tight'; font-style: normal; font-weight: 500 800; font-display: swap; src: url('fonts/InterTight-latin.woff2') format('woff2'); }

:root {
  color-scheme: light;
  --canvas: #ffffff; --sunk: #f5f5f5; --panel: #ffffff; --raised: #ffffff;
  --text: #0a0a0a; --text-2: #404040; --text-3: #666666;
  --border: #e5e5e5; --border-ctl: #767676;
  --ink: #0a0a0a; --on-ink: #ffffff;
  --aff: #0055b8; --aff-tint: #eaf1fb; --aff-edge: #b3cdee;
  --neg: #c8161f; --neg-tint: #fdecec; --neg-edge: #f4c0c2;
  --ok: #1a7a3a; --ok-tint: #e8f6ec;
  --call-blue: #0055b8; --call-red: #f2232d; --call-green: #4f6f58; --call-green-2: #93b39a;
  /* Debate formats on marketing cards: available = filled, coming soon = pale tint. */
  --fmt-live: var(--aff); --on-fmt-live: #ffffff;
  --fmt-ld: #fdecec; --fmt-ld-edge: #f4c0c2; --fmt-pf: #eef0fb; --fmt-pf-edge: #c9cff0;
  --brand: var(--ink); --on-brand: var(--on-ink); --brand-text: var(--ink); --brand-tint: #f5f5f5; --brand-edge: #d4d4d4; --ring: #0a0a0a;

  --shadow-1: 0 1px 2px rgb(0 0 0 / .05), 0 8px 24px rgb(0 0 0 / .06);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .06), 0 24px 60px rgb(0 0 0 / .12);

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Inter Tight', var(--font-sans);
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Marketing type scale (the app stops at 28 px; the sites add display sizes). */
  --fs-1: 13px; --fs-2: 14px; --fs-3: 16px; --fs-4: 18px; --fs-5: 22px; --fs-6: 30px;
  --fs-hero: clamp(36px, 6.2vw, 64px); --fs-h2: clamp(26px, 3.6vw, 40px);
  --lh-read: 1.6; --lh-tight: 1.1;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-xl: 18px; --r-pill: 999px;
  --wrap: 1160px; --wrap-text: 720px;
  --dur: .18s;
  /* Nav and footer surfaces. Tabula Debate light makes them solid white (owner decision 2026-11-21). */
  --chrome: color-mix(in srgb, var(--canvas) 90%, transparent); --chrome-foot: var(--sunk);
  /* Paper disc behind the owner's ink drawing on dark pages (the drawing is never inverted). */
  --paper: #f7f3ea;
}
:root[data-site="debate"] {
  --canvas: #ebeffc; --sunk: #dfe6f9; --panel: #ffffff; --raised: #ffffff;
  --text: #10162b; --text-2: #33405e; --text-3: #4c5875;
  --border: #d3daf0; --border-ctl: #6f7a99;
  --ink: #141b33; --on-ink: #ffffff;
  --brand: var(--ink); --on-brand: var(--on-ink); --brand-text: var(--ink); --brand-tint: #dfe6f9; --brand-edge: #c3cdec; --ring: #141b33;
  --chrome: #ffffff; --chrome-foot: #ffffff;
}
:root[data-site="events"] {
  --canvas: #f3f7f6; --sunk: #e7efed; --panel: #ffffff; --raised: #ffffff;
  --text: #0f1d1b; --text-2: #33443f; --text-3: #4c5e59;
  --border: #d5e1de; --border-ctl: #6c7f7a;
  --ink: #0f1d1b; --on-ink: #ffffff;
  --brand: #2f6f62; --on-brand: #ffffff; --brand-text: #255c51; --brand-tint: #e3efeb; --brand-edge: #8fbfb2; --ring: #2f6f62;
}

/* Dark. Written twice: once for the visitor's choice (data-theme), once for no-script on a dark device.
   With JS, the sites start light (theme.js) until the visitor picks dark. Without JS, they follow the device.
   build.test.mjs checks that the two copies match. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0a0a0a; --sunk: #141414; --panel: #111111; --raised: #181818;
  --text: #fafafa; --text-2: #d4d4d4; --text-3: #a3a3a3;
  --border: #262626; --border-ctl: #737373;
  --ink: #fafafa; --on-ink: #0a0a0a;
  --aff: #7fb0ff; --aff-tint: #122038; --aff-edge: #24406e;
  --neg: #ff7b74; --neg-tint: #361517; --neg-edge: #5e2426;
  --ok: #6fd190; --ok-tint: #12291a;
  --call-blue: #3b82f6; --call-red: #f2232d; --call-green: #93b39a; --call-green-2: #4f6f58;
  --fmt-live: #2f6fd6; --on-fmt-live: #ffffff;
  --fmt-ld: #2a1416; --fmt-ld-edge: #5e2426; --fmt-pf: #161a33; --fmt-pf-edge: #2e3766;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .4), 0 24px 60px rgb(0 0 0 / .5);
  --brand: var(--ink); --on-brand: var(--on-ink); --brand-text: var(--ink); --brand-tint: #171717; --brand-edge: #333333; --ring: #fafafa;
}
:root[data-theme="dark"][data-site="debate"] {
  --canvas: #0b1020; --sunk: #10172b; --panel: #131b31; --raised: #182139;
  --text: #e7ebf7; --text-2: #c0c8de; --text-3: #919cb8;
  --border: #24304d; --border-ctl: #66729a;
  --ink: #e7ebf7; --on-ink: #0b1020;
  --brand: var(--ink); --on-brand: var(--on-ink); --brand-text: var(--ink); --brand-tint: #161f38; --brand-edge: #2b3858; --ring: #e7ebf7;
  --chrome: color-mix(in srgb, var(--canvas) 90%, transparent); --chrome-foot: var(--sunk);
}
:root[data-theme="dark"][data-site="events"] {
  --canvas: #0b1312; --sunk: #101a19; --panel: #13201e; --raised: #182624;
  --text: #e6f0ed; --text-2: #c0d0cb; --text-3: #8fa39d;
  --border: #23332f; --border-ctl: #62766f;
  --ink: #e6f0ed; --on-ink: #0b1312;
  --brand: #7cc4b2; --on-brand: #0b1312; --brand-text: #93d1c1; --brand-tint: #13221f; --brand-edge: #26413a; --ring: #7cc4b2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --canvas: #0a0a0a; --sunk: #141414; --panel: #111111; --raised: #181818;
    --text: #fafafa; --text-2: #d4d4d4; --text-3: #a3a3a3;
    --border: #262626; --border-ctl: #737373;
    --ink: #fafafa; --on-ink: #0a0a0a;
    --aff: #7fb0ff; --aff-tint: #122038; --aff-edge: #24406e;
    --neg: #ff7b74; --neg-tint: #361517; --neg-edge: #5e2426;
    --ok: #6fd190; --ok-tint: #12291a;
    --call-blue: #3b82f6; --call-red: #f2232d; --call-green: #93b39a; --call-green-2: #4f6f58;
    --fmt-live: #2f6fd6; --on-fmt-live: #ffffff;
    --fmt-ld: #2a1416; --fmt-ld-edge: #5e2426; --fmt-pf: #161a33; --fmt-pf-edge: #2e3766;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .35);
    --shadow-2: 0 2px 4px rgb(0 0 0 / .4), 0 24px 60px rgb(0 0 0 / .5);
    --brand: var(--ink); --on-brand: var(--on-ink); --brand-text: var(--ink); --brand-tint: #171717; --brand-edge: #333333; --ring: #fafafa;
  }
  :root:not([data-theme])[data-site="debate"] {
    --canvas: #0b1020; --sunk: #10172b; --panel: #131b31; --raised: #182139;
    --text: #e7ebf7; --text-2: #c0c8de; --text-3: #919cb8;
    --border: #24304d; --border-ctl: #66729a;
    --ink: #e7ebf7; --on-ink: #0b1020;
    --brand: var(--ink); --on-brand: var(--on-ink); --brand-text: var(--ink); --brand-tint: #161f38; --brand-edge: #2b3858; --ring: #e7ebf7;
    --chrome: color-mix(in srgb, var(--canvas) 90%, transparent); --chrome-foot: var(--sunk);
  }
  :root:not([data-theme])[data-site="events"] {
    --canvas: #0b1312; --sunk: #101a19; --panel: #13201e; --raised: #182624;
    --text: #e6f0ed; --text-2: #c0d0cb; --text-3: #8fa39d;
    --border: #23332f; --border-ctl: #62766f;
    --ink: #e6f0ed; --on-ink: #0b1312;
    --brand: #7cc4b2; --on-brand: #0b1312; --brand-text: #93d1c1; --brand-tint: #13221f; --brand-edge: #26413a; --ring: #7cc4b2;
  }
}
