@import url("https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap");

:root {
  --ink: #172e55;
  --ink-soft: #4b4b4b;
  --paper: #ffffff;
  --paper-2: #ffffff;
  --rule: #c9c9c9;
  --rule-strong: var(--ink);
  --max: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Public Sans", Inter, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  overflow-x: hidden;
}
a { color: inherit; }
img { max-width: 100%; }
.container { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
  position: sticky;
  top: 0;
  z-index: 20;
}
.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 36px;
}
.brand {
  text-decoration: none;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 600;
  letter-spacing: .035em;
  line-height: 1;
}
.nav {
  display: flex;
  gap: 10px 22px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  text-decoration: none;
  font-size: .84rem;
  font-weight: 500;
  color: var(--ink);
}
.nav a:hover,
.nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

main { min-height: 70vh; }
.hero {
  padding: clamp(64px, 10vw, 124px) 0 clamp(54px, 8vw, 96px);
  background: var(--paper);
  border-bottom: 1px solid var(--rule-strong);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, .55fr);
  gap: clamp(48px, 9vw, 128px);
  align-items: end;
}
h1,
h2,
h3 {
  font-family: inherit;
  font-weight: 500;
  line-height: 1.04;
  margin-top: 0;
}
h1 {
  font-size: clamp(3.1rem, 7vw, 6.4rem);
  letter-spacing: -.055em;
  margin-bottom: 24px;
  max-width: 980px;
  overflow-wrap: anywhere;
}
.hero-title {
  max-width: 100%;
  font-size: clamp(2.25rem, 14vw, 6.4rem);
  white-space: nowrap;
}
h2 {
  font-size: clamp(1.9rem, 3.5vw, 3.2rem);
  letter-spacing: -.04em;
}
h3 {
  font-size: 1.08rem;
  line-height: 1.25;
}
.lead {
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1.42;
  max-width: 760px;
  color: var(--ink);
}
.hero-note {
  border-left: 1px solid var(--rule-strong);
  padding-left: 22px;
  color: var(--ink-soft);
}
.eyebrow {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .13em;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  background: var(--ink);
  border: 1px solid var(--ink);
  color: white;
  text-decoration: none;
  border-radius: 0;
  font-weight: 600;
  font-size: .86rem;
}
.button:hover { background: white; color: var(--ink); }

.section { padding: clamp(54px, 8vw, 92px) 0; }
.section.alt {
  background: var(--paper);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.section-heading { max-width: 780px; margin-bottom: 38px; }
.section-heading p { color: var(--ink-soft); font-size: 1rem; }

.explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
}
.explore-card {
  background: var(--paper);
  border-right: 1px solid var(--rule);
  padding: 24px 26px 26px 0;
  min-height: 165px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.explore-card + .explore-card { padding-left: 26px; }
.explore-card:last-child { border-right: 0; }
.explore-card:hover h3 { text-decoration: underline; text-underline-offset: 5px; }
.explore-card p { color: var(--ink-soft); margin: 0; font-size: .9rem; }
.arrow { color: var(--ink); font-size: 1.1rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 7vw, 90px); }
.list { border-top: 1px solid var(--rule-strong); }
.list-item {
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
}
.list-item p { margin: 4px 0 0; color: var(--ink-soft); }
.status {
  color: var(--ink);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 700;
  white-space: nowrap;
}
.status.confirmed,
.status.strongly_supported,
.status.hypothesis,
.status.rejected,
.status.contradicted { color: var(--ink); }

