@font-face { font-family: "Roboto Mono"; src: url("fonts/RobotoMono-Upright.woff2") format("woff2"); font-weight: 100 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Roboto Mono"; src: url("fonts/RobotoMono-Italic.woff2") format("woff2"); font-weight: 100 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Messina Sans"; src: url("fonts/MessinaSans-Upright.woff2") format("woff2"); font-weight: 1 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "Messina Sans Mono"; src: url("fonts/MessinaSansMono.woff2") format("woff2"); font-weight: 1 1000; font-display: swap; }
:root {
  --mono: "Roboto Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: "Messina Sans", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --bg: #fafaf6;
  --fg: #111;
  --heading: #5c5c57;
  --muted: #72726c;
  --hair: rgba(0, 0, 0, .14);
  --panel: #fff;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0c;
    --fg: #f3f3ee;
    --heading: #a6a6a0;
    --muted: #7d7d78;
    --hair: rgba(255, 255, 255, .18);
    --panel: #181816;
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0c;
  --fg: #f3f3ee;
  --heading: #a6a6a0;
  --muted: #7d7d78;
  --hair: rgba(255, 255, 255, .18);
  --panel: #181816;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.45;
}
main { max-width: 1280px; margin: 0 auto; padding: 32px 16px 40px; }
h1 { font-family: var(--mono); font-size: clamp(1.6rem, 4vw, 2.4rem); font-weight: 700; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-family: var(--mono); font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 8px; color: var(--heading); }
header { text-align: center; }
.sub { margin: 0 auto 24px; color: var(--heading); max-width: 60ch; }

.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.side {
  display: grid; gap: 32px;
  width: 100%; max-width: 900px; margin: 0 auto;
  padding-top: 28px; border-top: 1px solid var(--hair);
}

/* ---- map ---- */
.map-wrap { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.toggle { display: inline-flex; border: 1px solid var(--hair); border-radius: 999px; padding: 3px; gap: 2px; }
.toggle button {
  font: inherit; font-family: var(--mono); font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--heading); background: none; border: 0; border-radius: 999px; padding: 6px 14px; cursor: pointer;
}
.toggle button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }
.toggle button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.map.abbr .county { font-size: 1.9cqw; }
.map {
  position: relative;
  width: 100%;
  max-width: 1000px;
  aspect-ratio: 55 / 57.7;
  container-type: inline-size;
}

.county {
  position: absolute;
  transform: translate(-50%, -50%);
  margin: 0; padding: .15em .25em;
  border: 0; background: none; color: inherit;
  font: inherit; font-family: var(--mono);
  font-size: 1.45cqw;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  font-optical-sizing: auto;
  text-underline-offset: .22em;
  text-decoration-thickness: .08em;
  transition: opacity .2s;
}
.county:hover { background: color-mix(in srgb, var(--fg) 8%, transparent); }
.county:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; border-radius: 2px; z-index: 5; }
.county.faint { opacity: .3; }
.map.filtering .county:not(.dim) { opacity: 1; }
.county.dim { opacity: .1; }


/* ---- legend ---- */
.legend { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 48px; }
@media (min-width: 640px) { .legend { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.legend .group { display: grid; gap: 4px; align-content: start; }
.legend .hint { grid-column: 1 / -1; }
.legend button {
  display: grid; grid-template-columns: 7.5em 1fr; gap: 12px; align-items: center;
  height: 3.5rem; overflow: hidden;
  text-align: left; width: 100%;
  background: none; border: 1px solid transparent; border-radius: 4px;
  padding: 0 8px; margin: 0 -8px; width: calc(100% + 16px);
  color: inherit; font: inherit; cursor: pointer;
}
.legend button:hover { border-color: var(--hair); }
.legend button:focus-visible { outline: 2px solid var(--fg); outline-offset: 1px; }
.legend button[aria-pressed="true"] { border-color: var(--fg); }
.legend .sample { font-family: var(--mono); font-size: 1.05rem; white-space: nowrap; text-underline-offset: .22em; }
.legend .what { font-size: .88rem; color: var(--muted); }
.legend .hint { font-size: .8rem; color: var(--muted); margin: 10px 0 0; }

.caveats { padding-top: 28px; border-top: 1px solid var(--hair); }
.caveats ul { margin: 0; padding-left: 1.1em; font-size: .88rem; color: var(--muted); }
.caveats li { margin-bottom: .6em; }

footer {
  width: 100%; max-width: 900px; margin: 48px auto 0; padding-top: 40px; border-top: 1px solid var(--hair);
  text-align: center; color: var(--fg);
  font-family: "Messina Sans Mono", ui-monospace, Menlo, monospace;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; font-weight: 400;
}
footer p { margin: 6px auto 0; max-width: 62ch; }
footer .logo { display: block; width: min(256px, 70%); height: auto; margin: 0 auto 18px; }

/* ---- tooltip ---- */
.tip {
  position: fixed; z-index: 20; width: max-content; max-width: 300px;
  background: var(--panel); color: var(--fg);
  border: 0; border-radius: 6px;
  padding: 16px 18px 14px; font-size: .86rem; line-height: 1.6;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .28);
  pointer-events: none;
}
.tip[hidden] { display: none; }
.tip a { pointer-events: auto; color: inherit; text-underline-offset: .2em; }
.tip.pinned { pointer-events: auto; }
.tip .name { font-family: var(--mono); display: block; font-size: 1.1rem; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.tip .flag { margin: 4px 0 0; font-size: .78rem; line-height: 1.5; color: var(--heading); font-style: italic; }
.tip .row, .tip .src { display: flex; flex-direction: column; gap: 3px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--hair); }
.tip .row:first-of-type { margin-top: 12px; }
.tip .k { font-family: var(--mono); font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--heading); line-height: 1.4; }
.tip .v { font-size: .9rem; }
.tip .detail { display: block; margin-top: 6px; color: var(--heading); font-size: .8rem; line-height: 1.55; }
.tip .detail b { color: var(--fg); font-weight: 600; }
.tip ul { margin: 0; padding: 0; list-style: none; }
.tip li + li { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

footer a, .caveats a { color: inherit; text-underline-offset: .2em; }
footer a:hover, .caveats a:hover { text-decoration-thickness: 2px; }

/* Pill link-buttons, matching the toggles at the top */
.report {
  display: inline-block; font-family: var(--mono); font-size: .72rem; font-weight: 400; line-height: 1;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: var(--heading); background: none;
  border: 1px solid var(--hair); border-radius: 999px; padding: 8px 14px;
  cursor: pointer; pointer-events: auto;
}
.report:hover { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.report:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.tip .report { margin-top: 14px; }
footer .report { margin-top: 18px; }
