:root {
  --paper: #f4efe6;
  --paper-2: #ebe3d4;
  --ink: #1b1712;
  --ink-soft: #4d453c;
  --muted: #6d6357;
  --rule: #d8cebc;
  --card: #fffaf1;
  --accent: #9c3414;
  --accent-hover: #7a270e;
  --ok: #24543a;
  --ok-bg: #e4efe6;
  --note: #8a5410;
  --note-bg: #f6ead2;
  --warn: #7a2d16;
  --warn-bg: #f6e2d8;
  --shadow: 0 12px 32px rgba(27, 23, 18, 0.06);
  --radius: 14px;
  --measure: 42rem;
  --wide: 72rem;
  --header-h: 4.25rem;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14110e;
    --paper-2: #1c1814;
    --ink: #f4ece1;
    --ink-soft: #d2c6b6;
    --muted: #b0a293;
    --rule: #3a332b;
    --card: #1c1814;
    --accent: #e07a4c;
    --accent-hover: #f0986d;
    --ok: #8dceaa;
    --ok-bg: #1d3328;
    --note: #e2b56a;
    --note-bg: #332716;
    --warn: #f0a48a;
    --warn-bg: #352018;
    --shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  max-width: 100%;
  color: var(--ink);
  background:
    radial-gradient(1200px 480px at 8% -10%, rgba(156, 52, 20, 0.07), transparent 55%),
    var(--paper);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.55rem 0.8rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

.skip:focus {
  top: 1rem;
}

.wrap {
  width: min(calc(100vw - 2rem), var(--wide));
  margin-inline: auto;
  max-width: 100%;
}

.prose-wrap {
  width: min(calc(100vw - 2rem), var(--measure));
  margin-inline: auto;
  max-width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--rule);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem 1.4rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  color: inherit;
}

.mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  white-space: nowrap;
}

.brand-name span {
  color: var(--muted);
  font-weight: 400;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.95rem;
  min-width: 0;
  max-width: calc(100vw - 2rem);
}

.site-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 550;
  font-size: 0.98rem;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
}

.site-nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--accent);
}

.hero,
.page-hero {
  padding: 3.2rem 0 1.5rem;
}

.kicker {
  margin: 0 0 0.7rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
.lede,
.state-card {
  scroll-margin-top: 5.5rem;
}

h1,
h2,
h3,
.lede {
  font-family: var(--serif);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

h1 {
  margin: 0 0 0.85rem;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  font-weight: 600;
}

h2 {
  margin: 2.4rem 0 0.8rem;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.28rem;
}

.lede {
  max-width: 38rem;
  margin: 0 0 1.6rem;
  color: var(--ink-soft);
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 400;
  line-height: 1.45;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 2.5rem;
  align-items: end;
}

.hero-photo,
.figure {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.hero-photo img,
.figure img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.caption {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.names {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: 1.4rem 0 0;
  list-style: none;
}

.names a,
.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.names a:hover,
.chip:hover,
.chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.section {
  padding: 1.2rem 0 2.6rem;
}

.rule {
  height: 1px;
  background: var(--rule);
  border: 0;
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card,
.state-card,
.faq details,
.callout,
.search-panel {
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.card {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.2rem 1.2rem;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--rule));
}

.card h2,
.card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.35rem;
}

.card p,
.state-card p {
  margin: 0;
  color: var(--ink-soft);
}

.card .more {
  margin-top: 0.9rem;
  color: var(--accent);
  font-weight: 650;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.fact {
  padding: 1.1rem 1.15rem;
  border-top: 3px solid var(--accent);
  background: var(--card);
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
  border-radius: 0 0 var(--radius) var(--radius);
}

.fact strong {
  display: block;
  margin-bottom: 0.3rem;
  font-family: var(--serif);
  font-size: 1.2rem;
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose p {
  margin: 0 0 1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.breadcrumbs {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li:not(:last-child)::after {
  content: "/";
  margin-left: 0.5rem;
  color: var(--rule);
}

.breadcrumbs a {
  color: inherit;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
}

.callout {
  padding: 1rem 1.1rem;
  margin: 1.2rem 0;
}

.callout.ok {
  background: var(--ok-bg);
  border-color: color-mix(in srgb, var(--ok) 30%, var(--rule));
}

.callout.note {
  background: var(--note-bg);
  border-color: color-mix(in srgb, var(--note) 30%, var(--rule));
}

.callout.warn {
  background: var(--warn-bg);
  border-color: color-mix(in srgb, var(--warn) 28%, var(--rule));
}

.callout p:last-child {
  margin-bottom: 0;
}

.term-list {
  display: grid;
  gap: 0.85rem;
}

.term {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--rule);
}

.term dt {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.term dd {
  margin: 0.3rem 0 0;
  color: var(--ink-soft);
}

.search-panel {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
  margin: 1.4rem 0 1.2rem;
}

.search-panel label {
  font-weight: 650;
}

.search-panel input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.filters button {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

.result-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.state-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.state-card {
  padding: 1rem 1.05rem 1.05rem;
}

.state-card[hidden] {
  display: none;
}

.state-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
}

.state-card h3 {
  margin: 0;
  font-size: 1.2rem;
}

.badge {
  flex: none;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge.clear {
  background: var(--ok-bg);
  color: var(--ok);
}

.badge.note {
  background: var(--note-bg);
  color: var(--note);
}

.state-card a {
  display: inline-block;
  margin-top: 0.65rem;
  font-weight: 650;
  text-decoration: none;
}

.faq details {
  padding: 0.15rem 1rem;
  margin: 0 0 0.65rem;
}

.faq summary {
  cursor: pointer;
  padding: 0.85rem 0;
  font-weight: 650;
}

.faq details p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

.site-footer {
  margin-top: 2rem;
  padding: 2rem 0 2.4rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
}

.footer-nav a {
  color: inherit;
  text-decoration: none;
}

.footer-nav a:hover {
  color: var(--accent);
}

.not-found {
  min-height: 60vh;
  display: grid;
  align-content: center;
  padding: 4rem 0;
}

@media (max-width: 880px) {
  .hero-grid,
  .cards,
  .facts,
  .split,
  .state-list {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-nav {
    width: 100%;
    max-width: 100%;
    font-size: 0.92rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .search-panel,
  .skip {
    display: none;
  }

  body {
    background: #fff;
    color: #111;
  }

  a {
    color: inherit;
  }

  .state-card {
    break-inside: avoid;
  }
}
