/* ============================================================
   STLCA / Seattle R.A.R.E. — shared stylesheet
   "Forensic Cartography": deep navy-black night-map base,
   teal contour lines, amber/orange record intensity,
   brushed-brass institutional framing, signal-red reserved
   for accountability gaps.
   Plain CSS. No frameworks. Edit freely.
   ------------------------------------------------------------
   Fonts: Archivo (display) · Public Sans (body) · IBM Plex Mono (data/IDs)
   ============================================================ */

/* ---- Brand color tokens (change these once, applies everywhere) ---- */
:root {
  --brass:      #c9a24a;
  --brass-dim:  #8a6d2f;
  --amber:      #f5a623;
  --amber-deep: #e8913a;
  --teal:       #2fb6b0;
  --teal-dim:   #1f8a86;
  --signal:     #e23b3b;

  --ink:        #070d14;   /* page background */
  --ink-2:      #0a1320;   /* panel / section background */
  --card:       #0c1622;
  --fg:         #eef2f6;   /* main text */
  --fg-soft:    #cdd8e3;   /* secondary text */
  --muted:      #8ea0b2;   /* muted labels */
  --border:     rgba(140,170,200,0.14);
  --input-bd:   rgba(140,170,200,0.18);

  --font-display: "Archivo", system-ui, sans-serif;
  --font-sans:    "Public Sans", system-ui, sans-serif;
  --font-mono:    "IBM Plex Mono", ui-monospace, monospace;

  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --maxw: 1320px;
}

