/* THE BLUE PENCIL · tokens
   Read off the signed style sheet (inputs/sheet.html, :root at lines 36-40 and the classes at 41-157).
   Every component uses these variables; no colour, size or timing is typed twice.
   Material rule: ultramarine pencil and rubber-stamp ink on ruled white paper, held in heavy black frames.
   Tone comes only from pencil pressure and how fully a stamp is inked; depth exists only where something is pressed.
   Contrast figures are WCAG 2.x ratios, on page (#FFFFFF) and on desk (#F6F6F2). */
:root {
  /* ── colour: one ink, one job ── */
  --desk: #F6F6F2;     /* under the pages: the page background behind every sheet of paper */
  --page: #FFFFFF;     /* where the writing goes: every panel's working page, fields, popups (always opaque) */
  --ink: #121318;      /* the student's words and every frame. 18.6:1 on page, 17.1:1 on desk */
  --ink-soft: #4A4E5C; /* secondary words: captions, hints, the drafts behind. 8.3:1 on page, 7.6:1 on desk */
  --rule: #C9CCD6;     /* ruling every 28 px and quiet dividers. 1.6:1: never words, never a control's only edge */
  --ultra: #2742B5;    /* the pencil: every mark, link, the main action, the focus ring. 8.3:1 on page, 7.7:1 on desk */
  --cyan: #1A2C7A;     /* cyanotype: pressed, and the hard pencil. 12.5:1 on page, 11.5:1 on desk */
  --margin: #D9402E;   /* the margin line only. Never words, never a control's only edge, never the only sign of anything. 4.45:1 */
  --dry-ink: #5C606D;  /* a disabled part's words: a dry outline. 6.3:1 on page (disabled parts are exempt; it passes anyway) */
  --dry-edge: #8A8E9A; /* a disabled part's dry edge. 3.3:1 on page, 3.0:1 on desk */
  --on-ink-soft: #E4E6EC; /* second line of words on an ink ground (the toast). 14.9:1 on ink */
  --pencil-rule: rgba(39, 66, 181, .22); /* the catalogue card's blue ruling: drawn lines only, never words */
  --veil: rgba(18, 19, 24, .35); /* behind an open dialog: the desk dimmed, flat, no blur */

  /* text on colour, as the sheet pairs them:
     white on ultramarine 8.3:1 · white on cyanotype 12.5:1 · white on ink 18.6:1 · --on-ink-soft on ink 14.9:1.
     Ultramarine against ink is only 2.2:1, so a focus ring never sits on an ink or ultramarine face: it sits outside, on page or desk. */

  /* ── type: two faces ── */
  --fd: "Libre Baskerville", Georgia, serif; /* the voice: 700 display (the face's ceiling), 600 heads, 400 italic in ultramarine for the coach's words */
  --fb: "DM Sans", system-ui, sans-serif;    /* reading 400, labels 500, tracked capitals 700 for stamps and labels; also code */
  --w-read: 400; --w-label: 500; --w-caps: 700; --w-head: 600; --w-display: 700; /* Libre Baskerville tops out at 700 (was 800 in Fraunces) */
  --fs-cap: 10.5px;   /* tracked capital labels: the only size below 12 */
  --fs-small: 12.5px; /* small notes */
  --fs-code: 12.5px;  /* code boxes, in DM Sans (two faces only) */
  --fs-body: 14px;    /* reading */
  --fs-lead: 19px;    /* lead lines */
  --fs-h3: 23px;      /* § heads */
  --fs-coach: 24px;   /* the coach's blue words */
  --fs-band: 58px;    /* band heads */
  --lh-body: 1.45;
  --track-caps: .13em; /* tracked capitals */

  /* ── line: weights in px, pencil in three pressures ── */
  --w-frame: 3px;     /* every frame, table heads */
  --w-field: 2px;     /* a field's edge, labels, small frames */
  --w-head-rule: 1.5px; /* the rule over every § head */
  --w-rule: 1px;      /* ruling, every 28 px */
  --w-margin: 1.5px;  /* the red margin line: the left of a page, only */
  --p1: 1.2;          /* pencil, light: guides, queries (drawn at --p1-o opacity) */
  --p1-o: .55;
  --p2: 2.2;          /* pencil, medium: circles, ticks */
  --p3: 3.4;          /* pencil, hard: what the coach insists on */
  --ink-solid: 1;     /* a stamp from a fresh pad */
  --ink-faded: .5;    /* the second impression, as the sheet's faded stamp */
  --ink-dry: .38;     /* the third: a dry outline, as the sheet's dry stamp */
  --radius: 0;        /* paper is cut square */
  --radius-stamp: 50%; /* round only for stamps */

  /* ── spacing: one rule is 28 ── */
  --s1: 4px;    /* mark to word */
  --s2: 8px;    /* inside a label */
  --s3: 14px;   /* between parts */
  --s4: 28px;   /* one rule */
  --s5: 56px;   /* margin */
  --s6: 112px;  /* between bands */
  --rule-step: 28px; /* the ruling's line height */
  --tap: 44px;  /* the smallest thing a finger presses */

  /* ── depth: hard offset shadows, no blur, only on what can be pressed ── */
  --sh-big: 6px;    /* buttons and big parts: sinks 6 px onto it */
  --sh-small: 4px;  /* small buttons, chips */
  --sh-thumb: 3px;  /* the slider's thumb */
  --lift: -3px;     /* hover lifts the face 3 px off its shadow */

  /* ── focus ring: ultramarine, always on page or desk ── */
  --ring-w: 2px;
  --ring-gap: 3px;  /* offset; a pressable part adds its shadow so the ring clears the ink block */

  /* ── motion: the sheet draws four (§ 10), the other six are worked out from the material ──
     Never bounces. Words never move on their own. Reduced motion: every change is a cut. */
  --t-enter: 240ms;       /* drawn: onto the stack, 0 · 120 · 240 ms, ease out */
  --t-enter-step: 120ms;
  --t-press: 140ms;       /* drawn: sinks, ticks, 0 · 60 · 140 ms, straight (linear) */
  --t-press-step: 60ms;
  --t-load: 1200ms;       /* drawn: the pencil draws, 0 · 600 · 1,200 ms, repeating */
  --t-load-step: 600ms;
  --t-leave: 320ms;       /* drawn: stamped, filed, 0 · 160 · 320 ms, ease in */
  --t-leave-step: 160ms;
  --t-hover: 120ms;       /* worked out: lift 3 px and the pencil underlines; the enter's first step, ease out */
  --t-type: 0ms;          /* worked out: words never move; the caret is the pencil and each letter is a cut */
  --t-drag: 0ms;          /* worked out: the value follows the hand with no easing and no lag */
  --t-scroll: 0ms;        /* worked out: native scrolling, nothing eased, the paper moves with the hand */
  --t-break: 240ms;       /* worked out: the circled query is drawn at the enter's pace; its words arrive as a cut */
  --t-done: 140ms;        /* worked out: the tick is drawn at the press's pace, straight, the moment it lands */
  --ease-out: cubic-bezier(.2, .7, .3, 1);  /* a page dropping onto the stack: fast, then settled, never past */
  --ease-in: cubic-bezier(.55, 0, .85, .35); /* filed away: gathers speed as it leaves */
  --ease-press: linear;                      /* straight: a press is the hand, not a spring */

  /* ── a demo's simulated work (a save, a hand-in, a coach reading): time passing, not motion,
     so reduced motion leaves it as it is ── */
  --work-demo: 1200ms;
}

/* Reduced motion: every change is a cut. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --t-enter: 0ms; --t-enter-step: 0ms;
    --t-press: 0ms; --t-press-step: 0ms;
    --t-load: 0ms; --t-load-step: 0ms;
    --t-leave: 0ms; --t-leave-step: 0ms;
    --t-hover: 0ms; --t-type: 0ms; --t-drag: 0ms; --t-scroll: 0ms; --t-break: 0ms; --t-done: 0ms;
  }
}
