:root {
  color-scheme: light;
  --bg: #f8faf6;
  --ink: #0f172a;
  --muted: #475569;
  --line: #cbd5e1;
  --soft-line: #d9eadf;
  --panel: #ffffff;
  --primary: #0f6b52;
  --primary-dark: #0b4f3c;
  --ok: #0f6b52;
  --warn: #b45309;
  --bad: #b91c1c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 0 12px;
}

.brand,
.toplinks {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  font-weight: 850;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: #d9eadf;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 900;
}

.toplinks {
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.toplinks a {
  text-decoration: none;
}

.toplinks a:hover,
.toplinks a:focus-visible {
  color: var(--primary-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 max(64px, env(safe-area-inset-bottom));
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: clamp(24px, 6vw, 72px);
  align-items: end;
  padding: clamp(34px, 7vw, 86px) 0 clamp(28px, 6vw, 72px);
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 840px;
  margin-bottom: 20px;
  font-size: clamp(44px, 8vw, 86px);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 16px;
}

.lede,
.section-heading p,
.method-grid p {
  color: var(--muted);
  line-height: 1.75;
}

.lede {
  max-width: 720px;
  margin-bottom: 28px;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-link,
.secondary-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 12px 16px;
  font-weight: 750;
  text-decoration: none;
}

.primary-link {
  background: var(--primary);
  color: #ffffff;
}

.secondary-link {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.status-panel,
.metric-card,
.weak-item,
.table-shell,
.method-grid > div {
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--panel);
}

.status-panel {
  padding: 22px;
}

.panel-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.panel-value {
  margin-bottom: 18px;
  font-size: 20px;
  font-weight: 800;
}

.status-list {
  display: grid;
  gap: 12px;
  margin: 0;
}

.status-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--soft-line);
  padding-top: 12px;
}

.status-list dt {
  color: var(--muted);
}

.status-list dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.metrics,
.weak,
.cluster,
.breakdown,
.methodology {
  padding: clamp(34px, 6vw, 70px) 0 0;
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  padding: 18px;
}

.metric-label {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  margin-bottom: 10px;
  color: var(--primary-dark);
  font-size: clamp(30px, 5vw, 48px);
  font-weight: 900;
  line-height: 1;
}

.metric-note {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.weak-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.weak-item {
  padding: 16px;
}

.weak-breed {
  margin-bottom: 10px;
  font-weight: 850;
}

.weak-value {
  margin-bottom: 8px;
  color: var(--bad);
  font-size: 30px;
  font-weight: 900;
}

.weak-value.low {
  color: var(--ok);
}

.weak-value.medium {
  color: var(--warn);
}

.cluster-table {
  overflow: hidden;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  background: var(--panel);
}

.cluster-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.3fr) repeat(5, minmax(92px, 1fr));
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
  font-size: 14px;
}

.cluster-row:last-child {
  border-bottom: 0;
}

.cluster-head {
  background: #edf7f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cluster-boundary {
  max-width: 820px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.table-shell {
  overflow: hidden;
}

.table-tools {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--soft-line);
  padding: 16px;
}

.table-tools label {
  display: grid;
  gap: 8px;
  width: min(360px, 100%);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.table-tools input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  font: inherit;
}

.table-tools p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

.class-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) minmax(160px, 1fr) 90px 90px 80px;
  gap: 14px;
  align-items: center;
  border-bottom: 1px solid #e2e8f0;
  padding: 12px 16px;
  font-size: 14px;
}

.class-row:last-child {
  border-bottom: 0;
}

.class-head {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf7f0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breed-name {
  font-weight: 800;
}

.coverage-cell {
  display: grid;
  gap: 7px;
}

.coverage-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.coverage-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
}

.numeric {
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

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

.method-grid > div {
  padding: 18px;
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero,
  .metric-grid,
  .weak-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .cluster-table {
    overflow-x: auto;
  }

  .cluster-row {
    min-width: 760px;
  }

  .class-row {
    grid-template-columns: minmax(0, 1fr) 92px 76px;
  }

  .class-row span:nth-child(4),
  .class-row span:nth-child(5) {
    display: none;
  }
}

@media (max-width: 520px) {
  .toplinks {
    width: 100%;
    justify-content: space-between;
  }

  main,
  .topbar {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: clamp(38px, 14vw, 58px);
  }

  .hero {
    padding-top: 24px;
  }

  .table-tools {
    align-items: stretch;
    flex-direction: column;
  }
}
