/* ==========================================================================
   DeFlock Columbus — design system
   Dark surveillance-aware palette, cyan accent, Roboto.
   ========================================================================== */

:root {
  --bg:            #121212;
  --bg-alt:        #181818;
  --surface:       #212121;
  --surface-2:     #2a2a2a;
  --border:        #343434;

  --text:          #ffffff;
  --text-muted:    #b3b3b3;
  --text-dim:      #8a8a8a;

  --accent:        #1297c3;
  --accent-hover:  #15abdd;
  --accent-dim:    rgba(18, 151, 195, 0.14);
  --danger:        #e04b4b;
  --warn:          #e0a33a;

  --font: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;

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

  --wrap:      1160px;
  --wrap-text: 760px;

  --nav-h: 64px;

  --shadow:    0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------------------- reset -- */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

h1, h2, h3, h4 {
  margin: 0 0 0.5em;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.1rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.6rem, 3.8vw, 2.25rem); }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: 0.5em; }

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 3rem 0;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  font-weight: 700;
}
.skip-link:focus { left: 0; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ------------------------------------------------------------- layout -- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.wrap-text { max-width: var(--wrap-text); }

.section { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.section--alt { background: var(--bg-alt); }
.section--surface { background: var(--surface); }

.section__eyebrow {
  display: block;
  margin-bottom: 0.6rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lead {
  font-size: 1.15rem;
  color: var(--text-muted);
}

.muted { color: var(--text-muted); }
.dim   { color: var(--text-dim); font-size: 0.9rem; }
.center { text-align: center; }

/* ------------------------------------------------------------ buttons -- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  padding: 13px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.btn:hover {
  background: var(--accent-hover);
  color: #fff;
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text);
}
.btn--ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: #fff;
}

.btn--lg { padding: 16px 34px; font-size: 0.95rem; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.btn-row--center { justify-content: center; }

/* ------------------------------------------------------------ banner -- */

/* Time-boxed announcement bar. `data-expires` in the markup drives an
   auto-hide so a passed deadline never sits at the top of the site
   advertising itself. */
.banner {
  background: var(--accent);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}
.banner[hidden] { display: none; }

.banner__inner {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 10px 20px;
}

.banner__text {
  flex: 1;
  text-transform: uppercase;
}
.banner__text a {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.banner__text a:hover { color: #fff; }

.banner__close {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  cursor: pointer;
}
.banner__close:hover { background: rgba(0, 0, 0, 0.32); }

@media (max-width: 560px) {
  .banner__inner { padding: 9px 14px; gap: 10px; }
  .banner { font-size: 0.74rem; }
}

/* ---------------------------------------------------------- factgrid -- */

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 18px;
  margin: 2.5rem 0;
}

.fact {
  padding: 24px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.fact__num {
  display: block;
  font-size: 2.3rem;
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.fact__num--alarm { color: var(--danger); }

.fact__body {
  margin-top: 0.6rem;
  color: var(--text-muted);
  font-size: 0.94rem;
}

.fact__src {
  display: block;
  margin-top: 0.7rem;
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ---------------------------------------------------------- timeline -- */

.timeline {
  margin: 2.5rem 0 0;
  padding: 0 0 0 26px;
  list-style: none;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  margin-bottom: 26px;
  padding-left: 4px;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -33px;
  top: 7px;
  width: 12px;
  height: 12px;
  border: 2px solid var(--bg);
  border-radius: 50%;
  background: var(--accent);
}
.timeline li.is-next::before {
  background: var(--warn);
  box-shadow: 0 0 0 4px rgba(224, 163, 58, 0.25);
}

.timeline__date {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.timeline li.is-next .timeline__date { color: var(--warn); }

.timeline__body { color: var(--text-muted); font-size: 0.96rem; }

/* ----------------------------------------------------------- sources -- */

.sources {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.sources li { margin-bottom: 0.7em; }

/* --------------------------------------------------------------- nav -- */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--nav-h);
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.nav__brand:hover { color: var(--text); text-decoration: none; }
.nav__brand svg { color: var(--accent); flex: none; }
.nav__brand span { color: var(--accent); }

.nav__links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav__link {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav__link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  text-decoration: none;
}
.nav__link[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.nav__ig {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  color: var(--text-muted);
}
.nav__ig:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }

.nav__toggle {
  display: none;
  margin-left: auto;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

@media (max-width: 820px) {
  .nav__toggle { display: inline-flex; }

  /* The drawer's open state is a class on .nav, not the `hidden` attribute.
     `hidden` only works via a low-specificity UA rule, so the `.nav__links`
     class silently beat it and the menu rendered open regardless. */
  .nav__links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--nav-h);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 8px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
  }
  .nav.is-open .nav__links { display: flex; }
  .nav__link, .nav__ig {
    width: auto;
    height: auto;
    justify-content: flex-start;
    padding: 12px 14px;
    font-size: 1rem;
  }
  .nav__ig { gap: 10px; }
}

/* -------------------------------------------------------------- hero -- */

.hero {
  position: relative;
  padding: clamp(4rem, 11vw, 7.5rem) 0 clamp(3rem, 7vw, 4.5rem);
  background:
    linear-gradient(180deg, rgba(18, 18, 18, 0.82) 0%, rgba(18, 18, 18, 0.94) 55%, var(--bg) 100%),
    radial-gradient(1100px 500px at 50% -10%, rgba(18, 151, 195, 0.22), transparent 70%),
    var(--bg);
  overflow: hidden;
}

/* Faint grid, evoking a surveillance overlay. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 78%);
  pointer-events: none;
}

.hero > * { position: relative; }

.hero__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
  padding: 6px 14px;
  border: 1px solid rgba(18, 151, 195, 0.45);
  border-radius: 999px;
  background: var(--accent-dim);
  color: #7fd4f0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__title { margin-bottom: 0.35em; }
.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__sub {
  max-width: 640px;
  margin: 0 auto 2.5rem;
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  color: var(--text-muted);
}

/* ------------------------------------------------------------- stats -- */

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
  max-width: 860px;
  margin: 0 auto 2.75rem;
}

.stat {
  padding: 26px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(33, 33, 33, 0.72);
  text-align: center;
}

.stat__num {
  display: block;
  font-size: clamp(2.2rem, 6vw, 3.1rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.stat__label {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.stat__note {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-dim);
  font-size: 0.75rem;
}

/* ------------------------------------------------------------- cards -- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 20px;
  margin-top: 2.5rem;
}

.card {
  padding: 28px 26px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.card--danger { border-top-color: var(--danger); }
.card--warn   { border-top-color: var(--warn); }

.card__icon {
  margin-bottom: 14px;
  color: var(--accent);
}
.card--danger .card__icon { color: var(--danger); }
.card--warn .card__icon   { color: var(--warn); }

.card h3 { margin-bottom: 0.45em; }
.card p  { color: var(--text-muted); font-size: 0.97rem; margin-bottom: 0; }

/* --------------------------------------------------------- step list -- */

.steps {
  counter-reset: step;
  margin: 2.5rem 0 0;
  padding: 0;
  list-style: none;
}

.step {
  position: relative;
  margin-bottom: 20px;
  padding: 26px 26px 26px 82px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 26px;
  top: 26px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1;
}

.step h3 { margin-bottom: 0.4em; }
.step p  { color: var(--text-muted); font-size: 0.97rem; }
.step ul { color: var(--text-muted); font-size: 0.97rem; margin-bottom: 0; }

@media (max-width: 560px) {
  .step { padding: 74px 22px 24px; }
  .step::before { left: 22px; top: 22px; }
}

/* ---------------------------------------------------------- callouts -- */

.callout {
  margin: 2rem 0;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.97rem;
}
.callout strong { color: var(--text); }
.callout--warn { border-left-color: var(--warn); }

/* --------------------------------------------------------- split row -- */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(28px, 5vw, 56px);
  align-items: start;
}

/* --------------------------------------------------------------- cta -- */

.cta {
  padding: clamp(3.5rem, 8vw, 5rem) 0;
  background:
    linear-gradient(180deg, rgba(18, 151, 195, 0.16), rgba(18, 151, 195, 0.04)),
    var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.cta p { max-width: 560px; margin-inline: auto; color: var(--text-muted); }

/* ---------------------------------------------------------- map page -- */

/* The map fills whatever the banner and nav leave behind. Done with flex
   rather than `calc(100vh - ...)` so nothing has to know their heights —
   the banner wraps to two lines on narrow screens and grows again when the
   web font swaps in, and any measured value is wrong between those moments. */
.page-map {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page-map main {
  flex: 1;
  display: flex;
  min-height: 0;
}

.map-shell {
  position: relative;
  flex: 1;
  min-height: 520px;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg);
}

.map-panel {
  position: absolute;
  z-index: 500;
  top: 14px;
  left: 14px;
  width: 300px;
  max-width: calc(100% - 28px);
  max-height: calc(100% - 28px);
  overflow-y: auto;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(24, 24, 24, 0.95);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(6px);
}

.map-panel h1 {
  margin-bottom: 0.3em;
  font-size: 1.3rem;
}

.map-panel__count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-dim);
}
.map-panel__count b {
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.map-panel__count span {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.map-panel p { font-size: 0.88rem; color: var(--text-muted); }

.map-panel__status {
  font-size: 0.85rem;
  color: var(--text-dim);
}
.map-panel__status[data-state="error"] { color: var(--danger); }

.map-panel__toggle {
  display: none;
  position: absolute;
  z-index: 501;
  top: 14px;
  left: 14px;
}

@media (max-width: 700px) {
  .map-panel {
    top: auto;
    bottom: 14px;
    left: 14px;
    right: 14px;
    width: auto;
    max-height: 46%;
  }
}

/* Leaflet dark-mode overrides */
.leaflet-container { background: #101010; font-family: var(--font); }
.leaflet-bar a,
.leaflet-control-zoom a {
  background: var(--surface);
  color: var(--text);
  border-bottom-color: var(--border);
}
.leaflet-bar a:hover { background: var(--surface-2); color: var(--text); }
.leaflet-control-attribution {
  background: rgba(18, 18, 18, 0.85) !important;
  color: var(--text-dim) !important;
  font-size: 11px;
}
.leaflet-control-attribution a { color: var(--text-muted) !important; }

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.leaflet-popup-content { margin: 14px 16px; font-size: 0.9rem; line-height: 1.55; }
.leaflet-popup-content h4 { margin: 0 0 8px; font-size: 1rem; }
.leaflet-popup-content dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 0 0 10px;
}
.leaflet-popup-content dt {
  color: var(--text-dim);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.leaflet-popup-content dd { margin: 0; color: var(--text-muted); }
.leaflet-container a.leaflet-popup-close-button { color: var(--text-dim); }

.alpr-marker {
  width: 14px;
  height: 14px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(224, 75, 75, 0.28);
}

.marker-cluster {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(224, 75, 75, 0.28);
  color: #fff;
  font-weight: 700;
}
.marker-cluster div {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(224, 75, 75, 0.85);
  font-size: 0.85rem;
}

/* ------------------------------------------------------------ footer -- */

.footer {
  padding: 3.5rem 0 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 0.92rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(auto-fit, minmax(150px, 1fr));
  gap: 36px;
  margin-bottom: 2.5rem;
}

.footer h4 {
  margin-bottom: 1rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 0.6em; }
.footer a { color: var(--text-muted); }
.footer a:hover { color: var(--accent-hover); }

.footer__blurb { color: var(--text-muted); max-width: 340px; }

.footer__social {
  display: flex;
  gap: 10px;
  margin-top: 1rem;
}
.footer__social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-muted);
}
.footer__social a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
  padding-top: 1.6rem;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.83rem;
}

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