/* ============================================================
   PermitSignal — base tokens
   Art direction: construction data terminal.
   Industrial ink surfaces, concrete neutrals, one signal-orange accent.
   ============================================================ */

:root {
  /* type scale */
  --text-xs: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --text-sm: clamp(0.875rem, 0.85rem + 0.15vw, 0.9375rem);
  --text-base: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --text-xl: clamp(1.5rem, 1.25rem + 1.1vw, 2.125rem);
  --text-2xl: clamp(2rem, 1.35rem + 2.6vw, 3.25rem);
  --text-3xl: clamp(2.5rem, 1.4rem + 4.2vw, 4.25rem);

  /* spacing (4px base) */
  --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;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  --font-display: 'Archivo', 'Helvetica Neue', system-ui, sans-serif;
  --font-body: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --maxw: 1240px;
}

/* ---------- dark (default) ---------- */
:root, [data-theme='dark'] {
  --bg: #0d0f11;
  --surface: #14171a;
  --surface-2: #1a1e22;
  --surface-3: #21262b;
  --divider: #232a30;
  --border: #2c343b;
  --border-strong: #3b444c;

  --text: #eceae5;
  --text-muted: #9aa2aa;
  --text-faint: #656d75;
  --text-inverse: #0d0f11;

  --accent: #ff6b1a;
  --accent-hover: #ff8340;
  --accent-dim: rgba(255, 107, 26, 0.14);
  --accent-line: rgba(255, 107, 26, 0.32);

  --data-1: #ff6b1a;
  --data-2: #5ec8c0;
  --data-3: #7f8b95;

  --grid-line: rgba(255, 255, 255, 0.032);
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 12px 32px -12px rgba(0,0,0,.7);
}

/* ---------- light (blueprint / concrete) ---------- */
[data-theme='light'] {
  --bg: #f2f1ed;
  --surface: #fafaf8;
  --surface-2: #f6f5f2;
  --surface-3: #eceae5;
  --divider: #e0ddd7;
  --border: #d3cfc8;
  --border-strong: #b9b4ac;

  --text: #16191c;
  --text-muted: #5f666d;
  --text-faint: #93999f;
  --text-inverse: #fafaf8;

  --accent: #d64f00;
  --accent-hover: #b04100;
  --accent-dim: rgba(214, 79, 0, 0.09);
  --accent-line: rgba(214, 79, 0, 0.26);

  --data-1: #d64f00;
  --data-2: #12796f;
  --data-3: #6c757d;

  --grid-line: rgba(22, 25, 28, 0.045);
  --shadow: 0 1px 2px rgba(22,25,28,.06), 0 12px 28px -14px rgba(22,25,28,.18);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}

img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.06;
  letter-spacing: -0.024em;
  font-weight: 700;
  text-wrap: balance;
}

p { text-wrap: pretty; }

::selection { background: var(--accent); color: var(--text-inverse); }

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
