/* ===========================================================================
   base.css — reset, element defaults, typography, focus, utilities.
   Depends on tokens.css.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Clears the sticky header on anchor jumps.

     6.75rem -> 5rem, 2026-08-10. The old flat 108px was sized for a header
     that wrapped its nav below the brand lockup and measured ~99px. Hiding
     .site-brand__mark below 30rem (layout.css) mostly ended that, so 108px
     against a 62px header was leaving a 46px dead band above every target.

     BUT IT DOES STILL WRAP, JUST MUCH LOWER DOWN. Measured across widths:

       1280px   62px   nav on one row
        375px   62px   one row
        352px   62px   one row
        320px   81px   TWO rows

     A flat 5rem is therefore 1px short at 320px — the anchor target lands
     under the header on the narrowest phones still in use. Hence the query
     below rather than a single value. Re-measure both if a fifth nav item is
     ever added; that is what moves the wrap threshold. */
  scroll-padding-top: 5rem;
}

/* Below ~22rem the four nav items no longer fit beside the wordmark and the
   nav takes a second row, putting the header at 81px (measured at 320px).
   6.5rem clears that with headroom. The threshold sits at 22rem because 352px
   still measured one row — see the note above. */
@media (max-width: 22rem) {
  html { scroll-padding-top: 6.5rem; }
}

/* A branded selection colour — a small, cheap detail the reference bothers
   with, and one of the things that makes a site feel considered rather than
   templated. Plum ink on cream, straight from the logo. */
::selection {
  color: var(--c-plum-ink);
  background: var(--c-cream);
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-body);
  /* MEDIUM, not regular. Satoshi runs light at 400; at body size on a warm
     paper ground it reads thin. 500 is the weight this face wants for prose.
     Changed 2026-08-18. */
  font-weight: var(--fw-medium);
  line-height: var(--lh-body);
  /* NO -webkit-font-smoothing HERE, DELIBERATELY. It used to say `antialiased`
     (with -moz-osx-font-smoothing: grayscale). Removed 2026-08-18: on macOS
     that switches off subpixel rendering, and the documented side effect is
     that every glyph renders THINNER AND LIGHTER than the browser default.
     Applied to body, it was quietly thinning all text on the site. Do not
     put it back;
     if a specific element ever needs it, scope it to that element. */
}

/* --- Headings ---------------------------------------------------------------
   Satoshi throughout, so headings can carry real weight. The hierarchy is
   built from the two extreme steps only: --step-statement and --step-section.
   Deliberately no intermediate sizes — see the note in tokens.css. */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-section);
  line-height: var(--lh-section);
  color: var(--color-heading);
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: var(--step-section); }
h2 { font-size: var(--step-section); }
h3 { font-size: var(--step-body); font-weight: var(--fw-bold); letter-spacing: 0; }

h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: var(--fw-bold);
  font-size: var(--step-body);
  line-height: var(--lh-body);
  color: var(--color-heading);
  margin: 0;
}

p { margin: 0; max-width: var(--measure); text-wrap: pretty; }
ul, ol, dl, figure, blockquote { margin: 0; }

a {
  color: var(--color-link);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.2em;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--color-link-hover); }

img, picture, svg, video { display: block; max-width: 100%; height: auto; }

button { font: inherit; color: inherit; cursor: pointer; }

