:root {
  color-scheme: light;
  --ink: #161616;
  --muted: #525252;
  --subtle: #6f6f6f;
  --line: #d6d6d6;
  --soft-line: #e8e8e8;
  --surface: #ffffff;
  --canvas: #f4f4f4;
  --accent: #0f62fe;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--canvas);
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Arial, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

[hidden] {
  display: none !important;
}

.policy-app {
  min-height: 100dvh;
  background: var(--canvas);
}

.site-header,
.hero,
.metrics,
.tracker,
.site-footer {
  width: min(100% - 64px, 1440px);
  margin-inline: auto;
}

.site-header {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  font-size: 0.875rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.brand-mark {
  width: 8px;
  height: 24px;
  display: block;
  background: var(--accent);
}

.source-promise {
  color: var(--muted);
}

.hero {
  padding: 88px 0 80px;
}

.eyebrow,
.section-label,
.detail-label {
  margin: 0;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 1030px;
  margin: 18px 0 24px;
  font-size: clamp(2.75rem, 6vw, 5.5rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.lede {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  line-height: 1.5;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--line);
}

.metric {
  min-height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border-right: 1px solid var(--line);
}

.metric:first-child {
  padding-left: 0;
}

.metric:last-child {
  border-right: 0;
}

.metric-value {
  font-size: 2.625rem;
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1;
}

.metric-label {
  color: var(--muted);
  font-size: 0.875rem;
}

.tracker {
  padding: 112px 0 96px;
}

.tracker-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 36px;
}

.tracker-heading h2 {
  margin: 10px 0 0;
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.tracker-note {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.875rem;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(300px, 1.65fr) repeat(3, minmax(180px, 1fr));
  gap: 1px;
  margin: 0;
  padding: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.control {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.control > span {
  min-height: 28px;
  display: flex;
  align-items: end;
  padding: 8px 16px 2px;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
}

.control input,
.control select {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 42px 0 16px;
  background: #f4f4f4;
  border: 0;
  border-bottom: 1px solid #8d8d8d;
  border-radius: 0;
  color: var(--ink);
  font-size: 0.875rem;
  outline: 0;
}

.control input {
  padding-right: 16px;
}

.control input::placeholder {
  color: var(--subtle);
  opacity: 1;
}

.control input:focus,
.control select:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.results-bar {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ink);
  color: var(--muted);
  font-size: 0.875rem;
}

.clear-button,
.primary-button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
}

.clear-button {
  background: transparent;
  color: var(--accent);
}

.clear-button:hover:not(:disabled) {
  background: #e8e8e8;
}

.clear-button:disabled {
  color: #a8a8a8;
  cursor: default;
}

.primary-button {
  min-height: 48px;
  background: var(--accent);
  color: #ffffff;
}

.primary-button:hover {
  background: #0353e9;
}

.clear-button:focus-visible,
.primary-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.list-head,
.policy-summary {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(280px, 2.25fr) 110px 128px 64px;
  gap: 24px;
  align-items: center;
}

.list-head {
  min-height: 48px;
  padding: 0 20px;
  color: var(--subtle);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.policy-row {
  background: var(--surface);
  border-top: 1px solid var(--soft-line);
}

.policy-row:last-child {
  border-bottom: 1px solid var(--line);
}

.policy-summary {
  min-height: 96px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.policy-summary::-webkit-details-marker {
  display: none;
}

.policy-summary:hover {
  background: #f8f8f8;
}

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

.jurisdiction-cell,
.title-cell,
.age-cell,
.status-cell,
.row-action {
  min-width: 0;
}

.jurisdiction-cell {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.jurisdiction-cell strong {
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.jurisdiction-cell small {
  color: var(--subtle);
  font-size: 0.75rem;
}

.title-cell {
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
}

.age-cell,
.row-action {
  color: var(--muted);
  font-size: 0.875rem;
}

.status-cell {
  display: flex;
}

.status-tag {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.status-active {
  background: #a7f0ba;
  color: #0e6027;
}

.status-announced {
  background: #d0e2ff;
  color: #0043ce;
}

.status-proposed {
  background: #bae6ff;
  color: #00539a;
}

.status-advisory {
  background: #e0e0e0;
  color: #393939;
}

.status-blocked {
  background: #ffd7d9;
  color: #a2191f;
}

.row-action {
  justify-self: end;
  color: var(--accent);
  font-weight: 600;
}

.open-label {
  display: none;
}

.policy-row[open] .closed-label {
  display: none;
}

.policy-row[open] .open-label {
  display: inline;
}

.policy-row[open] .policy-summary {
  background: #f8f8f8;
}

.policy-detail {
  display: grid;
  grid-template-columns: minmax(180px, 0.9fr) minmax(260px, 1.6fr) minmax(260px, 1.6fr);
  gap: 40px;
  margin: 0 20px;
  padding: 30px 0 38px;
  border-top: 1px solid var(--line);
}

.detail-meta {
  display: grid;
  align-content: start;
  gap: 24px;
}

.detail-meta > div,
.detail-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detail-meta time,
.detail-value {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.detail-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.source-link {
  width: fit-content;
  margin-top: 10px;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.source-link:hover {
  text-decoration-thickness: 2px;
}

.empty-state {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 48px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 600;
}

.empty-state p {
  max-width: 520px;
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.6;
}

.site-footer {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.65fr);
  gap: 64px;
  padding: 36px 0 48px;
  border-top: 1px solid var(--ink);
}

.site-footer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.legal-note {
  align-self: end;
  text-align: right;
}

.noscript-message {
  position: fixed;
  inset: auto 16px 16px;
  margin: 0;
  padding: 16px;
  background: #da1e28;
  color: #ffffff;
  font-size: 0.875rem;
}

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

  .list-head,
  .policy-summary {
    grid-template-columns: minmax(130px, 0.85fr) minmax(240px, 2fr) 100px 112px 56px;
    gap: 16px;
  }

  .policy-detail {
    grid-template-columns: 0.8fr 1.4fr 1.4fr;
    gap: 28px;
  }
}

@media (max-width: 760px) {
  .site-header,
  .hero,
  .metrics,
  .tracker,
  .site-footer {
    width: min(100% - 40px, 1440px);
  }

  .site-header {
    min-height: 64px;
  }

  .source-promise {
    display: none;
  }

  .hero {
    padding: 64px 0 56px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 13vw, 4.1rem);
  }

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

  .metric {
    min-height: 112px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--line);
  }

  .metric:first-child,
  .metric:nth-child(3) {
    padding-left: 0;
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(3),
  .metric:nth-child(4) {
    border-bottom: 0;
  }

  .tracker {
    padding: 80px 0 72px;
  }

  .tracker-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 28px;
  }

  .tracker-note {
    margin: 0;
  }

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

  .list-head {
    display: none;
  }

  .policy-summary {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "jurisdiction status"
      "title title"
      "age action";
    gap: 10px 16px;
    padding: 20px 16px;
  }

  .jurisdiction-cell {
    grid-area: jurisdiction;
  }

  .title-cell {
    grid-area: title;
    padding: 6px 0 8px;
  }

  .age-cell {
    grid-area: age;
  }

  .status-cell {
    grid-area: status;
    justify-self: end;
  }

  .row-action {
    grid-area: action;
  }

  .policy-detail {
    grid-template-columns: 1fr;
    gap: 28px;
    margin: 0 16px;
    padding: 26px 0 32px;
  }

  .detail-meta {
    grid-template-columns: 1fr 1fr;
  }

  .empty-state {
    min-height: 280px;
    padding: 36px 24px;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .legal-note {
    text-align: left;
  }
}

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