/* ============================================================================
   HAUL ADZ — SHARED DESIGN FOUNDATION  (WS-DS1 · Design Language v1.0)
   Canonical source of foundation + semantic design tokens.
   Values are the tested Plans v8 build (not invented). Paths in this file are
   relative to THIS file's location (assets/), e.g. url(fonts/...) => assets/fonts/.
   Adoption: a page links this file, then consumes tokens by NAME — it must not
   re-declare foundation values in a page-local :root. See docs/design-system/.
   ============================================================================ */

/* --- Typography families (self-hosted; do not redistribute) --------------- */
@font-face{font-family:'Bebas Neue';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/bebasneue-400.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:400;font-display:swap;src:url(fonts/barlow-400.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:500;font-display:swap;src:url(fonts/barlow-500.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:600;font-display:swap;src:url(fonts/barlow-600.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:700;font-display:swap;src:url(fonts/barlow-700.woff2) format('woff2')}
@font-face{font-family:'Barlow';font-style:normal;font-weight:800;font-display:swap;src:url(fonts/barlow-800.woff2) format('woff2')}

:root{
  /* ========================================================================
     LAYER 2 — FOUNDATION TOKENS  (raw, tested values)
     Foundation token NAMES are kept identical to the Plans v8 build so the
     pilot renders with exact parity. New pages should prefer the SEMANTIC
     tokens below; foundation names remain the stable base they map to.
     ======================================================================== */

  /* Color — dark base (chosen warm-neutral, a hair toward the accent) */
  --bg:#0a0908;            /* base page surface            */
  --bg2:#100e0b;           /* raised surface / panels      */
  --bg3:#161310;           /* raised surface 2 / inputs    */
  --bg4:#1e1a15;           /* raised surface 3 / hover     */
  --yellow:#FFD020;        /* brand accent (see §12 discipline) */
  --yellow2:#ffdb4d;       /* accent hover                 */
  --white:#f6f1e9;         /* primary text (off-white)     */
  --muted:rgba(246,241,233,.58);   /* secondary text       */
  --muted2:rgba(246,241,233,.52);  /* faint text / meta — .52 is the lowest
                                      alpha that clears WCAG AA 4.5:1 on every
                                      surface token (5.18:1 on --bg, 5.03:1 on
                                      the lightest --bg4). It was .34 = 2.80:1,
                                      which failed AA on the honesty
                                      disclaimers, the support email and the
                                      footer. Kept below --muted (.58) so the
                                      two-step text hierarchy still reads. */
  --border:rgba(246,235,214,.07);      /* hairline separator   */
  --border-y:rgba(255,208,32,.28);     /* accent border        */
  --green:#5bd68a;         /* base success                 */

  /* Status palette (distinct from brand accent — validated on Plans v8 for
     success; warning/critical/info are approved-palette derivations, and are
     runtime-validated only where they have appeared. See docs limitations.) */
  --status-success:#5bd68a;
  --status-warning:#f5b73d;   /* PROVISIONAL — not yet runtime-validated in product */
  --status-critical:#e8574e;  /* PROVISIONAL */
  --status-info:#5aa8ff;      /* PROVISIONAL */
  --status-warning-deep:#d99022; /* PROVISIONAL (delivery-delayed) */

  /* Geometry */
  --rad:16px;              /* primary product radius       */
  --rad-sm:12px;           /* small controls / inputs      */
  --rad-pill:999px;        /* chips / toggles              */

  /* Elevation (prefer borders+contrast first, then this one shadow) */
  --shadow:0 12px 36px rgba(0,0,0,.32);

  /* Spacing — ONE scale */
  --s1:8px;--s2:14px;--s3:22px;--s4:32px;--s5:48px;--s6:72px;--s7:104px;

  /* Content measure */
  --maxtext:620px;

  /* Typography roles (families + fallbacks) */
  --font-display:'Bebas Neue','Arial Narrow',Impact,sans-serif;
  --font-text:'Barlow','Helvetica Neue',Arial,sans-serif;

  /* Motion (foundation durations + easing; reduced-motion honored globally) */
  --motion-fast:120ms;--motion:180ms;--motion-slow:240ms;--motion-slower:360ms;
  --ease:cubic-bezier(.2,.6,.2,1);

  /* Focus */
  --focus-ring:2px solid var(--yellow);
  --focus-offset:2px;

  /* ========================================================================
     LAYER 3 — SEMANTIC TOKENS  (purpose, not value — new pages consume THESE)
     ======================================================================== */

  /* Surfaces */
  --surface-base:var(--bg);
  --surface-raised:var(--bg2);
  --surface-raised-2:var(--bg3);
  --surface-overlay:rgba(10,9,8,.82);

  /* Text */
  --text-primary:var(--white);
  --text-secondary:var(--muted);
  --text-disabled:var(--muted2);

  /* Actions (see §13 action system) */
  --action-primary:var(--yellow);
  --action-primary-hover:var(--yellow2);
  --action-primary-ink:#000;
  --action-secondary-border:rgba(246,235,214,.14);
  --action-quiet:var(--muted);
  --action-destructive:var(--status-critical);   /* PROVISIONAL until product runtime audit */
  --action-emergency:var(--status-critical);     /* PROVISIONAL — ops/driver only, confirm-gated */

  /* Feedback / status semantics */
  --status-neutral:var(--muted);

  /* DOMAIN semantics — HaulAdz-specific. PROVISIONAL: these govern authenticated
     product/ops/driver surfaces that were NOT runtime-validated (no test account).
     Values are conservative mappings from the approved palette and MUST be
     re-validated against real rendered product states before those surfaces ship. */
  --proof-confirmed:var(--status-success);   /* device-reported + GPS-logged only */
  --delivery-active:var(--status-info);       /* PROVISIONAL */
  --delivery-at-risk:var(--status-warning);   /* PROVISIONAL */
  --delivery-delayed:var(--status-warning-deep); /* PROVISIONAL */
  --data-estimated:var(--muted);              /* pair with hatch/label, never as confirmed */
  --data-planned:var(--border-y);             /* outline-only treatment */
  --device-healthy:var(--status-success);     /* PROVISIONAL */
  --device-degraded:var(--status-warning);    /* PROVISIONAL */
  --availability-managed:var(--status-info);  /* PROVISIONAL */
}

/* --- Accessibility foundations (global helpers) --------------------------- */
:where(a,button,input,select,textarea,[tabindex],[role="button"]):focus-visible{
  outline:var(--focus-ring);outline-offset:var(--focus-offset);
}
.sr-only{
  position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;
}
[aria-disabled="true"],:disabled{opacity:.55;cursor:not-allowed}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{
    animation-duration:.01ms!important;animation-iteration-count:1!important;
    transition-duration:.01ms!important;scroll-behavior:auto!important;
  }
}
