/* Cobbe's Secret Mission — design tokens.
 *
 * The single source of truth for colour, type, spacing, effects and motion.
 * Lifted from the Cobbe's Secret Mission Design System token files so the app
 * and the design prototypes cannot drift apart; keep them in sync rather than
 * editing values here in isolation.
 *
 * Load order matters: fonts.css -> tokens.css -> agent-theme.css. The font
 * FAMILY tokens (--font-display / --font-ui / --font-mono) live in fonts.css,
 * next to the @font-face rules that make them real.
 *
 * Sections: colours, typography, spacing, effects, motion.
 */

/* ═══ colors.css ═══════════════════════════════════════════ */
/* Colour tokens — lifted verbatim from app/static/css/agent-theme.css
   plus the literal values used inline across the Jinja templates. */
:root{
  /* ── Agent shell: dark spy-tech surfaces ───────────────────────── */
  --bg-primary:#0a0e17;
  --bg-secondary:#111827;
  --bg-card:#1a2233;
  --bg-card-hover:#1f2937;
  --bg-app-shell:#0a0a1a; /* PWA manifest theme_color / background_color */
  --bg-terminal:#000;     /* hacker terminal overrides body to pure black */

  /* ── Neon accents — one hue per station ────────────────────────── */
  --neon-blue:#00d4ff;    /* lab, primary action, Cobbe */
  --neon-green:#00ff88;   /* hacker terminal, success */
  --neon-orange:#ff6b35;  /* interrogation, solve-the-case */
  --neon-red:#ff4d6a;     /* danger, wrong answer, red string (was #ff3355: 4.44:1 on bg-card) */
  --neon-purple:#c06bff;  /* suspects, accuracy (was #b44dff: 4.12:1 on bg-card) */
  --neon-gold:#ffd700;    /* badges, stars, notebook active tab */
  --neon-gold-deep:#ffb700;
  --neon-yellow:#ffcc00;  /* evidence-board accent */

  /* ── Text ──────────────────────────────────────────────────────── */
  --text-primary:#e2e8f0;
  --text-secondary:#94a3b8;
  --text-muted:#8494a9;  /* was #64748b, which failed 4.5:1 on every dark ground */
  --text-accent:var(--neon-blue);

  /* ── Lines & borders ───────────────────────────────────────────── */
  --border-color:#2a3444;
  --border-glow:rgba(0,212,255,.3);

  /* ── Neon washes: accent-tinted fills at 3–15% ─────────────────── */
  --wash-blue-02:rgba(0,212,255,.02);
  --wash-blue-05:rgba(0,212,255,.05);
  --wash-blue-10:rgba(0,212,255,.1);
  --wash-blue-15:rgba(0,212,255,.15);
  --wash-green-05:rgba(0,255,136,.05);
  --wash-green-15:rgba(0,255,136,.15);
  --wash-orange-08:rgba(255,107,53,.08);
  --wash-purple-10:rgba(180,77,255,.1);
  --wash-red-10:rgba(255,51,85,.1);
  --wash-gold-08:rgba(255,204,0,.08);

  /* ── Timer states: green → yellow → orange → red ───────────────── */
  --timer-cyan:#4dffff;
  --timer-green:#2dff2d;
  --timer-yellow:#ffdd00;
  --timer-amber:#ffaa00;
  --timer-orange:#ff6b2d;
  --timer-red:#ff3355;

  /* ── Paper world: the notebook & evidence board are LIGHT ───────── */
  --paper:#faf8f3;
  --paper-rule:#e8e6e1;
  --paper-note:#fff9e6;
  --paper-note-2:#fffbf0;
  --paper-scratch:#fffdf7;
  --paper-field:#fffef9;
  --paper-postit:#ffe6e6;
  --paper-postit-2:#ffecec;
  --paper-tab:#d4ccc0;
  --paper-tab-hover:#e0d5c8;
  --paper-binding:#8b7355;
  --paper-field-border:#c9bfa8;
  --polaroid:#fff;
  --polaroid-edge:#f0f0f0;
  --cork-grain:rgba(139,90,43,.03);

  /* ── Ink: text colours used ON paper surfaces ──────────────────── */
  --ink:#2d2d2d;
  --ink-strong:#333;
  --ink-soft:#555;
  --ink-muted:#666;
  --ink-brown:#5a4a32;

  /* ── Speech bubbles in the interrogation protocol ───────────────── */
  --bubble-q:#e3f2fd;
  --bubble-q-2:#f0f7ff;
  --bubble-a:#f3e5f5;
  --bubble-a-2:#faf5ff;
  --bubble-q-label:#1565c0;
  --bubble-a-label:#bf360c;  /* was #e65100: 3.13:1 on bubble-a */
  --suspect-link:#bf360c;     /* was #d84315: 4.18:1 on paper */

  /* ── Pins that hold paper to the board ─────────────────────────── */
  --pin-red:#ff6b6b;
  --pin-red-deep:#d63031;
  --pin-gold:var(--neon-gold);
  --pin-gold-deep:var(--neon-gold-deep);

  /* ── Semantic aliases — prefer these in new work ────────────────── */
  --surface-page:var(--bg-primary);
  --surface-raised:var(--bg-secondary);
  --surface-card:var(--bg-card);
  --surface-card-hover:var(--bg-card-hover);
  --surface-paper:var(--paper);
  --action-primary:var(--neon-blue);
  --action-primary-ink:var(--bg-primary);
  --state-success:var(--neon-green);
  --state-warning:var(--neon-orange);
  --state-danger:var(--neon-red);
  --state-reward:var(--neon-gold);
  --station-lab:var(--neon-blue);
  --station-hacker:var(--neon-green);
  --station-notes:var(--neon-orange);
  --station-suspects:var(--neon-purple);
  --station-board:var(--neon-yellow);
  --text-body:var(--text-primary);
  --text-quiet:var(--text-secondary);
  --text-faint:var(--text-muted);
  --text-on-paper:var(--ink);
}

