:root {
  color-scheme: light;
  --paper: oklch(96.5% 0.012 91);
  --paper-2: oklch(93.5% 0.018 91);
  --ink: oklch(22% 0.018 176);
  --ink-soft: oklch(42% 0.02 176);
  --muted: oklch(56% 0.018 176);
  --rule: oklch(84% 0.018 91);
  --panel: oklch(98.2% 0.007 91);
  --panel-deep: oklch(90.5% 0.025 178);
  --accent: oklch(43% 0.09 176);
  --accent-hover: oklch(37% 0.095 176);
  --warm: oklch(59% 0.11 48);
  --night: oklch(17% 0.018 176);
  --white-tint: oklch(99% 0.004 91);
  --shadow-soft: 0 24px 70px oklch(36% 0.02 176 / 0.14);
  --shadow-thin: 0 1px 0 oklch(100% 0 0 / 0.72) inset;
  --font-sans: "Hanken Grotesk", "Trebuchet MS", system-ui, sans-serif;
  --font-display: "Literata", Georgia, serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --container: min(100% - 32px, 1190px);
}

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

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 20;
  transform: translateY(-140%);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10000;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  background: var(--accent);
  pointer-events: none;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 21px;
  font-weight: 520;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 180ms var(--ease),
    border-color 180ms var(--ease),
    color 180ms var(--ease),
    transform 180ms var(--ease);
}

.button:focus-visible,
.state-search-input:focus-visible,
.hero-links a:focus-visible,
.console-note a:focus-visible,
.spotlight-cta:focus-visible,
.state-card:focus-visible,
.state-cell:focus-visible,
.site-footer a:focus-visible {
  outline: 3px solid oklch(63% 0.09 176 / 0.38);
  outline-offset: 3px;
}

.button-primary {
  background: var(--accent);
  color: var(--white-tint);
  box-shadow: var(--shadow-thin);
}

.button-primary:hover {
  background: var(--accent-hover);
  color: var(--white-tint);
  transform: translateY(-1px);
}

.button-secondary {
  background: oklch(96% 0.009 91);
  border-color: var(--rule);
  color: var(--ink);
}

.button-secondary:hover {
  border-color: oklch(72% 0.028 176);
  color: var(--accent-hover);
}

.states-hero {
  width: var(--container);
  min-height: 0;
  margin: 0 auto;
  padding: clamp(126px, 9.5vw, 158px) 0 clamp(54px, 7vw, 86px);
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(390px, 0.82fr);
  align-items: end;
  gap: clamp(44px, 7vw, 108px);
}

.states-hero-copy {
  max-width: 680px;
}

