/* tokens.css: Good Peeps brand tokens, fonts and the engine-critical layout (stage, rail, slides, labels).
   Measured contrast: cream on deep 7.5:1, cream on charcoal 8.9:1, white on green 4.7:1 (cream on green is 4.1:1:
   headings only), charcoal on cream 8.9:1. Component styles live in gp.css. */
@font-face { font-family: "Apple Garamond"; src: url("../fonts/AppleGaramond.ttf") format("truetype"); font-display: swap; font-weight: 300 500; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Variable.ttf") format("truetype"); font-display: swap; font-weight: 100 900; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-display: swap; font-weight: 400; }
@font-face { font-family: "IBM Plex Mono"; src: url("../fonts/IBMPlexMono-Light.ttf") format("truetype"); font-display: swap; font-weight: 300; }
@font-face { font-family: "Picnic Club Script"; src: url("../fonts/ThePicnicClub-Script.ttf") format("truetype"); font-display: swap; }

:root {
  --gp-green: #418152;
  --gp-deep: #2f543e;
  --gp-cream: #f5f0e6;
  --gp-bone: #ecebe4;
  --gp-charcoal: #484041;
  --gp-terracotta: #815241;
  --gp-ink: #2b2627;
  --hp-blue: #1f6fd6;
  --hp-red: #e8382d;
  --serif: "Apple Garamond", "EB Garamond", "Cormorant Garamond", Garamond, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --script: "Picnic Club Script", "Apple Garamond", cursive;
  --pad-x: clamp(18px, 6vw, 96px);
  --radius: 22px;
  --pill: 80px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--gp-green); color: var(--gp-cream); overflow-x: clip; scroll-padding-top: 0; }
body { margin: 0; font: 400 1rem/1.6 var(--mono); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis [data-lenis-prevent] { overscroll-behavior: contain; }

/* Themes. A section paints its own background on ::before at z-index -1, under the fixed stage, so the
   3D floats over the section colour and under the section's content. Never give a [data-slide] a transform,
   filter, opacity or z-index: that makes a stacking context and traps the background above the canvas. */
[data-theme="green"]    { --bg: var(--gp-green);    --fg: #ffffff;          --head: var(--gp-cream); --muted: rgba(255,255,255,.86); --line: rgba(245,240,230,.28); --card: var(--gp-cream); --card-fg: var(--gp-charcoal); --accent: var(--gp-cream); }
[data-theme="deep"]     { --bg: var(--gp-deep);     --fg: var(--gp-cream);  --head: var(--gp-cream); --muted: rgba(245,240,230,.82); --line: rgba(245,240,230,.22); --card: var(--gp-cream); --card-fg: var(--gp-charcoal); --accent: #9fd0ae; }
[data-theme="charcoal"] { --bg: var(--gp-charcoal); --fg: var(--gp-cream);  --head: var(--gp-cream); --muted: rgba(245,240,230,.82); --line: rgba(245,240,230,.2);  --card: var(--gp-cream); --card-fg: var(--gp-charcoal); --accent: #9fd0ae; }
[data-theme="cream"]    { --bg: var(--gp-cream);    --fg: var(--gp-charcoal); --head: var(--gp-charcoal); --muted: #5d5557; --line: rgba(72,64,65,.18); --card: #ffffff; --card-fg: var(--gp-charcoal); --accent: var(--gp-green); }

[data-slide] { position: relative; min-height: 100vh; min-height: 100svh; color: var(--fg); }
[data-slide]::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--bg); }
[data-slide] > * { position: relative; z-index: 1; }

/* The stage: one fixed, transparent canvas. Hidden until the first frame, and when WebGL is off or lost. */
/* The stage is part of the page, not fixed: deck.js translates it back under the viewport every frame. Between frames it
   scrolls with the sections, so on a phone (where the browser scrolls off the main thread) a picture never slides against
   its own slide. */
.stage { position: absolute; top: 0; left: 0; z-index: 0; width: 100%; height: 100vh; height: 100lvh; pointer-events: none; will-change: transform; }
/* A short fade at the top of every slide but the first, above the canvas and below the copy. A picture that reaches the
   top edge of its section melts into the section colour there instead of being cut by a straight line. */
[data-slide]:not(:first-of-type)::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2.75rem; z-index: 0; pointer-events: none; background: linear-gradient(to bottom, var(--bg), transparent); }
@media print { [data-slide]::after { display: none; } }
.stage canvas { display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; }
html[data-three="ready"] .stage canvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) { html[data-three="ready"] .stage canvas { transition: opacity .15s linear; } }

/* Labels pinned to 3D points by deck.place(). They live inside the slide that owns them, in a fixed layer. */
.labels { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: clip; }
.label { position: absolute; left: 0; top: 0; opacity: 0; transition: opacity .35s ease; will-change: transform; white-space: nowrap; }
html:not([data-three="ready"]) .labels { display: none; }
[data-slide]:not(.is-live) .labels { visibility: hidden; } /* is-live: the engine is drawing this slide's picture this frame */

/* Progress rail: real links, one per slide. */
.rail { position: fixed; right: 14px; top: 50%; z-index: 5; transform: translateY(-50%); list-style: none; margin: 0; padding: 8px 6px; display: grid; gap: 9px; border-radius: 999px; background: rgba(43,38,39,.38); backdrop-filter: blur(6px); }
.rail a { position: relative; display: block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(245,240,230,.75); background: transparent; transition: background .25s, transform .25s; }
.rail a.is-ready { background: rgba(245,240,230,.35); }
.rail a[aria-current="true"] { background: var(--gp-cream); transform: scale(1.45); }
.rail a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.rail-tip { position: absolute; right: 20px; top: 50%; transform: translateY(-50%); padding: 4px 10px; border-radius: 999px; background: var(--gp-ink); color: var(--gp-cream); font: 500 .72rem/1.2 var(--sans); white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .2s; }
.rail a:hover .rail-tip, .rail a:focus-visible .rail-tip { opacity: 1; }
@media (max-width: 760px) { .rail { right: 6px; gap: 7px; padding: 6px 4px; } .rail a { width: 7px; height: 7px; } .rail-tip { display: none; } }

.print-still { display: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 10; background: var(--gp-ink); color: var(--gp-cream); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
