/* Deck tokens and chrome shared by every deck in /presentations/.
   Tokens are a copy of shared.css (Evergreen & Marigold); keep the two in sync.
   Dark slides take data-theme="dark" on their <section>, like the site's dark bands. */

:root {
  /* ── Primitive scales (Evergreen & Marigold design system) ── */
  /* evergreen */
  --evergreen-50: #f3f8f6;
  --evergreen-100: #e5f0eb;
  --evergreen-200: #d0e1da;
  --evergreen-300: #b6cec4;
  --evergreen-400: #9bb9ae;
  --evergreen-500: #7da294;
  --evergreen-600: #5c8878;
  --evergreen-700: #3b6f5e;
  --evergreen-800: #1f5c4a;
  --evergreen-900: #0e4233;
  --evergreen-950: #1c2a24;
  /* marigold */
  --marigold-50: #fef5ed;
  --marigold-100: #ffe8d4;
  --marigold-200: #ffd3ab;
  --marigold-300: #fab877;
  --marigold-400: #ed952e;
  --marigold-500: #d48223;
  --marigold-600: #b26913;
  --marigold-700: #915102;
  --marigold-800: #733e01;
  --marigold-900: #562b00;
  --marigold-950: #3a1b00;
  /* lake */
  --lake-50: #f0f8ff;
  --lake-100: #e1effb;
  --lake-200: #cadff4;
  --lake-300: #adcbe8;
  --lake-400: #8fb6da;
  --lake-500: #6d9dc9;
  --lake-600: #3e7cb1;
  --lake-700: #306796;
  --lake-800: #205078;
  --lake-900: #123b5b;
  --lake-950: #05263f;
  /* neutral */
  --neutral-50: #f5f3ec;
  --neutral-100: #eeede7;
  --neutral-200: #ddddd6;
  --neutral-300: #c8c8c0;
  --neutral-400: #b1b2a9;
  --neutral-500: #979a90;
  --neutral-600: #7a7f76;
  --neutral-700: #5e665c;
  --neutral-800: #475047;
  --neutral-900: #303b33;
  --neutral-950: #1b2720;
  /* terracotta */
  --terracotta-50: #fef4f2;
  --terracotta-100: #ffe7e1;
  --terracotta-200: #fed0c5;
  --terracotta-300: #fbb3a2;
  --terracotta-400: #f09681;
  --terracotta-500: #d9644a;
  --terracotta-600: #c4573f;
  --terracotta-700: #9f422e;
  --terracotta-800: #7f301f;
  --terracotta-900: #611f11;
  --terracotta-950: #431005;
  /* plum */
  --plum-50: #fcf4fb;
  --plum-100: #f6e8f4;
  --plum-200: #ead5e7;
  --plum-300: #dbbcd7;
  --plum-400: #c9a3c5;
  --plum-500: #b587b0;
  --plum-600: #9d6898;
  --plum-700: #864a81;
  --plum-800: #6a3766;
  --plum-900: #4f264c;
  --plum-950: #361534;
  /* sage */
  --sage-50: #f3f8f5;
  --sage-100: #e6f0e9;
  --sage-200: #d1e1d7;
  --sage-300: #b7cec0;
  --sage-400: #9bb8a6;
  --sage-500: #85a08f;
  --sage-600: #6d8476;
  --sage-700: #55695d;
  --sage-800: #415247;
  --sage-900: #2e3c33;
  --sage-950: #1c2720;
  /* success */
  --success-50: #f0faf0;
  --success-100: #e1f2e1;
  --success-200: #cae5c9;
  --success-300: #acd4ac;
  --success-400: #8ec08e;
  --success-500: #6baa6d;
  --success-600: #34893c;
  --success-700: #287630;
  --success-800: #185c21;
  --success-900: #0a4413;
  --success-950: #002d06;
  /* warning */
  --warning-50: #fef5ef;
  --warning-100: #ffe8db;
  --warning-200: #ffd2b7;
  --warning-300: #fab68e;
  --warning-400: #ef9965;
  --warning-500: #dc701c;
  --warning-600: #c05e0f;
  --warning-700: #9c4700;
  --warning-800: #7b3601;
  --warning-900: #5c2500;
  --warning-950: #3f1600;
  /* error */
  --error-50: #fff4f2;
  --error-100: #ffe6e3;
  --error-200: #fed0c9;
  --error-300: #feb1a7;
  --error-400: #f39388;
  --error-500: #e57065;
  --error-600: #c9302d;
  --error-700: #b22524;
  --error-800: #901416;
  --error-900: #6e0308;
  --error-950: #4c0002;
  /* dark-band tints: low-chroma steps used only inside [data-theme="dark"] */
  --band-sunken: #16221d;
  --band-accent-soft: #3a2a10;
  --band-success-bg: #1c311d;
  --band-success-border: #376139;
  --band-category-1-bg: #492922;
  --band-category-2-bg: #41293f;
  --band-category-3-bg: #1a3b29;
  --band-category-4-bg: #1c354b;


  /* ── Semantic tokens (light / web) ── */
  --bg: var(--neutral-50);
  --surface: #ffffff;
  --surface-sunken: var(--neutral-100);
  --surface-inverse: var(--evergreen-950);
  --border: var(--neutral-200);
  --border-strong: var(--neutral-300);
  --text: var(--evergreen-950);
  --text-muted: var(--neutral-800);
  --text-subtle: var(--neutral-700);
  --text-inverse: var(--neutral-50);
  --primary: var(--evergreen-800);
  --primary-hover: var(--evergreen-900);
  --primary-text: var(--evergreen-800);
  --primary-soft: var(--evergreen-100);
  --on-primary: #ffffff;
  --surface-brand: var(--evergreen-800);
  --on-brand: #ffffff;
  --on-brand-muted: var(--evergreen-100);
  --accent-on-brand: var(--marigold-300);
  --surface-brand-hover: var(--evergreen-900);
  --border-on-brand: var(--evergreen-700);
  --accent: var(--marigold-400);
  --accent-hover: var(--marigold-500);
  --accent-soft: var(--marigold-100);
  --accent-text: var(--marigold-700);
  --accent-strong: var(--marigold-600);
  --on-accent: var(--evergreen-950);
  --link: var(--lake-700);
  --link-hover: var(--lake-800);
  --focus-ring: var(--lake-600);
  --selection: var(--marigold-200);
  --success-bg: var(--success-100);
  --success-border: var(--success-300);
  --success-text: var(--success-700);
  --category-1-bg: var(--terracotta-100); --category-1-text: var(--terracotta-800);
  --category-2-bg: var(--plum-100);       --category-2-text: var(--plum-800);
  --category-3-bg: var(--sage-100);       --category-3-text: var(--sage-800);
  --category-4-bg: var(--lake-100);       --category-4-text: var(--lake-800);
  --shadow-sm: 0 1px 2px #1c2a2414, 0 1px 1px #1c2a240a;
  --shadow-md: 0 6px 16px -4px #1c2a241f, 0 2px 4px #1c2a240f;
  --shadow-lg: 0 24px 48px -12px #1c2a2433, 0 4px 8px #1c2a2414;

  /* ── Type ── */
  --font-display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --font-text: 'Figtree', ui-sans-serif, system-ui, sans-serif;
  --font-code: 'JetBrains Mono', ui-monospace, Menlo, monospace;

  /* ── Space (4-pt scale) ── */
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 20px;
  --space-6: 24px; --space-8: 32px; --space-12: 48px; --space-16: 64px;
  --space-24: 96px; --space-32: 128px; --space-40: 160px;

  /* ── Shape ── */
  --radius-xs: 3px; --radius-sm: 6px; --radius-md: 8px; --radius-lg: 12px; --radius-xl: 16px; --radius-pill: 999px;

  /* ── Size ── */
  --control-sm: 36px; --control-md: 44px; --control-lg: 52px;
  --measure: 56ch; /* ≈ 75 characters of Figtree */
  --container: 1160px;
  --gutter: clamp(20px, 4vw, 32px);

  /* Hand-drawn Marigold underline — once per page. */
  --scribble: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'%3E%3Cpath d='M2 8.5C30 4 62 3.2 96 5.6S168 9.4 198 4.2' fill='none' stroke='%23ed952e' stroke-width='3.2' stroke-linecap='round'/%3E%3C/svg%3E");
}

