/* ============================================================
   AtomAdd design tokens.

   The only place design values are defined. No other file may hardcode a
   colour, font name, size, spacing value, width, radius or shadow.
   Use var(--token) everywhere else.

   Visual direction (first approved version): graphite black, warm mineral
   white, one controlled signal orange. Square geometry. Self-hosted Geist and
   Geist Mono from 2026-08-10; see briefs/TYPOGRAPHY_SYSTEM_BRIEF.md.
   ============================================================ */

:root {
  /* --- Palette. Approved values, referenced by the semantic tokens below. --- */
  --graphite-950: #0f1110;
  --graphite-900: #171a18;
  --graphite-800: #242824;
  /* Between graphite 800 and the minerals. Exists so restrained structural
     marks on a graphite ground stay legible without reading as text. */
  --graphite-700: #3e453d;
  --mineral-50: #f4f1e8;
  --mineral-100: #e8e3d7;
  --mineral-300: #c8c1b2;
  --signal: #ff5a2f;
  --signal-dark: #c93413;
  /* Small orange TEXT on a mineral ground only. --signal-dark measures
     4.12:1 at 12px, below AA; this clears it. Never used as a fill. */
  --signal-text: #93250c;

  /* --- Semantic colour. --- */
  --color-bg: var(--mineral-50);
  --color-surface: var(--mineral-100);
  --color-fg: var(--graphite-950);
  --color-fg-muted: var(--graphite-800);
  --color-border: var(--mineral-300);

  --color-bg-dark: var(--graphite-950);
  --color-surface-dark: var(--graphite-900);
  --color-fg-dark: var(--mineral-50);
  --color-fg-dark-muted: var(--mineral-300);
  --color-border-dark: var(--graphite-800);

  --color-accent: var(--signal);
  --color-accent-strong: var(--signal-dark);
  --color-accent-text: var(--signal-text);   /* small orange text on light */
  --color-layer: var(--graphite-700);        /* inactive hero layer bars */

  /* Light-section blending. A single warm-to-neutral step between the two light
     grounds, and a wash that lets an image meet its ground without a hard edge.
     Deliberately near-invisible: these must never read as a gradient. */
  --color-bg-blend: color-mix(in srgb, var(--mineral-50) 82%, var(--mineral-100));
  --image-edge-wash: color-mix(in srgb, var(--color-surface) 92%, transparent);
  /* Cools the dominant blue of the dental finishing image toward the graphite
     and mineral system without draining the gloves to grey. */
  --image-tone-strength: 0.14;
  --color-focus: var(--signal-dark);
  --color-focus-dark: var(--signal);

  /* --- Type families: self-hosted Geist, with the previous system stack
         kept behind it as the fallback while the file loads or if it fails.
         The @font-face programs are declared at the top of site.css. --- */
  --font-sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* --- Type scale. Character comes from scale and spacing, not a typeface. --- */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.125rem;
  --text-lg: 1.375rem;
  --text-xl: 1.75rem;
  --text-2xl: 2.25rem;
  --text-3xl: 3rem;
  --text-4xl: 4rem;
  --text-5xl: 5.25rem;

  /* Desktop hero headline. Scales with the viewport so the headline holds a
     settled line count across the desktop range. The floor keeps it readable
     at 1024; the ceiling stops it overpowering 1440 and above. */
  --text-hero-desktop: clamp(2.5rem, 3.9vw, 3.5rem);

  /* Mobile and tablet hero headline. Scales with the viewport so the longest
     word in the headline always fits the copy column: below about 400px a flat
     3rem can push a long word past the gutter and make the document scroll
     sideways. Reaches the full 3rem from roughly 400px upward and holds it
     through the tablet range, where the copy column narrows to 56%. */
  --text-hero-mobile: clamp(2.375rem, 12vw, 3rem);
  /* Capability hero headings on the narrowest phones only. `Stereolithography`
     is a single 17-character word measuring 301px at the 36px mobile heading
     size in Geist, and the column is 280px at a 320px viewport, so it overflowed
     by 21px. Measured: it fits unaided from a 344px viewport up, so this applies
     below that and nowhere else. Every other heading size is unchanged. */
  --text-hero-narrow: 2rem;

  --weight-normal: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  --leading-flush: 0.98;
  --leading-tight: 1.06;
  --leading-snug: 1.3;
  --leading-normal: 1.6;

  --tracking-tight: -0.03em;
  --tracking-flat: 0em;
  --tracking-wide: 0.1em;
  --tracking-wider: 0.16em;

  /* --- Spacing scale (4px base). --- */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* --- Layout. --- */
  --page-max: 82rem;      /* wide desktop shell */
  --measure: 38rem;       /* readable text measure */
  --measure-wide: 46rem;

  /* Capability pages sit between the readable measure and the full shell.
     Wide enough for a four-column fact band and three-column stages, narrow
     enough that the page still reads as a document rather than a dashboard.
     Text inside keeps its own max-width, so the reading measure is unaffected. */
  --capability-max: 64rem;
  /* Widened from 20rem on 2026-08-10 with the Geist switch. Geist sets wider
     than the system stack, which pushed three capability-split headings onto
     an extra line and broke `Matched to the requirement.` into `Matched` /
     `to the` / `requirement.`. 22rem is the smallest value that returns MJF,
     SLA and DLP to their previous line counts; 24rem was tested and changes
     more than the regression required. */
  --capability-aside: 22rem;   /* heading column in the two-column split */
  /* The request journey's summary column. Wide enough for a requirement label
     and its value on one line at 1024px without squeezing the step beside it,
     which is where the fields and the reading measure actually live. */
  --journey-summary: 21rem;
  --page-gutter: var(--space-5);
  --page-gutter-lg: var(--space-12);
  --header-height: 4rem;

  /* --- Sticky header. -----------------------------------------------------
     The header stays at the top of the viewport at every width, so an in-page
     anchor would otherwise come to rest underneath it. This is the measured
     header height, 83px closed at every width, plus clearance, and it is the
     scroll offset applied to every anchor target. Keep it in step if the
     header's height changes. --- */
  --header-offset: 5.75rem;

  /* Just above the tablet breakpoint the full header does not fit on one line:
     the wordmark, four navigation labels and the request action need more width
     than 768px allows, so the action wraps to a second row and the header
     stands at 142px. This is how the header already behaved before it became
     sticky. From 941px up it returns to one row and --header-offset.

     The upper edge of that range is measured, and it moves whenever a
     navigation label changes length. `ATOMADD-012` pushed it to 1054px when
     `Network` became `Network & Quality`; `ATOMADD-013` brought it back to
     941px when `Engineering Foundation` became `About`, which is 113px
     narrower. The bound lives beside the rule that uses it, in site.css. */
  --header-offset-tablet: 9rem;

  /* Stacking order. Only these two elements leave the normal flow, and the
     skip link must stay reachable above the header it sits over. */
  --layer-header: 100;
  --layer-skip-link: 110;

  /* Mobile menu control. A square at the comfortable minimum touch size, so
     the wordmark, the short request action and the toggle still share one row
     at 320px. The bars use --border-thick for their weight. */
  --toggle-size: 2.75rem;
  --toggle-bar-width: 1.125rem;
  --toggle-bar-gap: 0.3125rem;

  /* --- Lines and geometry. Square by intent. --- */
  --radius-none: 0;
  --radius-tag: 1px;      /* rectangular tags, never pills */
  --border-hair: 1px;
  --border-thick: 2px;
  --rule-accent: 3px;

  /* --- Motion. Restrained; every use must respect prefers-reduced-motion. --- */
  --motion-fast: 120ms;
  --motion-base: 200ms;
  --motion-ease: cubic-bezier(0.2, 0, 0, 1);
  /* The general crossfade. Slow enough to read as a dissolve rather than a cut,
     short enough that two images are never both half-present for long. */
  --motion-crossfade: 800ms;
  /* `--hero-crossfade` is gone as of `ATOMADD-043`. It existed only because a
     finite four-image run had to finish inside five seconds to justify carrying
     no pause control, which forced the hero below the shared 800ms. The hero
     now loops and carries a control, so there is no budget to fit and no reason
     for a second crossfade value: it fades at --motion-crossfade again. */

  /* Homepage hero pause/resume control. `ATOMADD-043`. Square at the 44px
     minimum interactive size. The mark is drawn in CSS from these three
     measures: two bars for pause, one triangle for play. */
  --hero-toggle-size: 2.75rem;
  --hero-toggle-mark: 0.875rem;
  --hero-toggle-bar: 0.25rem;
  --hero-toggle-gap: 0.3125rem;

  /* --- Hero image scrim. Graphite at decreasing opacity, so text sits on a
         near-solid ground on the left while the parts stay clear on the right.
         Raw rgba lives here because tokens.css is the only place a colour
         value may be written. --- */
  --hero-scrim-strong: rgba(15, 17, 16, 0.97);
  --hero-scrim-mid: rgba(15, 17, 16, 0.86);
  --hero-scrim-soft: rgba(15, 17, 16, 0.18);
  --hero-scrim-mobile: rgba(15, 17, 16, 0.35);
  --hero-min-height: 30rem;

  /* --- Hero field. Values for the CSS-only layered graphic. --- */
  --layer-height: 0.5rem;
  --layer-gap: var(--space-2);
  --layer-registration: 1px;
}

/* --- Breakpoints (documentation only; CSS custom properties cannot be
       used in media queries, so these values are restated by hand in
       site.css and must be kept in step with this list).

       --bp-sm:  30rem   (480px)  small phone to large phone
       --bp-md:  48rem   (768px)  tablet
       --bp-lg:  64rem  (1024px)  laptop
       --bp-xl:  80rem  (1280px)  wide desktop

       Approach is mobile-first: base rules are the small layout, and
       media queries only add from --bp-md upward. The layout must stay
       usable and free of horizontal scrolling at 320px.
   --- */
