:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-2: #edf1ec;
  --ink: #111a16;
  --muted: #63716a;
  --line: #d8e0da;
  --brand: #0c6b58;
  --brand-2: #164b85;
  --accent: #b2552f;
  --shadow: 0 18px 50px rgba(28, 44, 36, 0.12);
  --radius: 8px;
  --max: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101411;
  --surface: #171d19;
  --surface-2: #202821;
  --ink: #eef4ef;
  --muted: #a8b7ad;
  --line: #334039;
  --brand: #55c7a9;
  --brand-2: #8dbaf2;
  --accent: #e4a071;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--brand) 11%, transparent), transparent 32rem),
    var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: var(--brand-2);
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  outline-offset: 4px;
}

.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: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
}

.skip-link:focus {
  top: 1rem;
}

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

.nav-shell,
main {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
}

.nav-shell {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

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

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 7px;
  object-fit: cover;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  justify-content: end;
}

.nav-actions a {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem 0.78rem;
  color: var(--muted);
  text-decoration: none;
}

.nav-actions a:hover,
.nav-actions a[aria-current="page"] {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.theme-switch {
  width: 62px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: color-mix(in srgb, var(--surface) 84%, var(--surface-2));
  cursor: pointer;
  position: relative;
  display: inline-flex;
  align-items: center;
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.theme-switch:hover {
  border-color: var(--brand);
}

.switch-track {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f2c75d, #e8eef2);
  box-shadow: inset 0 0 0 1px rgba(17, 26, 22, 0.08);
  overflow: hidden;
}

.switch-track::before,
.switch-track::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  opacity: 0.9;
}

.switch-track::before {
  left: 9px;
  width: 8px;
  height: 8px;
  background: #ffffff;
  box-shadow: 14px -4px 0 -2px rgba(255, 255, 255, 0.9);
}

.switch-track::after {
  right: 9px;
  width: 11px;
  height: 11px;
  background: #172235;
  box-shadow: -4px 2px 0 0 #e8eef2;
}

.switch-knob {
  position: absolute;
  z-index: 1;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(17, 26, 22, 0.26);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1), background 180ms ease;
}

.switch-knob::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 5px;
  width: 2px;
  height: 8px;
  border-radius: 999px;
  background: var(--brand);
  transform: translateX(-50%);
}

.switch-knob::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 11px;
  height: 11px;
  border: 2px solid var(--brand);
  border-top-color: transparent;
  border-radius: 50%;
  transform: translate(-50%, -35%);
}

[data-theme="dark"] .switch-track {
  background: linear-gradient(90deg, #263244, #132018);
}

[data-theme="dark"] .switch-knob {
  transform: translateX(26px);
  background: #dff8eb;
}

.theme-switch.is-switching {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent), 0 0 28px color-mix(in srgb, var(--brand) 45%, transparent);
}

.theme-switch.is-switching .switch-knob {
  animation: electric-flick 520ms ease;
}

.theme-switch.is-switching::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 999px;
  pointer-events: none;
  background:
    linear-gradient(105deg, transparent 36%, color-mix(in srgb, var(--brand) 72%, white) 37%, transparent 41%),
    linear-gradient(70deg, transparent 58%, color-mix(in srgb, var(--accent) 72%, white) 59%, transparent 63%);
  opacity: 0;
  animation: electric-spark 520ms ease;
}

@keyframes electric-flick {
  0%, 100% {
    filter: brightness(1);
  }
  22%, 58% {
    filter: brightness(1.65);
  }
  38%, 76% {
    filter: brightness(0.85);
  }
}

@keyframes electric-spark {
  0%, 100% {
    opacity: 0;
    transform: scale(0.94);
  }
  28%, 62% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.landing-hero,
.page-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: 2rem;
  min-height: calc(100svh - 70px);
  padding: 4rem 0;
}

.page-hero.compact {
  display: block;
  min-height: 0;
  max-width: 920px;
  padding: 3.5rem 0 2rem;
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 13ch;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.6rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.page-hero h1 {
  max-width: 15ch;
  font-size: clamp(2.6rem, 6vw, 5.2rem);
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
}

.hero-copy {
  max-width: 720px;
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions,
.utility-actions,
.quick-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.hero-actions {
  margin-top: 1.7rem;
}

.button,
.chip {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.68rem 0.95rem;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 150ms ease, border-color 150ms ease, background 150ms ease;
}

.button:hover,
.chip:hover,
.category-button:hover,
.static-category-grid a:hover {
  transform: translateY(-1px);
  border-color: var(--brand);
}

.button.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #ffffff;
  font-weight: 850;
}

.button.secondary {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-weight: 800;
}

.button.ghost {
  background: transparent;
}

.chip {
  min-height: 38px;
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
}

.chip.active {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  font-weight: 800;
}

.insight-panel {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  box-shadow: var(--shadow);
}

.insight-panel > div {
  padding: 1.3rem;
  background: var(--surface);
}

.metric-value {
  display: block;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

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

.home-band,
.notice-band {
  margin: 0 0 2rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface));
}

.section-block,
.controls-section,
.comparison-section,
.average-section,
.aspect-section,
.table-section {
  padding: 2.5rem 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 0.75rem;
}