[data-theme="dark"] {
  --bg: var(--evergreen-950);
  --surface: var(--neutral-900);
  --surface-sunken: var(--band-sunken);
  --surface-inverse: var(--neutral-50);
  --border: var(--neutral-800);
  --border-strong: var(--neutral-700);
  --text: var(--neutral-50);
  --text-muted: var(--neutral-300);
  --text-subtle: var(--neutral-400);
  --text-inverse: var(--evergreen-950);
  --primary: var(--evergreen-700);
  --primary-hover: var(--evergreen-600);
  --primary-text: var(--evergreen-300);
  --primary-soft: var(--evergreen-900);
  --accent-hover: var(--marigold-300);
  --accent-soft: var(--band-accent-soft);
  --accent-text: var(--marigold-300);
  --accent-strong: var(--marigold-400);
  --link: var(--lake-300);
  --link-hover: var(--lake-200);
  --focus-ring: var(--lake-300);
  --selection: var(--marigold-800);
  --success-bg: var(--band-success-bg);
  --success-border: var(--band-success-border);
  --success-text: var(--success-200);
  --category-1-bg: var(--band-category-1-bg); --category-1-text: var(--terracotta-200);
  --category-2-bg: var(--band-category-2-bg); --category-2-text: var(--plum-200);
  --category-3-bg: var(--band-category-3-bg); --category-3-text: var(--sage-200);
  --category-4-bg: var(--band-category-4-bg); --category-4-text: var(--lake-200);
  --shadow-sm: 0 1px 2px #00000066;
  --shadow-md: 0 8px 20px -4px #00000080;
  --shadow-lg: 0 24px 48px -12px #000000a6;
  background: var(--bg);
  color: var(--text);
}