.callout { background: var(--ink); color: white; padding: 32px; box-shadow: none; }
.callout h3 { color: white; }
.callout p { color: #e4e4e4; }

.page-head {
  padding: clamp(54px, 8vw, 92px) 0 42px;
  border-bottom: 1px solid var(--rule-strong);
  background: var(--paper);
}
.page-head h1 {
  font-size: clamp(2.8rem, 6vw, 5.5rem);
  margin-bottom: 0;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: clamp(36px, 7vw, 88px);
  row-gap: 0;
  border-top: 1px solid var(--rule-strong);
}
.browse-tools {
  position: sticky;
  top: 72px;
  z-index: 10;
  background: rgba(255, 255, 255, .97);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  padding: 18px 0;
  margin-bottom: 34px;
}
.browse-row {
  display: grid;
  grid-template-columns: minmax(220px, .75fr) minmax(0, 1.75fr) auto;
  gap: 18px;
  align-items: center;
}
.filter-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 7px;
  scrollbar-width: thin;
}
.filter-button {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  font: inherit;
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.filter-button:hover,
.filter-button[aria-pressed="true"] {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}
.filter-select { display: none; }
.result-count { margin: 0; color: var(--ink-soft); font-size: .84rem; white-space: nowrap; }
.section-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0 0 30px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--rule);
  font-size: .84rem;
}
.section-jumps a { text-underline-offset: 4px; }
.browse-group { scroll-margin-top: 178px; }
.browse-group + .browse-group { margin-top: 48px; }
.browse-group[hidden],
[data-browse-item][hidden] { display: none; }
.no-results { color: var(--ink-soft); padding: 24px 0; }
.family-card-meta { color: var(--ink-soft); font-size: .84rem; }
.family-card-meta strong { color: var(--ink); }
.family-section { scroll-margin-top: 120px; }
.family-section + .family-section { margin-top: 56px; }
.family-structure {
  border-top: 1px solid var(--rule-strong);
  padding-top: 22px;
}
.connector-generation {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 18px 0;
  position: relative;
}
.connector-generation + .connector-generation { border-top: 1px solid var(--rule); }
.connector-node {
  min-width: 92px;
  border: 1px solid var(--ink);
  padding: 12px 14px;
  text-align: center;
  font-weight: 600;
}
.connector-node span { display: block; color: var(--ink-soft); font-size: .72rem; font-weight: 400; }
.connector-note { color: var(--ink-soft); font-size: .86rem; max-width: 700px; }
.card {
  background: var(--paper);
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 22px 0 26px;
}
.card p:last-child { margin-bottom: 0; }
.meta { color: var(--ink-soft); font-size: .86rem; }
.person-card { text-decoration: none; }
.person-card:hover h3 {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.record { max-width: 880px; }
.definition {
  display: grid;
  grid-template-columns: 180px 1fr;
  border-top: 1px solid var(--rule-strong);
}
.definition dt,
.definition dd {
  margin: 0;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}
.definition dt { font-weight: 600; color: var(--ink-soft); font-size: .84rem; }

.tree { display: flex; flex-direction: column; gap: 12px; max-width: 920px; margin: 0 auto; }
.generation {
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  padding: 22px 26px;
  position: relative;
}
.generation:not(:last-child)::after {
  content: "";
  width: 1px;
  height: 13px;
  background: var(--ink);
  position: absolute;
  left: 50%;
  bottom: -13px;
}
.people-line {
  display: flex;
  justify-content: center;
  gap: 8px 18px;
  flex-wrap: wrap;
  font-size: 1.05rem;
  font-weight: 500;
}
.tree-note { text-align: center; color: var(--ink-soft); font-size: .86rem; margin: 8px 0 0; }
.branches { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.branch { border-left: 1px solid var(--rule-strong); padding-left: 18px; }
.family-tree { padding: 8px 0 58px; scroll-margin-top: 90px; }
.family-tree + .family-tree { border-top: 1px solid var(--rule); padding-top: 58px; }
.text-tree { list-style: none; padding: 0; margin: 0 0 28px; border-top: 1px solid var(--rule-strong); }
.text-tree li { display: grid; grid-template-columns: minmax(180px, 1fr) 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.text-tree li span { color: var(--ink-soft); }
a:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.search {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--rule-strong);
  background: white;
  color: var(--ink);
  padding: 0 15px;
  border-radius: 0;
  font: inherit;
}
.search:focus { outline: 2px solid var(--ink); outline-offset: 2px; }

.site-footer {
  padding: 38px 0 50px;
  border-top: 1px solid var(--rule-strong);
  color: var(--ink-soft);
  font-size: .84rem;
}
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.visually-hidden {
  position: absolute!important;
  width: 1px!important;
  height: 1px!important;
  padding: 0!important;
  margin: -1px!important;
  overflow: hidden!important;
  clip: rect(0,0,0,0)!important;
  white-space: nowrap!important;
  border: 0!important;
}

@media (max-width: 900px) {
  .site-header { position: static; }
  .header-inner { align-items: flex-start; flex-direction: column; padding: 20px 0; gap: 18px; }
  .nav { justify-content: flex-start; gap: 12px 18px; }
  .hero-grid,
  .split { grid-template-columns: 1fr; }
  .hero-note { max-width: 620px; }
  .browse-tools { top: 0; }
  .browse-row { grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); }
  .result-count { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .container { width: min(var(--max), calc(100% - 28px)); }
  .grid,
  .explore-grid,
  .branches { grid-template-columns: 1fr; }
  .explore-card,
  .explore-card + .explore-card {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 22px 0;
    min-height: 0;
  }
  .explore-card:last-child { border-bottom: 0; }
  .nav { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .section { padding: 48px 0; }
  .hero { padding: 54px 0; }
  h1 { font-size: clamp(2.35rem, 13vw, 4.2rem); }
  .hero-title { font-size: clamp(2.25rem, 14vw, 4.2rem); }
  .page-head h1 { overflow-wrap: anywhere; }
  .browse-tools { position: static; margin-bottom: 28px; padding: 14px 0; }
  .browse-row { grid-template-columns: 1fr; gap: 12px; }
  .filter-buttons { display: none; }
  .filter-select {
    display: block;
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--rule-strong);
    border-radius: 0;
    background: white;
    color: var(--ink);
    padding: 0 12px;
    font: inherit;
  }
  .result-count { grid-column: auto; }
  .section-jumps { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 12px; }
  .section-jumps a { white-space: nowrap; }
  .definition { grid-template-columns: 1fr; }
  .definition dt { border-bottom: 0; padding-bottom: 0; }
  .definition dd { padding-top: 4px; }
  .list-item { grid-template-columns: 1fr; gap: 8px; }
  .text-tree li { grid-template-columns: 1fr; gap: 2px; }
}

@media (max-width: 360px) {
  .container { width: min(var(--max), calc(100% - 20px)); }
  .hero { padding: 42px 0; }
  .hero-title { font-size: clamp(2rem, 13.5vw, 3rem); }
}

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