/* Tokens for trial effects (14 November 2026): the halftone hands and smooth scrolling on Home, the dust on the 404.
   Loaded after tokens.css on the pages that use them. Colours only point at tokens.css; nothing here adds a hue.
   Unitless numbers are read by the scripts (hero-hands.js, smooth-scroll.js, dust.js) and are px, fractions, or rates per second.
   To remove the trials, delete this file and the files named in each block. */

:root {
  /* Halftone hands in Home's hero (hero-hands.css, hero-hands.js, halftone.js; the artwork is data-src on .hands, see assets/hero/SOURCE.md).
     After Halftone Pro's Paper theme: rows of ink dots on the paper, each dot's area following the hands' tone, never still. */
  --c-hands-ink: var(--c-ink);
  --hands-pitch: 7;              /* px between dots along a row (the demo's pitch at 1440) */
  --hands-rows: 1.55;            /* rows sit this many pitches apart, so they read as lines of dots, as in the reference */
  --hands-dot-max: 1.15;         /* the darkest dot's diameter, as a share of the pitch: above 1 neighbours in a row touch */
  --hands-dot-min: .16;          /* below this share of the pitch a dot is not drawn: the paper stays clear */
  --hands-gain: 1.3;             /* the artwork's darkness is multiplied by this (its hands are mid grey), then capped at 1, */
  --hands-gamma: .9;             /* then curved by this before it sets the dot size */
  --hands-crop-x: 0;             /* share of each hand's quarter of the sheet trimmed off the forearm (0 keeps the arms to the page's edges) */
  --hands-aspect: 4.15;          /* the band's width over its height. Set here, not by the script, so nothing below moves when the artwork loads;
                                    the sheet is cropped above and below to fit it (4.15 keeps every fingertip and no spare paper) */
  --hands-max: 2560px;           /* the band is as wide as the page up to this */
  --hands-feather: .07;          /* when the band is narrower than the page (past --hands-max, or scaled down to fit a short screen),
                                    each arm's outer end fades into the paper over this share of the band; a full-width band has no fade */

  /* The first screen: the name, the sentence and the whole band fit above the fold. The band is as wide as the page unless that
     would push its fingertips under the fold; then it is scaled down to the height that is left (small-viewport units) */
  --hands-head: var(--head-h);   /* the running head's height */
  --hands-pad-top: max(var(--sp-7), calc(22svh - 97px));   /* the hero's top margin is the site's, or this if smaller: screens under 900px tall give some back */
  --hands-gap-top: min(var(--sp-7), max(var(--sp-4), calc(12svh - 60px)));   /* between the sentence and the band, tightening the same way */
  --hands-fold: 12px;            /* paper kept between the fingertips and the fold */
  --hands-min: 62%;              /* the band is never narrower than this share of the page, however short the screen */
  --hands-tag-lines: 1;          /* lines the tagline and the sentence set in, per width (measured in Bonum): the space under them is */
  --hands-lede-lines: 3;         /* reserved before the fonts arrive, so the band never moves when they do */
  --hands-text: calc(var(--hands-tag-lines) * var(--fs-meta) * var(--lh-ui) + var(--sp-5) + var(--hands-lede-lines) * var(--fs-statement) * var(--lh-statement));
  --hands-above: calc(var(--hands-head) + min(var(--sp-hero-top), var(--hands-pad-top)) + var(--hands-text) + var(--hands-gap-top) + var(--hands-fold));

  /* The gap between the fingertips is the hero's one idea (2x2 sheets): the hands arrive at it, hold it, and answer whoever comes near it */
  --hands-gap: 7;                /* pitches of paper between the two fingertips at rest, */
  --hands-gap-near: 3;           /* and at their closest: they never touch */

  /* The idle. 1: calm, the default since 15 November 2026 (both reviews): the hands rest pointing, drifting and breathing only,
     the spark is the visitor's to cause, and the hands reach and spark by themselves once every --hands-calm-every.
     0: the loop below. Kept for comparison: ?idle=loop in the address shows it on any visit (?idle=calm forces calm) */
  --hands-calm: 1;
  --hands-calm-every: 13;        /* s between the calm idle's own reaches (the first comes this long after the arrival's spark) */

  /* The loop (?idle=loop): each hand points, opens, and points again; while both point they close, spark, and ease back.
     The reach below (linger, reach, touch, release) is also the calm idle's */
  --hands-hold: 4.4;             /* s: a hand holds its pointing pose this long (the reach happens inside it), */
  --hands-open: 2.6;             /* s: and its open pose this long, */
  --hands-change: 1.1;           /* s: dissolving between the two over this, */
  --hands-stagger: 1.6;          /* s: the right hand this far behind the left */
  --hands-scatter: .9;           /* during a change, dots jitter up to this many pitches out of place, settling as the pose lands */
  --hands-linger: .2;            /* s: the pause before the hands start to close, */
  --hands-reach: .9;             /* s: closing from rest to their closest takes this long, */
  --hands-touch: .6;             /* s: they hold still at their closest this long, while the spark passes (the arrival too), */
  --hands-release: 1.1;          /* s: and easing back this long (the loop's hold must cover stagger + linger + reach + touch + release) */

  /* The arrival on Home: the arms travel in from the page's edges and end on the loop's own closest moment */
  --hands-enter: 1.7;            /* s: the travel, slowing all the way (the last few dots take as long as the first half of the band) */
  --hands-enter-delay: .15;      /* s: after the artwork is ready, before the arms set off: barely a beat, so the band is never bare paper */
  --hands-enter-lag: .14;        /* s: the left arm sets off this much after the right; both arrive together */
  --hands-enter-trail: 2;        /* pitches: at full speed the dots trail this far behind the arm, gathering as it slows */
  --hands-enter-again: .9;       /* s: a return to Home in the same session: the hands are already in the frame and only close, */
  --hands-enter-from: 14;        /* pitches: from this far back, */
  --hands-enter-again-delay: .2; /* s: after this wait */

  /* The spark, timed from the hands reaching their closest: energy passing between the hands, light and precise, ink on paper.
     A fine dotted arc is drawn across the gap from the right fingertip to the left, and as it lands a wave runs up both arms */
  --hands-spark: .26;            /* s: the arc is drawn from fingertip to fingertip in this, */
  --hands-spark-tail: .3;        /* s: and lifted from the right after this, so for a moment the whole arc spans the gap, */
  --hands-spark-rise: 2.5;       /* pitches: bowing up to about this far above the higher fingertip, */
  --hands-spark-dots: 8;         /* in this many fine dots, about a pitch apart, */
  --hands-spark-size: .3;        /* the head this large (area, share of the darkest dot), the tail about half */
  --hands-spark-flare: .5;       /* the fingertip dots under the arc's head swell this share of the way to the cap, */
  --hands-spark-reach: 3;        /* within about this many pitches of it */
  --hands-spark-cap: .8;         /* no dot a spark touches grows wider than this share of the space between rows: paper always shows */
  --hands-spark-again: .85;      /* every spark after the arrival's is this share of its strength, */
  --hands-spark-held: .5;        /* and each repeat while the visitor stays near, this share */
  --hands-ripple: .6;            /* the wave's front swells the arms' dots this share of the way to the cap, fading as it travels, */
  --hands-ripple-trough: .45;    /* and the dots just behind it shrink by this share: a pale band running out along the arm, */
  --hands-ripple-at: .26;        /* s: leaving the gap as the arc lands, */
  --hands-ripple-speed: .78;     /* at this many band widths per second, so it reaches the page's edges, */
  --hands-ripple-width: 4.5;     /* pitches: its crest this wide, */
  --hands-ripple-life: .9;       /* s: gone after this, */
  --hands-ripple-push: 3;        /* px: nudging dots outwards along the arm as it passes */

  /* The visitor: the nearer the pointer to the gap, the further the hands close */
  --hands-near: 300;             /* px: the pointer starts to draw the hands together this far from the gap, */
  --hands-near-full: .7;         /* and has closed them fully once it has covered this share of that distance */
  --hands-near-in: 7;            /* rate at which they close on the pointer, */
  --hands-near-out: 3;           /* and let go */
  --hands-change-held: .5;       /* s: if a hand is open when the visitor comes near, it turns to point in this time */
  --hands-press: .7;             /* s: a press or a tap on the band holds them closed this long */
  --hands-beat: 3.4;             /* s between sparks while the pointer or a finger stays near (the first answers at once) */

  --hands-drift: 3.5;            /* px: the rows sway sideways this far, each a little out of step with the next, */
  --hands-drift-rate: .55;       /* at this speed (radians per second) */
  --hands-breathe: .14;          /* dot size swells and settles by this share, in a slow wave across the hands, */
  --hands-breathe-rate: .9;
  --hands-lens: 120;             /* px: the lens around the pointer, or a finger */
  --hands-swell: 1.1;            /* dots at the lens's centre grow by this share */
  --hands-push: 9;               /* px they are pushed outwards at the lens's edge */
  --hands-reveal: .22;           /* inside the lens even the paper shows dots this large (share of the darkest), fading out at its edge */
  --hands-follow: 9;             /* rate at which the lens catches up with the pointer */

  /* Smooth scrolling (smooth-scroll.js, vendor/lenis): eased wheel scrolling on Home. Touch keeps native scrolling. */
  --smooth-lerp: .12;            /* share of the remaining distance covered each frame: higher is tighter. Lenis's default is .1 */
  --smooth-wheel: 1;             /* wheel distance multiplier */

  /* Dust on the 404 (dust.css, dust.js): ink dots that the pointer draws into a ring around itself; a click scatters them */
  --c-dust: var(--c-ink);
  --dust-density: 4200;          /* one dot for every this many square px, */
  --dust-max: 260;               /* and never more than this many */
  --dust-size-min: .8;           /* dot radius in px */
  --dust-size-max: 1.9;
  --dust-alpha-min: .28;         /* dot opacity on the paper */
  --dust-alpha-max: .72;
  --dust-drift: 9;               /* px/s: the idle wander */
  --dust-reach: 240;             /* px: the pointer gathers dots within this distance, */
  --dust-pull: 2600;             /* this hard (px/s² far from the ring, easing off as a dot reaches it), */
  --dust-ring: 46;               /* px: into a ring this far around the pointer, hollow in the middle */
  --dust-spin: 22;               /* px/s: the ring turns slowly, so it reads as held, not frozen */
  --dust-hold: 5;                /* rate at which a dot on the ring loses speed: the ring keeps its shape as the pointer moves */
  --dust-damp: 1.6;              /* rate at which a free dot's speed decays: lower lets them coast longer */
  --dust-room: 6;                /* px: dots keep this far apart, so the ring reads as a line of grains and thickens as it fills */
  --dust-speed-max: 420;         /* px/s while gathering */
  --dust-burst: 640;             /* px/s: a click flings the ring's dots outwards this fast, */
  --dust-burst-rest: .7;         /* s: and the pointer gathers nothing for this long, so they fly before they come back */
  --dust-text-calm: .45;         /* over the words, dots show at this share of their opacity, so the words stay easy to read */
  --dust-still: 8;               /* s: left this long with no pointer or finger moving, the dots come to rest and nothing is drawn, */
  --dust-settle: 3;              /* s: the wander and the ring's turn easing away over this; the next movement wakes them */
}