/* ── reveal.js chrome ─────────────────────────────────────── */
html, body, .reveal-viewport { background: var(--bg); }
.reveal { font-family: var(--font-text); color: var(--text-muted); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.reveal .slides { text-align: left; }
.reveal .slides > section { height: 100%; padding: 0; }
.reveal .progress { color: var(--accent); height: 4px; }
.reveal .controls { color: var(--primary); }
.reveal.has-dark-background .controls, .reveal:has(section[data-theme="dark"].present) .controls { color: var(--marigold-300); }
.reveal .slide-number { font-family: var(--font-text); background: transparent; color: var(--text-subtle); right: auto; }
.reveal .slide-number a { color: inherit; text-decoration: none; }
.reveal.has-dark-background .slide-number, .reveal:has(section[data-theme="dark"].present) .slide-number { color: var(--neutral-300); }

.reveal h1, .reveal h2, .reveal h3 { font-family: var(--font-display); color: var(--text); letter-spacing: -0.02em; text-transform: none; margin: 0; font-weight: 600; line-height: 1.1; }
.reveal strong { color: var(--text); font-weight: 600; }
.reveal code { font-family: var(--font-code); }
.reveal a { color: var(--link); text-decoration: none; }

/* Eyebrow: the only uppercase text */
.eyebrow { font-family: var(--font-text); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-text); }

/* The one Marigold mark on a key phrase (Marigold is never text on Linen) */
.mark { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: .14em; text-underline-offset: .18em; text-decoration-skip-ink: none; }

