/* sennit.us tokens, direction "Front Desk" (ADR 0020, products/website/REDESIGN_PLAN.md section 3.4).
   The only file on the site that holds colour values. check_site.py enforces that, and tools/contrast.py checks
   every text and background pair in it against WCAG AA (README has the table).
   Light is the default, with a slightly warm tint. Dark is true black. Dark applies when the theme switch says
   "Dark", or when it says "System" (no data-theme) and the visitor's system asks for dark. The two dark blocks
   below must stay identical; contrast.py fails if they drift.
   .console always uses the dark set (the Control Room look of product screens). The footer is always dark. */

/* Fonts: Inter (variable: wght 400 to 700, opsz 14 to 32 so large text gets the Display shapes) with true italics,
   and Geist Mono (wght 400 to 600). Latin subsets, SIL OFL 1.1, licences next to the files. */
@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-italic.woff2") format("woff2"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono.woff2") format("woff2"); font-weight: 400 600; font-style: normal; font-display: swap; }
/* Size-adjusted fallbacks so the swap does not move the page (CLS). Computed from the font files (summed advance widths of a sample
   sentence, Inter at opsz 16 / opsz 32 against Liberation Sans, the metric twin of Arial); overrides are the Inter metrics divided by size-adjust.
   Geist Mono and Liberation Mono both advance 0.6em. See README "Fonts". */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("Helvetica Neue"), local("Liberation Sans"); font-weight: 400 500; size-adjust: 106.1%; ascent-override: 91.3%; descent-override: 22.7%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"); font-weight: 600 700; size-adjust: 95.6%; ascent-override: 101.4%; descent-override: 25.2%; line-gap-override: 0%; }
@font-face { font-family: "Inter Fallback"; src: local("Arial Italic"), local("Arial-ItalicMT"), local("Liberation Sans Italic"); font-weight: 400 700; font-style: italic; size-adjust: 107.4%; ascent-override: 90.2%; descent-override: 22.4%; line-gap-override: 0%; }
@font-face { font-family: "Geist Mono Fallback"; src: local("Menlo"), local("DejaVu Sans Mono"), local("Liberation Mono"); size-adjust: 100%; ascent-override: 100%; descent-override: 28%; line-gap-override: 0%; }

:root {
  color-scheme: light;
  /* light: slightly tinted, warm */
  --bg: #FAF8F6;
  --surface: #FFFFFF;
  --sunken: #F5F2EE;
  --ink: #16141A;
  --ink-2: #5B5763;
  --line: #E4E0E8;          /* thin dividers and card outlines (decorative, not a control edge) */
  --edge: #7C7787;          /* input and control borders, at least 3:1 on every surface */
  --accent: #5B3DF5;        /* deep violet: buttons, links, key words */
  --accent-ink: #FFFFFF;
  --highlight: #A34A09;     /* second accent: small highlights only */
  --braid: rgba(91, 61, 245, 0.05);
  --focus: #5B3DF5;
  --mark: #FBEBDA;          /* tint behind a step that waits for a person */
  --ok: #1F6B42;
  --bad: #A62B2B;
  /* product accents: small marks, tags, diagram strokes only */
  --p-mesh: #5B3DF5;
  --p-custom: #C2410C;
  --p-guard: #0F766E;
  --p-local: #A16207;
  --p-training: #1D4ED8;
  /* footer: always dark */
  --foot-bg: #16141A;
  --foot-ink: #F3F1F6;
  --foot-ink-2: #B3AEBB;
  --foot-line: #3A3641;
  --foot-edge: #8B8695;
  --foot-accent: #B7A8FF;
  --foot-focus: #B7A8FF;

  --font-sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --font-display: var(--font-sans);

  --step--2: 0.8125rem;
  --step--1: 0.9375rem;
  --step-0: 1rem;
  --step-1: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --step-2: clamp(1.25rem, 1.18rem + 0.3vw, 1.4375rem);
  --step-3: clamp(1.375rem, 1.25rem + 0.5vw, 1.75rem);
  --step-4: clamp(1.75rem, 1.5rem + 0.6vw, 2rem);
  --step-5: clamp(2rem, 0.9rem + 3.1vw, 3.5rem);

  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px;
  --space-6: 32px; --space-7: 48px; --space-8: 64px; --space-9: 96px;
  --section: clamp(3rem, 7vw, 5.5rem);
  --wrap: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --gap: 24px;
  --radius: 8px;            /* buttons */
  --radius-card: 4px;       /* cards: sharp, outlined, no shadow */
  --radius-console: 4px;
  --target: 44px;
  --dur-1: 150ms;
  --dur-2: 250ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* dark: true black. Identical in both blocks below. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --surface: #0C0B0E; --sunken: #060509; --ink: #F3F1F6; --ink-2: #A29EAA;
  --line: #24212A; --edge: #77727F; --accent: #8B74FF; --accent-ink: #0B0910; --highlight: #F5A524;
  --braid: rgba(139, 116, 255, 0.06); --focus: #A593FF; --mark: #2B1A05; --ok: #5FCB8B; --bad: #FF8A80;
  --p-mesh: #8B74FF; --p-custom: #FB7A45; --p-guard: #2DD4BF; --p-local: #EAB308; --p-training: #6B9BFF;
  --foot-bg: #0C0B0E;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --surface: #0C0B0E; --sunken: #060509; --ink: #F3F1F6; --ink-2: #A29EAA;
    --line: #24212A; --edge: #77727F; --accent: #8B74FF; --accent-ink: #0B0910; --highlight: #F5A524;
    --braid: rgba(139, 116, 255, 0.06); --focus: #A593FF; --mark: #2B1A05; --ok: #5FCB8B; --bad: #FF8A80;
    --p-mesh: #8B74FF; --p-custom: #FB7A45; --p-guard: #2DD4BF; --p-local: #EAB308; --p-training: #6B9BFF;
    --foot-bg: #0C0B0E;
  }
}

/* Product screens and demos are dark in both themes (the Control Room look). */
.console {
  color-scheme: dark;
  --bg: #000000; --surface: #0C0B0E; --sunken: #060509; --ink: #F3F1F6; --ink-2: #A29EAA;
  --line: #24212A; --edge: #77727F; --accent: #8B74FF; --accent-ink: #0B0910; --highlight: #F5A524;
  --braid: rgba(139, 116, 255, 0.06); --focus: #A593FF; --mark: #2B1A05; --ok: #5FCB8B; --bad: #FF8A80;
}

/* Legacy names. The Mesh, Security and Tools pages (and feed.css) still use the old --color-* vocabulary until
   Phases 2 and 3 rewrite them; each alias re-resolves inside .console. Delete this block with legacy.css. */
:root, .console {
  --color-bg: var(--bg); --color-surface: var(--surface); --color-sunken: var(--sunken);
  --color-text: var(--ink); --color-muted: var(--ink-2); --color-line: var(--line); --color-edge: var(--edge);
  --color-accent: var(--accent); --color-accent-ink: var(--accent-ink); --color-mark: var(--mark);
  --color-wait: var(--highlight); --color-ok: var(--ok); --color-bad: var(--bad); --color-focus: var(--focus);
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur-1: 0ms; --dur-2: 0ms; }
}