.filters label {
  display: grid;
  gap: 0.34rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.filters input,
.filters select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 0.82rem;
  background: var(--surface);
  color: var(--ink);
}

.quick-ranges {
  margin-top: 0.85rem;
}

.status-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
  padding: 1rem 0 2rem;
}

.status-card,
.comparison-card,
.comparison-empty,
.aspect-card,
.category-button {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(28, 44, 36, 0.06);
}

.status-card {
  padding: 1rem;
}

.status-card strong {
  display: block;
  margin-top: 0.2rem;
  font-size: 1.25rem;
}

.static-category-grid,
.category-button-grid,
.aspect-grid,
.comparison-grid {
  display: grid;
  gap: 0.85rem;
}

.static-category-grid,
.category-button-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.aspect-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.comparison-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.static-category-grid a,
.category-button {
  min-height: 92px;
  padding: 1rem;
  color: var(--ink);
  text-decoration: none;
}

.category-button {
  display: grid;
  align-content: space-between;
}

.category-button span,
.static-category-grid a {
  font-weight: 850;
}

.category-button strong {
  color: var(--muted);
  font-size: 0.86rem;
}

.aspect-card {
  min-width: 0;
  padding: 0.95rem;
}

.aspect-card strong {
  display: block;
  margin-bottom: 0.3rem;
}

.aspect-card p,
.comparison-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

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

.coverage-pill {
  display: inline-flex;
  margin-top: 0.65rem;
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.coverage-pill.has-data {
  background: color-mix(in srgb, var(--brand) 14%, var(--surface));
  color: var(--brand);
}

.comparison-card,
.comparison-empty {
  padding: 1rem;
}

.comparison-card-top,
.comparison-values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.comparison-card-top {
  color: var(--muted);
  font-size: 0.82rem;
}

.comparison-card h3 {
  margin-top: 0.65rem;
}

.comparison-values {
  margin: 0.95rem 0 0.85rem;
}

.comparison-values div {
  flex: 1;
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.comparison-values span {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
}

.comparison-values strong {
  display: block;
  margin-top: 0.25rem;
  overflow-wrap: anywhere;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  padding: 1.5rem 0 2.5rem;
}

.chart-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 28px rgba(28, 44, 36, 0.06);
}

.chart-card.wide {
  grid-column: 1 / -1;
}

.chart-card header {
  padding: 1rem 1rem 0;
}

.chart-card header p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.chart-frame {
  height: 330px;
  padding: 1rem;
}

.chart-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0 1rem 1rem;
}

.empty-state {
  padding: 1.25rem;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

caption {
  padding: 0.85rem 1rem;
  color: var(--muted);
  text-align: left;
}

th,
td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.source-list {
  display: grid;
  gap: 0.75rem;
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.source-list li {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow-wrap: anywhere;
}

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

.method-grid article {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

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

.site-footer {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
}

.footer-grid {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 2.5rem 0;
  display: grid;
  grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(150px, 0.65fr));
  gap: 1.25rem;
}

.footer-brand {
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 900;
  text-decoration: none;
}

.site-footer p {
  max-width: 420px;
  margin: 0.65rem 0 0;
  color: var(--muted);
}

.managed-by {
  font-weight: 750;
}

.site-footer h2 {
  margin: 0 0 0.6rem;
  font-size: 0.82rem;
  color: var(--muted);
  text-transform: uppercase;
}

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 0.4rem 0;
  color: var(--ink);
  text-decoration: none;
}

.site-footer a:not(.footer-brand):hover {
  color: var(--brand);
}

.footer-bottom {
  width: min(100% - 2rem, var(--max));
  margin: 0 auto;
  padding: 1rem 0 1.25rem;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.legal-hero h1 {
  max-width: 14ch;
}

.legal-content {
  max-width: 900px;
  padding: 0 0 3rem;
}

.legal-content h2 {
  margin: 1.6rem 0 0.45rem;
  font-size: 1.25rem;
}

.legal-content p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .landing-hero,
  .filters,
  .status-row,
  .static-category-grid,
  .category-button-grid,
  .aspect-grid,
  .comparison-grid,
  .chart-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .landing-hero {
    min-height: 0;
    padding-top: 3rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

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

@media (max-width: 620px) {
  .nav-shell,
  main {
    width: min(100% - 1rem, var(--max));
  }

  .brand span {
    display: none;
  }

  .nav-actions {
    gap: 0.25rem;
  }

  .nav-actions a {
    padding-inline: 0.55rem;
    font-size: 0.86rem;
  }

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

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

  h1 {
    max-width: 10ch;
  }

  table {
    min-width: 0;
  }

  caption,
  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    padding: 0.85rem;
    border-top: 1px solid var(--line);
  }

  td {
    display: grid;
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.45rem 0;
    border: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
  }

  td a {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .chart-frame {
    height: 300px;
  }

  .footer-grid {
    width: min(100% - 1rem, var(--max));
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    width: min(100% - 1rem, var(--max));
    flex-direction: column;
  }
}

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

@media print {
  .site-header,
  .hero-actions,
  .utility-actions,
  .filters,
  .quick-ranges,
  .chart-actions,
  .toast {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  main {
    width: 100%;
  }

  .chart-grid,
  .comparison-grid,
  .status-row {
    grid-template-columns: 1fr;
  }
}