.intro-label,
.workbench-heading p,
.handoff-card p {
  margin: 0 0 14px;
  color: var(--accent-hover);
  font-size: 0.8rem;
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin-bottom: 20px;
  font-family: var(--font-display);
  font-size: clamp(3.1rem, 5.7vw, 5.45rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.99;
  text-wrap: balance;
}

.hero-lede {
  max-width: 58ch;
  margin: 0 0 28px;
  color: var(--ink-soft);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.state-hero-form {
  width: min(100%, 660px);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 24px;
  background: oklch(92.5% 0.012 91 / 0.78);
  box-shadow: var(--shadow-thin);
}

.state-combobox {
  min-width: 0;
  position: relative;
}

.state-search-input {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 17px;
  padding: 0 18px;
  background: transparent;
  color: var(--ink);
  outline: none;
}

.state-search-input::placeholder {
  color: oklch(46% 0.014 176 / 0.8);
}

.state-search-input:focus {
  background: oklch(98.5% 0.006 91 / 0.74);
  box-shadow: 0 0 0 3px oklch(63% 0.09 176 / 0.28);
}

.hero-picker-btn {
  min-width: 118px;
  border-radius: 18px;
}

.hero-picker-error {
  min-height: 1.3em;
  margin: 10px 0 0;
  color: oklch(46% 0.14 31);
  font-size: 0.95rem;
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 18px;
}

.hero-links a,
.console-note a,
.spotlight-cta {
  color: var(--accent-hover);
  font-weight: 620;
  text-decoration: none;
}

.hero-links a:hover,
.console-note a:hover,
.spotlight-cta:hover {
  color: var(--ink);
}

.states-console {
  align-self: end;
  padding: 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: transparent;
  box-shadow: none;
}

.console-top,
.console-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.console-top {
  justify-content: space-between;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--accent-hover);
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.console-top strong {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 620;
  letter-spacing: 0.04em;
  text-align: right;
}

.console-search {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
}

.console-flow {
  display: grid;
}

.console-step {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 20px;
  align-items: center;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  background: transparent;
}

.console-step.is-current {
  background: transparent;
  border-color: var(--rule);
}

.console-step span {
  color: var(--accent-hover);
  font-weight: 620;
}

.console-step p {
  margin: 0;
  color: var(--ink-soft);
}

.console-note {
  padding: 18px 0;
  border-top: 0;
}

.hero-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-suggestions[hidden] {
  display: none;
}

.hero-suggestions-list {
  max-height: 300px;
  margin: 0;
  padding: 8px;
  list-style: none;
  overflow: auto;
}

.hero-suggestion {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.hero-suggestion:hover,
.hero-suggestion[aria-selected="true"] {
  background: oklch(93.5% 0.018 91);
}

.hero-suggestion code {
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.state-workbench,
.list-section,
.source-system,
.handoff-section {
  width: var(--container);
  margin: 0 auto;
}

.state-workbench {
  padding: clamp(48px, 7vw, 86px) 0 68px;
  border-top: 1px solid var(--rule);
}

.workbench-heading {
  max-width: 820px;
  margin-bottom: 30px;
}

.workbench-heading h2,
.list-header h2,
.source-system h2,
.handoff-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.3vw, 3.35rem);
  font-weight: 400;
  letter-spacing: -0.032em;
  line-height: 1.04;
}

.workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  align-items: start;
  gap: 20px;
}

.map-section {
  min-width: 0;
  position: relative;
}

.map-container,
.spotlight-card,
.handoff-card {
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: none;
}

.map-container {
  padding: clamp(18px, 3vw, 32px);
  overflow-x: auto;
}

.map-header {
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.map-title {
  margin: 0 0 6px;
  font-size: 1.18rem;
  font-weight: 620;
}

.map-subtitle {
  max-width: 48ch;
  margin: 0;
  color: var(--muted);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.86rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  width: 13px;
  height: 13px;
  border: 1px solid var(--rule);
  border-radius: 5px;
  background: oklch(95% 0.009 91);
}

.legend-swatch.low {
  background: oklch(94% 0.027 178);
  border-color: oklch(80% 0.04 176);
}

.legend-swatch.medium {
  background: oklch(89% 0.048 178);
  border-color: oklch(72% 0.06 176);
}

.legend-swatch.high {
  background: oklch(82% 0.075 176);
  border-color: oklch(60% 0.08 176);
}

.us-map {
  min-width: 720px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  grid-template-rows: repeat(8, 1fr);
  gap: 6px;
}

.state-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: oklch(96% 0.008 91);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 620;
  text-decoration: none;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.state-cell:hover {
  transform: translateY(-1px);
  border-color: oklch(63% 0.07 176);
  color: var(--ink);
  box-shadow: none;
}

.state-cell.low-activity {
  background: oklch(94% 0.027 178);
  border-color: oklch(80% 0.04 176);
  color: var(--ink-soft);
}

.state-cell.medium-activity {
  background: oklch(89% 0.048 178);
  border-color: oklch(72% 0.06 176);
  color: var(--ink);
}

.state-cell.high-activity {
  background: oklch(82% 0.075 176);
  border-color: oklch(60% 0.08 176);
  color: var(--ink);
}

.state-cell.empty {
  visibility: hidden;
}

.state-tooltip {
  position: fixed;
  z-index: 1000;
  min-width: 190px;
  padding: 14px 16px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 10px 28px oklch(36% 0.02 176 / 0.08);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 150ms var(--ease),
    transform 150ms var(--ease);
}

.state-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.tooltip-name {
  margin-bottom: 8px;
  font-weight: 620;
}

.tooltip-stats {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tooltip-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tooltip-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.tooltip-dot.bills {
  background: var(--accent);
}

.tooltip-dot.petitions {
  background: var(--warm);
}

.tooltip-action {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  color: var(--accent-hover);
  font-size: 0.86rem;
  font-weight: 620;
}

.spotlight-card {
  padding: 26px;
  position: sticky;
  top: 104px;
}

.spotlight-eyebrow {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--accent-hover);
  font-size: 0.76rem;
  font-weight: 620;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.spotlight-state-name {
  margin-bottom: 12px;
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 1;
}

.spotlight-desc,
.spotlight-detail {
  color: var(--ink-soft);
}

.spotlight-detail strong {
  color: var(--ink);
  font-weight: 620;
}

.spotlight-cta {
  display: inline-flex;
  margin-top: 10px;
}

.list-section {
  padding: 16px 0 78px;
}

.list-header {
  margin-bottom: 20px;
  display: grid;
  grid-template-columns: minmax(0, 0.42fr) minmax(360px, 0.58fr);
  gap: clamp(24px, 5vw, 68px);
  align-items: end;
}

.list-controls {
  display: grid;
  gap: 10px;
}

.search-wrapper {
  position: relative;
}

.list-section .search-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  pointer-events: none;
}

.list-section .search-input,
.filter-select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
  outline: none;
}

.list-section .search-input {
  padding: 0 16px 0 44px;
}

.filter-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.filter-select {
  padding: 0 12px;
  cursor: pointer;
}

.list-section .search-input:focus,
.filter-select:focus {
  border-color: oklch(63% 0.07 176);
  box-shadow: 0 0 0 3px oklch(63% 0.09 176 / 0.2);
}

.states-grid {
  display: grid;
  max-height: 540px;
  padding: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
  border: 1px solid var(--rule);
  border-radius: 18px;
  background: oklch(95.6% 0.01 91);
  overflow: auto;
}

.state-card {
  min-height: 74px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 9px;
  position: relative;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition:
    transform 180ms var(--ease),
    border-color 180ms var(--ease),
    background 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

.state-card:hover {
  transform: translateY(-1px);
  border-color: oklch(73% 0.055 176);
  background: oklch(99% 0.003 91);
  box-shadow: none;
}

.state-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.state-card .abbr {
  color: var(--ink);
  font-size: 1.25rem;
  font-weight: 620;
}

.state-card .name {
  color: var(--muted);
  font-size: 0.92rem;
}

.state-card .counts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.count-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.dot.bills {
  background: var(--accent);
}

.dot.petitions {
  background: var(--warm);
}

.state-card.no-data {
  opacity: 0.58;
}

.state-card.high-activity-card .abbr {
  color: var(--accent-hover);
}

.activity-badge {
  display: none;
}

.loading {
  padding: 42px 0;
  color: var(--muted);
}

.source-system {
  padding: 72px 0;
  display: grid;
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 0.55fr);
  gap: clamp(28px, 5vw, 70px);
  border-top: 1px solid var(--rule);
}

.source-rows {
  display: grid;
  border-top: 1px solid var(--rule);
}

.source-rows article {
  display: grid;
  grid-template-columns: 48px minmax(140px, 0.4fr) 1fr;
  gap: 18px;
  align-items: baseline;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}

.source-rows span {
  color: var(--accent-hover);
  font-weight: 620;
}

.source-rows h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 620;
}