/* Circle motif (cover only): Evergreen disc, small Marigold disc on its ring. Each deck sets the geometry. */
.motif { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.motif .disc { position: absolute; border-radius: 50%; background: var(--surface-brand); }
.motif .hop { position: absolute; border-radius: 50%; background: var(--accent); }

/* Dark slides: cover, section dividers, closing */
[data-theme="dark"] .frame { color: var(--text-muted); }

/* Code: sunken well, radius-md; inline code is a primary-soft chip, radius-xs */
.reveal pre, .reveal pre.code-wrapper { background: var(--surface-sunken); border: 0; border-radius: var(--radius-md); box-shadow: none; }
.reveal :not(pre) > code { background: var(--primary-soft); color: var(--primary-text); padding: 2px 7px; border-radius: var(--radius-xs); font-size: .9em; }

/* Syntax colours (highlight.js): keywords and operators Plum, functions and types Lake, strings Terracotta,
   numbers and literals Evergreen, comments neutral italic, everything else Forest ink */
.reveal pre code.hljs, .reveal pre code { color: var(--text); background: transparent; }
.reveal .hljs-keyword, .reveal .hljs-meta, .reveal .hljs-meta .hljs-keyword, .reveal .hljs-operator, .reveal .hljs-selector-tag, .reveal .hljs-doctag { color: var(--plum-700); }
.reveal .hljs-type, .reveal .hljs-title, .reveal .hljs-title.function_, .reveal .hljs-title.class_, .reveal .hljs-built_in, .reveal .hljs-name, .reveal .hljs-section { color: var(--lake-700); }
.reveal .hljs-string, .reveal .hljs-regexp, .reveal .hljs-meta .hljs-string, .reveal .hljs-addition { color: var(--terracotta-700); }
.reveal .hljs-number, .reveal .hljs-literal, .reveal .hljs-symbol, .reveal .hljs-bullet { color: var(--evergreen-700); }
.reveal .hljs-comment, .reveal .hljs-quote { color: var(--neutral-700); font-style: italic; }
.reveal .hljs-params, .reveal .hljs-variable, .reveal .hljs-attr, .reveal .hljs-attribute, .reveal .hljs-subst, .reveal .hljs-punctuation, .reveal .hljs-property, .reveal .hljs-deletion { color: inherit; background: transparent; }

/* ── Slide layout components (shared by every deck) ─────────── */
:root {
  --pad-top: 56px; --pad-x: 72px; --pad-bottom: 48px;
  /* Slide type scale on the 1280×720 canvas */
  --type-eyebrow: 0.9375rem; --type-small: 1.0625rem; --type-body: 1.125rem; --type-subtitle: 1.625rem; --type-title: 2.875rem; --type-title-lg: 4rem;
  --type-lead: 1.25rem; --type-h3: 1.5rem; --type-h2: 2rem; --type-h1: 2.5rem; --type-stat: 3.5rem; --type-stat-xl: 4.5rem; --type-cell: 0.75rem;
}
.reveal .slides .frame { height: 100%; box-sizing: border-box; padding: var(--pad-top) var(--pad-x) var(--pad-bottom); display: flex; flex-direction: column; }
.reveal .slides .grow { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; }

/* Title block: eyebrow, then the headline, 8px apart */
.reveal .slides .eyebrow { font-size: var(--type-eyebrow); margin: 0 0 8px; }
.reveal .slides h1 { font-size: var(--type-title-lg); }
.reveal .slides h2 { font-size: var(--type-title); margin: 0 0 8px; }
.reveal .slides h3 { font-size: 1.375rem; margin: 0 0 6px; }
.reveal p { margin: 0; line-height: 1.45; }
.reveal .slides .src { font-family: var(--font-text); font-size: var(--type-small); color: var(--text-subtle); }
.reveal .slides .faint { color: var(--text-subtle); }
.reveal .slides .lg { font-size: 1.75rem; }
.reveal .slides .sm { font-size: 1.25rem; }

/* Card: white, radius-lg, shadow-sm */
.reveal .slides .card { background: var(--surface); border-radius: var(--radius-lg); padding: 16px 20px; box-shadow: var(--shadow-sm); }
.reveal .slides .card p { font-size: var(--type-body); line-height: 1.4; }

/* Dark slides: section dividers are centred, the cover is left-aligned with the circle motif */
[data-theme="dark"] .frame { justify-content: center; align-items: center; text-align: center; }
.reveal .slides .frame.cover { align-items: flex-start; text-align: left; position: relative; }
.reveal .slides .cover h1 { font-size: var(--type-title-lg); }
.reveal .slides .cover .sub { font-size: 1.75rem; margin-top: 20px; max-width: 720px; }
.reveal .slides .cover .name { font-family: var(--font-display); font-size: 1.75rem; font-weight: 600; color: var(--text); margin-top: 56px; }

/* Closing slide: QR codes with a caption */
.reveal .slides .contact { display: flex; gap: 56px; justify-content: center; margin-top: 44px; }
.reveal .slides .contact a, .reveal .slides .contact .item { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); text-decoration: none; font-size: 1.25rem; }
.reveal .slides .contact a:hover span { text-decoration: underline; }
.reveal .slides .contact img { width: 190px; height: 190px; }

/* ── Shared deck components (reference: tsfm-intro) ──────────────
   Everything below is available to every deck; a deck's own <style> holds only what is unique to it
   (one chart, one diagram). Appended last so it keeps winning over the base rules above. */
:root { --ctx: var(--link); --ctx-fill: var(--category-4-bg); --bad: var(--terracotta-700); --plum: var(--plum-700); }
.reveal { font-size: 1.625rem; line-height: 1.45; }
.reveal .slide-number { font-size: 1rem; left: 18px; bottom: 14px; }

/* Inline emphasis colours: context (Lake), forecast/result (Evergreen), Plum, "bad" (Terracotta) */
.ctx { color: var(--ctx); }
.fc { color: var(--primary); }
.plum { color: var(--plum); }
.bad { color: var(--bad); }
.ico { display: inline-block; width: 1em; height: 1em; vertical-align: -0.14em; }
.reveal .mt { margin-top: 22px; }
.reveal .mb { margin-bottom: 18px; }

