/* ==========================================================================
   tokens.css — brief.md (approved C3), family editorial-modern, archetype
   annotated-profile, signature "the strata settle and the credential line
   draws". Every value restates a brief value (house-tech-spec §3, §12).
   ========================================================================== */

:root {

  /* Colour (brief §2.1). Derivation: (1) no real-world brand colour on file
     (dossier §4.5) — nothing to echo. (2) local character: the paperwork/
     permit-stamp register, survey-rust. (3) family norm: editorial-modern's
     grid-confident type. One mode: light — no dark band anywhere, so
     --color-focus-on-band stays unset. */

  --scheme: light;

  --color-bg:          #F7F2E9;  /* paper-bone */
  --color-surface:     #EDE6D8;  /* raised bands, cards, form fields */
  --color-ink:         #231F1C;
  --color-ink-muted:   #5B5349;
  --color-accent:      #A04925;  /* survey-rust — the one colour that means "act" */
  --color-accent-ink:  #FFFFFF;

  --color-border:        #DCD2BE;  /* decorative hairlines only */
  --color-border-strong: #5B5349;  /* = ink-muted — control boundary, WCAG 1.4.11 */
  --color-focus: #A04925;          /* = accent — >=3:1 vs bg AND surface */
  --color-selection-bg:  #A04925;
  --color-selection-ink: #FFFFFF;

  /* Hero device strata bands (brief §2.1), decorative only. Clay = accent at
     45% opacity at paint time, realised as a true alpha mix so it reads
     correctly on both bg and surface grounds. */
  --color-strata-topsoil: #D8C7A8;
  --color-strata-caliche: #C9A24A;
  --color-strata-clay: color-mix(in srgb, var(--color-accent) 45%, transparent);

  /* About band's scrim (brief §4 row 7, §2.2): surface at 94% opacity over
     the caliche-clay texture, never bare under text. */
  --color-surface-scrim: color-mix(in srgb, var(--color-surface) 94%, transparent);

  /* Typography (brief §2.3). Literata (display, variable wght 400-700, used
     600) + Literata Italic (emphasis, variable wght 400-600, used 500) +
     Public Sans (body, variable wght 400-700, used 400/600). 2 families, 3
     files (§5/§7 <=4 ceiling). Both SIL OFL 1.1. Weight via font-weight
     only — opsz is Literata's only variable axis in play and is left to
     auto-interpolation, so no font-variation-settings ships anywhere. */

  --font-display:  'Literata', 'Literata Fallback', 'Literata Fallback 2', Georgia, serif;
  --font-emphasis: 'Literata Italic', 'Literata Italic Fallback', 'Literata Italic Fallback 2', Georgia, serif;
  --font-body:     'Public Sans', 'Public Sans Fallback', Arial, sans-serif;

  --font-weight-body:        400;
  --font-weight-body-strong: 600;  /* eyebrow, nav, buttons, labels, idx-row headings */
  --font-weight-display:     600;  /* H1/H2, wordmark */
  --font-weight-emphasis:    500;  /* accent/emphasis word */

  /* Fixed, non-fluid — the wordmark size the brief's fluid table doesn't
     name (house convention), reused for Permit step headings. */
  --text-h3: 1.125rem;
  --text-small: 0.9375rem;

  /* Fluid scale (brief §2.3), each clamp() solved from the brief's stated
     floor/@375/@1440/ceiling so getComputedStyle().fontSize reproduces the
     brief's table at both checkpoints (design-rules §5, §7.3 rule 9). */
  --text-display: clamp(2.4rem, 2.0232rem + 2.4742vw, 4.25rem);   /* 41.65px@375 -> 68px@1440 (ceiling ~1427px) */
  --text-h2:      clamp(1.7rem, 1.45rem + 1vw, 2.4rem);           /* 27.2px@375(floor) -> 37.6px@1440 (ceiling ~1520px) */
  --text-lead:    clamp(1.125rem, 1.05rem + 0.3vw, 1.375rem);     /* 18px@375(floor) -> 21.12px@1440 (ceiling ~1733px) */
  --text-body:    clamp(1rem, 0.96rem + 0.15vw, 1.0625rem);       /* 16px@375(floor) -> 17px@1440 (ceiling ~1093px) */
  --text-eyebrow: clamp(0.8125rem, 0.78rem + 0.1vw, 0.9375rem);   /* 13px@375(floor) -> 13.92px@1440 (ceiling never reached) */

  --leading-tight: 1.04;   /* brief §3.2's H1 line-height figure */
  --leading-snug:  1.25;
  --leading-body:  1.6;

  --tracking-tight: -0.01em;
  --tracking-normal: 0em;
  --tracking-wide:   0.08em;   /* eyebrow — uppercased via text-transform, never typed in caps */

  /* Space (brief §2.4) — house scale, unchanged. */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
  --space-2xl: 6rem;
  --space-3xl: 9rem;

  /* Section rhythm (brief §2.4): fixed 6rem/96px. Two call sites only:
     .section's padding-block and the hero's padding-block-end ("and nothing
     else") — every section's vertical rhythm is this ONE value; §4's
     desktop table is read as inline-gutter guidance only, never a
     per-section padding-block override. */
  --section-gap: var(--space-2xl);

  /* §4's own repeated inline-gutter/grid-gap figures — named because
     neither sits on the scale above (house-tech-spec §3 bars the literal). */
  --space-gap-md: 2rem;   /* Trust/Permit/Footer grid gaps */
  --space-gap-lg: 3rem;   /* Hero/Services/Service-area column gaps */

  /* Layout. Brief §4: full-bleed bands, no page-level max-width box, so
     --layout-container is unused by any section (kept only because
     base.css's primitives expect it to exist). */
  --layout-container: 72rem;
  --layout-measure: 62ch;   /* About band's stated max-width, brief §4 row 7 */
  --layout-gutter: clamp(1.25rem, 5vw, 3rem);
  --layout-tap-min: 44px;

  /* §4's per-section text measures, named rather than literal in site.css. */
  --measure-course:     50ch;   /* hero text column; Permit step body; services-list row */
  --measure-wide:        48ch;  /* Hours & Season column */
  --measure-contact:     44ch;  /* CTA/contact headline + form, >=48em */
  --measure-intro:       34ch;  /* Services left column */
  --measure-area:        30ch;  /* Service Area left column */
  --measure-heading:     24ch;  /* Permit step heading */
  --measure-card:        20ch;  /* Trust card figure + caption */
  --measure-footer-col:  28ch;  /* Footer column */

  /* Component sizes brief §3.2/§4/§2.5 state but the scale doesn't carry. */
  --hero-field-height: 11.875rem;  /* 190px — brief §3.2's mobile device-field height */
  --icon-size-md: 1.5rem;          /* hero pencil-tip glint */
  --icon-size-lg: 2rem;            /* hero compass-rose */
  --image-box-sm: 20rem;           /* Services plan-view diagram, <=320px drawn */
  --image-box-area: 26.25rem;      /* Service Area motif, ~420px drawn */
  --row-max-hours: 24rem;
  --rule-height: 3px;              /* head-rule's stated 3px total height */
  --rule-dot-size: 8px;            /* head-rule's stated 8px dot, echoed by hero node dots */

  /* Radius / shadow / border — flat register: no boxed/elevated card
     anywhere (Trust strip is "typographic cards only"), so the house scale
     stands unmodified; shadows declared but unused. */
  --radius-none: 0;
  --radius-sm: 2px;
  --radius-md: 6px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  --shadow-none: none;
  --shadow-sm: 0 1px 2px rgb(35 31 28 / 0.06);
  --shadow-md: 0 6px 24px rgb(35 31 28 / 0.09);
  --shadow-lg: 0 24px 60px rgb(35 31 28 / 0.14);

  --border-hairline: 1px;
  --border-thick: 3px;
  --border-style: solid;

  /* Motion (brief §2.4, §6) — house generic-reveal defaults, unchanged. */
  --duration-fast: 140ms;
  --duration-base: 320ms;
  --duration-slow: 640ms;

  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --reveal-shift: 1.25rem;
  --reveal-stagger: 90ms;

  /* Signature move (brief §6, carried from Tile B). One-shot sequence, NOT
     reveal-token-driven — explicit keyframe timings. */
  --duration-strata-settle: 0.6s;   /* strata/picture fade+rise on load */
  --duration-line-draw:     1.1s;   /* index line draws left-to-right */
  --duration-node-pop:      0.5s;   /* each node's scale-in */
  --delay-node-1: 1.1s;
  --delay-node-2: 1.35s;
  --delay-node-3: 1.6s;
  --delay-node-4: 1.85s;

  /* Two independent, non-synced ambient loops (ref-001); no common multiple
     so the pencil glint and compass turn never visibly align. */
  --duration-ambient-pencil:  5.8s;
  --duration-ambient-compass: 9s;
  --delay-ambient-start:      2.2s;

  --z-base: 0;
  --z-header: 100;
  --z-nav-panel: 200;
  --z-skip-link: 300;
}