@media (max-width: 1024px) {
  :root { --hands-crop-x: .2; --hands-aspect: 3.21; --hands-near: 240; }
}

@media (max-width: 760px) {
  :root {
    --hands-pitch: 4;
    --hands-crop-x: .4125;         /* phones keep the hands and wrists, so the gesture is large enough to read */
    --hands-aspect: 2.19;
    --hands-head: 96px;            /* the running head is two rows on phones */
    --hands-gap-top: min(var(--sp-6), max(var(--sp-4), calc(12svh - 60px)));
    --hands-lens: 90;
    --hands-near: 150;
    --dust-density: 3600;
    --dust-reach: 170;
    --dust-ring: 38;
  }
  html.js { --hands-head: var(--menu-row); }   /* with JavaScript, one row: the phone menu (site.css) */
}

@media (max-width: 564px) { :root { --hands-lede-lines: 4; } }   /* measured 15 November 2026, with the sentence as Home's headline */
@media (max-width: 432px) { :root { --hands-lede-lines: 5; } }
@media (max-width: 360px) { :root { --hands-lede-lines: 6; } }
@media (max-width: 337px) { :root { --hands-tag-lines: 2; --hands-min: 50%; } }   /* the narrowest phones: the floor gives way, so a 320x568 screen still shows the fingertips */
@media (max-width: 324px) { :root { --hands-lede-lines: 7; } }

