:root {
  --ink: #142126;
  --muted: #53656d;
  --paper: #f6f0e3;
  --paper-2: #fffdf7;
  --blue: #0b4f6c;
  --blue-dark: #07384d;
  --green: #3f6b52;
  --brick: #9b3e2f;
  --yellow: #f2c14e;
  --line: #b8b09f;
  --shadow: 0 10px 0 rgba(20, 33, 38, .12);
  --radius: 8px;
  --focus: 4px solid #f2c14e;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(20,33,38,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,33,38,.035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 18px;
  line-height: 1.55;
}

body.high-contrast {
  --ink: #000;
  --muted: #111;
  --paper: #fff;
  --paper-2: #fff;
  --blue: #003f5c;
  --blue-dark: #00283a;
  --green: #1d5a35;
  --brick: #7a2018;
  --line: #000;
}

a { color: inherit; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: var(--focus); outline-offset: 3px; }

.wrap { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; background: #fff; padding: .75rem 1rem; z-index: 1000; }
.skip-link:focus { top: 1rem; }

.utility-strip { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem max(16px, calc((100vw - 1180px)/2)); background: var(--yellow); font-size: .86rem; border-bottom: 2px solid var(--ink); }
.text-button { background: none; border: 0; text-decoration: underline; font-weight: 700; cursor: pointer; }
.site-header { background: var(--paper-2); border-bottom: 3px solid var(--ink); position: relative; z-index: 10; }
.brand-row { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; font-family: "Atkinson Hyperlegible", sans-serif; }
.brand strong { display: block; font-size: 1.25rem; line-height: 1; }
.brand small { font-family: "IBM Plex Mono", monospace; letter-spacing: .16em; font-weight: 600; text-transform: uppercase; }
.bell-mark { width: 52px; height: 58px; display: grid; place-items: center; color: var(--paper-2); background: var(--brick); border: 3px solid var(--ink); border-radius: 48% 48% 18% 18%; font-family: "IBM Plex Mono", monospace; font-weight: 700; box-shadow: 4px 4px 0 var(--ink); }
nav { display: flex; gap: 1.5rem; font-weight: 700; }
nav a { text-decoration-thickness: 2px; text-underline-offset: 4px; }

.hero { position: relative; overflow: hidden; min-height: 620px; background: linear-gradient(180deg, #c7e3ec 0 58%, var(--paper) 58%); border-bottom: 3px solid var(--ink); }
.hero-content { position: relative; z-index: 2; padding: 80px 0 210px; max-width: 790px; margin-left: max(16px, calc((100vw - 1180px)/2)); margin-right: 16px; }
.eyebrow { margin: 0 0 .7rem; font-family: "IBM Plex Mono", monospace; font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; color: var(--blue-dark); }
h1, h2, h3 { font-family: "Atkinson Hyperlegible", sans-serif; line-height: 1.05; margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 1rem; font-size: clamp(3.3rem, 8vw, 7.2rem); letter-spacing: -.045em; }
h2 { font-size: clamp(2.3rem, 5vw, 4rem); letter-spacing: -.035em; margin-bottom: .75rem; }
h3 { font-size: 1.45rem; }
.hero-copy { max-width: 700px; font-size: clamp(1.18rem, 2.2vw, 1.5rem); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1.7rem 0 1rem; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: .7rem 1rem; border: 3px solid var(--ink); border-radius: 3px; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: 5px 5px 0 var(--ink); transition: transform .15s ease, box-shadow .15s ease; }
.button:hover { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.button.primary { background: var(--brick); color: #fff; }
.button.secondary { background: var(--paper-2); color: var(--ink); }
.button.full { width: 100%; }
.trust-note { font-size: .95rem; font-weight: 600; }
.trust-note span { color: var(--green); }
.hero-skyline { position: absolute; inset: auto 0 0; color: var(--ink); z-index: 1; }
.hero-skyline svg { display: block; width: 100%; min-width: 1100px; height: auto; }
.skyline-back { fill: #7897a3; }
.city-hall { fill: #8e5d46; }
.rowhomes { color: #7a2f25; fill: var(--brick); }
.trolley { fill: var(--yellow); stroke: var(--ink); stroke-width: 4; }
.bridge { color: var(--blue-dark); }
.trees { fill: var(--green); }

.alert-band { background: var(--blue-dark); color: #fff; border-bottom: 3px solid var(--ink); }
.alert-grid { display: grid; grid-template-columns: 190px 1fr; gap: 1.5rem; padding-block: 1rem; }

.finder-section { padding-block: 84px; }
.section-heading { max-width: 820px; margin-bottom: 2.2rem; }
.section-heading > p:last-child { color: var(--muted); font-size: 1.1rem; }
.finder-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 2rem; align-items: start; }
.filter-panel { position: sticky; top: 20px; padding: 1.25rem; background: var(--paper-2); border: 3px solid var(--ink); box-shadow: var(--shadow); }
.field-group, fieldset { margin: 0 0 1.35rem; }
fieldset { padding: 0; border: 0; }
label, legend { font-weight: 700; }
legend { margin-bottom: .55rem; }
input[type="search"], select { width: 100%; margin-top: .45rem; min-height: 48px; padding: .65rem .75rem; background: #fff; border: 2px solid var(--ink); border-radius: 2px; }
.check-row { display: grid; grid-template-columns: 24px 1fr; gap: .6rem; align-items: start; padding: .45rem 0; font-weight: 600; }
.check-row input { width: 22px; height: 22px; accent-color: var(--blue); }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.results-toolbar p { margin: 0; font-weight: 700; }
.view-switch { display: inline-flex; border: 2px solid var(--ink); }
.view-switch button { min-width: 74px; padding: .45rem .7rem; border: 0; background: var(--paper-2); font-weight: 700; cursor: pointer; }
.view-switch button + button { border-left: 2px solid var(--ink); }
.view-switch button.active { background: var(--ink); color: #fff; }
.refuge-list { display: grid; gap: 1rem; }
.refuge-card { background: var(--paper-2); border: 3px solid var(--ink); padding: 1.25rem; box-shadow: 6px 6px 0 rgba(20,33,38,.12); }
.card-top { display: flex; justify-content: space-between; gap: 1rem; }
.card-kicker { margin: 0 0 .25rem; color: var(--brick); font-family: "IBM Plex Mono", monospace; text-transform: uppercase; font-size: .75rem; font-weight: 600; letter-spacing: .08em; }
.refuge-card h3 { margin-bottom: .35rem; }
.address { margin: 0; color: var(--muted); }
.distance-chip { white-space: nowrap; height: fit-content; padding: .3rem .55rem; background: var(--yellow); border: 2px solid var(--ink); font-family: "IBM Plex Mono", monospace; font-size: .78rem; font-weight: 600; }
.feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin: 1rem 0; }
.feature { display: flex; align-items: center; gap: .5rem; padding: .48rem .6rem; border: 1px solid var(--line); background: #fff; font-size: .92rem; }
.status-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); flex: 0 0 auto; }
.status-confirmed { background: #72a276; }
.status-reported { background: var(--yellow); }
.status-unknown { background: #fff; }
.card-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .8rem; align-items: center; border-top: 1px solid var(--line); padding-top: .85rem; font-size: .9rem; }
.card-footer button { background: none; border: 0; padding: 0; color: var(--blue-dark); font-weight: 800; text-decoration: underline; cursor: pointer; }
.empty-state { padding: 2rem; border: 3px dashed var(--ink); background: var(--paper-2); }
.map-shell { border: 3px solid var(--ink); background: var(--paper-2); }
#map { height: 650px; }
.map-note { margin: 0; padding: .55rem .75rem; font-size: .8rem; border-top: 2px solid var(--ink); }

.how-section { padding-block: 84px; background: var(--blue); color: #fff; border-block: 3px solid var(--ink); }
.how-section .eyebrow { color: var(--yellow); }
.section-heading.compact { margin-bottom: 2rem; }
.principle-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.principle-grid article { min-height: 260px; padding: 1.3rem; background: var(--paper-2); color: var(--ink); border: 3px solid var(--ink); box-shadow: 7px 7px 0 rgba(0,0,0,.35); }
.big-number { display: block; margin-bottom: 2.2rem; color: var(--brick); font-family: "IBM Plex Mono", monospace; font-size: 2rem; font-weight: 700; }

.about-section { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; padding-block: 84px; }
.about-section p { font-size: 1.12rem; }
footer { padding-block: 42px; background: var(--ink); color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
footer p { margin-bottom: 0; }

@media (max-width: 820px) {
  nav { display: none; }
  .hero { min-height: 690px; }
  .hero-content { padding-top: 58px; }
  .finder-layout { grid-template-columns: 1fr; }
  .filter-panel { position: static; }
  .principle-grid, .about-section, .footer-grid { grid-template-columns: 1fr; }
  .alert-grid { grid-template-columns: 1fr; gap: .15rem; }
}

@media (max-width: 560px) {
  body { font-size: 17px; }
  .utility-strip { align-items: flex-start; }
  .brand-row { min-height: 76px; }
  .bell-mark { width: 46px; height: 50px; }
  h1 { font-size: 3.4rem; }
  .hero { min-height: 720px; }
  .hero-content { padding-bottom: 235px; }
  .feature-grid { grid-template-columns: 1fr; }
  .card-top { display: block; }
  .distance-chip { display: inline-block; margin-top: .7rem; }
  .results-toolbar { align-items: flex-start; }
}

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