:root {
  --bg: #0b0d10;
  --bg-alt: #11151a;
  --surface: #161b22;
  --surface-2: #1c232c;
  --text: #eef2f6;
  --muted: #9aa7b4;
  --line: #232c36;
  --brand: #e11d2e;      /* breaking-news red */
  --fire: #ff5630;
  --police: #3b82f6;
  --medical: #22c55e;
  --traffic: #f5a623;
  --hazmat: #a855f7;
  --radius: 12px;
  --maxw: 1160px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.narrow { max-width: 760px; }
.center { text-align: center; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, .brand-text { font-family: "Barlow Semi Condensed", "Inter", sans-serif; letter-spacing: .3px; line-height: 1.1; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: rgba(11,13,16,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 14px; height: 14px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(225,29,46,.2); }
.brand-text { font-size: 1.35rem; font-weight: 600; letter-spacing: 1px; }
.brand-text strong { color: var(--brand); font-weight: 700; }
.tagline { color: var(--muted); font-size: .82rem; justify-self: start; border-left: 1px solid var(--line); padding-left: 14px; }
.nav-links { display: flex; gap: 20px; justify-self: end; }
.nav-links a { color: var(--muted); font-weight: 500; font-size: .93rem; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 6px; justify-self: end; }
.nav-toggle span { width: 22px; height: 2px; background: var(--text); }

/* Buttons */
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 12px 22px; border-radius: 8px; font-weight: 700; border: 0; cursor: pointer; font-size: .98rem; transition: transform .12s, box-shadow .12s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(225,29,46,.3); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { box-shadow: none; border-color: var(--muted); }
.mini-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 6px; padding: 3px 10px; font-size: .78rem; cursor: pointer; margin-left: 8px; }
.mini-btn:hover { color: var(--text); }

/* Hero */
.hero { padding: 70px 0 54px; background: radial-gradient(900px 380px at 85% -20%, rgba(225,29,46,.16), transparent 60%); border-bottom: 1px solid var(--line); }
.kicker { display: inline-flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: 2px; font-size: .74rem; font-weight: 700; color: var(--muted); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--brand); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(225,29,46,.6);} 50% { opacity: .6; box-shadow: 0 0 0 6px rgba(225,29,46,0);} }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); margin: 16px 0 18px; }
.lede { max-width: 680px; color: var(--muted); font-size: 1.12rem; }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }

/* Sections */
.section { padding: 62px 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { margin-bottom: 26px; }
.section h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.section-sub { color: var(--muted); margin-top: 8px; max-width: 640px; }
.section p + p { margin-top: 14px; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.filter { background: var(--surface); border: 1px solid var(--line); color: var(--muted); padding: 8px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: .15s; }
.filter:hover { color: var(--text); border-color: var(--muted); }
.filter.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Feed grid */
.feed-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 24px; align-items: start; }
.feed-status { color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.feed-status #feed-count { color: var(--text); font-weight: 700; }
.source { font-weight: 700; font-size: .78rem; padding: 2px 9px; border-radius: 999px; }
.source.live { color: #0a0; background: rgba(34,197,94,.14); color: var(--medical); }
.source.live::before { content: "● "; }
.source.demo { color: var(--traffic); background: rgba(245,166,35,.14); }
.incident-list { list-style: none; display: flex; flex-direction: column; gap: 10px; max-height: 560px; overflow-y: auto; padding-right: 6px; }
.incident { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 13px 15px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; animation: slideIn .35s ease; }
.incident.new { box-shadow: 0 0 0 1px var(--brand); }
@keyframes slideIn { from { opacity: 0; transform: translateY(-6px);} to { opacity:1; transform: none;} }
.incident.fire { border-left-color: var(--fire); }
.incident.police { border-left-color: var(--police); }
.incident.medical { border-left-color: var(--medical); }
.incident.traffic { border-left-color: var(--traffic); }
.incident.hazmat { border-left-color: var(--hazmat); }
.incident .type { font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.incident.fire .type { color: var(--fire);} .incident.police .type { color: var(--police);}
.incident.medical .type { color: var(--medical);} .incident.traffic .type { color: var(--traffic);}
.incident.hazmat .type { color: var(--hazmat);}
.incident .title { font-weight: 600; grid-column: 1 / -1; }
.incident .loc { color: var(--muted); font-size: .88rem; grid-column: 1 / -1; }
.incident .time { color: var(--muted); font-size: .8rem; white-space: nowrap; text-align: right; }
.feed-note { color: var(--muted); font-size: .82rem; margin-top: 14px; }
.feed-note code { background: var(--surface-2); padding: 2px 6px; border-radius: 5px; font-size: .85em; }

/* PulsePoint live embed */
.embed-wrap { position: relative; width: 100%; height: 860px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.embed-wrap iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 700px) { .embed-wrap { height: 640px; } }

/* Map */
#map { height: 560px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; z-index: 1; }
.map-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; color: var(--muted); font-size: .82rem; }
.map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot-fire { background: var(--fire);} .dot-police { background: var(--police);}
.dot-medical { background: var(--medical);} .dot-traffic { background: var(--traffic);} .dot-hazmat { background: var(--hazmat);}
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); }
.leaflet-popup-content { font-family: "Inter", sans-serif; }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: relative; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--brand); transform: translateY(-3px); }
.card-num { font-family: "Barlow Semi Condensed"; color: var(--brand); font-size: 1.4rem; font-weight: 700; }
.card h3 { margin: 6px 0 8px; font-size: 1.2rem; }
.card p { color: var(--muted); font-size: .93rem; }
.card .tag { display: inline-block; font-size: .68rem; text-transform: uppercase; letter-spacing: 1.4px; color: var(--brand); font-weight: 700; margin-bottom: 8px; }
.card.article h3 a { color: var(--text); } .card.article:hover h3 a { color: var(--brand); }

/* Pledge / tick list */
.pledge { margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.pledge h3 { margin-bottom: 12px; }
.tick { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.tick li { color: var(--muted); padding-left: 24px; position: relative; }
.tick li::before { content: "→"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.tick strong { color: var(--text); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 16px; font-size: .9rem; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; cursor: default; transition: .15s; }
.chip:hover { border-color: var(--muted); color: var(--text); }
.chip b { color: var(--text); font-weight: 700; }
.chip .count { background: var(--surface-2); border-radius: 999px; padding: 1px 8px; font-size: .78rem; color: var(--brand); font-weight: 700; }

/* Signup */
.signup { display: flex; gap: 10px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }
.signup input { background: var(--surface); border: 1px solid var(--line); color: var(--text); padding: 12px 16px; border-radius: 8px; font-size: 1rem; min-width: 280px; }
.signup input:focus { outline: none; border-color: var(--brand); }
.form-msg { margin-top: 14px; color: var(--medical); font-weight: 600; min-height: 1.2em; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0 20px; background: var(--bg-alt); }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: start; }
.foot-note { color: var(--muted); font-size: .84rem; margin-top: 8px; max-width: 420px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; }
.foot-links a { color: var(--muted); font-size: .9rem; }
.foot-links a:hover { color: var(--text); }
.copyright { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.copyright p { color: var(--muted); font-size: .82rem; }

/* Responsive */
@media (max-width: 900px) { .feed-grid { grid-template-columns: 1fr; } #map { height: 400px; } }
@media (max-width: 780px) {
  .nav { grid-template-columns: auto auto; }
  .tagline { display: none; }
  .nav-toggle { display: flex; }
  .nav-links { position: absolute; top: 62px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg-alt); border-bottom: 1px solid var(--line); max-height: 0; overflow: hidden; transition: max-height .25s ease; }
  .nav-links.open { max-height: 420px; }
  .nav-links a { padding: 14px 22px; border-top: 1px solid var(--line); width: 100%; }
}
