/* VitalTrace — government-adjacent design system
   Palette: deep navy #0b2545, ink #102a43, paper #fbfaf6, gold #c9a23a, line #e3e0d6
   Type:    Source Serif 4 (headings), Inter (body), JetBrains Mono (data)
*/
@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@500&display=swap');

:root {
  --navy: #0b2545;
  --navy-2: #13315c;
  --navy-3: #1c4878;
  --ink: #102a43;
  --ink-soft: #486581;
  --muted: #829ab1;
  --paper: #fbfaf6;
  --paper-2: #f3f0e6;
  --line: #e3e0d6;
  --line-soft: #efece2;
  --gold: #c9a23a;
  --gold-soft: #f3e7bf;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(11, 37, 69, .06);
  --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 6px 24px rgba(11, 37, 69, .07);
  --shadow-lg: 0 2px 4px rgba(11, 37, 69, .08), 0 24px 48px -12px rgba(11, 37, 69, .18);
  --r: 8px;
  --r-lg: 14px;
  --serif: 'Source Serif 4', 'Iowan Old Style', 'Palatino', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  font: 16px/1.65 var(--sans);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-3); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--navy); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--navy);
  line-height: 1.2;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
  font-weight: 600;
}
h1 { font-size: clamp(2rem, 4.4vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.85rem); margin-top: 1.8em; }
h3 { font-size: 1.18rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
strong { color: var(--navy); font-weight: 600; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); font-size: .88em; }
.mono { font-family: var(--mono); font-size: .9em; }

/* ============ HEADER ============ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
  backdrop-filter: saturate(180%) blur(8px);
  background: rgba(255,255,255,.92);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; color: var(--navy); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 8px;
  background: var(--navy); color: var(--white);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.25rem;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08), 0 1px 2px rgba(11,37,69,.4);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; inset: auto 0 -2px 0; height: 2px;
  background: var(--gold); border-radius: 0 0 6px 6px;
}
.brand-name { font-family: var(--serif); font-size: 1.32rem; letter-spacing: -.01em; }
.brand-tag { font-family: var(--sans); font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); display: block; margin-top: -2px; font-weight: 600; }
.primary-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.primary-nav a {
  color: var(--ink); font-size: .92rem; font-weight: 500;
  padding: 8px 12px; border-radius: 6px;
}
.primary-nav a:hover { background: var(--paper-2); text-decoration: none; }

/* ============ BREADCRUMBS ============ */
.breadcrumbs {
  font-size: .82rem; color: var(--ink-soft);
  padding: 14px 0; border-bottom: 1px solid var(--line);
  background: var(--white);
}
.breadcrumbs .sep { margin: 0 8px; color: var(--muted); }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs a:hover { color: var(--navy); }

