:root {
  --ink: #17224d;
  --ink-soft: #55607f;
  --sun: #ffc531;
  --sun-deep: #e9a400;
  --sky: #eaf1fa;
  --paper: #ffffff;
  --line: #d5deec;
  --local: #1f7a4d;
  --display: "Bricolage Grotesque", "Trebuchet MS", sans-serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--sun-deep); outline-offset: 2px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2.5rem, 7vw, 4.75rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 4vw, 2.6rem); font-weight: 700; max-width: 22ch; }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0 0 1em; max-width: 68ch; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sun); padding: 0.5rem 1rem; z-index: 20; }
.skip:focus { left: 0; }

/* Header */
.site-head { background: var(--ink); color: #fff; }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 0.9rem; flex-wrap: wrap; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; text-decoration: none; display: flex; align-items: center; gap: 0.55rem; }
.brand::before { content: ""; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--sun); flex: none; }
.nav { display: flex; gap: 1.4rem; flex-wrap: wrap; font-size: 0.98rem; }
.nav a { text-decoration: none; padding-block: 0.25rem; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--sun); }

/* Hero */
.hero { background: var(--ink); color: #fff; position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; padding-block: clamp(2.5rem, 7vw, 5rem) clamp(3rem, 8vw, 6rem); }

.hero h1 { max-width: 13ch; }
.hero .lede { font-size: clamp(1.1rem, 2.2vw, 1.3rem); max-width: 46ch; margin-top: 1.4rem; color: #dfe6f7; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 2rem; }
.btn { display: inline-block; font-weight: 700; text-decoration: none; padding: 0.8rem 1.3rem; border-radius: 999px; border: 2px solid transparent; font-size: 1rem; cursor: pointer; font-family: inherit; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #ffd35e; }
.btn-ghost { border-color: rgba(255,255,255,0.55); color: #fff; }
.btn-ghost:hover { border-color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #24337a; }
.btn-line { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-line:hover { background: var(--sky); }
.hero-facts { display: flex; flex-wrap: wrap; gap: 0.6rem 2.2rem; max-width: 26rem; margin: 2.6rem 0 0; padding: 0; list-style: none; font-size: 0.98rem; color: #dfe6f7; }
.hero-facts strong { color: #fff; font-family: var(--display); font-size: 1.15rem; }

.page-head { background: var(--ink); color: #fff; }
.page-head .wrap { padding-block: clamp(2rem, 5vw, 3.5rem); }
.page-head h1 { font-size: clamp(2.1rem, 5.5vw, 3.6rem); max-width: 18ch; }
.page-head p { color: #dfe6f7; margin-top: 1rem; font-size: 1.15rem; }
.crumbs { font-size: 0.92rem; color: #c3cdea; margin-bottom: 1rem; }
.crumbs a { color: inherit; }

/* Sections */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-sky { background: var(--sky); }
.section > .wrap > h2 { margin-bottom: 1.2rem; }
.section-intro { font-size: 1.12rem; color: var(--ink-soft); margin-bottom: 2rem; }

/* Filters */
.filters { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
.search { display: block; }
.search span, .sort span, .chips-label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.35rem; }
.search input, .sort select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 2px solid var(--ink); border-radius: 12px; padding: 0.7rem 0.9rem;
}
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 999px; padding: 0.4rem 0.95rem; cursor: pointer; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
@media (min-width: 760px) {
  .filters { grid-template-columns: 2fr 1fr; align-items: end; }
  .filters .chip-group { grid-column: 1 / -1; }
}
.count { font-size: 0.95rem; color: var(--ink-soft); margin: 0 0 0.6rem; }

/* Directory list */
.list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.row { display: grid; gap: 0.5rem 1.5rem; padding: 1.4rem 0; border-bottom: 1px solid var(--line); grid-template-columns: 1fr; }
.row[hidden] { display: none; }
.row h3 a { text-decoration: none; }
.row h3 a:hover { text-decoration: underline; }
.row-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.93rem; color: var(--ink-soft); margin-top: 0.35rem; }
.row-usp { margin: 0; }
.row-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.6rem; padding: 0; list-style: none; }
.row-tags li { font-size: 0.83rem; background: var(--sky); border-radius: 6px; padding: 0.12rem 0.5rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-start; }
.row-actions .btn { padding: 0.5rem 1rem; font-size: 0.93rem; }
.badge { display: inline-block; font-size: 0.8rem; font-weight: 700; border-radius: 6px; padding: 0.1rem 0.5rem; vertical-align: middle; }
.badge-local { background: #dff3e7; color: var(--local); }
.badge-region { background: #e2ecfb; color: #234a94; }
.badge-state { background: #efe6fb; color: #5a2f9b; }
.badge-national { background: #eceef3; color: #454d63; }
.tier { font-weight: 700; color: var(--ink); letter-spacing: 0.05em; }
.tier i { font-style: normal; color: #b9c2d6; }
@media (min-width: 860px) {
  .row { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr) auto; align-items: start; }
  .row-actions { flex-direction: column; align-items: stretch; min-width: 9.5rem; text-align: center; }
}
.empty { padding: 2rem 0; border-bottom: 1px solid var(--line); }

/* Table */
.table-scroll { overflow-x: auto; border-top: 2px solid var(--ink); }
table { border-collapse: collapse; width: 100%; font-size: 0.97rem; min-width: 620px; }
th, td { text-align: left; padding: 0.7rem 1rem 0.7rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-size: 0.95rem; }
td.num, th.num { font-variant-numeric: tabular-nums; }

/* Prose blocks */
.cols { display: grid; gap: 2rem 3rem; }
@media (min-width: 860px) { .cols { grid-template-columns: 1fr 1fr; } .cols-3 { grid-template-columns: repeat(3, 1fr); } }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.4rem 3rem; }
@media (min-width: 760px) { .checks { grid-template-columns: 1fr 1fr; } }
.checks li { padding-left: 1.6rem; position: relative; }
.checks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--sun); box-shadow: 0 0 0 2px var(--ink); }
.checks h3 { margin-bottom: 0.3rem; }
.checks p { margin: 0; color: var(--ink-soft); }
.figures { display: grid; gap: 1.5rem 2.5rem; margin: 0 0 2rem; }
@media (min-width: 700px) { .figures { grid-template-columns: repeat(3, 1fr); } }
.figures div { border-top: 2px solid var(--ink); padding-top: 0.8rem; }
.figures dt { font-size: 0.95rem; color: var(--ink-soft); }
.figures dd { margin: 0.15rem 0 0; font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: -0.02em; }
.figures small { display: block; font-family: var(--body); font-size: 0.85rem; font-weight: 400; letter-spacing: 0; color: var(--ink-soft); margin-top: 0.2rem; }
.note { font-size: 0.92rem; color: var(--ink-soft); }
.prose h2 { margin: 2.5rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.8rem 0 0.5rem; }
.prose ul, .prose ol { max-width: 68ch; padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }

/* FAQ */
.faq { border-top: 2px solid var(--ink); max-width: 820px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 1.15rem; padding: 1.1rem 2rem 1.1rem 0; list-style: none; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.2rem; top: 0.9rem; font-size: 1.5rem; font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding-bottom: 1.1rem; margin: 0; }

/* Profile */
.profile { display: grid; gap: 2.5rem 4rem; }
@media (min-width: 900px) { .profile { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: start; } }
.contact { background: var(--sky); border-radius: 18px; padding: 1.6rem; }
.contact h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.contact dl { margin: 0 0 1.2rem; display: grid; gap: 0.9rem; }
.contact dt { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.contact dd { margin: 0; overflow-wrap: anywhere; }
.contact .btn { display: block; text-align: center; margin-top: 0.6rem; }
.facts { margin: 0 0 2rem; border-top: 2px solid var(--ink); }
.facts div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.facts dt { font-weight: 600; }
.facts dd { margin: 0; }
.more-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }

/* Footer */
.site-foot { background: var(--ink); color: #c9d2ec; font-size: 0.95rem; }
.site-foot .wrap { padding-block: 2.5rem; display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .site-foot .wrap { grid-template-columns: 2fr 1fr; } }
.site-foot p { margin: 0 0 0.6rem; }
.site-foot nav { display: grid; gap: 0.4rem; align-content: start; }
.site-foot a { color: #fff; }

@media (max-width: 520px) {
  .nav { gap: 0.2rem 1rem; font-size: 0.92rem; }
  .site-head .wrap { gap: 0.4rem; }
}

/* Hero illustration */
.hero-art { position: absolute; z-index: 0; right: -3%; bottom: 0; width: min(54vw, 660px); height: auto; overflow: hidden; display: block; }
.sun-rise { animation: sun-rise 1.6s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.rays { transform-origin: 400px 300px; animation: rays-turn 90s linear infinite; }
.glint { opacity: 0; animation: glint 8s ease-in-out 2s infinite; }
.hero-art g:nth-of-type(3) .glint { animation-delay: 2.4s; }
.hero-art g:nth-of-type(4) .glint { animation-delay: 2.8s; }
@keyframes sun-rise { from { transform: translateY(190px); } to { transform: translateY(0); } }
@keyframes rays-turn { to { transform: rotate(360deg); } }
@keyframes glint { 0%, 82%, 100% { opacity: 0; } 90% { opacity: 1; } }
@media (max-width: 760px) {
  .hero-art { width: 96vw; right: -22vw; }
  .hero .wrap { padding-bottom: 54vw; }
  .hero-facts { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sun-rise, .rays, .glint, .flow li::after { animation: none !important; }
}
.page-head { position: relative; overflow: hidden; }
.page-head .wrap { position: relative; z-index: 1; }
.page-head::after { content: ""; position: absolute; right: -90px; bottom: -150px; width: 300px; aspect-ratio: 1; border-radius: 50%; background: var(--sun); }
@media (max-width: 760px) { .page-head::after { width: 150px; right: -60px; bottom: -90px; } }

/* Map */
.map-block { margin-bottom: 2.2rem; }
.map-block .chip-group { margin-bottom: 0.9rem; }
.map { height: clamp(300px, 46vw, 460px); border: 2px solid var(--ink); border-radius: 18px; overflow: hidden; background: var(--sky); margin-bottom: 0.6rem; z-index: 0; position: relative; }
.map-fallback { padding: 1.5rem; margin: 0; color: var(--ink-soft); }
.map.is-live .map-fallback { display: none; }
.leaflet-container { font-family: var(--body); font-size: 0.95rem; }
.leaflet-popup-content { margin: 0.8rem 1rem; line-height: 1.45; color: var(--ink); }
.leaflet-popup-content a { color: var(--ink); display: block; }
.map-name { font-family: var(--display); font-weight: 700; font-size: 1.05rem; }

/* How it works */
.flow { list-style: none; margin: 0; padding: 0; display: grid; gap: 2.2rem; counter-reset: none; }
.flow li { position: relative; padding-left: 5.2rem; }
.flow svg { position: absolute; left: 0; top: 0; width: 3.6rem; height: 3.6rem; }
.flow h3 { margin-bottom: 0.3rem; }
.flow p { margin: 0; color: var(--ink-soft); }
.flow li::after { content: ""; position: absolute; left: 1.7rem; top: 4.1rem; bottom: -1.9rem; width: 4px; background: repeating-linear-gradient(to bottom, var(--sun-deep) 0 8px, transparent 8px 16px); background-size: 4px 16px; animation: flow-down 0.9s linear infinite; }
.flow li:last-child::after { display: none; }
@keyframes flow-down { to { background-position: 0 16px; } }
@keyframes flow-right { to { background-position: 16px 0; } }
@media (min-width: 900px) {
  .flow { grid-template-columns: repeat(4, 1fr); gap: 2.5rem; }
  .flow li { padding-left: 0; padding-top: 5rem; }
  .flow li::after { left: 4.4rem; right: -1.6rem; top: 1.7rem; bottom: auto; width: auto; height: 4px; background: repeating-linear-gradient(to right, var(--sun-deep) 0 8px, transparent 8px 16px); background-size: 16px 4px; animation-name: flow-right; }
}

/* Calculator */
.calc { background: #fff; border: 2px solid var(--ink); border-radius: 18px; padding: clamp(1.2rem, 3vw, 2rem); margin-bottom: 1.5rem; max-width: 860px; }
.calc-size span { display: block; margin-bottom: 0.6rem; }
.calc-size strong { font-family: var(--display); font-size: 1.4rem; }
.calc input[type="range"] { width: 100%; accent-color: var(--ink); height: 2rem; }
.calc-bar { position: relative; height: 14px; border-radius: 7px; background: var(--sky); margin: 1rem 0 1.8rem; }
.calc-range { position: absolute; top: 0; bottom: 0; left: var(--lo, 30%); width: calc(var(--hi, 46%) - var(--lo, 30%)); background: var(--sun); border-radius: 7px; transition: left 0.15s, width 0.15s; }
.calc-avg { position: absolute; top: -5px; bottom: -5px; width: 4px; margin-left: -2px; left: var(--avg, 40%); background: var(--ink); border-radius: 2px; transition: left 0.15s; }
.calc .figures { margin-bottom: 1rem; }
.calc .figures dd { font-size: clamp(1.3rem, 3.4vw, 1.8rem); }