/* ═══ print surface ═══════════════════════════════════════════════════
   The printed clue sheet is its own world: cream stock, real ink, no glow and
   no neon. These are deliberately separate from the --paper-* tokens above,
   which describe the notebook *on screen*; ink that reads on a lit display is
   not ink that reads on paper. Nothing here casts a shadow — the dark shell's
   shadow system does not apply to print. */
:root{
  --print-page:#faf8f3;   /* the sheet itself */
  --print-note:#fffdf8;   /* a cut-out note card */
  --print-ink:#1f1a14;    /* body and the code */
  --print-ink-2:#6b5f4f;  /* labels, eyebrows, instructions */
  --print-rule:#9a8b75;   /* cut lines and dotted rules */
}

/* ═══ typography.css ═══════════════════════════════════════════ */
/* Type tokens. Font FAMILY tokens live in fonts.css.

   Three families, one job each. The source app used the platform UI stack and
   Courier New; those are kept as the fallback tail so nothing collapses if the
   webfonts fail to load. See tokens/fonts.css for the self-hosting note.

   --font-display  Rajdhani   — agency chrome: wordmark, station titles, buttons,
                                uppercase labels, stat numbers, timer digits.
                                Condensed and squared; it is the "flashy tech"
                                voice. Max weight 700 — 800/900 tokens clamp.
   --font-ui       Figtree    — everything a human reads: body copy, Cobbe's
                                lines, suspect names, the whole paper world.
   --font-mono     Space Mono — the machine voice: terminal, evidence codes,
                                transmissions, percentages. */
:root{

  /* The app sets html{font-size:var(--font-size-base)} — 18px is 1rem. */
  --font-size-base:18px;  /* body, buttons, inputs */
  --font-size-sm:14px;    /* labels, meta, status */
  --font-size-lg:22px;    /* card headings, big buttons */
  --font-size-xl:28px;    /* station titles, code entry */
  --font-size-2xl:36px;   /* logo, results, suspect names */

  /* Display sizes that appear only inline in templates */
  --font-size-hero:48px;  /* achievement stat values */
  --font-size-mega:64px;  /* celebration glyphs */

  --weight-regular:400; /* @kind font */
  --weight-medium:500; /* @kind font */
  --weight-semibold:600; /* @kind font */
  --weight-bold:700; /* @kind font */
  --weight-heavy:800; /* @kind font */
  --weight-black:900; /* @kind font */

  --leading-tight:1.2; /* @kind font */
  --leading-body:1.6;   /* @kind font */ /* body default */
  --leading-relaxed:1.7; /* @kind font */
  --leading-loose:2;    /* @kind font */ /* briefing transmission text */

  --tracking-tight:0; /* @kind font */
  --tracking-label:1px;   /* @kind font */ /* uppercase labels */
  --tracking-title:2px;   /* @kind font */ /* station titles, stamps */
  --tracking-logo:4px;    /* @kind font */ /* C.O.B.B.E. wordmark */
  --tracking-code:4px;    /* @kind font */ /* evidence code entry */
  --tracking-wide:6px;    /* @kind font */ /* ANALYSERAR… overlay */
}
@media (max-width:768px){
  :root{--font-size-base:16px;--font-size-lg:20px;--font-size-xl:24px;--font-size-2xl:30px}
}