/* Layout: flex row and equal-column grids, 18px apart */
.row { display: flex; gap: 18px; align-items: center; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g5 { grid-template-columns: repeat(5, 1fr); }
.g53 { grid-template-columns: 3fr 2fr; gap: 40px; align-items: center; }

/* Card variants: .accent outlines the one card to look at; .meta is the small line under a card title */
.card.accent { border: 2px solid var(--primary); }
.card .meta { font-family: var(--font-text); font-size: 1rem; color: var(--text-subtle); margin-bottom: 6px; }

/* Statement: the one big sentence on a slide */
.statement { font-family: var(--font-display); font-size: 3.375rem; line-height: 1.2; font-weight: 600; color: var(--text); letter-spacing: -0.02em; }

/* Numbered step badge in a heading ("1 Scale: …"). Not .step: that name belongs to reveal-driven widgets. */
.step-num { display: inline-flex; align-items: center; justify-content: center; width: 1.5em; height: 1.5em; border-radius: var(--radius-pill); background: var(--primary); color: var(--on-primary); font-family: var(--font-text); font-size: .55em; font-weight: 600; margin-right: 14px; vertical-align: middle; }

/* Chat mock */
.chat { display: flex; flex-direction: column; gap: 14px; max-width: 980px; margin: 0 auto; }
.bubble { border-radius: var(--radius-xl); padding: 14px 20px; font-size: 1.25rem; line-height: 1.45; color: var(--text); }
.bubble.user { align-self: flex-end; background: var(--ctx-fill); border-bottom-right-radius: var(--radius-xs); max-width: 80%; }
.bubble.bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: var(--radius-xs); max-width: 82%; }
.who { font-family: var(--font-text); font-size: 1rem; font-weight: 600; color: var(--text-subtle); margin-bottom: 4px; }

/* Token chips: a vocabulary item, as a model sees it */
.tok { display: inline-block; font-family: var(--font-code); font-size: 1.1875rem; min-width: 1.5em; text-align: center; padding: 4px 7px; margin: 2px; border-radius: var(--radius-sm); border: 2px solid var(--ctx); background: var(--ctx-fill); color: var(--text); }
.tok.sep { border-color: var(--border); background: var(--surface); color: var(--text-subtle); }
.tok.out { border-color: var(--primary); border-style: dashed; background: transparent; }

/* Comparison table */
.cmp { width: 100%; border-collapse: collapse; font-size: 1.0625rem; }
.cmp th, .cmp td { padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; font-family: var(--font-text); }
.cmp th { color: var(--text); font-weight: 600; }
.cmp td.new { color: var(--text); font-weight: 600; }

/* Dark slides: body text muted, source line muted */
[data-theme="dark"] p:not(.eyebrow) { color: var(--text-muted); }
[data-theme="dark"] .src { color: var(--text-muted); }

/* Code layout (colours are above) */
.reveal pre { position: relative; width: 100%; margin: 0; font-size: 1.0625rem; padding: 16px 22px; box-sizing: border-box; }
.reveal pre code { padding: 0; max-height: none; overflow: visible; line-height: 1.5; }

/* Circle motif (cover only): geometry on the 1280×720 canvas */
.motif .disc { right: -180px; bottom: -220px; width: 620px; height: 620px; }
.motif .hop { right: 305px; bottom: 265px; width: 88px; height: 88px; }

/* Fragments: one fade, the site's --ease-out curve; on SVG groups too */
.reveal .fragment { transition: opacity .45s cubic-bezier(0.16, 1, 0.3, 1); }
svg .fragment:not(.visible) { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .reveal .fragment { transition: none !important; } }

/* Keyboard focus: links and reveal's controls */
.reveal a:focus-visible, .reveal button:focus-visible, .reveal .controls button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; border-radius: var(--radius-xs); }

/* PDF export (?print-pdf) */
html.print-pdf .reveal .slides > .pdf-page > section { height: 720px !important; min-height: 720px; }
html.print-pdf .frame { height: 720px; }

/* Text colour utilities for deck markup (replace inline style="color:var(--x)") */
.reveal .slides .fg-border { color: var(--border); }
.reveal .slides .fg-evergreen-700 { color: var(--evergreen-700); }
.reveal .slides .fg-evergreen-950 { color: var(--evergreen-950); }
.reveal .slides .fg-lake-700 { color: var(--lake-700); }
.reveal .slides .fg-link { color: var(--link); }
.reveal .slides .fg-neutral-700 { color: var(--neutral-700); }
.reveal .slides .fg-plum-700 { color: var(--plum-700); }
.reveal .slides .fg-primary-hover { color: var(--primary-hover); }
.reveal .slides .fg-terracotta-text { color: var(--terracotta-text); }
.reveal .slides .fg-text { color: var(--text); }
.reveal .slides .fg-text-subtle { color: var(--text-subtle); }
