/* Calibrate Freight — base layer: reset, typography, layout + shared primitives.
   Section builders MUST reuse these classes so the page reads as one system. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* layered deep-space glows */
  background-image:
    radial-gradient(1200px 700px at 80% -10%, color-mix(in oklch, var(--brand) 14%, transparent), transparent 60%),
    radial-gradient(1000px 600px at 0% 10%, oklch(0.55 0.16 250 / 0.10), transparent 55%),
    radial-gradient(900px 900px at 50% 120%, color-mix(in oklch, var(--brand) 8%, transparent), transparent 60%);
  background-attachment: fixed;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
:focus-visible { outline: 2px solid var(--brand-hi); outline-offset: 3px; border-radius: 4px; }

::selection { background: var(--brand-a30); color: var(--fg); }
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; border: 3px solid var(--bg-2); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-soft); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); }
.section { padding-block: clamp(4.5rem, 9vw, 8rem); position: relative; }
.section--tight { padding-block: clamp(3rem, 6vw, 5rem); }
.stack > * + * { margin-top: 1rem; }

/* ---------- Typography ---------- */
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; }
.display { font-size: clamp(2.6rem, 6.2vw, 4.6rem); font-weight: 700; letter-spacing: -0.035em; }
.h1 { font-size: clamp(2.2rem, 4.6vw, 3.4rem); }
.h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.28rem); color: var(--dim); line-height: 1.6; }
.muted { color: var(--dim); }
.mono { font-family: var(--font-mono); }
.balance { text-wrap: balance; }
.measure { max-width: 52ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: 500;
  letter-spacing: 0.22em; text-transform: uppercase; color: var(--brand-hi);
}
.eyebrow::before { content: ""; width: 1.4rem; height: 1px; background: linear-gradient(90deg, transparent, var(--brand-hi)); }
.eyebrow--center::before { display: none; }

.grad-text {
  background: linear-gradient(105deg, var(--fg) 20%, var(--brand-hi) 55%, var(--brand) 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.section-head { max-width: 44rem; }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head .h2 { margin-top: 0.9rem; }
.section-head .lead { margin-top: 1rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-weight: 600; font-size: 0.95rem; padding: 0.8rem 1.35rem;
  border-radius: var(--r-md); border: 1px solid transparent;
  transition: transform 0.18s var(--ease), box-shadow 0.25s var(--ease), background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px) scale(0.99); }
.btn-primary { background: var(--brand); color: white; box-shadow: var(--glow-brand); }
.btn-primary:hover { background: var(--brand-hi); transform: translateY(-2px); box-shadow: 0 0 55px -6px color-mix(in oklch, var(--brand) 60%, transparent); }
.btn-ghost { border-color: var(--line); color: var(--fg); background: var(--white-a05); }
.btn-ghost:hover { border-color: var(--brand-soft); background: var(--white-a08); transform: translateY(-2px); }
.btn-sm { padding: 0.55rem 0.95rem; font-size: 0.85rem; }
.btn-lg { padding: 0.95rem 1.7rem; font-size: 1.02rem; }

/* ---------- Surfaces ---------- */
.glass {
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md), inset 0 1px 0 0 var(--white-a05);
}
.glass-soft { background: var(--white-a05); border: 1px solid var(--line-soft); border-radius: var(--r-lg); }
.hairline { border: 1px solid var(--line); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md); }

/* ---------- Evidence badges (the product's signature device) ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.06em; padding: 0.2rem 0.5rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); color: var(--dim); background: var(--field);
  text-transform: uppercase; white-space: nowrap;
}
.badge::before { content: ""; width: 0.42rem; height: 0.42rem; border-radius: 50%; background: currentColor; }
.badge-obs  { color: var(--good);  border-color: color-mix(in oklch, var(--good) 40%, var(--line)); background: var(--good-a15); }
.badge-inf  { color: var(--brand-hi); border-color: var(--brand-soft); background: var(--brand-a12); }
.badge-decl { color: var(--warn);  border-color: color-mix(in oklch, var(--warn) 35%, var(--line)); background: var(--warn-a15); }
.badge-mtch { color: var(--brand-hi); border-color: var(--brand-soft); background: var(--brand-a12); }
.badge-user { color: var(--dim); }

.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; padding: 0.32rem 0.7rem; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--white-a05); color: var(--dim);
}

/* ---------- Confidence meter ---------- */
.meter { height: 6px; border-radius: 999px; background: var(--field); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand), var(--brand-hi)); transition: width 1s var(--ease-out); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.5rem); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Dividers / rules ---------- */
.rule { height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); border: 0; }
.glow-line { height: 1px; background: linear-gradient(90deg, transparent, var(--brand-hi), transparent); opacity: 0.6; }

/* ---------- Reveal on scroll ---------- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out); will-change: opacity, transform; }
[data-reveal].is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { [data-reveal] { opacity: 1 !important; transform: none !important; } }

/* ---------- Utilities ---------- */
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: 0.5rem; } .gap { gap: 1rem; } .gap-lg { gap: 1.5rem; }
.wrap { flex-wrap: wrap; }
.mt-sm { margin-top: 0.5rem; } .mt { margin-top: 1rem; } .mt-lg { margin-top: 2rem; } .mt-xl { margin-top: 3rem; }
.full { width: 100%; }
.relative { position: relative; }
.cta-row { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.tag-good { color: var(--good); } .tag-warn { color: var(--warn); } .tag-bad { color: var(--bad); } .tag-brand { color: var(--brand-hi); }
.tnum { font-variant-numeric: tabular-nums; }

/* HUD glass — translucent + blurred, for panels floating over the globe.
   (Base .glass is opaque, for cards on the solid page background.) */
.glass-hud {
  position: relative;
  background: color-mix(in oklch, var(--card) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md), inset 0 1px 0 0 var(--white-a05);
  overflow: hidden;
}
.glass-hud::after { /* faint instrument scanline */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background: repeating-linear-gradient(0deg, oklch(1 0 0 / 0.03) 0 1px, transparent 1px 3px);
}
.scanline::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.4;
  background: repeating-linear-gradient(0deg, oklch(1 0 0 / 0.03) 0 1px, transparent 1px 3px);
}
.globe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
/* MapLibre inside the decorative globe: kill its focus ring + let the deep-space bg show */
.globe-canvas .maplibregl-canvas { outline: none; }
.globe-canvas .maplibregl-ctrl-attrib, .globe-canvas .maplibregl-ctrl-logo { display: none !important; }