/* ═══ spacing.css ═══════════════════════════════════════════ */
/* Spacing & radii. The app has one --spacing step (16px) and pads in
   multiples/halves of it; the scale below names the values actually used. */
:root{
  --spacing:16px;
  --space-1:4px;
  --space-2:8px;
  --space-3:12px;
  --space-4:16px;
  --space-5:20px;
  --space-6:24px;
  --space-8:32px;
  --space-10:40px;
  --space-12:48px;

  --radius:12px;      /* cards, nav cards, panels */
  --radius-sm:8px;    /* buttons, inputs, tabs */
  --radius-xs:4px;    /* chips, tiny pills, progress bar */
  --radius-lg:14px;   /* generator sections, submit button */
  --radius-pill:20px; /* detail chips, example tags */
  --radius-round:50%; /* avatars, icon bubbles, pins */

  /* Content widths used across the app */
  --width-app:1200px; /* @kind spacing */
  --width-board:1100px; /* @kind spacing */
  --width-notebook:900px; /* @kind spacing */
  --width-terminal:800px; /* @kind spacing */
  --width-station:700px; /* @kind spacing */
  --width-result:600px; /* @kind spacing */

  --tap-min:48px;   /* @kind spacing */ /* WCAG touch target enforced in tablet.css */
  --tap-large:56px; /* @kind spacing */ /* primary actions */
}