/* --- Focus ---------------------------------------------------------------- */
:focus-visible {
  outline: var(--focus-width) solid var(--color-focus);
  outline-offset: var(--focus-offset);
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* On mulberry and near-black blocks the raspberry ring is too close in hue. */
.block--hero :focus-visible,
.block--dark :focus-visible,
.site-header :focus-visible,
.site-footer :focus-visible { outline-color: var(--color-focus-on-dark); }

/* --- The press ------------------------------------------------------------
   ADDED 2026-08-10, and it is the cheapest real improvement on the site.

   Before this, exactly ONE control on the whole page answered being pressed
   (.carousel__btn). Everything else — pills, nav, roster tabs, the play
   facade, the CTA, footer links, index links — changed on :hover and then did
   nothing at all on the press itself.

   That matters most where there is no hover to fall back on. On a phone the
   entire site gave zero feedback between touching a control and the page
   already having changed, which reads as latency whether or not anything is
   actually slow. Feedback belongs on pointer-DOWN; the click is the commit,
   not the acknowledgement.

   One rule, one property, and deliberately a small number: 0.97 is felt rather
   than seen. Scale rather than colour so it composes with the hover colours
   each control already has instead of fighting them.

   NOT inside a no-preference query, on purpose. The reduced-motion block below
   flattens transition-duration to 0.01ms, which turns this into an instant
   state change — the correct behaviour there, not a missing one. */
:is(.pill, .site-nav a, .selector__tab, .cta__link, .social a,
    .index-table a, .scroll-cue, .site-brand, .skip-link):active {
  transform: scale(0.97);
}

/* The play facade is a big surface, so it takes a smaller number — the same
   0.97 on a 700px poster reads as the whole video flinching. */
.video__frame:active:not([disabled]) { transform: scale(0.994); }

:is(.pill, .site-nav a, .selector__tab, .cta__link, .social a,
    .index-table a, .scroll-cue, .site-brand, .skip-link, .video__frame) {
  transition-property: transform;
  transition-duration: 100ms;
  transition-timing-function: var(--ease-out);
}

/* --- Contrast -------------------------------------------------------------
   The site leans on two soft greys: .h-duo__rest at 68% of the heading colour
   (6.22:1) and --color-text-muted at 6.82:1 on paper. Both were darkened on
   2026-08-18 — they were 52% (3.66:1) and #7D6C76 (4.75:1), which passed AA
   and still made the page read faint.

   A reader who has asked their OS for more contrast was getting exactly the
   same page. Here the muted tones collapse back to full-strength ink and the
   hairline rules gain weight, so structure stays legible without colour doing
   the work. Nothing moves and nothing is hidden — this only stops the design's
   quiet greys from being quiet. */
@media (prefers-contrast: more) {
  :root {
    --color-text-muted: var(--c-plum-ink);
    --color-rule: var(--c-plum-ink);
  }
  .panel--tint  { --color-text-muted: var(--c-plum-ink); }
  .panel--peach { --color-text-muted: var(--c-plum-ink); }
  .panel--hero,
  .panel--dark  { --color-text-muted: var(--c-cream); }

  .h-duo__rest { color: currentColor; }
  .selector__tab[aria-selected="false"] { opacity: 0.85; }
  .carousel__item { --dim: 0.3; }
}

/* --- Transparency ---------------------------------------------------------
   The header is the one translucent surface on the site (see layout.css). A
   reader who has asked for less transparency gets the solid mulberry bar it
   used to be — the blur is refinement, never the thing carrying legibility. */
@media (prefers-reduced-transparency: reduce) {
  .site-header {
    background: var(--block-hero-bg);
    -webkit-backdrop-filter: none;
            backdrop-filter: none;
  }
}

/* --- Motion --------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  /* The ticker is decorative: park it rather than let it strobe. */
  .ticker__track { animation: none !important; transform: none !important; }
}

/* ===========================================================================
   TYPE UTILITIES — the reference's voice lives here
   =========================================================================== */

/* The hero statement. First person, large, tight. Not a name, not a tagline. */
.statement {
  font-family: var(--font-display);
  font-size: var(--step-statement);
  font-weight: var(--fw-medium);
  line-height: var(--lh-statement);
  letter-spacing: var(--tracking-statement);
  max-width: 34ch;
  margin: 0;
  text-wrap: pretty;
  /* MUST inherit. .statement sits on the mulberry hero and on paper panels, so
     it has to take the colour of whatever field it is on. When this became an
     <h1> it picked up `h1 { color: var(--color-heading) }` above — near-black on
     mulberry, measured at 1.9:1, a severe contrast failure caused by nothing
     more than the element type. Do not replace this with a fixed colour. */
  color: inherit;
}

/* Ruby's star mark opening the hero statement, in place of the ✦ glyph it
   replaced (2026-08-09).

   Sized in em so it scales with --step-statement's fluid clamp — the thing it
   replaced was type, and this has to behave like type or it drifts out of
   proportion between breakpoints. 0.78em rather than 1em because the artwork
   is a squared PNG carrying its own internal padding, so a full 1em box
   renders a mark noticeably larger than the cap height beside it.

   The inner img is display:block on purpose: an inline <img> sits on the text
   baseline and contributes a descender gap, which lifted the mark off the line
   it is meant to open. vertical-align on the wrapper does the optical seating
   instead.

   THERE IS NO MARGIN, AND THAT IS NOT AN OVERSIGHT. Fixed 2026-08-10.

   This carried `margin-inline-end: 0.12em` and rendered a gap of 0.387em —
   measured on the live hero, 17.8px at the statement's 46px, more than three
   times the intended value. The cause is upstream: reveal.js tokenise() treats
   this <picture> as its own token and appends a REAL space text node after it,
   which is correct and load-bearing (it is what keeps the accessible string
   intact). So the margin was stacking on top of a full word space.

   At 46px the difference is plainly visible — the star read as a detached
   bullet rather than as a mark opening the sentence. The word space alone is
   the right amount. If reveal.js ever stops inserting it, this needs ~0.25em
   back, not 0.12. */
.statement__mark {
  display: inline-block;
  width: 0.78em;
  vertical-align: -0.06em;
}

.statement__mark img {
  display: block;
  width: 100%;
  height: auto;
}

/* Two-tone single-line heading: label in ink, descriptor in grey, same size,
   same line. Colour alone carries the distinction. */
.h-duo {
  font-size: var(--step-section);
  font-weight: var(--fw-medium);
  letter-spacing: var(--tracking-section);
  line-height: 1.02;
  margin: 0;
  max-width: 20ch;
  text-wrap: balance;
}

