@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-wght-italic.woff2") format("woff2");
  font-weight: 100 900; font-style: italic; font-display: swap;
}

:root {
  --asphalt: #2E3133;
  --asphalt-2: #5B6064;
  --concrete: #E9E9E4;
  --paper: #F7F7F3;
  --rule: #CFCFC8;
  --lane: #2F7D4F;      /* bike-lane green; the sign panel */
  --lane-deep: #1F5A38;
  --sev0: #B9B6AD;
  --sev1: #E3AE45;
  --sev2: #DE7A2C;
  --sev3: #C2352A;
  --sev4: #5E1020;
  --focus: #1D5FD6;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--concrete);
  color: var(--asphalt);
  font-family: "Overpass", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.preview {
  background: #FFE9A8; color: #3A2E00;
  padding: 10px 16px; font-size: 15px; line-height: 1.4;
  border-bottom: 1px solid #E0C766;
}

/* The one loud thing: a road sign. */
.top { max-width: 1200px; margin: 0 auto; padding: 28px 16px 8px; }
.sign {
  background: var(--lane);
  color: #fff;
  border-radius: 14px;
  padding: 22px 26px 20px;
  box-shadow: inset 0 0 0 4px var(--lane), inset 0 0 0 7px #fff;
  max-width: 820px;
}
.sign h1 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(34px, 6.2vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.01em;
}
.sign-sub { margin: 10px 0 0; font-size: clamp(16px, 2.2vw, 20px); font-weight: 500; opacity: .92; }
.lede { max-width: 70ch; margin: 18px 0 0; font-size: 19px; }
.lede strong { font-weight: 750; }

main { max-width: 1200px; margin: 0 auto; padding: 0 16px 64px; }

.mapwrap {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 0;
  margin-top: 22px;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
}
#map { height: min(72vh, 680px); min-height: 380px; background: #DADAD4; }
.filters { padding: 16px 18px; border-left: 1px solid var(--rule); display: flex; flex-direction: column; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 700; font-size: 15px; margin-bottom: 6px; padding: 0; }
select {
  font: inherit; font-size: 16px; color: inherit;
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  padding: 6px 8px; width: 100%;
}
.yearpick { display: flex; gap: 10px; }
.yearpick label { flex: 1; font-size: 14px; color: var(--asphalt-2); }
.yearpick select { margin-top: 2px; }
.sevpick { display: flex; flex-direction: column; gap: 4px; }
.sevpick label { display: flex; align-items: center; gap: 8px; font-size: 15px; cursor: pointer; min-height: 30px; }
.sevpick input { width: 18px; height: 18px; margin: 0; accent-color: var(--asphalt); }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; border: 1px solid rgba(0,0,0,.25); }
.sevpick .n { margin-left: auto; color: var(--asphalt-2); font-size: 14px; }
.count { margin: auto 0 0; font-size: 15px; color: var(--asphalt-2); }
.count strong { color: var(--asphalt); font-size: 22px; font-weight: 800; display: block; }

.block { margin-top: 52px; max-width: 900px; }
h2 { font-size: 30px; font-weight: 800; line-height: 1.1; margin: 0 0 6px; }
h3 { font-size: 19px; font-weight: 750; margin: 26px 0 4px; }
.note { margin: 0 0 16px; color: var(--asphalt-2); max-width: 70ch; font-size: 16px; }

/* year bars */
.years { display: grid; grid-template-columns: 3.2em 1fr 3.4em; gap: 4px 10px; align-items: center; }
.years .y { font-weight: 650; font-size: 15px; }
.years .bar { height: 20px; display: flex; border-radius: 3px; overflow: hidden; background: transparent; }
.years .bar span { display: block; height: 100%; }
.years .v { text-align: right; font-size: 15px; }
.years .partial { color: var(--asphalt-2); font-weight: 400; }

/* clusters */
.sites { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.sites li { border-bottom: 1px solid var(--rule); }
.sites button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: 2.4em 1fr auto; gap: 12px; align-items: baseline;
  padding: 11px 4px;
}
.sites button:hover .where { text-decoration: underline; text-underline-offset: 3px; }
.sites button:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.sites .rank { font-weight: 800; color: var(--lane-deep); font-size: 18px; }
.sites .where { font-weight: 650; }
.sites .town { display: block; font-weight: 400; color: var(--asphalt-2); font-size: 15px; }
.sites .num { text-align: right; font-size: 15px; }
.sites .num b { font-size: 20px; font-weight: 800; display: block; }
.sites .empty { padding: 14px 4px; color: var(--asphalt-2); }

.prose { max-width: 68ch; }
.prose p { margin: 0 0 14px; }
.byline { color: var(--asphalt-2); font-size: 15px; margin-top: 28px; }

/* map popup */
.maplibregl-popup-content {
  font-family: "Overpass", system-ui, sans-serif; font-size: 15px; line-height: 1.4;
  padding: 12px 14px; border-radius: 8px; color: var(--asphalt); max-width: 280px;
}
.pop-when { color: var(--asphalt-2); font-size: 14px; }
.pop-where { font-weight: 750; margin: 2px 0 6px; font-size: 16px; }
.pop-sev { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; }
.pop dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 14px; }
.pop dt { color: var(--asphalt-2); }
.pop dd { margin: 0; }

@media (max-width: 820px) {
  .mapwrap { grid-template-columns: 1fr; }
  .filters { border-left: 0; border-top: 1px solid var(--rule); }
  #map { height: 62vh; }
  .sign { padding: 18px 18px 16px; }
  .lede { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