/* ═══ effects.css ═══════════════════════════════════════════ */
/* Shadows, glows, gradients, textures. */
:root{
  --shadow-glow:0 0 15px rgba(0,212,255,.15);
  --shadow-card:0 4px 12px rgba(0,0,0,.4);
  --shadow-focus:0 0 10px rgba(0,212,255,.15);
  --shadow-hover-blue:0 0 15px rgba(0,212,255,.3);
  --shadow-hover-green:0 0 20px rgba(0,255,136,.25);
  --shadow-solve:0 0 30px rgba(255,107,53,.5);
  --shadow-badge:0 0 20px rgba(255,215,0,.3);

  /* Paper shadows: offset to the LEFT — paper is pinned, lit from the right */
  --shadow-pinned:-4px 6px 12px rgba(0,0,0,.3),inset 0 1px 0 rgba(255,255,255,.5);
  --shadow-pinned-hover:-6px 8px 16px rgba(0,0,0,.4),inset 0 1px 0 rgba(255,255,255,.5);
  --shadow-postit:-2px 4px 6px rgba(0,0,0,.15),inset 0 1px 0 rgba(255,255,255,.5);
  --shadow-polaroid:0 4px 12px rgba(0,0,0,.3),-3px 3px 0 rgba(0,0,0,.1);
  --shadow-polaroid-hover:0 6px 16px rgba(0,0,0,.4),-4px 4px 0 rgba(0,0,0,.15);
  --shadow-tag:0 2px 6px rgba(0,0,0,.1);

  /* Signature gradients */
  --grad-cobbe:linear-gradient(135deg,rgba(0,212,255,.08),rgba(0,255,136,.05)); /* @kind other */
  --grad-progress:linear-gradient(90deg,var(--neon-blue),var(--neon-green)); /* @kind other */
  --grad-generate:linear-gradient(135deg,var(--neon-green),var(--neon-blue)); /* @kind other */
  --grad-solve:linear-gradient(135deg,var(--neon-orange),var(--neon-red)); /* @kind other */
  --grad-gloss:linear-gradient(135deg,rgba(255,255,255,.05),transparent); /* @kind other */
  --grad-notebook-tab:linear-gradient(135deg,#ffd700 0%,#ffed4e 100%); /* @kind other */
  --grad-paper-note:linear-gradient(135deg,#fff9e6 0%,#fffbf0 100%); /* @kind other */
  --grad-pin-red:radial-gradient(circle at 30% 30%,#ff6b6b,#d63031); /* @kind other */
  --grad-pin-gold:radial-gradient(circle at 30% 30%,#ffd700,#ffb700); /* @kind other */

  /* Ambient page glow behind every agent screen */
  --page-ambience:radial-gradient(ellipse at 20% 50%,rgba(0,212,255,.03) 0%,transparent 50%),radial-gradient(ellipse at 80% 50%,rgba(0,255,136,.03) 0%,transparent 50%); /* @kind other */
  /* CRT scanlines over the hacker terminal */
  --texture-scanline:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,255,136,.015) 2px,rgba(0,255,136,.015) 4px); /* @kind other */
  --texture-scanline-blue:repeating-linear-gradient(0deg,transparent,transparent 2px,rgba(0,212,255,.03) 2px,rgba(0,212,255,.03) 4px); /* @kind other */
  /* Lined-paper backdrop, 29px rhythm */
  --texture-lined-paper:linear-gradient(to bottom,#faf8f3 0%,#faf8f3 28px,#e8e6e1 28px,#e8e6e1 29px); /* @kind other */
  --texture-lined-paper-size:100% 29px; /* @kind other */
}

/* ═══ motion.css ═══════════════════════════════════════════ */
/* Motion tokens. The app uses plain ease for UI and one overshoot curve for
   rewards; nothing is spring-simulated. */
:root{
  --transition-fast:150ms ease;   /* @kind other */ /* buttons, tabs, hover */
  --transition-normal:300ms ease; /* @kind other */ /* cards, meters, bars */
  --duration-fast:150ms; /* @kind other */
  --duration-normal:300ms; /* @kind other */
  --duration-enter:400ms;   /* @kind other */ /* slide/scale entrances */
  --duration-fade:500ms;    /* @kind other */ /* fade-in-up */
  --duration-page:350ms;    /* @kind other */ /* page transition */
  --duration-reveal:2s;     /* @kind other */ /* typewriter, scan sweep */
  --ease-default:ease; /* @kind other */
  --ease-out:ease-out; /* @kind other */
  --ease-pop:cubic-bezier(.175,.885,.32,1.275); /* @kind other */ /* scale-pop, rewards */
  --stagger-step:.05s;      /* @kind other */ /* stagger-children increment */
  --stagger-delay:.2s;      /* @kind other */ /* fade-in--delay-N increment */
  --lift-card:-2px;         /* @kind other */ /* nav/top-level hover translateY */
  --lift-card-strong:-6px;  /* @kind other */ /* hub nav card hover */
  --scale-hover:1.03; /* @kind other */
  --scale-press:.97; /* @kind other */
}

/* ═══ Phase C additions (from the design system, 2026-11-23) ════════
 * Promoted literals, the Spelledare console aliases and the contrast fixes
 * the design system flagged. Surface rules: [Agent] child tablet,
 * [Spelledare] parent console, [Paper] notebook/board, [Print] A4 sheet.
 */
:root{
  /* [Agent, Spelledare] */
  --ink-on-neon:#000;            /* label on a neon fill */
  --on-danger:var(--bg-primary); /* label on a danger or solve fill: dark, ≥5.38:1 (white was 2.84–3.22) */
  --border-control:#64748b;      /* 3:1 boundary for inputs, choice tiles, switches */
  --line-cobbe:rgba(0,212,255,.2);
  --line-chip-green:rgba(0,255,136,.3);
  --line-chip-orange:rgba(255,107,53,.3);
  --radar-line:rgba(0,212,255,.35);
  --radar-ring:rgba(0,212,255,.18);
  --radar-cross:rgba(0,212,255,.15);
  --wash-gold-06:rgba(255,215,0,.06);
  --scan-placeholder:var(--text-secondary); /* was #3a4759: 1.88:1 */
  --shadow-avatar-glow:0 0 20px rgba(0,212,255,.3);

  /* [Paper, Print] */
  --polaroid-photo:#e8e8e8;
  --polaroid-track:#e0e0e0;
  --paper-alias:#bf360c;         /* text-safe orange on paper (neon-orange is 2.84:1) */
  --paper-alibi:#1b6e3c;         /* text-safe green for alibis on paper (neon-green is 1.3:1) */
  --paper-alibi-wash:rgba(27,110,60,.1);
  --paper-line-cobbe:#ccc;
  --qr-quiet:#fff;

  /* [Spelledare] the console: same palette, calm and dense */
  --width-console:520px;
  --gm-surface:var(--bg-primary);
  --gm-panel:var(--bg-secondary);
  --gm-row:var(--bg-card);
  --gm-line:var(--border-color);
  --gm-text:var(--text-primary);
  --gm-text-quiet:var(--text-secondary);
  --gm-accent:var(--neon-blue);
  --gm-found:var(--neon-green);
  --gm-found-bg:var(--wash-green-05);
  --gm-next-bg:var(--wash-blue-05);
  --gm-waiting:var(--neon-orange);
}
