/* ============================================================
   BEACON — Design Tokens
   Shared across landing, web-user, web-qa, mobile prototypes
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@100..900&family=Geist+Mono:wght@100..900&display=swap');

:root {
  /* ---- Color: Neutrals (warm off-white system) ---- */
  --bg: #FAFAF7;
  --bg-elev: #FFFFFF;
  --bg-subtle: #F2F2EE;
  --bg-deep: #0E0E10;
  --bg-deep-elev: #18181B;
  --bg-deep-subtle: #27272A;

  /* ---- Color: Foreground ---- */
  --fg: #0E0E10;
  --fg-secondary: #3F3F46;
  --fg-muted: #71717A;
  --fg-faint: #A1A1AA;
  --fg-on-dark: #FAFAF7;
  --fg-on-dark-muted: #A1A1AA;

  /* ---- Color: Borders ---- */
  --border: #E4E4E1;
  --border-strong: #D4D4D1;
  --border-dark: #27272A;
  --border-dark-strong: #3F3F46;

  /* ---- Color: Accents (anti-AI-purple, contextual) ---- */
  --signal: #E94B1B;          /* urgency / live activity */
  --signal-soft: #FEE9DE;
  --signal-deep: #B23A14;

  --verified: #047857;        /* AI-verified, trusted */
  --verified-soft: #D1FAE5;
  --verified-deep: #035F45;

  --danger: #B91C1C;          /* critical damage / rejected */
  --danger-soft: #FEE2E2;

  --info: #1E40AF;            /* analytical / structural */
  --info-soft: #DBEAFE;

  --warn: #B45309;            /* requires documents */
  --warn-soft: #FEF3C7;

  /* ---- Damage grade scale (EMS-98 inspired) ---- */
  --grade-1: #FBBF24;  /* G1 — Negligible */
  --grade-2: #F59E0B;  /* G2 — Slight */
  --grade-3: #EA580C;  /* G3 — Substantial */
  --grade-4: #B91C1C;  /* G4 — Heavy */
  --grade-5: #7F1D1D;  /* G5 — Destruction */

  /* ---- Typography ---- */
  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --text-xs: 0.6875rem;    /* 11px */
  --text-sm: 0.8125rem;    /* 13px */
  --text-base: 0.9375rem;  /* 15px */
  --text-md: 1.0625rem;    /* 17px */
  --text-lg: 1.25rem;      /* 20px */
  --text-xl: 1.5rem;       /* 24px */
  --text-2xl: 2rem;        /* 32px */
  --text-3xl: 2.75rem;     /* 44px */
  --text-4xl: 3.75rem;     /* 60px */
  --text-5xl: 5.25rem;     /* 84px */

  --tracking-tight: -0.02em;
  --tracking-tighter: -0.035em;
  --tracking-wide: 0.04em;
  --tracking-mono: -0.01em;

  /* ---- 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-7: 2rem;
  --space-8: 2.5rem;
  --space-9: 3rem;
  --space-10: 4rem;
  --space-12: 6rem;
  --space-16: 8rem;

  /* ---- Radius ---- */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 28px;
  --radius-pill: 999px;

  /* ---- Shadow (tinted, no neon) ---- */
  --shadow-xs: 0 1px 2px rgba(14, 14, 16, 0.04);
  --shadow-sm: 0 2px 4px rgba(14, 14, 16, 0.04), 0 1px 1px rgba(14, 14, 16, 0.03);
  --shadow-md: 0 4px 8px rgba(14, 14, 16, 0.06), 0 1px 2px rgba(14, 14, 16, 0.04);
  --shadow-lg: 0 12px 24px -8px rgba(14, 14, 16, 0.08), 0 4px 8px -4px rgba(14, 14, 16, 0.04);
  --shadow-xl: 0 24px 48px -16px rgba(14, 14, 16, 0.10), 0 8px 16px -8px rgba(14, 14, 16, 0.04);
  --shadow-diffuse: 0 20px 40px -15px rgba(14, 14, 16, 0.05);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);

  /* ---- Motion ---- */
  --ease-soft: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);

  --dur-fast: 0.18s;
  --dur-base: 0.32s;
  --dur-slow: 0.6s;

  /* ---- Layout ---- */
  --container: 1280px;
  --container-wide: 1440px;
  --nav-h: 72px;
}

/* ============================================================
   GLOBAL RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--fg);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'ss01', 'ss02', 'cv01', 'cv11';
}

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

::selection { background: var(--fg); color: var(--bg); }

/* ============================================================
   UTILITY CLASSES — shared primitives
   ============================================================ */
.mono { font-family: var(--font-mono); letter-spacing: var(--tracking-mono); }
.uppercase-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
  font-weight: 500;
}
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--fg-muted);
  vertical-align: middle;
}
.dot.live {
  background: var(--signal);
  position: relative;
  animation: livePulse 2.4s ease-in-out infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 75, 27, 0.35); }
  50% { box-shadow: 0 0 0 8px rgba(233, 75, 27, 0); }
}
.dot.verified { background: var(--verified); }
.dot.warn { background: var(--warn); }

/* Container */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-6);
}
@media (min-width: 768px) {
  .container { padding-inline: var(--space-8); }
}

/* Button primitives */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  transition: transform var(--dur-fast) var(--ease-soft),
              background var(--dur-fast) var(--ease-soft),
              border-color var(--dur-fast) var(--ease-soft),
              box-shadow var(--dur-fast) var(--ease-soft);
  white-space: nowrap;
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.12);
}
.btn-primary:hover { background: #1A1A1D; }
.btn-secondary {
  background: var(--bg-elev);
  color: var(--fg);
  border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--border-strong); background: #FCFCFA; }
.btn-ghost {
  background: transparent;
  color: var(--fg);
}
.btn-ghost:hover { background: rgba(14, 14, 16, 0.04); }
.btn-signal {
  background: var(--signal);
  color: white;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-signal:hover { background: var(--signal-deep); }

/* Surfaces */
.surface {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

/* Status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 500;
}
.pill-verified { background: var(--verified-soft); color: var(--verified-deep); }
.pill-pending { background: #FEF3C7; color: #92400E; }
.pill-rejected { background: var(--danger-soft); color: var(--danger); }
.pill-docs { background: #E0E7FF; color: #3730A3; }
.pill-live { background: var(--signal-soft); color: var(--signal-deep); }
.pill-neutral { background: var(--bg-subtle); color: var(--fg-secondary); border: 1px solid var(--border); }

/* Grade badges (G1..G5) */
.grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 12px;
  color: white;
  letter-spacing: -0.02em;
}
.grade-1 { background: var(--grade-1); color: #422006; }
.grade-2 { background: var(--grade-2); }
.grade-3 { background: var(--grade-3); }
.grade-4 { background: var(--grade-4); }
.grade-5 { background: var(--grade-5); }

/* Scrollbars (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--fg-muted); }

/* Skeleton shimmer */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, #EAEAE5 50%, var(--bg-subtle) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s linear infinite;
  border-radius: var(--radius-sm);
}

/* Focus ring */
:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* Grain overlay (premium texture, fixed, pointer-events none) */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.025;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