.source-rows p {
  margin: 0;
  color: var(--ink-soft);
}

.handoff-section {
  padding: 28px 0 76px;
}

.handoff-card {
  padding: clamp(30px, 5vw, 56px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}

.handoff-card h2 {
  max-width: 760px;
  margin-bottom: 14px;
}

.handoff-card span {
  display: block;
  max-width: 62ch;
  color: var(--ink-soft);
}

.handoff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.site-footer {
  padding: clamp(48px, 6vw, 76px) max(16px, calc((100vw - 1190px) / 2));
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 36px;
  background: var(--night);
  color: oklch(92% 0.008 91);
}

.site-footer p {
  margin: 18px 0 0;
  color: oklch(76% 0.012 91);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: oklch(96% 0.006 91);
  font-weight: 620;
  letter-spacing: 0.16em;
  text-decoration: none;
  text-transform: uppercase;
}

.footer-brand img {
  width: 32px;
  height: 32px;
}

.site-footer nav {
  display: grid;
  grid-template-columns: repeat(2, auto);
  align-content: start;
  gap: 12px 34px;
}

.site-footer a {
  color: oklch(84% 0.012 91);
  text-decoration: none;
}

.site-footer a:hover {
  color: oklch(96% 0.006 91);
}

.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 12px 14px;
  background: var(--panel);
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateX(32px);
  transition:
    opacity 180ms var(--ease),
    transform 180ms var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translateX(0);
}

.toast.hide {
  opacity: 0;
  transform: translateX(32px);
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

@media (max-width: 980px) {
  .states-hero,
  .workbench-grid,
  .list-header,
  .source-system,
  .handoff-card,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .states-hero {
    min-height: 0;
  }

  .states-console {
    max-width: 720px;
  }

  .spotlight-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .states-hero {
    width: min(100% - 24px, 1190px);
    padding: 120px 0 52px;
    gap: 30px;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 4.2rem);
    line-height: 1.02;
  }

  .state-hero-form {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }

  .hero-picker-btn {
    width: 100%;
  }

  .hero-suggestions {
    top: calc(100% + 72px);
  }

  .state-workbench,
  .list-section,
  .source-system,
  .handoff-section {
    width: min(100% - 24px, 1190px);
  }

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

  .map-legend {
    justify-content: flex-start;
  }

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

  .states-grid {
    grid-template-columns: 1fr;
    max-height: 560px;
  }

  .source-rows article {
    grid-template-columns: 38px 1fr;
  }

  .source-rows p {
    grid-column: 2;
  }

  .handoff-actions,
  .handoff-actions .button {
    width: 100%;
  }

  .site-footer nav {
    grid-template-columns: 1fr;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