/* ---- Reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5 { font-family: var(--font-display); letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---- Layout container ---- */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 1.25rem;
}
@media (min-width: 640px) { .container { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .container { padding: 0 2rem; max-width: var(--maxw); } }
.maxw-4xl { max-width: 56rem; margin-left: auto; margin-right: auto; }
.maxw-2xl { max-width: 42rem; }
.maxw-3xl { max-width: 48rem; }

/* ---- Color helpers ---- */
.t-amber  { color: var(--amber); }
.t-teal   { color: var(--teal); }
.t-signal { color: var(--signal); }
.t-brass  { color: var(--brass); }
.t-muted  { color: var(--muted); }
.t-soft   { color: var(--fg-soft); }

.brass-text {
  background: linear-gradient(160deg, #e7cd84 0%, #c9a24a 38%, #8a6d2f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---- Eyebrow label ---- */
.eyebrow {
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.7rem;
  color: var(--brass);
}
.mono { font-family: var(--font-mono); }

/* ---- Glass panel ---- */
.glass {
  background: rgba(10,18,28,0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 0.4rem;
}

/* ---- Brass hairline frame with corner ticks ---- */
.brass-frame { position: relative; border: 1px solid rgba(201,162,74,0.28); }
.brass-frame::before, .brass-frame::after {
  content: ""; position: absolute; width: 14px; height: 14px;
  border-color: var(--brass); border-style: solid;
}
.brass-frame::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; }
.brass-frame::after  { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; }

.divider-rule { height: 1px; background: linear-gradient(90deg, transparent, rgba(201,162,74,0.5), transparent); }

/* ---- KPI numerals ---- */
.kpi-num { font-family: var(--font-display); font-weight: 800; line-height: 0.95; font-variant-numeric: tabular-nums; }
.kpi-xl  { font-size: clamp(2.6rem, 6vw, 4rem); }
.kpi-md  { font-size: 1.9rem; }
.kpi-sm  { font-size: 1.4rem; }
.kpi-label { margin-top: 0.4rem; font-size: 0.72rem; line-height: 1.3; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.75rem 1.4rem; border-radius: 0.25rem;
  font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  transition: transform 0.16s var(--ease-out), background 0.2s, filter 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(to bottom, #e7cd84, #a07e34); color: #1a1206; }
.btn-primary:hover { filter: brightness(1.1); }
.btn-ghost { border: 1px solid rgba(201,162,74,0.45); color: var(--brass); background: rgba(10,19,32,0.6); }
.btn-ghost:hover { background: #0a1320; }

/* ---- Header / nav ---- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  transition: background 0.25s var(--ease-out), border-color 0.25s, backdrop-filter 0.25s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: rgba(7,13,20,0.88);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(201,162,74,0.18);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 0.7rem; }
.brand img { height: 38px; width: auto; }
.brand-title { font-family: var(--font-display); font-weight: 800; font-size: 1.05rem; line-height: 1; }
.brand-sub { font-family: var(--font-mono); font-size: 0.6rem; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.nav-links { display: none; align-items: center; gap: 1.6rem; }
.nav-links a {
  font-size: 0.82rem; color: var(--fg-soft); position: relative; padding: 0.4rem 0;
  transition: color 0.18s;
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.active { color: var(--amber); }
.nav-links a.active::after {
  content: ""; position: absolute; bottom: -2px; left: 0; right: 0; height: 2px;
  background: var(--amber); border-radius: 2px;
}
.nav-toggle { display: inline-flex; background: none; border: 1px solid var(--border); border-radius: 4px; padding: 0.4rem 0.55rem; color: var(--fg); }
.mobile-menu { display: none; flex-direction: column; gap: 0.2rem; padding: 0.5rem 0 1rem; border-top: 1px solid var(--border); }
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 0.7rem 0.25rem; font-size: 0.95rem; color: var(--fg-soft); border-bottom: 1px solid var(--border); }
.mobile-menu a.active { color: var(--amber); }
@media (min-width: 900px) {
  .nav-links { display: flex; }
  .nav-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

/* ---- Hero ---- */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-grad-1 { position: absolute; inset: 0; background: linear-gradient(to right, var(--ink) 0%, rgba(6,10,16,0.85) 45%, rgba(6,10,16,0.3) 100%); }
.hero-grad-2 { position: absolute; inset: 0; background: linear-gradient(to top, var(--ink), transparent 40%, rgba(6,10,16,0.6) 100%); }
.hero-grid { position: relative; display: grid; gap: 3rem; align-items: center; padding: 7rem 0 4rem; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 1.15fr 1fr; } }
.hero h1 { font-weight: 900; font-size: clamp(2.8rem, 7vw, 4.6rem); line-height: 0.98; }

/* ---- Page hero (interior pages) ---- */
.page-hero { position: relative; padding: 8rem 0 3.5rem; overflow: hidden; border-bottom: 1px solid rgba(201,162,74,0.14); }
.page-hero-bg { position: absolute; inset: 0; opacity: 0.16; background-size: cover; background-position: center; }
.page-hero-grad { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(7,13,20,0.7), rgba(7,13,20,0.9) 60%, var(--ink)); }
.page-hero h1 { font-weight: 800; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-hero p { margin-top: 1.1rem; max-width: 44rem; color: var(--fg-soft); }

/* ---- Sections ---- */
.section { padding: 4rem 0; }
.section-tight { padding: 3rem 0; }
.section-band { background: var(--ink-2); border-top: 1px solid rgba(201,162,74,0.16); border-bottom: 1px solid rgba(201,162,74,0.16); }

/* ---- Source tag ---- */
.source-tag {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--teal); border: 1px solid rgba(47,182,176,0.35); border-radius: 999px;
  padding: 0.25rem 0.7rem; background: rgba(47,182,176,0.06);
}

/* ---- Grids ---- */
.grid { display: grid; gap: 1.25rem; }
.gap-sm { gap: 0.75rem; }
.gap-lg { gap: 2rem; }
.g2 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) {
  .g3 { grid-template-columns: repeat(3, 1fr); }
  .g4 { grid-template-columns: repeat(4, 1fr); }
  .g5 { grid-template-columns: repeat(5, 1fr); }
}
@media (max-width: 1023px) { .g3, .g4, .g5 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .g2, .g3, .g4, .g5 { grid-template-columns: 1fr; } }

/* ---- Cards ---- */
.card { padding: 1.4rem; }
.card-link { transition: transform 0.2s var(--ease-out), border-color 0.2s; display: block; }
.card-link:hover { transform: translateY(-4px); border-color: rgba(201,162,74,0.45); }

/* ---- Tables ---- */
.ledger { width: 100%; overflow-x: auto; }
.ledger table { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 0.74rem; text-align: left; }
.ledger th { color: var(--muted); border-bottom: 1px solid var(--border); padding: 0.5rem 0.75rem 0.5rem 0; font-weight: 500; }
.ledger td { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid rgba(140,170,200,0.08); }
.ledger tr:hover td { background: rgba(255,255,255,0.02); }
.scroll-thin::-webkit-scrollbar { height: 8px; width: 8px; }
.scroll-thin::-webkit-scrollbar-track { background: rgba(255,255,255,0.03); }
.scroll-thin::-webkit-scrollbar-thumb { background: rgba(201,162,74,0.35); border-radius: 4px; }

/* ---- Bars (horizontal comparison) ---- */
.bar-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.6rem; }
.bar-label { width: 2.4rem; font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-soft); }
.bar-track { flex: 1; height: 1.4rem; background: rgba(255,255,255,0.04); border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s var(--ease-out); }
.bar-val { width: 3.2rem; text-align: right; font-family: var(--font-mono); font-size: 0.78rem; }

/* keyword meter */
.meter { height: 0.5rem; border-radius: 999px; background: rgba(255,255,255,0.05); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(to right, #2fb6b0, #c9a24a); }

/* ---- Findings list ---- */
.finding { display: grid; gap: 1.5rem; }
@media (min-width: 768px) { .finding { grid-template-columns: 11rem 1fr; gap: 2.5rem; } }
.finding-stat { font-family: var(--font-display); font-weight: 800; font-size: clamp(2.2rem,5vw,3rem); line-height: 0.95; }

/* ---- Blockquote (case study) ---- */
.q { position: relative; padding-left: 1.5rem; border-left: 2px solid rgba(201,162,74,0.45); margin-top: 0.75rem; }
.q p { font-style: italic; color: rgba(238,242,246,0.9); font-size: 0.86rem; line-height: 1.55; }
.q span { font-family: var(--font-mono); font-size: 0.62rem; color: var(--muted); }

/* ---- Disclaimer block ---- */
.disclaimer { border-left: 2px solid rgba(47,182,176,0.4); padding-left: 1.1rem; }
.disclaimer li { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); line-height: 1.6; margin-bottom: 0.3rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid rgba(201,162,74,0.18); background: #060a10; margin-top: 4rem; }
.footer-grid { display: grid; gap: 2.5rem; padding: 3rem 0; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-copy { display: flex; flex-direction: column; gap: 1rem; }
@media (min-width: 768px) { .footer-copy { flex-direction: row; justify-content: space-between; } }
.footer-copy p { font-family: var(--font-mono); font-size: 0.68rem; color: var(--muted); }

/* ---- Interactive map ---- */
.map-wrap { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 1024px) { .map-wrap { grid-template-columns: 1.05fr 0.95fr; } }
.map-svg { width: 100%; height: auto; max-height: 560px; filter: drop-shadow(0 20px 60px rgba(0,0,0,0.6)); }
.map-svg path { transition: fill-opacity 180ms ease, stroke-width 180ms ease; cursor: pointer; }
.metric-toggle { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.metric-btn {
  font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.45rem 0.8rem; border-radius: 3px; border: 1px solid var(--border);
  background: #0c1622; color: var(--muted); transition: all 0.16s var(--ease-out);
}
.metric-btn:hover { border-color: rgba(201,162,74,0.45); color: var(--fg-soft); }
.metric-btn.active { border-color: var(--brass); color: var(--brass); background: rgba(201,162,74,0.1); }
.legend-bar { height: 0.5rem; flex: 1; border-radius: 999px; }

/* ---- Utility spacing ---- */
.mt-1{margin-top:.25rem} .mt-2{margin-top:.5rem} .mt-3{margin-top:.75rem} .mt-4{margin-top:1rem}
.mt-5{margin-top:1.25rem} .mt-6{margin-top:1.5rem} .mt-8{margin-top:2rem} .mt-10{margin-top:2.5rem} .mt-12{margin-top:3rem}
.mb-2{margin-bottom:.5rem} .mb-3{margin-bottom:.75rem} .mb-4{margin-bottom:1rem} .mb-6{margin-bottom:1.5rem} .mb-10{margin-bottom:2.5rem} .mb-12{margin-bottom:3rem}
.flex{display:flex} .items-center{align-items:center} .items-end{align-items:flex-end} .items-start{align-items:flex-start}
.justify-between{justify-content:space-between} .flex-wrap{flex-wrap:wrap} .gap2{gap:.5rem} .gap3{gap:.75rem} .gap4{gap:1rem} .gap6{gap:1.5rem}
.text-center{text-align:center} .shrink0{flex-shrink:0} .w-full{width:100%}
.fs-sm{font-size:.82rem} .fs-xs{font-size:.72rem} .lh-relaxed{line-height:1.65}

/* ---- Entrance animation ---- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.anim-fadeup { animation: fadeUp 0.7s var(--ease-out) both; }
@keyframes glowPulse { 0%,100% { opacity: 0.55; } 50% { opacity: 0.85; } }
.anim-glow { animation: glowPulse 6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .anim-fadeup, .anim-glow, .bar-fill { animation: none !important; transition: none !important; } }

/* ---- Grain overlay ---- */
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---- Native select on dark ---- */
select.select-dark {
  background: #0c1622; border: 1px solid var(--input-bd); border-radius: 0.25rem;
  padding: 0.5rem 0.75rem; font-size: 0.8rem; color: var(--fg); min-width: 160px;
  font-family: var(--font-sans); transition: border-color 0.16s var(--ease-out);
}
select.select-dark:hover { border-color: rgba(201,162,74,0.45); }
select.select-dark:focus { outline: none; border-color: var(--brass); }
select.select-dark option { background: #0c1622; color: var(--fg); }

/* sticky filter bar */
.filter-bar {
  position: sticky; top: 68px; z-index: 30;
  border-bottom: 1px solid rgba(201,162,74,0.18);
  background: rgba(10,18,28,0.95); backdrop-filter: blur(14px);
}
.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field > span { font-family: var(--font-mono); font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); }

/* simple svg chart helpers */
.chart svg { width: 100%; height: auto; display: block; }
.chart-axis { font-family: var(--font-mono); font-size: 9px; fill: var(--muted); }

/* ---- Chart container height ---- */
.chart { width: 100%; min-height: 200px; }
.chart svg { width: 100%; height: auto; }

/* ---- Back link (interior pages) ---- */
.back-link {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); transition: color 0.16s var(--ease-out);
}
.back-link:hover { color: var(--brass); }

/* ---- Case study block ---- */
.case { padding: 1.6rem; }
.case-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.case-count { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex-shrink: 0; }
.quotes { display: flex; flex-direction: column; gap: 0.6rem; }
.quote {
  position: relative; margin: 0; padding: 0.6rem 0 0.6rem 1.1rem;
  border-left: 2px solid rgba(201,162,74,0.45);
}
.quote p { font-style: italic; color: rgba(238,242,246,0.92); font-size: 0.86rem; line-height: 1.55; margin-top: 0.25rem; }
.why { border-top: 1px solid var(--border); padding-top: 1rem; }

/* ---- Claim lists (shows / does not claim) ---- */
.claim-list li {
  position: relative; padding-left: 1.6rem; margin-bottom: 0.8rem;
  font-size: 0.9rem; line-height: 1.55; color: var(--fg-soft);
}
.claim-list.shows li::before {
  content: "+"; position: absolute; left: 0; top: -1px;
  font-family: var(--font-display); font-weight: 800; color: var(--teal);
}
.claim-list.nots li::before {
  content: "\2212"; position: absolute; left: 0; top: -1px;
  font-family: var(--font-display); font-weight: 800; color: var(--muted);
}

/* gap helpers also usable as grid gaps */
.gap4 { gap: 1rem; }
.gap6 { gap: 1.5rem; }
