:root {
    --ink: #1c1916;
    --muted: #5c564e;
    --paper: #f3eee6;
    --card: #fbf7f0;
    --line: #d9d0c3;
    --accent: #9a3b24;
    --accent-dark: #6e2818;
    --map: #3d5a45;
    --shadow: 0 18px 40px rgba(28, 25, 22, 0.08);
    --sans: "IBM Plex Sans", "Segoe UI", sans-serif;
    --serif: "Newsreader", Georgia, serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--ink);
    background:
        radial-gradient(900px 380px at 8% -10%, rgba(154, 59, 36, 0.08), transparent 55%),
        linear-gradient(180deg, #efe8dc 0%, var(--paper) 28%);
    font-family: var(--serif);
    line-height: 1.55;
}
a { color: var(--accent-dark); }
main { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 8px 0 72px; flex: 1; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(243, 238, 230, 0.94);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 10px 0 14px;
}
.top-bar,
.seek--bar {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 10px;
}
.top--plain { padding-bottom: 10px; }
.top--plain .top-bar { margin-bottom: 0; }
.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 700;
    letter-spacing: -0.03em;
}
.brand span span { color: var(--muted); font-weight: 500; }
.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--ink);
    color: #e8dcc8;
    display: grid;
    place-items: center;
    font-size: 0.95rem;
}
.seek {
    display: flex;
    gap: 0;
    min-width: 0;
    position: relative;
}
.seek input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--ink);
    border-right: 0;
    border-radius: 999px 0 0 999px;
    padding: 14px 18px;
    font: 500 1.02rem var(--sans);
    background: var(--card);
}
.seek input:focus {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
    z-index: 1;
}
.seek button[type="submit"] {
    border: 1px solid var(--ink);
    border-radius: 0 999px 999px 0;
    padding: 14px 22px;
    background: var(--ink);
    color: #f6efe4;
    font: 650 0.95rem var(--sans);
    cursor: pointer;
    white-space: nowrap;
}
.seek button[type="submit"]:hover { background: var(--accent-dark); }
.seek--bar input { padding: 16px 20px; font-size: 1.08rem; }
.seek--bar button[type="submit"] { padding: 16px 24px; }
.suggest {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    background: var(--card);
    border: 1px solid var(--ink);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 40;
}
.suggest[hidden] { display: none; }
.suggest button {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    padding: 11px 16px;
    font: 500 0.95rem var(--sans);
    text-align: left;
    cursor: pointer;
    color: var(--ink);
}
.suggest button:last-child { border-bottom: 0; }
.suggest button span { color: var(--muted); font-weight: 500; }
.suggest button.is-on,
.suggest button:hover { background: #efe4d4; }
.top-nav { display: flex; gap: 14px; font-family: var(--sans); font-weight: 600; font-size: 0.88rem; }
.top-nav a { text-decoration: none; color: var(--muted); }
.top-nav a:hover { color: var(--ink); }
.trail {
    width: min(1120px, calc(100% - 2rem));
    margin: 8px auto 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
}
.trail a { color: var(--muted); text-decoration: none; }
.trail a:hover { color: var(--ink); }
.trail [aria-current="page"] { color: var(--ink); }
.trail-sep { color: var(--line); font-weight: 500; }

.hero { padding: 36px 0 12px; }
.kicker {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin: 0 0 8px;
}
h1, h2 { font-weight: 650; letter-spacing: -0.03em; line-height: 1.15; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 4.1rem); margin: 0 0 12px; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; line-height: 1.55; }
.seek--hero { margin: 28px 0 12px; max-width: 720px; }
.seek--hero input { padding: 16px 20px; font-size: 1.08rem; }
.seek--hero button { padding: 16px 22px; }
.hints { display: flex; flex-wrap: wrap; gap: 8px 14px; font-family: var(--sans); font-size: 0.9rem; }
.hints a { background: var(--card); border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px; text-decoration: none; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 48px; }
.grid-3 article { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px 20px 8px; box-shadow: var(--shadow); }
.grid-3 h2 { font-size: 1.25rem; margin-top: 0; }

.place-head { padding: 28px 0 8px; }
.place-head h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 0 0 8px; }
.meta { font-family: var(--sans); color: var(--muted); margin: 0; }
.facts {
    list-style: none;
    padding: 0;
    margin: 18px 0 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
.facts li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 12px;
    font-family: var(--sans);
}
.facts span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}
.living {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 22px 0 8px;
}
.living article {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px 18px 8px;
}
.living h3 { margin: 0 0 6px; font-size: 1.15rem; }
.living p { color: var(--muted); line-height: 1.55; }
.living article:first-child,
.living article:last-child { grid-column: 1 / -1; }

.map-block { margin: 20px 0 36px; }
.map-years {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 10px;
    font-family: var(--sans);
}
.map-years button,
.map-years a {
    border: 1px solid var(--ink);
    background: var(--card);
    color: var(--ink);
    border-radius: 999px;
    padding: 6px 12px;
    font: 650 0.82rem var(--sans);
    cursor: pointer;
    text-decoration: none;
}
.map-years button.is-on {
    background: var(--ink);
    color: #f6efe4;
}
.live-map {
    height: 380px;
    border-radius: 18px;
    border: 1px solid var(--line);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.map-credit, .more-maps, figcaption {
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--muted);
}

