/* ===========================================================================
   tokens.css — design tokens only. No selectors beyond :root.
   Ruby Reilly / Rue Stars Animations portfolio.

   BRAND COLOURS ARE MEASURED, NOT ASSUMED.
   Every --c-* value except --c-paper and the --c-tint derivatives was
   sampled directly from "my logo/My Logo brand.png" by decoding the PNG and
   counting opaque pixels. The brief calls the logo "purple"; the file is a deep
   mulberry / plum-magenta and also carries cream, raspberry, violet and peach.

   TYPE VOICE — decided 2026-07-26.
   Satoshi throughout, no Concert One. Concert One is a rounded single-weight
   display face; setting the 40-word hero statement at ~46px in it reads as a
   kids' brand rather than a working animator. Satoshi is a geometric
   grotesque (free, Fontshare) with a real weight range. The personality comes
   from the colour blocking, the scale contrast and the scalloped CTA — not from
   the letterforms.
   =========================================================================== */

:root {
  /* --- Brand: sampled from the logo ------------------------------------- */
  --c-plum:      #6D1D48;  /* dominant, ~25% of opaque logo pixels */
  --c-plum-ink:  #280D24;  /* logo outlines */
  --c-violet:    #855188;  /* logo eye/blush shapes */
  --c-raspberry: #D81159;  /* logo lettering keyline */
  --c-cream:     #F8EA9F;  /* logo lettering fill */
  --c-peach:     #EFBEA3;  /* logo face fill */

  /* --- Derived neutrals (not sampled — flagged) ------------------------- */
  --c-paper:     #FDFBF6;  /* warm off-white page base, never pure white */
  --c-tint:      #F6EDE7;  /* mulberry-warmed off-white for alternating blocks */
  --c-hairline:  #DFD3CC;  /* rule colour for the ruled-row lists */

  /* --- Colour blocks ---------------------------------------------------
     Sections are full-bleed colour, not white boxes on white. This is the
     single biggest change from the first pass. */
  --block-hero-bg:   var(--c-plum);
  --block-hero-fg:   var(--c-cream);
  --block-paper-bg:  var(--c-paper);
  --block-tint-bg:   var(--c-tint);
  --block-ticker-bg: var(--c-peach);
  --block-ticker-fg: var(--c-plum-ink);
  --block-dark-bg:   var(--c-plum-ink);
  --block-dark-fg:   var(--c-cream);

  /* --- Semantic layer -------------------------------------------------- */
  --color-bg:            var(--c-paper);
  --color-text:          var(--c-plum-ink);
  /* The grey half of two-tone headings, plus notes and micro captions.
     Mulberry-tinted rather than neutral so it belongs to the palette.
     MUST clear 4.5:1 on --c-paper: this token is used at 10px and 12px, so the
     large-text 3:1 allowance does not apply. History: #9A8A92 measured 3.16:1,
     a real AA failure; #7D6C76 fixed that at 4.75:1.

     DARKENED 2026-08-18 to #645460 — 6.82:1 on paper, 6.10:1 on tint, because
     at small sizes it still took effort to read. 4.75:1 passed AA but AA's
     4.5 line is calibrated for body-sized text, and this token is used at
     10px and 12px, where passing and reading comfortably are not the same
     thing. Do not lighten it without re-measuring at the SMALLEST size it is
     used at.

     THIS TOKEN IS THE PAPER VALUE ONLY. Every other ground overrides it in
     panels.css — .panel--tint, .panel--peach, and .panel--hero/.panel--dark
     each set their own so the grey is tuned per background. Change one and
     check the others; the ratios are noted beside each. */
  --color-text-muted:    #645460;
  --color-heading:       var(--c-plum-ink);
  --color-link:          var(--c-plum-ink);
  --color-link-hover:    var(--c-raspberry);
  --color-rule:          var(--c-hairline);
  --color-focus:         var(--c-raspberry);
  --color-focus-on-dark: var(--c-cream);

  /* --- Type ------------------------------------------------------------
     One family, full weight range. Satoshi via Fontshare. */
  --font-body: 'Satoshi', -apple-system, BlinkMacSystemFont, 'Segoe UI',
               system-ui, sans-serif;
  --font-display: var(--font-body);

  /* EXTREME SCALE CONTRAST — the mechanic that stops this reading generic.
     A ~46px statement against 10px UI text, and almost nothing in between.
     Do not add intermediate steps to "smooth" this out; the jump is the point. */
  --step-micro:     0.6875rem;                                  /* 11px — pills, ticker, captions */
  --step-small:     0.75rem;                                    /* 12px — meta, table cells */
  --step-body:      clamp(1rem, 0.97rem + 0.14vw, 1.0625rem);   /* 16–17px */
  /* THE MISSING RUNG, added 2026-08-18. The scale deliberately jumped from a
     ~45px heading straight to 12–17px body with nothing between, and that gap
     is what made sections read as empty: the eye has nowhere to land between
     the headline and the small print, so the space around the small text reads
     as void rather than breathing room. Used for the lead paragraph of each
     project — Ruby's own blurbs — and nothing else. Keep it rare; if this
     starts appearing everywhere the scale contrast that gives the site its
     character is gone. */
  --step-lead:      clamp(1.125rem, 1.04rem + 0.42vw, 1.375rem);  /* 18–22px */
  /* 28–45px. Raised from 22–31px to match the reference's 45px section
     headings. This also matters for contrast: the second, lighter half of a
     two-tone heading only clears WCAG at the 3:1 large-text threshold, which
     needs >=24px. At the old 22px floor it would have needed 4.5:1 and failed. */
  --step-section:   clamp(1.75rem, 1.2rem + 2.1vw, 2.8125rem);
  --step-statement: clamp(1.75rem, 1.02rem + 3.5vw, 2.875rem);  /* 28–46px — the hero statement */

  /* 1.14 -> 1.09, 2026-07-27. Measured off the agreed design reference:
     its 55px display type runs 60px leading, exactly 1.09, and its 40px
     headings run 1.10. At the statement's 46px this closes each line by about
     2px, which is what makes large type read as one block rather than as
     stacked lines. Only .statement consumes this (base.css:114). */
  --lh-statement: 1.09;
  /* DELIBERATELY UNCHANGED at 1.18. It looks like the display partner of
     --lh-statement, but the section headings do not use it: .h-duo sets its
     own line-height: 1.02, already tighter than the reference's 1.09. What
     --lh-section actually reaches is h1/h2/h3 that are NOT .h-duo — chiefly
     the small bold h3 at --step-body. Tightening it would squeeze 15px
     headings, the opposite of what the measurements suggest: the reference
     runs its 24px sub-headings at 1.30, looser rather than tighter. */
  --lh-section:   1.18;
  --lh-body:      1.55;
  --lh-micro:     1.2;

  --fw-regular:  400;
  --fw-medium:   500;
  --fw-bold:     700;
  --fw-black:    900;

  /* Tight on display, wide on micro — the micro-caps look in the reference. */
  /* -0.022em -> -0.006em, 2026-07-27. The statement was over-tightened.
     Measured on the reference: its 55px display type carries only -0.2px of
     negative tracking (-0.0036em) — very close to normal — while -0.022em at
     46px works out near -1px, roughly five times tighter at a SMALLER size.
     Tight tracking on a 40-word first-person paragraph costs legibility and
     buys nothing.

     Also improves .contact-email (components.css:317), which sets Ruby's
     email address at this same display size. Negative tracking on an address
     is actively unhelpful — characters need to stay individually readable. */
  --tracking-statement: -0.006em;
  /* Unchanged. The reference's 40px headings run -0.8px = -0.02em, which this
     already matches almost exactly. Nothing to correct.

     THE 3x GAP BETWEEN THESE TWO IS DELIBERATE — do not "fix" it. The
     2026-08-10 audit flagged that .statement renders at 46px with -0.006em
     while .h-duo renders at 45px with -0.018em: effectively the same size on
     the same page, tracked three times apart, which normally means one of them
     has drifted.

     Neither has. They were measured separately off the reference, and the
     reference itself tracks its display sentence and its section headings
     differently, because they do different jobs:

       .statement  is a 40-word first-person PARAGRAPH set large. Tight
                   tracking on running prose costs legibility and buys nothing
                   — this token was already walked back once, from -0.022em,
                   for exactly that reason (see the note above).
       .h-duo      is a two-or-three-word LABEL. Tight tracking is what makes a
                   short heading read as one object rather than as spaced-out
                   letters.

     The shared size is a coincidence of where the two fluid clamps happen to
     land at this viewport, not evidence of a mistake. If they are ever
     unified, unify on PURPOSE, not on pixel size. */
  --tracking-section:   -0.018em;
  /* Unchanged. Not comparable to the reference's +0.03em uppercase tracking:
     that is measured at 30-40px, whereas this is applied at 10px, where wide
     tracking is a legibility requirement rather than a style choice. */
  --tracking-micro:     0.09em;

  /* --- Space ------------------------------------------------------------ */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs:  0.75rem;
  --space-s:   1rem;
  --space-m:   1.5rem;
  --space-l:   2rem;
  --space-xl:  3rem;
  --space-2xl: 4.5rem;
  /* 7rem -> 5rem, 2026-07-27. This is the section padding (panels.css .panel),
     applied top AND bottom across eight sections — so it was contributing
     roughly 1790px of pure whitespace to a 5869px page.

     Measured against the agreed design reference: that site runs about
     5.4 viewport-heights end to end, this one ran about 7.3. Cutting 2rem
     recovers close to a full screen of scrolling without removing a single
     piece of content. Do not push below ~4rem — the generous air between
     colour grounds is what stops the full-bleed blocks reading as stacked
     banners. */
  --space-3xl: 5rem;

  /* --- Layout ---------------------------------------------------------- */
  --measure:   58ch;
  --container: 1240px;
  --gutter: clamp(1.125rem, 4vw, 2.75rem);

  /* --- Shape ------------------------------------------------------------
     Cards are gone. The only radii left are the pill buttons, the media
     blocks, and the scallop. */
  /* 10px on media, pill on buttons — both read off the reference's own inline
     styles (border-radius: 10px on imagery, 100px on the outlined buttons). */
  --radius-media: 10px;
  --radius-pill:  999px;
  --scallop-size: 56px;   /* width of one scallop bump */
  --scallop-rise: 28px;   /* how far the bumps rise above the CTA */

  /* --- Motion ----------------------------------------------------------
     The full scroll-motion system lives in css/motion.css. These are its
     tokens. Read that file's header before changing any of them — the values
     are a set, not independent knobs.

     ONE IDEA: the page is a single continuous take through eight colour
     fields, and the artwork is the subject. Text leads, media lands last and
     settles longest, so the eye is always delivered to the work. */
  --dur-fast: 150ms;
  --dur-base: 280ms;
  --ease-out: cubic-bezier(0.2, 0.7, 0.3, 1);
  /* 32s -> 128s, 2026-07-28. NOT a speed change — a distance change. The track
     went from 2 groups to 8 (see the note on the ticker markup in index.html:
     at 2 groups the -50% shift left too little content to cover the viewport,
     and the banner visibly ran out of words before snapping back). The shift
     is therefore 4x longer in pixels, so the duration is 4x longer to hold the
     same ~24px/s drift. Change these two together, or the speed changes with
     the group count. */
  --ticker-duration: 128s;

  /* Entrance durations, by role. Media is deliberately ~1.5x the text so the
     artwork is still settling after the words have stopped — that lag is what
     reads as "cinematic" rather than "everything fades in at once". */
  --dur-enter-micro: 520ms;
  --dur-enter-text:  640ms;
  --dur-enter-media: 940ms;

  /* Expo-out. Most of the distance is covered early, then a long quiet
     settle. --ease-out (the UI curve) is too even to read as camera motion;
     keep both, they do different jobs. */
  --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-media: cubic-bezier(0.22, 0.88, 0.24, 1);

  /* Travel distance, by role. Deliberately NOT one value: 30px on a 45px
     heading and 30px on a 700px-wide video read as completely different
     amounts of movement, which is why a single distance felt flat. Distance
     scales with the visual mass of the thing being moved. */
  --rise-micro:  10px;
  --rise-word:   14px;
  --rise-body:   22px;
  --rise-media:  40px;
  --scale-media: 0.955;   /* media eases UP into place, never down onto the reader */

  /* Choreography. --stagger is the gap between siblings arriving; it is what
     turns a section's independent fades into one ordered sentence. */
  --stagger:      78ms;
  --stagger-word: 26ms;

  /* Continuous scroll-linked depth. Small numbers on purpose — this layer
     should be felt, not seen. */
  --parallax-media: 3.5%;   /* image drift inside its own frame */
  --parallax-zoom:  1.08;   /* the overscale that keeps that drift contained */

  /* --- The statement field (motion layer 5) ------------------------------
     The hero statement's glyph clusters lean toward the pointer. Read
     css/statement-field.css and js/statement-field.js before changing any of
     these; like the entrance tokens above they are a set, not five knobs.

     Every value is deliberately small. The effect has to survive being looked
     at for the four seconds a recruiter spends on the hero, so it is tuned to
     be noticed once and then forgotten. */
  --field-radius: 220px;    /* influence radius — about 4-5 clusters across at 46px */
  --field-pull:   6px;      /* max displacement; under one glyph width, so a line never looks broken */
  --field-scale:  0.06;     /* 1.00 -> 1.06; more and a cluster overlaps its neighbour */
  --field-lerp:   0.14;     /* per-frame approach — ~12 frames to settle. Higher snaps, lower is syrup */
  --field-engage: 0.07;     /* how fast the recede arrives once the pointer enters the hero */

  /* THE ONE VALUE WITH A HARD FLOOR. Clusters away from the pointer dim to
     this WHILE THE POINTER IS IN THE HERO — at rest the statement is full
     strength. Cream #F8EA9F over mulberry #6D1D48 rests at 8.99:1;
     composited at this alpha it measures:

       0.68   ~#CDA982   4.90:1   <- this value
       0.66   ~#C9A581   4.75:1   floor
       0.62   ~#C39C7E   4.37:1   FAILS AA

     4.5:1 is the bar, not the 3:1 large-text allowance: the reader can park
     the pointer anywhere and a dimmed word is still text they are reading.
     Re-measure if --c-cream or --block-hero-bg ever changes. */
  --field-dim:    0.68;

  --z-header: 100;

  --focus-width:  3px;
  --focus-offset: 2px;
}