/* base.css collapses --duration-fast/-base/-slow and --reveal-shift under
   reduced motion already. This adds the signature's own tokens. Brief §6:
   the line renders fully drawn, all four nodes at full opacity/scale, and
   the pencil/compass sit static. site.css pairs this with `animation: none`
   on the same elements so an infinite loop actually stops. */
@media (prefers-reduced-motion: reduce) {
  :root {
    /* @allow-literal: a duration token must resolve to a real time value */
    --duration-strata-settle: 0.01ms;
    --duration-line-draw: 0.01ms;
    --duration-node-pop: 0.01ms;
    --duration-ambient-pencil: 0.01ms;
    --duration-ambient-compass: 0.01ms;
  }
}

/* @font-face — self-hosted woff2, instanced to the brief's axis ranges
   (upright wght 400-700, italic 400-600, Public Sans 400-700), subset to
   the house safe range. Both SIL OFL 1.1 (assets/fonts/OFL-*.txt). No CDN.
   Metrics-matched fallbacks first (spec §8), computed with
   scripts/font-metrics.mjs (Fontaine's method) against real donor files. */

@font-face {
  font-family: 'Literata';
  src: url('../assets/fonts/literata-variable-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0020-007E, U+00A0, U+00A9, U+00AE, U+2122, U+00B0, U+00B7,
    U+00BF, U+00C0-00FF, U+2010-2015, U+2018-201A, U+201C-201E,
    U+2026, U+2032-2033;
}

@font-face {
  font-family: 'Literata Italic';
  src: url('../assets/fonts/literata-italic-variable-latin.woff2') format('woff2');
  font-weight: 400 600;
  font-style: italic;
  font-display: swap;
  unicode-range:
    U+0020-007E, U+00A0, U+00A9, U+00AE, U+2122, U+00B0, U+00B7,
    U+00BF, U+00C0-00FF, U+2010-2015, U+2018-201A, U+201C-201E,
    U+2026, U+2032-2033;
}

@font-face {
  font-family: 'Public Sans';
  src: url('../assets/fonts/public-sans-variable-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range:
    U+0020-007E, U+00A0, U+00A9, U+00AE, U+2122, U+00B0, U+00B7,
    U+00BF, U+00C0-00FF, U+2010-2015, U+2018-201A, U+201C-201E,
    U+2026, U+2032-2033;
}

/* Coverage gap (house-tech-spec §8): U+2010/2011/2012/2015 declared, absent
   from all three faces (fontTools-checked) — same four missing everywhere,
   no mid-sentence split. Public Sans also lacks U+2032/2033; copy.md uses
   no curly prime, so unnarrowed.

   Fallback faces, two tiers per Literata style (cds-pool precedent): Georgia
   isn't installed here (`fc-match` -> DejaVu Serif), so tier 1 is measured
   against Gelasio (Georgia's open metric twin, measurement-only, unshipped)
   and tier 2 against the installed DejaVu Serif. Public Sans's donor, Arial,
   resolves locally to the installed Liberation Sans — one tier. */

@font-face {
  font-family: 'Literata Fallback';
  src: local('Georgia'), local('Gelasio');
  size-adjust: 107.85%;
  ascent-override: 109.13%;
  descent-override: 28.56%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Literata Italic Fallback';
  src: local('Georgia'), local('Gelasio');
  font-style: italic;
  size-adjust: 99.59%;
  ascent-override: 118.18%;
  descent-override: 30.93%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Literata Fallback 2';
  src: local('DejaVu Serif');
  size-adjust: 92.42%;
  ascent-override: 127.36%;
  descent-override: 33.33%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Literata Italic Fallback 2';
  src: local('DejaVu Serif');
  font-style: italic;
  size-adjust: 87.12%;
  ascent-override: 135.1%;
  descent-override: 35.35%;
  line-gap-override: 0%;
}

@font-face {
  font-family: 'Public Sans Fallback';
  src: local('Arial'), local('Liberation Sans');
  size-adjust: 105.21%;
  ascent-override: 90.3%;
  descent-override: 21.39%;
  line-gap-override: 0%;
}