/* TWO LINES, not one. The reference puts a <br> between label and descriptor;
   the first pass ran them together, which loses the distinction at narrow
   widths. display:block forces the break, so the markup stays two plain spans. */
.h-duo__label {
  display: block;
  color: var(--color-heading);
}

/* Reduced-strength ink, not a separate grey — the reference uses its text
   colour at 50%. Legible here only because --step-section now starts at 28px,
   clearing the WCAG large-text threshold where 3:1 applies. If that size is
   ever lowered below 24px, revert this to a solid AA-safe colour. */
/* 68%, raised from 52% on 2026-08-18. At 52% the grey half of every heading
   measured 3.66:1 — legal for large text, but visibly washed, and it set the
   tone for the whole page reading faint. 68% measures 6.22:1 and still reads
   as clearly the quieter of the two tones. */
.h-duo__rest { color: color-mix(in srgb, var(--color-heading) 68%, transparent); }

@supports not (color: color-mix(in srgb, red, blue)) {
  .h-duo__rest { color: var(--color-text-muted); }
}

/* 10px wide-tracked caps. Pills, captions, ticker, table meta. */
.micro {
  font-size: var(--step-micro);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-micro);
  line-height: var(--lh-micro);
  text-transform: uppercase;
}

/* --- Utilities ------------------------------------------------------------ */

.u-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.u-measure { max-width: var(--measure); }

/* Lead paragraph — the first thing read after a project heading. See
   --step-lead in tokens.css for why this rung exists. Slightly tighter
   leading than body because the type is bigger, and a wider measure so it
   fills its column rather than trailing off. */
.lead {
  font-size: var(--step-lead);
  line-height: 1.45;
  max-width: 46ch;
}

/* --- Arrow icon ------------------------------------------------------------
   WHY THIS EXISTS. Every arrow on the site used to be a text entity — &rarr;,
   &larr;, &darr;, &#8599;. Satoshi contains no arrow glyphs, so all of them
   silently fell back to a system font: measured, U+2192 set at 100px rendered
   91.2px wide where Satoshi's own 'A' is 64.5px. That is a different typeface
   sitting inside 10px letter-spaced caps — hairline against the 1.5px pill
   borders, off-baseline, and a different shape on every OS. It was the single
   loudest "unfinished" signal on the page.

   One mask, drawn at the same stroke weight as the borders it sits beside, in
   currentColor so it inherits every colour ground automatically. Rotation
   gives the other directions, so there is exactly one shape to maintain.

   stroke-width is 2.75 on a 24-unit viewBox deliberately: these render at
   ~11px next to 10px micro-caps, where a 2 would fall below a pixel and look
   thin all over again. */
.icon {
  display: inline-block;
  /* 1.15em -> 1.5em, 2026-07-28. At 1.15 the arrow matched the cap height of
     the 10px micro caps beside it almost exactly — technically correct, and it
     read as timid. This site sets a 60px+ hero statement and is confident
     everywhere else, so a matched-height arrow looked like a fallback glyph
     rather than a chosen mark. Sizing it half again above the text gives it
     presence; the stroke drops to 2.25 below to hold the same optical weight,
     since a thicker stroke scaled up would have read as heavy rather than
     large. vertical-align tracks this — change the two together. */
  width: 1.5em;
  height: 1.5em;
  flex: none;
  vertical-align: -0.34em;
  background-color: currentColor;
  --icon-src: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12h15M13 6l6 6-6 6'/%3E%3C/svg%3E");
  -webkit-mask-image: var(--icon-src);
          mask-image: var(--icon-src);
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  /* Direction travels as a CUSTOM PROPERTY, not as a competing `transform`
     declaration. Transform ownership is the trap this project has already
     paid for twice — ONE OWNER PER TRANSFORM: an animation or a later rule setting
     `transform` on the same element silently drops whatever was here. Two
     consumers do exactly that — .pill__arrow's optical nudge and the scroll
     cue's cue-bob keyframes — so they compose rotate(var(--icon-rotate)) into
     their own transform instead of fighting this one. */
  transform: rotate(var(--icon-rotate, 0deg));
}

/* The base shape points east. */
.icon--s  { --icon-rotate: 90deg; }
.icon--n  { --icon-rotate: -90deg; }
.icon--ne { --icon-rotate: -45deg; }

/* Without mask support this would render as a bare coloured square, which is
   worse than the glyph it replaced. Hide it there instead — every arrow is
   aria-hidden decoration beside a real text label, so nothing is lost. */
@supports not ((-webkit-mask-image: none) or (mask-image: none)) {
  .icon { display: none; }
}

.u-visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: 0; left: var(--space-s);
  z-index: calc(var(--z-header) + 1);
  padding: var(--space-2xs) var(--space-s);
  background: var(--c-cream);
  color: var(--c-plum-ink);
  font-weight: var(--fw-bold);
  transform: translateY(-110%);
  transition: transform var(--dur-fast) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