/* ===== Footer lab (14 November 2026): lab-footers.html, footers.css, footers.js. Seven trial footers; G became the site's footer on 15 November.
   To remove them, delete this block, those three files and assets/footer-art/. The cover colours are the newsletter's,
   measured from the afterglow skies (newsletter/DESIGN.md, Covers); they are greys, so still no new hue. ===== */
:root {
  /* Over the night sky of an afterglow picture (B) */
  --c-cover: #1d1b1c;            /* the four skies' top edge */
  --c-on-cover: var(--c-paper);  /* words, field text, messages: 15.5:1 on the sky */
  --c-on-cover-2: #c1bfb9;       /* the note, placeholder, field rule: 9.6:1 */
  --c-on-cover-hover: #dcd9d3;   /* the light button under the pointer */
  --c-envelope: var(--c-print);  /* C: the envelope's paper, edged with a soft hairline like the prints (no shadow: the site is flat) */
  --c-stamp: var(--c-paper);     /* C: the stamp's paper, a shade under the envelope's, so its perforated edge reads without a shadow */

  /* The signup, rebuilt from the newsletter's form (A ruled line and a square button). Since G became the site's footer
     (15 November 2026), the values it shares with the site live in tokens.css (--fs-msg, --lh-msg, --press, --letter-*) and are pointed at here */
  --fx-field-h: 52px;
  --fs-field: 17px;
  --fx-btn-min: 8em;             /* fits Subscribe and Sending, so the field never moves */
  --fx-press: var(--press);      /* the button goes down this far, like type into paper */
  --fx-press-dur: var(--press-dur);
  --fx-mock-send: .9s;   /* the mock's Sending state lasts this long before the lab note shows */

  /* E to G. The newsletter's addressing alone (its back cover's To and From), ink and hairlines, no envelope */
  --fx-ltr-k: var(--letter-k);   /* the To and From column, as on the newsletter */
  --fx-ltr-gap: var(--letter-gap);   /* between that column and the field */
  --fx-ltr-from: var(--letter-from); /* the From line sits this far under the field (the newsletter's row gap) */
  --fx-ltr-draw: .9s;            /* E: the field's ruled line draws in from the left over this, */
  --fx-ltr-write: 1.1s;          /* F: Keith writes itself on the From line over this, */
  --fx-ltr-wait: .15s;           /* each starting this long after the form is half in view */

  /* A. The name in dots: his name set across the width, drawn in the hero's rows of ink dots */
  --fx-name-pitch: 6;            /* px between dots along a row */
  --fx-name-rows: 1.3;           /* rows this many pitches apart */
  --fx-name-dot-max: 1.12;       /* the darkest dot, as a share of the pitch */
  --fx-name-dot-min: .14;        /* below this share no dot is drawn */
  --fx-name-settle: 1.7;         /* s: as the footer arrives the dots fly in from a scatter and settle, left to right */
  --fx-name-scatter: 14;         /* pitches: how far out they start */
  --fx-name-breathe: .07;        /* then sizes breathe by this share in a slow wave */
  --fx-name-lens: 110;           /* px: the lens around the pointer */
  --fx-name-swell: .9;
  --fx-name-push: 8;
  --fx-name-reveal: .2;
  --fx-name-follow: 9;

  /* B. The ink reveal: an ink edge sweeps across the paper and leaves the Writing Lamp behind it */
  --fx-reveal-dur: 1.9;          /* s, the sweep */
  --fx-reveal-start: .28;        /* starts once this share of the scene is in view */
  --fx-reveal-edge: 90;          /* px: how ragged the ink front is */
  --fx-reveal-flecks: 120;       /* spray ahead of the front */
  --fx-reveal-hz: .35;           /* where the afterglow starts, as a share of the picture's height (newsletter, measured) */
  --fx-reveal-gap: clamp(24px, 3vw, 40px);  /* words end at least this far above the glow */

  /* C. The envelope */
  --fx-env-w: 720px;             /* about a DL envelope's shape once the address is on it (2.2 to 1): no empty paper either side of the form */
  --fx-env-rise: 34px;           /* arrives from this far below, */
  --fx-env-tilt: -2.2deg;        /* this far askew, */
  --fx-env-dur: 1.1s;            /* over this long */
  --fx-stamp-w: 120px;           /* multiples of the perforation step */
  --fx-stamp-h: 150px;
  --fx-perf: 10px;               /* perforation step */
  --fx-stamp-pitch: 6;           /* px: the stamp is printed in the hero's ink dots, this far apart (about 17 across: dots, not a screen), */
  --fx-stamp-dot-max: 1.15;      /* the darkest dot as a share of the pitch (the hero's), */
  --fx-stamp-dot-min: .16;       /* and the smallest drawn (the hero's) */
  --fx-mark-dur: .36s;           /* the postmark strikes when a letter is sent, */
  --fx-write-dur: .6s;           /* then the address is written onto the envelope, left to right, over this */

  /* D. La Vuelta in dots: the picture in coloured dots that wind into place as you scroll down to it */
  --fx-vortex-pitch: 7;
  --fx-vortex-dot-max: 1.18;
  --fx-vortex-dot-min: .12;
  --fx-vortex-turn: 2.6;         /* rad: how far the inner dots are wound back at the start */
  --fx-vortex-flat: .34;         /* the spiral lies on the ground: its height over its width */
  --fx-vortex-cx: .5;            /* the spiral's centre (the man), as a share of the picture */
  --fx-vortex-cy: .7;
  --fx-vortex-horizon: .47;      /* above this share of the height is sky: it stays put while the ground winds */
  --fx-vortex-lens: 130;
  --fx-vortex-swell: .8;
  --fx-vortex-push: 10;
}

