/* ==========================================================================
   Headland Safety — design tokens
   --------------------------------------------------------------------------
   Ported from the Headland Safety Design System (brand + design system v3.1):
   tokens/colors.css, typography.css, spacing.css, geometry.css, motion.css.

   Values are verbatim from the design system except where marked
   "ACCESSIBILITY DELTA". Those two changes correct measured WCAG failures;
   both keep the brand's own logic. See README.md for the ratios.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Inter — self-hosted variable font (SIL Open Font License 1.1).
   The design system loads Inter from Google Fonts; serving it from our own
   origin removes two third-party connections from every page load and keeps
   visitor requests off a third party. Weight axis 400-700 covers the whole
   type scale in one file. See src/assets/fonts/OFL.txt.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-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: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/assets/fonts/inter-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 {
  /* --- Identity: Navy + White + Coastal Blue --------------------------- */
  --hs-navy: #071e3b;
  --hs-coastal: #17679b;
  --hs-white: #ffffff;
  --hs-fog: #e9eef1;
  --hs-slate: #536573;

  /* --- Functional palette (meaning only, never decoration) ------------- */
  --hs-teal: #27666a;
  --hs-moss: #66745a;
  --hs-sand: #d8c9ad;
  --hs-red: #a5483f;

  /* --- Mechanical steps, derived from the identity colors -------------- */
  --hs-navy-press: #061a32;
  --hs-navy-hover: #0d2a4c;
  --hs-navy-60: #516276;
  --hs-navy-24: #c1c7ce;
  --hs-coastal-hover: #145b88;
  --hs-coastal-press: #114e76;
  --hs-coastal-wash: #e8f0f5;
  --hs-fog-deep: #dce3e8;
  --hs-hairline: #c4ccd2;
  --hs-hairline-soft: #dce2e6;

  /* On-navy accent. The design system reuses Coastal Blue here, which
     measures 2.74:1 against navy. The wireframes already use this lighter
     step for eyebrows on navy; it measures 7.35:1. Adopted system-wide. */
  --hs-coastal-light: #7fb2d6; /* ACCESSIBILITY DELTA */

  --hs-teal-wash: #e5eded;
  --hs-moss-wash: #edeeeb;
  --hs-sand-wash: #f7f3eb;
  --hs-red-wash: #f4e9e8;

  /* --- Semantic: surfaces ---------------------------------------------- */
  --surface-page: var(--hs-white);
  --surface-panel: var(--hs-fog);
  --surface-panel-alt: var(--hs-white);
  --surface-inverse: var(--hs-navy);
  --surface-edge: var(--hs-navy);
  --surface-accent-wash: var(--hs-coastal-wash);
  --surface-table-head: var(--hs-fog);
  --surface-table-stripe: #f4f7f9;

  /* --- Semantic: text --------------------------------------------------- */
  --text-heading: var(--hs-navy);
  --text-body: #1b2c40;
  --text-secondary: var(--hs-slate);

  /* Design system value #6B7B87 measures 4.37:1 on white and 3.74:1 on Fog,
     below the 4.5:1 AA minimum for normal text. Darkened one step to
     5.49:1 on white and 4.70:1 on Fog; still reads as Slate. */
  --text-meta: #5c6b77; /* ACCESSIBILITY DELTA */

  --text-link: var(--hs-coastal);
  --text-link-hover: var(--hs-coastal-hover);
  --text-on-navy: var(--hs-white);
  --text-on-navy-secondary: #a9bacb;
  --text-accent: var(--hs-coastal);
  --text-accent-on-navy: var(--hs-coastal-light);

  /* --- Semantic: lines --------------------------------------------------- */
  --line-hairline: var(--hs-hairline);
  --line-soft: var(--hs-hairline-soft);
  --line-strong: var(--hs-navy);
  --line-accent: var(--hs-coastal);
  --line-on-navy: #294564;

  /* --- Semantic: interactive --------------------------------------------- */
  --action-primary-bg: var(--hs-navy);
  --action-primary-bg-hover: var(--hs-navy-hover);
  --action-primary-bg-press: var(--hs-navy-press);
  --action-primary-fg: var(--hs-white);
  --action-secondary-fg: var(--hs-navy);
  --action-secondary-line: var(--hs-navy);
  --action-secondary-bg-hover: var(--hs-fog);
  --action-accent-bg: var(--hs-coastal);
  --action-accent-bg-hover: var(--hs-coastal-hover);
  --action-disabled-bg: var(--hs-fog-deep);
  --action-disabled-fg: #6f7c86;
  --focus-ring: var(--hs-coastal);
  --focus-ring-inverse: var(--hs-white); /* Coastal is 2.74:1 on navy */

  /* --- Semantic: status (functional palette, carrying meaning) ----------- */
  --status-critical: var(--hs-red);
  --status-critical-wash: var(--hs-red-wash);
  --status-strengthened: var(--hs-moss);
  --status-strengthened-wash: var(--hs-moss-wash);
  --status-learning: var(--hs-teal);
  --status-learning-wash: var(--hs-teal-wash);
  --status-reflection: var(--hs-sand);
  --status-reflection-wash: var(--hs-sand-wash);
  --status-neutral: var(--hs-slate);
  --status-neutral-wash: var(--hs-fog);

  /* --- Typography -------------------------------------------------------- */
  --font-core: "Inter", "Inter var", "Aptos", "Segoe UI", system-ui,
    -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-data: "Inter", "Aptos", system-ui, sans-serif;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;
  --weight-black: 800;

  /* Web scale, body = 17px. Display sizes are fluid on the site so the
     ratio contract (hero 7-9x body, section 2.5-3.5x, subhead 1.4-1.7x)
     survives Letter -> 16:9 -> web -> mobile. */
  --size-body: 17px;
  --size-body-lg: 19px;
  --size-body-sm: 15px;
  --size-caption: 14px;
  --size-label: 13px;

  --size-hero: clamp(2.75rem, 1.35rem + 5.6vw, 6.5rem);
  --size-statement: clamp(2rem, 1.15rem + 3.4vw, 4rem);
  --size-section: clamp(1.75rem, 1.15rem + 2.4vw, 3.1875rem);
  --size-subhead: clamp(1.25rem, 1.08rem + 0.7vw, 1.625rem);
  --size-h3: clamp(1.0625rem, 0.99rem + 0.3vw, 1.1875rem);

  --leading-hero: 0.94;
  --leading-display: 1.02;
  --leading-heading: 1.1;
  --leading-subhead: 1.25;
  --leading-body: 1.6;
  --leading-tight: 1.35;

  --tracking-hero: -0.03em;
  --tracking-heading: -0.02em;
  --tracking-body: 0;
  --tracking-label: 0.14em;
  --tracking-wordmark: 0.22em;

  --measure-body: 62ch;
  --measure-narrow: 46ch;

  /* --- Spacing (one unit = 8px) ------------------------------------------ */
  --unit: 8px;
  --space-xs: 4px;
  --space-s: 8px;
  --space-m: 16px;
  --space-l: 32px;
  --space-xl: 48px;
  --space-xxl: 64px;
  --space-hero: 112px;

  /* Section padding shrinks on small screens; the rhythm is preserved. */
  --section-pad: clamp(56px, 8vw, 112px);
  --section-pad-tight: clamp(40px, 5.5vw, 64px);

  --grid-gutter: 24px;
  --page-max: 1280px;
  --page-gutter: clamp(24px, 5vw, 56px);

  /* --- Geometry ----------------------------------------------------------- */
  --radius-none: 0;
  --radius-control: 2px;
  --radius-max: 2px;

  --border-hairline: 1px;
  --border-emphasis: 2px;
  --border-rule: 3px;
  --border-edge: 6px;

  --shadow-none: none;
  --focus-ring-width: 2px;
  --focus-ring-offset: 2px;

  /* The Headland Edge: 25-35% of one edge */
  --edge-default: 30%;

  --header-height: 86px;

  /* --- Motion (functional only) -------------------------------------------- */
  --motion-instant: 80ms;
  --motion-fast: 120ms;
  --motion-base: 180ms;
  --motion-slow: 260ms;
  --ease-standard: cubic-bezier(0.2, 0, 0.2, 1);
  --ease-exit: cubic-bezier(0.4, 0, 1, 1);
  --transition-control: color var(--motion-fast) var(--ease-standard),
    background-color var(--motion-fast) var(--ease-standard),
    border-color var(--motion-fast) var(--ease-standard);
}

@media (max-width: 640px) {
  :root {
    --header-height: 68px;
  }
}
