/* ==========================================================================
   Shield Nest Hub — Design tokens
   Edit brand colors, type, spacing and motion here. Every other stylesheet
   reads these custom properties. Documented in docs/design-system.md.
   Contrast ratios noted are WCAG 2.x, measured against --ivory-50 unless stated.
   ========================================================================== */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("../fonts/archivo-latin-variable.woff2") format("woff2-variations"),
       url("../fonts/archivo-latin-variable.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;
}

:root {
  /* ---- Core palette ---------------------------------------------------- */
  --graphite-950: #141518;
  --graphite-900: #1C1D20;   /* ink / night surfaces — 15.1:1 on ivory */
  --graphite-800: #26282C;
  --graphite-700: #34363B;
  --graphite-600: #45484E;
  --stone-600: #52555B;      /* muted text — 6.7:1 on ivory */
  --stone-500: #6B6E74;      /* large/secondary text only */
  --stone-400: #7D8086;      /* control borders — 3.9:1 on paper */
  --stone-300: #B9BBBE;      /* muted text on graphite — 8.8:1 */
  --stone-200: #D9D4C8;      /* hairlines */
  --stone-100: #E9E4D9;
  --ivory-50:  #F6F2EA;      /* page background */
  --paper:     #FFFDF8;      /* raised surfaces */

  --copper-800: #7C3418;
  --copper-700: #9A4220;     /* links & text accents — 5.9:1 on ivory */
  --copper-600: #A9481F;     /* primary buttons — white text 5.8:1 */
  --copper-500: #B4512A;     /* brand mark */
  --copper-400: #D2693C;     /* accents on graphite — 4.7:1 */
  --copper-300: #E58A5F;     /* text accents on graphite — 6.5:1 */
  --copper-100: #F3DED1;
  --copper-50:  #FAEFE7;

  --lane-yellow: #E9C46A;    /* road-marking motif, decorative only */

  /* ---- Semantic colors -------------------------------------------------- */
  --color-bg: var(--ivory-50);
  --color-surface: var(--paper);
  --color-surface-sunken: var(--stone-100);
  --color-ink: var(--graphite-900);
  --color-ink-muted: var(--stone-600);
  --color-ink-inverse: var(--ivory-50);
  --color-ink-inverse-muted: var(--stone-300);
  --color-line: var(--stone-200);
  --color-line-strong: var(--graphite-900);
  --color-control-border: var(--stone-400);
  --color-accent: var(--copper-600);
  --color-accent-hover: var(--copper-800);
  --color-link: var(--copper-700);
  --color-focus: var(--copper-600);
  --color-night: var(--graphite-900);

  --color-success: #2E6A4D;  /* 5.7:1 */
  --color-success-bg: #E1EDE5;
  --color-danger: #A2262B;   /* 6.6:1 */
  --color-danger-bg: #F6E0DE;
  --color-warning: #8A5A00;  /* 5.3:1 */
  --color-warning-bg: #F5E8C8;
  --color-info: #2C5878;     /* 6.8:1 */
  --color-info-bg: #E2EAF0;
  --color-demo-ink: #5A4300; /* 7.4:1 on --color-demo-bg */
  --color-demo-bg: #F3E4B8;

  /* ---- Typography -------------------------------------------------------- */
  --font-sans: "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* Fluid type scale (min @ 360px → max @ 1440px) */
  --text-xs:   0.75rem;                                   /* 12 */
  --text-sm:   0.875rem;                                  /* 14 */
  --text-base: 1.0625rem;                                 /* 17 */
  --text-md:   clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem); /* 18–20 */
  --text-lg:   clamp(1.25rem, 1.15rem + 0.45vw, 1.5rem);  /* 20–24 */
  --text-xl:   clamp(1.5rem, 1.3rem + 0.9vw, 2rem);       /* 24–32 */
  --text-2xl:  clamp(1.85rem, 1.45rem + 1.75vw, 2.85rem); /* 30–46 */
  --text-3xl:  clamp(2.25rem, 1.6rem + 2.9vw, 4rem);      /* 36–64 */
  --text-4xl:  clamp(2.6rem, 1.7rem + 4vw, 5.25rem);      /* 42–84 */

  --leading-tight: 1.02;
  --leading-snug: 1.18;
  --leading-normal: 1.58;
  --tracking-display: -0.022em;
  --tracking-label: 0.09em;

  /* Width axis presets (Archivo wdth 62–125) */
  --stretch-display: 118%;
  --stretch-label: 112%;
  --stretch-body: 100%;
  --stretch-condensed: 86%;

  /* ---- Spacing (4px base) ------------------------------------------------ */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --section-pad: clamp(3.5rem, 2rem + 6vw, 7.5rem);

  /* ---- Layout ------------------------------------------------------------ */
  --container: 1320px;
  --container-narrow: 760px;
  --gutter: clamp(1rem, 0.6rem + 2.2vw, 2.5rem);
  --header-h: 72px;

  /* ---- Shape ------------------------------------------------------------- */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-pill: 999px;
  --border-hair: 1px solid var(--color-line);
  --border-control: 1.5px solid var(--color-control-border);
  --border-rule: 3px solid var(--color-line-strong);

  /* ---- Elevation (used sparingly) --------------------------------------- */
  --shadow-1: 0 1px 2px rgb(20 21 24 / 0.06), 0 2px 8px rgb(20 21 24 / 0.05);
  --shadow-2: 0 2px 4px rgb(20 21 24 / 0.06), 0 12px 32px rgb(20 21 24 / 0.12);
  --shadow-3: 0 24px 64px rgb(20 21 24 / 0.28);

  /* ---- Motion ------------------------------------------------------------ */
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 140ms;
  --dur-base: 240ms;
  --dur-slow: 480ms;

  /* ---- Media ------------------------------------------------------------- */
  --ratio-card: 16 / 10;
  --ratio-gallery: 16 / 9.5;
  --ratio-wide: 21 / 9;

  color-scheme: light;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}