@media (max-width: 760px) {
  :root {
    --fx-name-pitch: 3.4;
    --fx-name-lens: 70;
    --fx-name-push: 5;
    --fx-reveal-edge: 50;
    --fx-reveal-flecks: 60;
    --fx-env-tilt: -1.4deg;
    --fx-stamp-w: 100px;
    --fx-stamp-h: 120px;
    --fx-stamp-pitch: 4.4;
    --fx-vortex-pitch: 4.2;
    --fx-vortex-lens: 80;
    --fx-vortex-push: 7;
  }
}

/* ===== Phone nav lab (15 November 2026): lab-nav.html, nav-lab.css, nav-lab.js. Four trial phone navigations, not on any site page.
   To remove them, delete this block and those three files. Colours point at tokens.css, except two greys for words and rules on the
   ink page (D), which has no paper under it; still no new hue. ===== */
:root {
  --nl-frame-w: 390px;           /* the lab's phone frames */
  --nl-frame-h: 760px;

  /* The one row every variant keeps: the name, and (A, C, D) Letters and the menu button */
  --nl-row: 56px;
  --nl-icon: 16px;               /* the drawn plus (A) and the swatch (D) inside their 44px buttons */
  --nl-rise: 10px;               /* words rise this far as they arrive */

  /* A. Index sheet: a sheet of paper drawn down from the head's rule, the destinations set large on it */
  --fs-nl-big: 40px;             /* the three destinations, in the headline face */
  --nl-big-row: 84px;
  --nl-big-underline: 6px;
  --nl-big-arrow: .34em;         /* Favourites' drawn arrow at that size */
  --nl-big-arrow-drop: .16em;
  --nl-big-arrow-gap: .14em;
  --nl-count-drop: .18em;        /* the count sits up at the cap line, as beside the Writing headline */
  --nl-sheet-in: .44s;           /* the paper comes down over this, */
  --nl-sheet-out: .22s;          /* and goes back up quicker */
  --nl-sheet-lead: .06s;         /* the first row starts this long after the paper, */
  --nl-stagger: .045s;           /* each next row this long after the one before */

  /* B. Thumb bar */
  --nl-bar: 60px;                /* the bar's height, above the phone's home indicator */
  --nl-mark: 22px;               /* a cell's drawn mark */
  --nl-mark-gap: 5px;            /* mark to word */
  --nl-away: 7px;                /* Favourites' arrow beside its mark */
  --fs-nl-bar: 14px;             /* small capitals */
  --nl-bar-track: .06em;
  --nl-tick-inset: 18px;         /* the ink rule is the cell's width less this each side */
  --nl-slide: .5s;               /* the rule slides from the last page's cell to this one's over this */
  --nl-press: 1px;               /* a tapped cell goes down this far, like type into paper (the newsletter's button) */
  --nl-press-dur: .03s;

  /* C. Folding head */
  --nl-links: 45px;              /* the links row, its rule included */
  --nl-settle: .26s;             /* stopped part way, the head eases to open, one row or gone over this */
  --nl-here-rule: 14px;          /* the short rule before the page's word, as before the hero's tagline */

  /* D. Ink bloom */
  --c-nl-on-ink-2: #a9a6a0;      /* the count on the ink page: 7.9:1 on ink */
  --c-nl-ink-rule: #45423e;      /* rules on the ink page */
  --nl-sw-dot: 5px;              /* the swatch's largest dot */
  --nl-bloom-in: .34s;           /* the ink blooms across the screen over this (a tap answered at once), */
  --nl-bloom-out: .26s;          /* and draws back into the swatch over this */
  --nl-bloom-pitch: 9px;         /* px between the bloom's dots */
  --nl-bloom-dot: 1.5;           /* a full-grown dot's diameter as a share of the pitch: above 1.42 the dots merge into solid ink */
  --nl-bloom-soft: 150px;        /* a dot grows from nothing to full over this far behind the front */
  --nl-bloom-ragged: 26px;       /* the front is this ragged, dot by dot */
  --nl-bloom-words: .3;          /* the links arrive from this share of the bloom */
  --nl-flip: .18s;               /* the name, Letters and the swatch turn to paper as the ink reaches them */
  --nl-here-dot: 8px;            /* the paper dot in the margin by the page you are on */
}