.section-head h2 { margin-bottom: 6px; }
.section-head h3 { margin: 22px 0 6px; font-size: 1.25rem; }
.section-head p { margin-top: 0; color: var(--muted); }
.section-head .kicker { margin-bottom: 4px; }
.cuts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.cuts figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.cut-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}
.cuts img { width: 100%; height: 180px; object-fit: cover; display: block; background: #ddd6c8; }
.cuts figcaption { padding: 8px 10px 10px; }
.cut-full {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 56px 16px 24px;
    border: 0;
    background: rgba(18, 16, 14, 0.94);
    color: #f4efe6;
}
.cut-full::backdrop { background: #111; }
.cut-full img {
    display: block;
    max-width: min(1280px, 96vw);
    max-height: calc(100vh - 120px);
    margin: 0 auto;
    object-fit: contain;
    background: #1c1916;
}
.cut-full-cap {
    text-align: center;
    margin: 10px 0 0;
    font-family: var(--sans);
    font-size: 0.9rem;
    color: #d9d0c4;
}
.cut-full-back {
    position: absolute;
    top: 12px;
    left: 12px;
    font: 650 1rem var(--sans);
    border: 1px solid #f4efe6;
    background: transparent;
    color: #f4efe6;
    border-radius: 999px;
    padding: 8px 16px;
    cursor: pointer;
}

.crash-block { margin: 36px 0; }
.crash-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    align-items: end;
    margin: 0 0 10px;
    font-family: var(--sans);
}
.crash-controls label {
    display: grid;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--muted);
}
.crash-controls input[type="month"] {
    font: 500 1rem var(--sans);
    border: 1px solid var(--ink);
    border-radius: 10px;
    padding: 8px 10px;
    background: var(--card);
    color: var(--ink);
}
.crash-count { margin: 0; font-size: 0.95rem; color: var(--ink); }
.crash-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin: 0 0 10px;
    font-family: var(--sans);
    font-size: 0.82rem;
    color: var(--muted);
}
.crash-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px rgba(0,0,0,.2);
}
.dot-death { background: #111; }
.dot-heavy { background: #b42318; }
.dot-light { background: #ca8a04; }
.dot-none { background: #3d5a45; }

.crash-pop-wrap .leaflet-popup-content-wrapper {
    border-radius: 14px;
    font-family: var(--sans);
}
.crash-pop { font-size: 0.9rem; line-height: 1.4; min-width: 12rem; }
.crash-pop strong { display: block; margin-bottom: 6px; }
.crash-pop dl { margin: 0; }
.crash-pop dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 8px;
}
.crash-pop dd { margin: 0; }

.timeline { list-style: none; padding: 0; }
.timeline li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.timeline span { font-family: var(--sans); font-weight: 700; color: var(--accent); }

.near, .firms { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.near li, .firms li {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    display: grid;
    gap: 2px;
}
.near-item {
    position: relative;
    cursor: pointer;
}
.near-item:hover, .near-item:focus-within { z-index: 8; }
.near-pop {
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);
    width: min(280px, calc(100vw - 2rem));
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(40, 28, 18, 0.18);
    padding: 8px;
    z-index: 9;
    pointer-events: none;
}
.near-item:hover .near-pop,
.near-item:focus-within .near-pop,
.near-item.is-open .near-pop { display: block; }
.near-mini {
    height: 168px;
    border-radius: 12px;
    overflow: hidden;
    background: #e8e0d4;
}
.near-pop p {
    margin: 8px 6px 4px;
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--muted);
}
.near-pop p strong {
    display: block;
    color: var(--ink);
    font-size: 0.95rem;
}
.firms a, .near a { color: inherit; }
.near-kind { font-family: var(--sans); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--map); }
.near-walk { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.near em { font-style: normal; color: var(--muted); font-size: 0.92rem; }

.prose { max-width: 42rem; }
.prose h1 { font-size: 2.1rem; }
.mag-index { max-width: 46rem; }
.mag-list { display: grid; gap: 16px; margin: 22px 0; }
.mag-list--home { grid-template-columns: repeat(3, 1fr); }
.mag-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px 22px;
    box-shadow: var(--shadow);
}
.mag-card h2, .mag-card h3 { margin: 0 0 8px; font-size: 1.35rem; }
.mag-card h2 a, .mag-card h3 a { text-decoration: none; color: var(--ink); }
.mag-card h2 a:hover, .mag-card h3 a:hover { color: var(--accent-dark); }
.mag-card p { margin: 0 0 10px; color: var(--muted); }
.mag-card .more { font-family: var(--sans); font-weight: 650; text-decoration: none; }
.mag-meta {
    font-family: var(--sans);
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 8px;
}
.mag-home { margin: 36px 0 8px; }
.mag-home > p { font-family: var(--sans); }
@media (max-width: 800px) {
    .mag-list--home { grid-template-columns: 1fr; }
}
.btn {
    display: inline-block;
    margin-top: 8px;
    font-family: var(--sans);
    font-weight: 650;
    text-decoration: none;
    background: var(--ink);
    color: #f6efe4;
    padding: 10px 16px;
    border-radius: 999px;
}

.loading {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    background: rgba(243, 238, 230, 0.78);
    backdrop-filter: blur(8px);
}
.loading[hidden] { display: none; }
.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 28px 32px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}
.loading-card p {
    margin: 0;
    font-family: var(--sans);
    font-weight: 650;
    font-size: 0.95rem;
    color: var(--ink);
}
.loading-spin {
    width: 28px;
    height: 28px;
    border: 3px solid var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: loading-turn 0.7s linear infinite;
}
@keyframes loading-turn {
    to { transform: rotate(360deg); }
}

.foot { border-top: 1px solid var(--line); font-family: var(--sans); font-size: 0.88rem; color: var(--muted); }
.foot-inner { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 22px 0 32px; }

@media (max-width: 860px) {
    .grid-3, .cuts, .near, .firms, .facts, .living { grid-template-columns: 1fr; }
    .timeline li { grid-template-columns: 1fr; gap: 2px; }
    .suggest button { flex-direction: column; gap: 2px; }
}
