:root {
  --navy: #092140;
  --navy-2: #0f2d55;
  --blue: #236caf;
  --raspberry: #b94b72;
  --gold: #c08a3e;
  --sky: #b2cff4;
  --ink: #16202c;
  --muted: #5b6776;
  --line: #e1e6ee;
  --bg: #f3f5f9;
  --card: #ffffff;
  --radius: 14px;
  --font: "Century Gothic", "Didact Gothic", "Avenir Next", Futura, system-ui, sans-serif;
  --shadow: 0 1px 2px rgba(9,33,64,.06), 0 8px 28px rgba(9,33,64,.07);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.55; overflow-x: hidden; }
a { color: var(--blue); }
h1, h2, h3 { font-weight: 400; letter-spacing: -.01em; }
.wrap { width: 100%; max-width: 1240px; margin-left: auto; margin-right: auto; padding-left: 28px; padding-right: 28px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff; overflow: hidden;
  background:
    linear-gradient(90deg, var(--navy) 30%, rgba(9,33,64,.7) 62%, rgba(9,33,64,.15)),
    var(--navy) url(header.webp) right center / cover no-repeat;
}
.nav { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; padding-bottom: 22px; }
.logo img { height: 20px; display: block; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: #dbe6f5; text-decoration: none; font-size: 15px; }
.nav-links a:hover { color: #fff; }
.hero-body { padding-top: 56px; padding-bottom: 64px; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; color: var(--sky); letter-spacing: .14em; text-transform: uppercase; font-size: 13px; }
.ring { width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--gold); display: inline-block; }
h1 { margin: 0; font-size: clamp(36px, 6vw, 68px); line-height: 1.04; max-width: 820px; }
h1 em { font-style: normal; color: var(--gold); }
.lead { margin: 20px 0 0; max-width: 600px; font-size: clamp(16px, 1.6vw, 19px); color: #d3deec; }
.stats { margin: 44px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 860px; border-top: 1px solid rgba(178,207,244,.25); }
.stats div { padding: 18px 18px 0 0; }
.stats div + div { padding-left: 18px; border-left: 1px solid rgba(178,207,244,.18); }
.stats dt { font-size: 13px; color: #9fb4cf; letter-spacing: .02em; }
.stats dd { white-space: nowrap; margin: 4px 0 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; color: #fff; font-variant-numeric: tabular-nums; }
.cta-down { display: inline-flex; gap: 8px; align-items: center; margin-top: 40px; color: #fff; text-decoration: none; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 11px 20px; font-size: 15px; transition: background .2s; }
.cta-down:hover { background: rgba(255,255,255,.1); }

/* ---------- Explore layout ---------- */
.explore { display: grid; grid-template-columns: 290px minmax(0, 1fr); gap: 24px; margin-top: -28px; position: relative; z-index: 2; align-items: start; }
.filters, .viz { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.filters { padding: 22px 20px; position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; }
.viz { padding: 24px 26px 22px; min-width: 0; }
.sheet-head, .sheet-foot { display: none; }
.f-block { padding: 14px 0; border-top: 1px solid var(--line); }
.f-block:first-of-type, .search-block { border-top: 0; padding-top: 0; }
.f-row { display: flex; justify-content: space-between; align-items: baseline; }
.f-label { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 10px; }
.mini { background: none; border: 0; padding: 0; color: var(--blue); font-size: 13px; cursor: pointer; }
.years-out { font-weight: 400; font-size: 14px; color: var(--ink); }

/* search */
.search { position: relative; }
.search input { width: 100%; font: inherit; font-size: 15px; padding: 11px 12px 11px 36px; border: 1px solid var(--line); border-radius: 10px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6776' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") 12px center no-repeat; }
.search input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(35,108,175,.15); }
.results { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.results li { padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 14px; line-height: 1.3; }
.results li small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.results li:hover, .results li[aria-selected=true] { background: var(--bg); }
.results .none { color: var(--muted); cursor: default; }

/* segmented control */
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--bg); border-radius: 10px; padding: 4px; }
.seg button { border: 0; background: none; padding: 8px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--muted); }
.seg button[aria-checked=true] { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(9,33,64,.12); }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { --c: var(--navy); display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 11px; font-size: 13px; cursor: pointer; transition: all .15s; color: var(--ink); }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c); flex: none; }
.chip b { font-weight: 400; color: var(--muted); font-size: 12px; }
.chip[aria-pressed=false] { color: #9aa4b1; background: #f7f8fa; border-style: dashed; }
.chip[aria-pressed=false] i { background: #cdd3db; }
.chip:hover { border-color: #b9c3cf; }

/* dual range */
.range { position: relative; height: 34px; }
.range::before { content: ""; position: absolute; left: 0; right: 0; top: 15px; height: 4px; border-radius: 2px; background: var(--line); }
.range input { position: absolute; left: 0; right: 0; top: 8px; width: 100%; margin: 0; pointer-events: none; background: none; -webkit-appearance: none; appearance: none; height: 18px; }
.range input::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); cursor: pointer; box-shadow: 0 1px 4px rgba(9,33,64,.25); }
.range input::-moz-range-thumb { pointer-events: auto; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); cursor: pointer; }
.range input::-moz-range-track { background: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 10px 18px; font-size: 14px; cursor: pointer; text-decoration: none; border: 1px solid transparent; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--navy); }
.btn.solid { background: var(--navy); color: #fff; }
.btn.light { background: #fff; color: var(--navy); font-size: 15px; padding: 13px 22px; }
.icon-btn { border: 0; background: var(--bg); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 14px; color: var(--muted); flex: none; }

/* viz */
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.viz h2 { margin: 0; font-size: 22px; color: var(--navy); }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.presets { display: flex; gap: 8px; margin-top: 16px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.presets::-webkit-scrollbar { display: none; }
.presets button { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 7px 14px; font-size: 14px; cursor: pointer; color: var(--navy); white-space: nowrap; }
.presets button[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chart-wrap { position: relative; height: 560px; margin-top: 14px; }
.empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 15px; pointer-events: none; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 13px; color: var(--ink); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend .hollow { background: #fff; border: 2px solid #8b95a1; width: 8px; height: 8px; }

/* detail card */
.detail {
  position: absolute; top: 8px; right: 8px; width: 300px; z-index: 5;
  background: var(--navy); color: #fff; border-radius: 12px; padding: 18px 18px 16px; box-shadow: 0 12px 32px rgba(9,33,64,.3);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.detail .icon-btn { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.12); color: #fff; width: 30px; height: 30px; }
.d-tag { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--sky); display: flex; align-items: center; gap: 7px; }
.d-tag i { width: 9px; height: 9px; border-radius: 50%; }
.detail h3 { margin: 6px 34px 10px 0; font-size: 18px; line-height: 1.25; }
.d-big { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.d-big span { font-size: 40px; line-height: 1; }
.d-big small { color: #9fb4cf; font-size: 13px; }
.d-big.low span { color: #f0a3bf; }
.d-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 14px; }
.d-grid dt { color: #9fb4cf; }
.d-grid dd { margin: 0; }
.d-note { margin: 10px 0 0; font-size: 12px; color: #9fb4cf; }
.d-note:empty { display: none; }

/* distribution */
.dist { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.dist-head h3 { margin: 0; font-size: 17px; color: var(--navy); }
.hist-wrap { position: relative; height: 190px; margin-top: 10px; }

/* FAB (mobile) */
.fab { display: none; }

/* ---------- Sections ---------- */
.section-title { font-size: clamp(26px, 3vw, 34px); color: var(--navy); margin: 0 0 22px; }
.about { margin-top: 72px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.card-ico svg { width: 44px; height: 44px; display: block; }
.card h3 { margin: 14px 0 6px; font-size: 18px; color: var(--navy); }
.card p { margin: 0; font-size: 15px; color: var(--muted); }
.reports { margin-top: 64px; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.report { border-radius: var(--radius); padding: 24px; background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff; min-height: 170px; position: relative; overflow: hidden; }
.report::after { content: ""; position: absolute; right: -46px; bottom: -58px; width: 120px; height: 120px; border-radius: 50%; border: 10px solid var(--gold); opacity: .55; }
.report h3 { margin: 8px 0 6px; font-size: 20px; }
.report p { margin: 0; color: #c6d3e4; font-size: 15px; max-width: 72%; position: relative; z-index: 1; }
.r-kicker { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--sky); }
.cta-band { margin-top: 72px; background: var(--blue); color: #fff; }
.cta-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-top: 40px; padding-bottom: 40px; flex-wrap: wrap; }
.cta-band h2 { margin: 0 0 4px; font-size: 28px; }
.cta-band p { margin: 0; color: #dce8f6; }
footer { background: var(--navy); color: #9fb4cf; font-size: 14px; }
.foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding-top: 26px; padding-bottom: 26px; }
.foot img { height: 14px; opacity: .85; }
footer a { color: #fff; }

/* ---------- Tablet ---------- */
@media (max-width: 1080px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Mobile / small tablet: filters become a bottom sheet ---------- */
@media (max-width: 900px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .nav-links { gap: 18px; }
  .nav-links a { font-size: 14px; }
  .hero { background: linear-gradient(180deg, rgba(9,33,64,.82), rgba(9,33,64,.95)), var(--navy) url(header.webp) 72% center / cover no-repeat; }
  .hero-body { padding-top: 28px; padding-bottom: 56px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid rgba(178,207,244,.18); margin-top: 16px; }
  .explore { display: block; margin-top: -24px; padding-left: 0; padding-right: 0; }
  .viz { border-radius: 0; padding: 20px 16px 18px; }
  .viz h2 { font-size: 19px; }
  .reset-inline { display: none; }
  .chart-wrap { height: min(68vh, 460px); }
  .filters {
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; top: auto; max-height: 86vh;
    border-radius: 18px 18px 0 0; padding: 0 18px calc(18px + env(safe-area-inset-bottom));
    transform: translateY(105%); transition: transform .28s ease; display: flex; flex-direction: column; overflow: auto;
  }
  .filters.open { transform: none; }
  .sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: #fff; padding: 16px 0 12px; z-index: 2; }
  .sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
  .sheet-head h2 { margin: 0; font-size: 20px; color: var(--navy); }
  .sheet-foot { display: flex; gap: 10px; position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom)); background: #fff; padding: 12px 0 calc(18px + env(safe-area-inset-bottom)); margin-top: 6px; border-top: 1px solid var(--line); }
  .sheet-foot .btn { flex: 1; padding: 13px; font-size: 15px; }
  .chip { padding: 8px 12px; font-size: 14px; }
  .backdrop { position: fixed; inset: 0; background: rgba(9,33,64,.45); z-index: 55; }
  .fab {
    display: inline-flex; align-items: center; gap: 8px; position: fixed; z-index: 50; left: 50%; transform: translateX(-50%);
    bottom: calc(18px + env(safe-area-inset-bottom)); background: var(--navy); color: #fff; border: 0; border-radius: 999px;
    padding: 13px 22px; font-size: 15px; box-shadow: 0 10px 26px rgba(9,33,64,.35); cursor: pointer; transition: opacity .2s, transform .2s;
  }
  body.sheet-open .fab, body.detail-open .fab { opacity: 0; pointer-events: none; }
  .fab.hide { opacity: 0; pointer-events: none; transform: translate(-50%, 20px); }
  .badge { background: var(--gold); color: var(--navy); border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; display: inline-grid; place-items: center; }
  .detail { position: fixed; left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; z-index: 58; }
  .about { margin-top: 48px; }
  .cards { grid-template-columns: 1fr; gap: 12px; }
  .card { display: grid; grid-template-columns: 44px 1fr; gap: 0 14px; padding: 18px; }
  .card-ico { grid-row: span 2; }
  .card h3 { margin: 0 0 4px; font-size: 17px; }
  .card p { font-size: 14px; }
  .reports { margin-top: 48px; }
  .cta-band { margin-top: 48px; }
  .cta-inner { padding-bottom: 96px; }
}
@media (max-width: 420px) {
  .nav-links a:not(:first-child) { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
