/* base.css — design tokens + resets */

:root,
[data-theme='light'] {
  /* Surfaces — warm off-white */
  --color-bg: #f5f2ec;
  --color-surface: #faf7f1;
  --color-surface-2: #fffdf8;
  --color-surface-offset: #ebe6dc;
  --color-surface-offset-2: #ddd6c8;
  --color-divider: #d6cfbf;
  --color-border: #c5bba5;

  /* Workwear navy / charcoal */
  --color-text: #14213d;
  --color-text-muted: #4a5468;
  --color-text-faint: #8a8e9a;
  --color-text-inverse: #faf7f1;

  /* Primary (workwear navy) */
  --color-primary: #14213d;
  --color-primary-hover: #0c1428;
  --color-primary-active: #06091a;
  --color-primary-highlight: #cdd1de;

  /* Charcoal — secondary surface for dark panels */
  --color-charcoal: #232934;
  --color-charcoal-2: #2c333f;

  /* Accent — restrained safety orange (CTAs + emergency) */
  --color-accent: #d8530b;
  --color-accent-hover: #b94508;
  --color-accent-active: #8f3505;
  --color-accent-highlight: #f7d7c2;

  /* Semantic */
  --color-error: #a13544;
  --color-success: #437a22;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.875rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(20, 33, 61, 0.06);
  --shadow-md: 0 6px 18px rgba(20, 33, 61, 0.08);
  --shadow-lg: 0 18px 40px rgba(20, 33, 61, 0.12);

  /* Content widths */
  --content-narrow: 680px;
  --content-default: 1040px;
  --content-wide: 1240px;

  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.25rem);
  --text-hero: clamp(2.75rem, 1rem + 6vw, 5.75rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Fonts — to be defined on style.css after Fontshare load */
  --font-body: 'Satoshi', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Khand', 'Satoshi', 'Inter', system-ui, sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;
}

[data-theme='dark'] {
  --color-bg: #0e1422;
  --color-surface: #14213d;
  --color-surface-2: #1a2849;
  --color-surface-offset: #0a1020;
  --color-surface-offset-2: #232934;
  --color-divider: #232b44;
  --color-border: #2c3556;

  --color-text: #ece8de;
  --color-text-muted: #9aa3bc;
  --color-text-faint: #6b7290;
  --color-text-inverse: #0e1422;

  --color-primary: #e8d8b8;
  --color-primary-hover: #f3e8d3;
  --color-primary-active: #fff5e0;
  --color-primary-highlight: #2c3556;

  --color-charcoal: #0a1020;
  --color-charcoal-2: #14213d;

  --color-accent: #ff7a2e;
  --color-accent-hover: #ff8f4d;
  --color-accent-active: #ffa770;
  --color-accent-highlight: #3d2a1c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 40px rgba(0, 0, 0, 0.6);
}

/* Resets */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  text-size-adjust: none;
  -webkit-text-size-adjust: none;
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  background-image:
    radial-gradient(1100px 540px at 110% -10%, rgba(216, 83, 11, 0.05), transparent 60%),
    radial-gradient(900px 440px at -10% 20%, rgba(20, 33, 61, 0.045), transparent 60%);
  transition: background-color 200ms ease, color 200ms ease;
}

img, picture, video, canvas, svg { display: block; max-width: 100%; height: auto; }
ul[role='list'], ol[role='list'] { list-style: none; }
input, button, textarea, select { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
  line-height: 1.08;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
}

p, li, figcaption { text-wrap: pretty; max-width: 68ch; }

a { color: inherit; text-decoration: none; }

::selection {
  background: rgba(216, 83, 11, 0.25);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

button { cursor: pointer; background: none; border: none; }
table { border-collapse: collapse; width: 100%; }

a, button, [role='button'], [role='link'], input, textarea, select {
  transition:
    color var(--transition-interactive),
    background var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  background: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 200;
  transform: translateY(-150%);
  transition: transform 180ms ease;
}
.skip-link:focus { transform: translateY(0); }
