:root {
  --bg: #f3f7f2;
  --ink: #1d2c28;
  --card: #fffdf8;
  --line: #c9d7cd;
  --accent: #0f766e;
  --accent-soft: #d9f3ef;
  --warm: #f59e0b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 15%, #d7ece5, transparent 45%),
    radial-gradient(circle at 90% 0%, #fde7be, transparent 32%),
    var(--bg);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
  display: grid;
  gap: 1.1rem;
}

.hero h1,
.panel h2 {
  margin: 0;
  font-family: "Fraunces", serif;
  letter-spacing: 0.01em;
}

.hero {
  background: linear-gradient(135deg, #0f766e 0%, #166534 100%);
  color: #f7fff8;
  border-radius: 18px;
  padding: 1.3rem;
}

.eyebrow {
  margin: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  color: #bbf7d0;
}

.lead {
  margin-bottom: 0;
  max-width: 75ch;
}

.hero a {
  color: #ffffff;
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.hero a:visited {
  color: #ffffff;
}

.hero a:hover,
.hero a:focus-visible {
  color: #dcfce7;
}

.controls,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}

.controls {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
}

input,
select {
  border: 1px solid #a1b4a6;
  border-radius: 10px;
  padding: 0.55rem;
  font: inherit;
}

.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.summary,
.state-pick {
  font-size: 0.85rem;
  color: #415a52;
  margin: 0;
}

.map {
  height: 430px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #b7c8be;
}

.state-pick {
  margin-top: 0.45rem;
}

.table-wrap {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.55rem;
  border-bottom: 1px solid #e1eae4;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  background: #edf5ef;
}

.filter-row th {
  top: 42px;
  background: #f4f9f5;
  padding: 0.35rem 0.45rem;
}

.year-filter {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 0.35rem;
}

.table-year-filter {
  grid-template-columns: 56px 1fr;
}

.table-filter {
  width: 100%;
  font-size: 0.78rem;
  padding: 0.35rem 0.4rem;
  border-radius: 6px;
}

tbody tr:nth-child(odd) {
  background: #fafdf9;
}

.notes p {
  margin: 0.45rem 0;
}

.legend {
  background: #f7fffd;
  border: 1px solid #bcd3c8;
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 550ms ease forwards;
}

.reveal:nth-child(2) {
  animation-delay: 70ms;
}

.reveal:nth-child(3) {
  animation-delay: 120ms;
}

.reveal:nth-child(4) {
  animation-delay: 170ms;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }

  .controls {
    grid-template-columns: 1fr;
  }

  .map {
    height: 360px;
  }
}
