/* tiresizeinches.com — design tokens
   Direction: a workshop measuring instrument. The tire is drawn to scale, the numbers are
   read off it, and every comparison is an overlay you can see.

   Ported from proposals/c ("shop gauge"), which the operator picked on 2026-08-26.
   Everything below is derived from that one sentence:
   - the ground is machined steel, not cream and not ink-on-white;
   - the answer sits on ONE dark inset instrument face — the deliberate departure;
   - the accent is instrument amber, the colour a scale is engraved and filled with, and it
     is only ever a signal (a delta, a live value, a focus ring), never a decorative field;
   - the mono face is functional: a size code is a fixed-width string and a column of
     figures must not jitter when it changes.
*/

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('./fonts/archivo.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-400.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-500.woff2') format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('./fonts/ibm-plex-mono-600.woff2') format('woff2');
}

:root {
  /* --- palette, as roles ------------------------------------------------ */
  --paper:        #edf0f2;   /* the page: cold-rolled steel, not cream         */
  --paper-edge:   #e2e7ea;
  --surface:      #ffffff;   /* panels the content sits on                     */
  --surface-sunk: #f4f6f7;   /* zebra rows, inset wells                        */
  --ink:          #12191c;   /* body ink                                       */
  --ink-2:        #4a585f;   /* secondary ink                                  */
  --rule:         #c7d0d5;
  --rule-strong:  #78888f;   /* graduations, table head rule, control borders  */

  --face:         #0f1a1f;   /* the instrument face — the one dark mass        */
  --face-2:       #16262d;
  --face-ink:     #e8f1f4;
  --face-ink-2:   #9db4bd;   /* secondary ink on the face                      */

  --accent:       #a83f00;   /* engraved amber, on light                       */
  --accent-soft:  #fbeadf;
  --accent-lit:   #ffb43d;   /* the lit scale, only on --face                  */

  --under:        #0a666e;   /* an undersize delta — smaller than the reference */
  --under-lit:    #5fd2dd;   /* the same signal on the face                    */
  --over:         #a83f00;   /* an oversize delta — larger than the reference  */
  --over-lit:     #ffb43d;

  /* the tolerance band is a scale, not a traffic light: it reads magnitude and
     direction, in the same two signals the deviation bars use. */
  --band-well:    #eef1f3;
  --band-zero:    #a83f00;

  /* --- type ------------------------------------------------------------- */
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  /* 17px base, ratio 1.2, rounded to whole pixels so hairlines stay crisp */
  --t-xs:   13px;
  --t-sm:   14px;
  --t-base: 17px;
  --t-md:   20px;
  --t-lg:   25px;
  --t-xl:   30px;
  --t-2xl:  36px;
  --t-3xl:  43px;
  --t-read: 56px;   /* the headline figure on the instrument face */

  /* --- spacing, 4px grid ------------------------------------------------ */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --measure: 68ch;
  --page: 1220px;

  /* --- shape: machined radii, one small and one for housings ------------ */
  --r-sm: 3px;
  --r-md: 8px;
  --r-lg: 14px;
  --r-pill: 999px;

  /* --- depth: a housing sits on the page, a well sits in it ------------- */
  --lift:  0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(18,25,28,.10),
           0 8px 24px -14px rgba(18,25,28,.35);
  --sunk:  0 1px 3px rgba(18,25,28,.20) inset;
  --face-lift: 0 1px 0 rgba(255,255,255,.10) inset,
               0 14px 32px -18px rgba(15,26,31,.85);

  /* --- motion ----------------------------------------------------------- */
  --e-out:  cubic-bezier(.2,.7,.3,1);
  --e-snap: cubic-bezier(.3,1.3,.5,1);
  --d-fast: 140ms;
  --d-mid:  260ms;
  --d-slow: 200ms;
  --d-draw: 520ms;

  /* the focus ring is deliberately instant — see DESIGN.md, motion inventory */
  --focus: 0 0 0 2px var(--surface), 0 0 0 5px var(--accent);
  --focus-dark: 0 0 0 2px var(--face), 0 0 0 5px var(--accent-lit);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f4f7f8 0, var(--paper) 260px),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.55;
  font-synthesis-weight: none;
  padding-bottom: 50px;   /* the anchor unit's reserved height */
}

h1, h2, h3 { line-height: 1.16; margin: 0 0 var(--s-3); font-weight: 700; letter-spacing: -.015em; }
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-md); }
/* one step down on a phone: a three-line h1 pushes the readout most of a fold, and on this
   site the readout IS the page */
@media (max-width: 480px) {
  h1 { font-size: var(--t-xl); }
  h2 { font-size: var(--t-lg); }
}
p  { margin: 0 0 var(--s-4); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

:where(a, button, input, select, summary, [tabindex]):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: var(--r-sm);
}

.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

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

.skip {
  position: absolute; left: var(--s-3); top: -60px; z-index: 60;
  background: var(--surface); color: var(--ink); font-weight: 600;
  padding: var(--s-3) var(--s-4); border-radius: var(--r-sm);
  box-shadow: var(--lift); text-decoration: none;
  transition: top var(--d-fast) var(--e-out);
}
.skip:focus { top: var(--s-3); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
