/*
 * Vesperwood — design tokens. Every colour, font stack, size, duration and
 * easing on the site lives here; site.css / site.js only reference them.
 * Prefix --s- (the gallery's own tokens are also loaded, for the ribbon).
 *
 * Contrast pairs (WCAG AA, checked):
 *   ink / ink-soft on every light dusk stop (0..2)          >= 4.9:1
 *   night-text / night-muted on every dark dusk stop (3..4) >= 7:1
 *   blood + moss are decorative only (tallies, rules, struck lines) — never body text on bone.
 */
:root {
    /* Palette */
    --s-bone: #ece5d3;
    --s-paper: #f4efe2;
    --s-paper-edge: #d8ccb0;
    --s-ink: #2b2118;
    --s-ink-soft: #574636;
    --s-moss: #9b8c6a;
    --s-blood: #6e0f12;
    --s-blood-soft: #6e0f12b3;
    --s-blood-lift: #c0484c;     /* the strike on dark grounds — decorative, the struck text stays night-text */
    --s-pencil: #6e0f12;         /* margin note on bone: 11.9:1 */
    --s-ash: #0b0b0a;
    --s-ash-2: #161512;
    --s-ash-3: #24211c;
    --s-night-text: #e8e1d0;
    --s-night-muted: #b3a88f;
    --s-rule-day: #2b211833;
    --s-rule-night: #e8e1d026;
    --s-shadow: #0b0b0a59;
    --s-shadow-deep: #000000b3;
    --s-lantern: #ffcf8a;
    --s-lantern-glow: #ffb45a55;
    --s-lantern-edge: #ffb45a00;
    --s-window-light: #ffd89a;
    --s-window-glow: #ffb45acc;
    --s-window-figure: #2b2118e6;
    --s-lamp-clear: #0b0b0a00;
    --s-lamp-edge: #0b0b0a59;
    --s-mask-solid: black;
    --s-mask-half: #00000059;
    --s-mask-clear: transparent;
    --s-focus-day: #6e0f12;
    --s-focus-night: #ffcf8a;
    --vw-focus: var(--s-focus-day); /* default; .vw-day/.vw-night override it per section */

    /* Dusk: the document background walks these stops section by section.
       0-2 carry ink text, 3-4 carry night text; the switch happens on the
       threshold band, which holds no body text. */
    --s-dusk-0: #ece5d3;
    --s-dusk-1: #e3dac5;
    --s-dusk-2: #d3c8ad;
    --s-dusk-3: #1d1a16;
    --s-dusk-4: #0b0b0a;

    /* Lantern room */
    --s-room-dim: brightness(0.16) sepia(0.4) contrast(1.1);
    --s-room-lit: sepia(0.55) saturate(1.15) brightness(0.86) contrast(1.06);
    --s-room-even: brightness(0.62) sepia(0.45) contrast(1.05);
    --s-lantern-r-desk: 22;      /* % of the room's width */
    --s-lantern-r-touch: 54;
    --s-lantern-unveil-at: 0.84;  /* share of a room's scroll after which the lantern is set down and the room is lit whole */
    --s-lantern-soft: 0.3;       /* fraction of the radius that is solid light */
    --s-flicker: 0.026;          /* radius wobble amplitude, never a strobe */
    --s-lantern-follow: 0.14;    /* pointer smoothing per frame */

    /* Type */
    --s-font-display: "IM Fell English", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
    --s-font-type: "Courier Prime", "Courier New", Courier, monospace;
    --s-font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --s-step-hero: clamp(2.6rem, 9vw, 5.2rem);
    --s-step-h2: clamp(2rem, 6vw, 3.4rem);
    --s-step-h3: clamp(1.4rem, 3.4vw, 1.9rem);
    --s-step-body: clamp(1.06rem, 1.2vw, 1.19rem);
    --s-step-small: 0.8125rem;
    --s-step-micro: 0.75rem;
    --s-track-micro: 0.18em;
    --s-step-note: clamp(1.05rem, 4.4vw, 1.6rem);
    --s-step-price: clamp(1.6rem, 4vw, 2.2rem);
    --s-step-wall: clamp(0.85rem, 2.4vw, 1.6rem);
    --s-step-wall-big: clamp(1.05rem, 3.6vw, 2.5rem);
    --s-wall-s: 1.8cqw;
    --s-wall-m: 2.3cqw;
    --s-wall-l: 3.1cqw;
    --s-step-release: clamp(1.9rem, 9.4vw, 3.6rem);
    --s-track-ui: 0.16em;
    --s-track-wall: 0.22em;

    /* Space + layout */
    --s-gutter: clamp(16px, 5vw, 48px);
    --s-section: clamp(72px, 12vw, 160px);
    --s-measure: 62ch;
    --s-wide: 780px;
    --s-measure-wide: 1180px;    /* header, listing hero, facade, gallery share this one container */
    --s-facade-crop: 62.5%;      /* frame height as a share of width (16:10) on wide screens */
    --s-facade-shift: -8.333%;   /* lifts the 4:3 drawing so the roof and steps both stay in frame */
    --s-slip-rot: -1.5deg;       /* the gallery frame that has started to slip */
    --rot: 0deg;                 /* sheet-drop tilt; overridden per item in site.css */
    --s-slip-y: 12px;
    --s-slip-caption: 12px;
    --s-strike: 3px;
    --s-room-max: 1100px;
    --s-room-min: 720px;      /* narrower screens swipe across the room instead of shrinking it */
    --s-card-max: 560px;
    --s-mount: #e9dfc9;           /* the empty mount where a photograph was withheld */
    --s-mount-corner: #3a3026;
    --s-mount-hatch: #3a302614;
    --s-radius: 2px;
    --s-tear: 14px;
    /* Heights in viewport units (unitless; site.css multiplies by 1svh with a 1vh fallback) */
    --s-threshold-h: 70;
    --s-pages-head-w: 20rem;
    --s-pages-top: clamp(56px, 6vw, 96px);
    --s-ending-gap: clamp(48px, 5vw, 96px);        /* wide screens: notice and agent card side by side, one last page */
    --s-ending-pad: clamp(56px, 7vw, 112px);        /* wide screens: the bureau's pages run straight into the ending */
    --s-agent-w: 22rem;
    --s-pages-sticky: 22vh;
    --s-pages-max: 1440px;
    --s-door-h: clamp(220px, 38vh, 360px);
    --s-door-flicker: 2.6s;
    --s-room-pin-desk: 140;
    --s-room-pin-touch: 120;

    /* Motion */
    --s-ease: cubic-bezier(0.2, 0.7, 0.1, 1);
    --s-ease-ink: cubic-bezier(0.45, 0, 0.2, 1);
    --s-dur: 400ms;
    --s-dur-ink: 600ms;
    --s-blur-bleed: 3px;         /* the rewritten fact blurring out before the swap */
    --s-blur-ink-in: 6px;        /* the rewritten fact's ink focusing in */
    --s-dur-paper: 1.1s;
    --s-dur-window: 4.2s;        /* the attic lamp: on, a gutter, out */
    --s-delay-window: 0.4s;
    --s-dur-write: 1.3s;         /* the pencilled margin note writing itself in */
    --s-delay-write: 1.1s;
    --s-ease-gsap-paper: power3.out;
    --s-ease-gsap-none: none;
    --s-paper-drop: 48;          /* px the found pages fall onto the table */
    --s-paper-start: top 85%;
    --s-lamp-scrub: 0.6;
    --s-lamp-close: 3;           /* timeline weight: vignette closing in vs letting go */
    --s-lamp-open: 1;
    --s-rewrite-delay: 500ms;
    --s-rewrite-stagger: 260ms;
    --s-pointer-hold: 1800ms;    /* after this long without the pointer moving, the scroll tour takes the light back */
    --s-tour-start: top 45%;     /* the light starts its walk as the room comes up the screen */
    --s-tour-travel: 0.35;       /* share of each mark's slot spent travelling; the rest it rests there */
    --s-house-seen: 0.4;
    --s-focus-delay: 900ms;      /* advisory: wait for the smooth scroll before moving focus */
    --s-facts-seen: 0.6;
    --s-mq-reduce: "(prefers-reduced-motion: reduce)";
    --s-mq-fine: "(hover: hover) and (pointer: fine)";

    /* Layers */
    --s-z-room: 1;
    --s-z-writing: 2;
    --s-z-glow: 3;
    --s-z-ui: 5;

    /* -- added: type scale + length tokens collected from site.css literals -- */
    --s-weight-400: 400;
    --s-weight-700: 700;
    --s-weight-100: 100;
    --s-weight-900: 900;
    --s-weight-500: 500;
    --s-leading-105: 1.05;
    --s-leading-115: 1.15;
    --s-leading-98: 0.98;
    --s-leading-100: 1;
    --s-leading-110: 1.1;
    --s-leading-82: 0.82;
    --s-leading-130: 1.3;
    --s-leading-150: 1.5;
    --s-leading-95: 0.95;
    --s-weight-600: 600;
    --s-leading-165: 1.65;
    --s-leading-120: 1.2;
    --s-leading-140: 1.4;
    --s-leading-145: 1.45;
    --s-leading-160: 1.6;
    --s-leading-125: 1.25;
    --s-leading-170: 1.7;
    --s-leading-155: 1.55;
    --s-space-1: 1em;
    --s-track-n0p01: -0.01em;
    --s-measure-1p5: 1.5em;
    --s-track-n0p015: -0.015em;
    --s-em-1p6: 1.6em;
    --s-em-0p5: 0.5em;
    --s-space-0p06: 0.06em;
    --s-space-0p08: 0.08em;
    --s-size-3p4: 3.4em;
    --s-track-0p14: 0.14em;
    --s-track-0p04: 0.04em;
    --s-space-0p15: 0.15em;
    --s-space-1p6: 1.6em;
    --s-em-1p2: 1.2em;
    --s-space-1p4: 1.4em;
    --s-space-0p1: 0.1em;
    --s-em-9: 9em;
    --s-track-0p06: 0.06em;
    --s-space-0p35: 0.35em;
    --s-size-1p1: 1.1em;
    --s-track-0p12: 0.12em;
    --s-size-1p08: 1.08em;
    --s-track-0p03: 0.03em;
}