/* ==========================================================================
   y2-tokens.css — design tokens + self-hosted faces
   Redesign Phase 1. Reference render: /design-system.html
   --------------------------------------------------------------------------
   This file emits NO visual rules. Only @font-face and custom properties on
   :root. Linking it into an existing page cannot change that page's
   appearance — which is what keeps the "zero style regressions" guarantee
   structural rather than a matter of spot-checking.

   Every colour pairing below carries its measured WCAG 2.1 contrast ratio.
   Those numbers are computed, not estimated. Re-measure before changing a hex.
   ========================================================================== */

/* --------------------------------------------------------------------------
   FACES — self-hosted, variable, latin + latin-ext
   Both families are SIL Open Font License 1.1; the license texts ship
   alongside the binaries in /assets/fonts/. Previously these loaded from
   fonts.googleapis.com, which is render-blocking and a third-party dependency
   on every page paint.

   Weight is declared as a range because both files are variable fonts: one
   binary covers 400-700, so there is no per-weight request.
   -------------------------------------------------------------------------- */

/* Fraunces — display. Optical size axis defaults via font-optical-sizing. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* Public Sans — body. */
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/public-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Public Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/public-sans-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* ------------------------------------------------------------------------
     COLOUR

     --y2-ink and --y2-pencil were confirmed against the deployed homepage and
     match the plan exactly. --y2-paper and --y2-line did not: the plan carried
     #FBFAF7 / #E4E1D8, the live site uses #FBFAF6 / #E4E1D6. Live wins, per the
     plan's own rule.
     ------------------------------------------------------------------------ */
  --y2-ink:    #14264C;  /* headings, nav, footer, primary surface  */
  --y2-pencil: #F5B91E;  /* accent — CTA surface, rules, highlights */
  --y2-paper:  #FBFAF6;  /* page background                         */
  --y2-white:  #FFFFFF;  /* card surfaces                           */
  --y2-ink-60: #5A6785;  /* body text, secondary                    */
  --y2-line:   #E4E1D6;  /* decorative dividers, card borders       */

  /* Border for anything a user operates — inputs, selects, unfilled buttons.
     --y2-line is 1.25:1 against paper, far under the 3:1 that WCAG 1.4.11
     requires for a control's visual boundary. This is the accessible
     counterpart, not a second decorative grey. 3.67:1 on white, 3.51:1 on
     paper. An addition to the plan's block; G5 cannot be met without it. */
  --y2-line-strong: #7C8699;

  /* Link / eyebrow blue, lifted from the deployed homepage where it is used
     for section eyebrows and inline links. 6.62:1 on white, 6.33:1 on paper. */
  --y2-link: #2E5AAC;

  /* Focus ring. Ink on light surfaces reads at 14.88:1. Inside .y2-on-ink the
     ring flips to pencil (8.39:1 on ink) — see y2-components.css. */
  --y2-focus: var(--y2-ink);
  --y2-focus-width: 3px;
  --y2-focus-offset: 2px;

  /* Disabled surfaces. WCAG exempts inactive controls from contrast minimums;
     these are chosen to read as unavailable without becoming invisible. */
  --y2-disabled-surface: #F1EFEA;
  --y2-disabled-ink:     #8A93A8;

  /* ------------------------------------------------------------------------
     MEASURED CONTRAST — the pairings this system is allowed to use

       ink       on paper    14.25   body + large    PASS
       ink       on white    14.88   body + large    PASS
       ink       on pencil    8.39   body + large    PASS   <- primary button
       white     on ink      14.88   body + large    PASS   <- inverted button
       pencil    on ink       8.39   body + large    PASS   <- accent on dark
       ink-60    on paper     5.41   body            PASS
       ink-60    on white     5.66   body            PASS
       link      on paper     6.33   body            PASS
       line-strong on white   3.67   UI boundary     PASS

     FORBIDDEN — do not use as text or as a control boundary:

       pencil    on white     1.77   FAIL
       pencil    on paper     1.70   FAIL
       line      on white     1.31   FAIL (decorative rules only)
       line      on paper     1.25   FAIL (decorative rules only)

     Pencil is a surface colour. It carries ink on top of it; it is never
     itself text on a light background. The plan calls this out and the
     measurement confirms it.
     ------------------------------------------------------------------------ */

  /* ------------------------------------------------------------------------
     TYPE — 1.25 ratio, clamped. Mobile-first: the low end of each clamp is
     the 375px value.
     ------------------------------------------------------------------------ */
  --y2-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --y2-body:    'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --y2-t-hero:  clamp(2.5rem, 5vw + 1rem, 4.5rem);
  --y2-t-h2:    clamp(1.875rem, 2.5vw + 1rem, 3rem);
  --y2-t-h3:    clamp(1.25rem, 1vw + 1rem, 1.75rem);
  --y2-t-body:  1.0625rem;
  --y2-t-small: 0.9375rem;

  --y2-lh-tight: 1.1;
  --y2-lh-head:  1.25;
  --y2-lh-body:  1.65;

  /* Eyebrow: the small uppercase label that sits under the pencil rule. */
  --y2-t-eyebrow:    0.8125rem;
  --y2-track-eyebrow: 0.1em;

  /* ------------------------------------------------------------------------
     SPACING — 8pt base
     ------------------------------------------------------------------------ */
  --y2-s-1: 0.5rem;
  --y2-s-2: 1rem;
  --y2-s-3: 1.5rem;
  --y2-s-4: 2rem;
  --y2-s-6: 3rem;
  --y2-s-8: 4rem;
  --y2-s-12: 6rem;
  --y2-s-16: 8rem;

  /* Section rhythm. Sole source of vertical section padding — see the
     specificity note at the top of y2-components.css. */
  --y2-section-y: var(--y2-s-8);

  /* ------------------------------------------------------------------------
     SURFACE
     ------------------------------------------------------------------------ */
  --y2-radius:    16px;
  --y2-radius-lg: 24px;
  --y2-radius-sm: 8px;
  --y2-shadow:    0 1px 3px rgba(20, 38, 76, .06), 0 8px 24px rgba(20, 38, 76, .06);
  --y2-shadow-lg: 0 2px 6px rgba(20, 38, 76, .08), 0 16px 48px rgba(20, 38, 76, .10);

  --y2-maxw:       1200px;
  --y2-maxw-prose: 68ch;

  /* Signature element: the pencil rule above each section eyebrow. 2px,
     25% of container width, left-aligned. The one flourish in the system. */
  --y2-rule-w: 25%;
  --y2-rule-h: 2px;

  /* Motion. Every transition in the component layer routes through these, so
     the reduced-motion block in y2-components.css can zero them in one place
     rather than chasing individual declarations. */
  --y2-dur-fast: 120ms;
  --y2-dur:      200ms;
  --y2-ease:     cubic-bezier(.2, .6, .3, 1);
}

@media (min-width: 768px) {
  :root { --y2-section-y: var(--y2-s-12); }
}

@media (min-width: 1280px) {
  :root { --y2-section-y: var(--y2-s-16); }
}