/* ============ HERO ============ */
.hero {
  background:
    radial-gradient(ellipse at 80% -10%, rgba(201,162,58,.18), transparent 55%),
    radial-gradient(ellipse at 0% 110%, rgba(28,72,120,.20), transparent 50%),
    linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  color: var(--white);
  padding: 84px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse at 50% 50%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero .container { position: relative; }
.hero h1 { color: var(--white); max-width: 18ch; margin: 0 auto 18px; text-align: center; }
.hero h1 em { color: var(--gold); font-style: normal; font-family: var(--serif); }
.hero .eyebrow {
  text-align: center; color: var(--gold); font-weight: 600;
  text-transform: uppercase; letter-spacing: .18em; font-size: .78rem;
  margin: 0 0 18px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.hero .eyebrow::before, .hero .eyebrow::after {
  content: ""; flex: 0 0 36px; height: 1px; background: rgba(201,162,58,.5);
}
.hero .lede {
  text-align: center; max-width: 62ch; margin: 0 auto 32px;
  font-size: 1.13rem; color: rgba(255,255,255,.78);
}

/* Search */
.hero-search {
  max-width: 720px; margin: 0 auto;
  background: var(--white);
  border-radius: 14px;
  padding: 8px;
  box-shadow: var(--shadow-lg);
  display: flex; gap: 6px;
  border: 1px solid rgba(255,255,255,.5);
}
.hero-search input[type=search] {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  font: 500 1.02rem var(--sans); color: var(--ink);
  padding: 14px 18px;
  background: transparent;
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search button {
  border: 0; cursor: pointer;
  background: var(--navy); color: var(--white);
  font: 600 .98rem var(--sans);
  padding: 0 24px; border-radius: 8px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease;
}
.hero-search button:hover { background: var(--gold); color: var(--navy); }
.hero-search-meta {
  text-align: center; margin-top: 14px;
  color: rgba(255,255,255,.6); font-size: .85rem;
}
.hero-search-meta strong { color: var(--gold); font-weight: 600; }
.hero-quick { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.hero-quick a {
  font-size: .82rem; color: rgba(255,255,255,.78);
  padding: 6px 12px; border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
}
.hero-quick a:hover {
  text-decoration: none; color: var(--navy); background: var(--gold); border-color: var(--gold);
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 8px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent; cursor: pointer;
  transition: all .15s ease;
  font-family: var(--sans);
  text-decoration: none;
}
.btn-primary { background: var(--navy); color: var(--white); }
.btn-primary:hover { background: var(--navy-2); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-ghost { background: var(--white); color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { background: var(--paper-2); text-decoration: none; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d6b14a; text-decoration: none; }

/* ============ SECTIONS ============ */
.section { padding: 72px 0; }
.section-tight { padding: 48px 0; }
.section-band { background: var(--white); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-dark { background: var(--navy); color: rgba(255,255,255,.85); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-lede { color: var(--ink-soft); max-width: 68ch; font-size: 1.03rem; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 28px; }
.section-head h2 { margin: 0; }
.eyebrow {
  text-transform: uppercase; letter-spacing: .14em;
  font-size: .76rem; color: var(--navy-3); font-weight: 700;
  margin: 0 0 12px;
}
.divider {
  height: 1px; border: 0; margin: 28px 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

/* ============ CARDS ============ */
.card-grid { display: grid; gap: 20px; }
.card-grid-2 { grid-template-columns: repeat(2, 1fr); }
.card-grid-3 { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 28px; box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.card h3 { margin-top: 0; }
.card .icon {
  width: 44px; height: 44px; border-radius: 10px;
  background: var(--paper-2); color: var(--navy);
  display: grid; place-items: center; margin-bottom: 16px;
  font-family: var(--serif); font-weight: 700; font-size: 1.3rem;
  border: 1px solid var(--line);
}
.link-card { display: block; color: var(--ink); }
.link-card:hover { border-color: var(--navy); text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); }
.link-card .more { color: var(--navy-3); font-weight: 600; font-size: .9rem; margin-top: 12px; display: inline-block; }
.link-card:hover .more { color: var(--gold); }

/* ============ STATE GRID ============ */
.state-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.state-tile {
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--ink);
  position: relative; overflow: hidden;
  transition: all .15s ease;
}
.state-tile::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--gold); transform: scaleY(0); transform-origin: top; transition: transform .2s ease;
}
.state-tile:hover { border-color: var(--navy); background: var(--white); text-decoration: none; transform: translateX(2px); }
.state-tile:hover::before { transform: scaleY(1); }
.state-tile .abbr { font-family: var(--mono); color: var(--navy-3); font-weight: 600; font-size: .78rem; letter-spacing: .04em; }
.state-tile .name { font-weight: 600; color: var(--navy); font-size: .98rem; }
.state-tile .count { font-size: .78rem; color: var(--muted); }

/* ============ POPULAR STATES ============ */
.popular-states {
  list-style: none; padding: 0; margin: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px;
}
.popular-states a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--white); border: 1px solid var(--line);
  border-radius: 10px; color: var(--ink); font-weight: 500;
}
.popular-states a:hover { border-color: var(--navy); text-decoration: none; color: var(--navy); }
.popular-states a::after { content: "→"; color: var(--gold); font-weight: 700; }

/* ============ PAGE LAYOUT ============ */
.page-head { margin-bottom: 32px; max-width: 820px; }
.page-head .eyebrow { color: var(--navy-3); }
.page-head h1 { margin-bottom: 14px; }
.page-head .lede { color: var(--ink-soft); font-size: 1.1rem; max-width: 65ch; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 56px; align-items: start; }
.prose { max-width: 720px; font-size: 1.02rem; }
.prose h2 { margin-top: 2em; padding-bottom: .35em; border-bottom: 1px solid var(--line); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin: .35em 0; }
.prose li::marker { color: var(--gold); }
.prose a { color: var(--navy-3); border-bottom: 1px solid rgba(28,72,120,.3); }
.prose a:hover { text-decoration: none; border-bottom-color: var(--gold); color: var(--navy); }

.steps {
  counter-reset: step; list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px;
}
.steps li {
  counter-increment: step; position: relative;
  padding: 18px 22px 18px 70px;
  background: var(--white); border: 1px solid var(--line); border-radius: 10px;
}
.steps li::before {
  content: counter(step); position: absolute; left: 18px; top: 16px;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy); color: var(--white);
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 1.05rem;
  box-shadow: 0 0 0 4px var(--paper);
}

.county-list { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; }
.county-list li { break-inside: avoid; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.county-list li:last-child { border-bottom: 0; }
.county-list a { color: var(--ink); font-weight: 500; }
.county-list a:hover { color: var(--navy); }
.county-list .muted { margin-left: 8px; font-family: var(--mono); font-size: .78em; }

/* ============ SIDEBAR ============ */
.sidebar { display: grid; gap: 18px; position: sticky; top: 92px; }
.info-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow-sm); }
.info-card.accent { border-top: 3px solid var(--gold); }
.info-card h3 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .14em;
  color: var(--navy-3); margin: 0 0 14px;
  font-family: var(--sans); font-weight: 700;
}
.info-card .strong { font-weight: 600; color: var(--navy); }
.info-card .big { font-size: 1.5rem; font-weight: 700; color: var(--navy); font-family: var(--serif); }
.info-card p { font-size: .94rem; margin-bottom: .6em; }
.info-card address { font-style: normal; font-size: .94rem; color: var(--ink-soft); }
.fee-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.fee-table th, .fee-table td { text-align: left; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.fee-table th { color: var(--ink-soft); font-weight: 500; }
.fee-table td { color: var(--navy); font-weight: 600; font-family: var(--mono); font-size: .9em; }
.fee-table tr:last-child th, .fee-table tr:last-child td { border-bottom: 0; }
.link-list { list-style: none; padding: 0; margin: 0; }
.link-list li { padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: .94rem; }
.link-list li:last-child { border-bottom: 0; }
.link-list a { color: var(--navy); font-weight: 500; }

/* Related resources block (real, disclosed editorial links) */
.related-resources { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.related-resources h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--navy-3); margin: 0 0 14px; font-family: var(--sans); font-weight: 700; }
.related-resources ul { list-style: none; padding: 0; margin: 0; }
.related-resources li { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.related-resources li:last-child { border-bottom: 0; }
.related-resources a { color: var(--navy); font-weight: 500; font-size: .94rem; display: flex; flex-direction: column; }
.related-resources a small { color: var(--ink-soft); font-weight: 400; font-size: .82rem; margin-top: 2px; }
.related-resources .disclosure { color: var(--muted); font-size: .76rem; margin: 12px 0 0; font-style: italic; }

/* ============ STATS BAND ============ */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding: 32px 0; }
.stats .stat { text-align: center; padding: 0 12px; border-right: 1px solid rgba(255,255,255,.1); }
.stats .stat:last-child { border-right: 0; }
.stats .stat .num { display: block; font-family: var(--serif); font-size: 2.4rem; font-weight: 700; color: var(--gold); line-height: 1; }
.stats .stat .lab { display: block; font-size: .82rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(255,255,255,.7); margin-top: 8px; font-weight: 500; }

/* ============ FOOTER ============ */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.72);
  margin-top: 64px;
  font-size: .92rem;
}
.site-footer .brand { color: var(--white); }
.site-footer .brand-name { color: var(--white); }
.site-footer .brand-mark { background: var(--white); color: var(--navy); }
.site-footer a { color: rgba(255,255,255,.78); }
.site-footer a:hover { color: var(--gold); text-decoration: none; }
.site-footer h4 {
  color: var(--white); font-family: var(--sans); font-size: .78rem;
  text-transform: uppercase; letter-spacing: .14em; margin: 0 0 14px;
  font-weight: 700;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { padding: 5px 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; padding: 56px 0 40px; }
.footer-grid p { color: rgba(255,255,255,.6); margin-top: 14px; max-width: 38ch; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 20px 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: rgba(255,255,255,.45); font-size: .82rem;
}

/* ============ MOBILE NAV ============ */
.nav-toggle {
  display: none; background: transparent; border: 1px solid var(--line);
  width: 42px; height: 42px; border-radius: 8px; cursor: pointer;
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 18px; height: 2px; background: var(--navy); position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; gap: 36px; }
  .sidebar { position: static; }
  .card-grid-3 { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats .stat { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.1); padding-bottom: 16px; }
  .stats .stat:nth-last-child(-n+2) { border-bottom: 0; }
}
@media (max-width: 720px) {
  .container { padding: 0 18px; }
  .section { padding: 56px 0; }
  .hero { padding: 64px 0 72px; }
  .hero-search { flex-direction: column; padding: 10px; gap: 8px; }
  .hero-search button { padding: 14px; justify-content: center; width: 100%; }
  .card-grid-3, .card-grid-2 { grid-template-columns: 1fr; }
  .county-list { columns: 1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 18px 16px;
    display: none;
  }
  .site-header.open .primary-nav { display: flex; }
  .primary-nav a { padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
  .primary-nav a:last-child { border-bottom: 0; }
  .header-inner { position: relative; }
}
@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .stats { grid-template-columns: 1fr; }
  .stats .stat { border-bottom: 1px solid rgba(255,255,255,.1); }
  .stats .stat:last-child { border-bottom: 0; }
  h1 { font-size: 2rem; }
  .brand-tag { display: none; }
}

/* ============ UTILITY / MISC ============ */
.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--navy); color: var(--white);
  padding: 10px 14px; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
