:root {
  --paper: #f2eadb;
  --paper-light: #f8f3e9;
  --ink: #1d2836;
  --muted: #64605a;
  --line: #b9ad9b;
  --line-soft: rgba(49, 43, 35, .16);
  --prehistoric: #b44932;
  --ancient: #c78a22;
  --medieval: #5c7e3d;
  --early-modern: #2f8190;
  --modern: #315b9b;
  --contemporary: #7b4d93;
  --shadow: 0 18px 60px rgba(51, 38, 18, .08);
  --hero-progress: 0;
  --story-progress: 0;
  --poster-progress: 0;
  --serif: Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,255,255,.72), transparent 32rem),
    linear-gradient(rgba(92,76,50,.025) 1px, transparent 1px),
    var(--paper);
  background-size: auto, 100% 28px, auto;
  color: var(--ink);
  font-family: var(--serif);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  z-index: 99;
}
a { color: inherit; }
button, input, select { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  transform: translateY(-180%);
  background: var(--ink);
  color: white;
  padding: 10px 14px;
  z-index: 200;
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 0 clamp(20px, 4vw, 64px);
  border-bottom: 1px solid var(--line-soft);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 760;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 18px;
}
.site-header nav { display: flex; gap: clamp(16px, 3vw, 36px); }
.site-header nav a {
  text-decoration: none;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #4d5154;
}
.site-header nav a:hover, .site-header nav a:focus-visible, .site-header nav a[aria-current="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }

.section-shell { width: min(1280px, calc(100% - 40px)); margin-inline: auto; }
.hero { min-height: 78vh; display: grid; align-content: center; padding: 110px 0 90px; text-align: center; }
.hero > * {
  transform: translateY(calc(var(--hero-progress) * -22px));
  opacity: calc(1 - var(--hero-progress) * .58);
  will-change: transform, opacity;
}
.hero-kicker, .eyebrow {
  font-family: var(--sans);
  text-transform: uppercase;
  letter-spacing: .19em;
  font-weight: 720;
  font-size: 10px;
}
.hero-kicker { margin-bottom: 26px; color: #6a6257; }
.hero h1 {
  margin: 0;
  font-weight: 500;
  font-size: clamp(54px, 8vw, 116px);
  line-height: .9;
  letter-spacing: -.045em;
}
.hero h1 em { font-weight: 400; }
.hero-deck { margin: 30px auto 0; font-size: clamp(20px, 2.3vw, 31px); font-style: italic; color: #434850; }
.hero-copy { max-width: 710px; margin: 24px auto 0; font-size: 17px; line-height: 1.65; color: #59574f; }
.hero-actions { display: flex; justify-content: center; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--ink);
  text-decoration: none;
  font-family: var(--sans);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  background: transparent;
  cursor: pointer;
}
.button-primary { background: var(--ink); color: #fff; }
.button-ghost:hover { background: rgba(255,255,255,.28); }
.button-primary:hover { background: #303b49; }
.hero-rule { margin: 64px auto 0; width: min(700px, 92%); display: grid; grid-template-columns: 1fr auto 1.7fr auto 1fr; align-items: center; gap: 14px; color: #84786a; }
.hero-rule span { height: 1px; background: var(--line); }
.hero-rule b { font-size: 11px; font-weight: 400; font-style: italic; }

.archive { padding: 95px 0 110px; border-top: 1px solid var(--line-soft); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 12px; color: #71685c; }
.section-heading h2, .lab h2, .methodology h2 { margin: 0; font-size: clamp(38px, 5vw, 64px); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.section-note { max-width: 310px; margin: 0; text-align: right; font-style: italic; color: #6d675f; line-height: 1.45; }
.filter-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.filter {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.18);
  padding: 8px 12px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.filter.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, .tree-scroller:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.lineage-story { position: relative; min-height: 270vh; }
.lineage-sticky {
  position: sticky;
  top: 82px;
  min-height: calc(100vh - 100px);
  display: grid;
  align-content: center;
  padding-bottom: 24px;
}
.story-status {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) minmax(180px, .7fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #786f63;
}
.story-status strong { color: var(--ink); font-weight: 760; }
.story-narrative {
  grid-column: 1 / -1;
  margin: -7px 0 0;
  max-width: 720px;
  color: #625c54;
  font-family: var(--serif);
  font-size: 13px;
  font-style: italic;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}
.story-meter { height: 2px; overflow: hidden; background: var(--line-soft); }
.story-meter i { display: block; width: calc(var(--story-progress) * 100%); height: 100%; background: var(--ink); }
.story-cue {
  margin: 12px 0 0;
  text-align: center;
  font: 700 9px var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #776f64;
  opacity: calc(1 - var(--story-progress) * 2);
}
.story-cue span { display: inline-block; margin-left: 7px; animation: story-cue 1.4s ease-in-out infinite; }
@keyframes story-cue { 50% { transform: translateY(4px); } }
.archive-grid { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(300px, .8fr); border: 1px solid var(--line); background: rgba(248,243,233,.52); box-shadow: var(--shadow); }
.tree-card { min-width: 0; border-right: 1px solid var(--line); }
.tree-toolbar { min-height: 58px; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 12px 18px; border-bottom: 1px solid var(--line-soft); }
.tree-toolbar p { margin: 0; color: #6a6257; font-size: 12px; font-style: italic; }
.text-button { border: 0; background: none; padding: 2px 0; cursor: pointer; font-family: var(--sans); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 4px; }
.tree-scroller { overflow-x: auto; overscroll-behavior-inline: contain; }
#dendrogram { min-width: 920px; display: block; width: 100%; height: auto; }
.tree-branch {
  fill: none;
  stroke-width: 2.1;
  opacity: .78;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: var(--branch-length, 1);
  stroke-dashoffset: calc(var(--branch-length, 1) * (1 - var(--branch-reveal, 1)));
  transition: opacity .28s ease, stroke-width .28s ease;
}
.tree-branch.is-muted { opacity: .09; }
.tree-branch.is-selected { stroke-width: 3.4; opacity: 1; }
.tree-branch.is-previewed { stroke-width: 3.2; opacity: 1; }
.tree-group-label, .tree-group-date { opacity: var(--group-reveal, 1); transform: translateX(calc((1 - var(--group-reveal, 1)) * 14px)); transition: opacity .18s linear; }
.tree-group-label { font: 600 17px var(--serif); fill: var(--ink); }
.tree-group-date { font: italic 12px var(--serif); fill: #756b60; }
.tree-node { cursor: pointer; opacity: var(--node-reveal, 1); transform-box: fill-box; transform-origin: left center; transition: opacity .2s linear; }
.tree-node .node-hit { fill: transparent; }
.tree-node .node-dot { stroke: var(--paper-light); stroke-width: 3px; transform-box: fill-box; transform-origin: center; transition: transform .22s ease; }
.tree-node .node-name { font: 600 17px var(--serif); fill: var(--ink); }
.tree-node .node-date { font: 13px var(--serif); fill: #5f5a53; }
.tree-node .node-motto { font: italic 12px var(--serif); fill: #777065; }
.tree-node:hover .node-name, .tree-node:focus .node-name { text-decoration: underline; }
.tree-node:focus { outline: none; }
.tree-node.is-muted { opacity: calc(var(--node-reveal, 1) * .17); }
.tree-node.is-selected .node-name { font-weight: 700; }
.tree-node.is-previewed .node-dot { transform: scale(1.48); }
.tree-node.is-previewed .node-name { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tree-root-label { font: 600 18px var(--serif); fill: var(--ink); }
.tree-root-date { font: italic 13px var(--serif); fill: #6b635a; }

.specimen-panel { padding: 34px 30px 28px; min-height: 720px; position: relative; }
.catalog-number { margin: 0 0 54px; font: 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #777064; }
.specimen-era { margin: 0 0 9px; font: 700 10px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #756d61; }
.specimen-panel h3 { margin: 0; font-size: 43px; line-height: .95; letter-spacing: -.035em; font-weight: 500; }
.specimen-date { margin: 12px 0 0; color: #686158; font-style: italic; }
.specimen-panel blockquote { margin: 38px 0 22px; padding: 0 0 0 18px; border-left: 2px solid var(--ink); font-size: 22px; font-style: italic; line-height: 1.3; }
.specimen-panel > p:not(.catalog-number):not(.specimen-era):not(.specimen-date) { color: #55534d; line-height: 1.62; }
.specimen-facts { margin: 30px 0 0; }
.specimen-facts div { padding: 15px 0; border-top: 1px solid var(--line-soft); }
.specimen-facts dt { margin-bottom: 5px; font: 700 9px var(--sans); letter-spacing: .15em; text-transform: uppercase; color: #7d7366; }
.specimen-facts dd { margin: 0; line-height: 1.45; }
.panel-actions { position: absolute; left: 30px; right: 30px; bottom: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.panel-actions [hidden] { display: none !important; }
.button-small { min-height: 40px; padding: 0 10px; font-size: 9px; }
.button-quiet { border-color: var(--line); }
.accessible-index { border: 1px solid var(--line); border-top: 0; background: rgba(248,243,233,.38); }
.accessible-index summary { cursor: pointer; padding: 18px; font-family: var(--sans); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.index-grid { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line-soft); }
.index-button { border: 0; border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); background: transparent; text-align: left; padding: 18px; cursor: pointer; }
.index-button strong { display: block; font-size: 15px; margin-bottom: 4px; }
.index-button span { color: #71695f; font-size: 12px; font-style: italic; }
.index-button:hover { background: rgba(255,255,255,.3); }

.lab { padding: 110px 0; border-top: 1px solid var(--line-soft); }
.lab-heading { max-width: 760px; }
.lab-heading > p:last-child { max-width: 600px; font-size: 18px; line-height: 1.6; color: #5a5650; }
.calculator-card { margin-top: 42px; display: grid; grid-template-columns: 1fr .92fr; border: 1px solid var(--line); background: rgba(248,243,233,.56); box-shadow: var(--shadow); }
.calculator-controls { padding: clamp(26px, 4vw, 52px); display: grid; align-content: center; gap: 24px; border-right: 1px solid var(--line); }
.field-group label { display: block; margin-bottom: 8px; font: 700 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; }
.input-pair { display: grid; grid-template-columns: 1fr minmax(160px, .45fr); }
.input-pair input, .input-pair select, .unit-chip { height: 56px; border: 1px solid var(--line); background: rgba(255,255,255,.34); color: var(--ink); border-radius: 0; }
.input-pair input { width: 100%; padding: 0 15px; border-right: 0; font-size: 21px; }
.input-pair select { padding: 0 13px; font-family: var(--sans); font-size: 12px; }
.input-pair-fixed { grid-template-columns: 1fr 72px; }
.unit-chip { display: grid; place-items: center; font-family: var(--sans); font-size: 12px; }
.preset { border: 0; border-bottom: 1px solid var(--ink); background: none; justify-self: start; padding: 0 0 4px; cursor: pointer; font-size: 13px; font-style: italic; }
.result-card { background: var(--ink); color: var(--paper-light); padding: clamp(30px, 5vw, 62px); display: flex; flex-direction: column; justify-content: center; min-height: 440px; overflow: hidden; position: relative; }
.result-card::after {
  content: "";
  position: absolute;
  width: 260px;
  aspect-ratio: 1;
  right: -95px;
  top: -115px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 52% 48% 49% 51% / 62% 62% 38% 38%;
  transform: scale(var(--result-inflate, .55));
  opacity: calc(.08 + var(--result-inflate, .55) * .35);
  transition: transform 1.1s cubic-bezier(.2,.8,.2,1), opacity 1.1s ease;
}
.result-card > * { position: relative; z-index: 1; }
.result-label { margin: 0 0 18px; font: 700 10px var(--sans); text-transform: uppercase; letter-spacing: .17em; color: #c7c0b7; }
.result-number { margin: 0; font-size: clamp(54px, 7vw, 102px); line-height: .82; letter-spacing: -.055em; }
.result-unit { margin: 11px 0 0; font-size: 25px; font-style: italic; }
.result-rule { height: 1px; background: rgba(255,255,255,.22); margin: 33px 0 25px; }
.result-sentence { margin: 0; color: #d8d2c9; line-height: 1.55; }
.result-card .text-button { align-self: start; margin-top: 28px; color: #fff; }
.result-actions { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 28px; }
.result-card .result-actions .text-button { margin-top: 0; }
.lab-footnote { max-width: 820px; margin: 18px 0 0; color: #6a635b; font-size: 12px; line-height: 1.55; }

.poster-section { padding: 100px 0 115px; border-top: 1px solid var(--line-soft); }
.poster-story { min-height: 225vh; position: relative; }
.poster-sticky { position: sticky; top: 82px; min-height: calc(100vh - 100px); display: grid; align-content: center; }
.poster-frame {
  height: min(72vh, 760px);
  margin: 0;
  padding: 12px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--line);
  background: #e9dfcd;
  box-shadow: var(--shadow);
}
.poster-frame img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transform: scale(calc(1.46 - var(--poster-progress) * .46)) translateY(calc((1 - var(--poster-progress)) * 2.5%));
  transform-origin: 50% 29%;
  filter: saturate(calc(.72 + var(--poster-progress) * .28)) contrast(calc(1.07 - var(--poster-progress) * .07));
  will-change: transform, filter;
}
.poster-reveal-copy {
  position: absolute;
  left: 32px;
  right: 32px;
  bottom: 28px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  padding-top: 80px;
  color: #fff;
  background: linear-gradient(transparent, rgba(19,24,31,.72));
  opacity: clamp(0, calc((var(--poster-progress) - .68) * 4), 1);
}
.poster-reveal-copy span { font: 700 9px var(--sans); letter-spacing: .15em; text-transform: uppercase; }
.poster-reveal-copy strong { font-size: clamp(22px, 3vw, 38px); font-weight: 500; }
.poster-status { display: grid; grid-template-columns: auto minmax(180px, .55fr); justify-content: end; align-items: center; gap: 18px; margin-top: 12px; font: 700 9px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: #766d61; }
.poster-status > div { width: min(300px, 35vw); height: 2px; background: var(--line-soft); }
.poster-status i { display: block; height: 100%; width: calc(var(--poster-progress) * 100%); background: var(--ink); }
.poster-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  margin-top: 30px;
  padding: 26px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}
.poster-actions p { max-width: 650px; margin: 0; color: #615c54; line-height: 1.55; }
.poster-actions p strong { color: var(--ink); }
.poster-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }

.motion-ready .motion-reveal { opacity: 0; transform: translateY(28px); transition: opacity .85s ease, transform .85s cubic-bezier(.2,.7,.2,1); }
.motion-ready .motion-reveal.is-visible { opacity: 1; transform: none; }

.methodology { margin-bottom: 90px; display: grid; grid-template-columns: 110px 1fr; gap: 34px; padding-top: 55px; padding-bottom: 55px; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); }
.methodology-number { font-size: 82px; line-height: .75; }
.methodology > div:last-child { max-width: 820px; }
.methodology p:not(.eyebrow) { font-size: 17px; line-height: 1.62; color: #53514c; }
.site-footer { border-top: 1px solid var(--line-soft); min-height: 130px; display: flex; align-items: center; justify-content: space-between; gap: 30px; font-size: 12px; color: #615b54; }
.site-footer div { display: flex; flex-direction: column; gap: 7px; }
.site-footer strong { color: var(--ink); font-family: var(--sans); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; }

@media (max-width: 980px) {
  .lineage-story { min-height: auto; }
  .lineage-sticky { position: relative; top: auto; min-height: auto; padding-bottom: 0; }
  .story-status, .story-cue { display: none; }
  .archive-grid { grid-template-columns: 1fr; }
  .tree-card { border-right: 0; border-bottom: 1px solid var(--line); }
  .specimen-panel { min-height: 570px; }
  .index-grid { grid-template-columns: repeat(2, 1fr); }
  .calculator-card { grid-template-columns: 1fr; }
  .calculator-controls { border-right: 0; border-bottom: 1px solid var(--line); }
  .poster-story { min-height: auto; }
  .poster-sticky { position: relative; top: auto; min-height: auto; }
  .poster-frame { height: auto; }
  .poster-frame img { height: auto; transform: none; filter: none; }
  .poster-status { display: none; }
  .poster-reveal-copy { position: static; margin-top: 12px; padding: 0; color: var(--ink); background: none; opacity: 1; }
  .poster-actions { grid-template-columns: 1fr; }
  .poster-actions > div { justify-content: flex-start; }
}
@media (max-height: 780px) and (min-width: 981px) {
  .lineage-story { min-height: auto; }
  .lineage-sticky { position: relative; top: auto; min-height: auto; padding-bottom: 0; }
  .story-status, .story-cue { display: none; }
  .poster-story { min-height: auto; }
  .poster-sticky { position: relative; top: auto; min-height: auto; }
  .poster-frame { height: auto; }
  .poster-frame img { height: auto; transform: none; filter: none; }
  .poster-status { display: none; }
  .poster-reveal-copy { opacity: 1; }
}
@media (max-width: 680px) {
  .section-shell { width: min(100% - 24px, 1280px); }
  .site-header { padding: 0 14px; min-height: 58px; }
  .site-header nav a:nth-child(1), .site-header nav a:nth-child(3) { display: none; }
  .brand { letter-spacing: .08em; }
  .hero { min-height: auto; padding: 90px 0 76px; }
  .hero h1 { font-size: clamp(50px, 16vw, 78px); }
  .hero-deck { font-size: 20px; }
  .hero-copy { font-size: 15px; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-note { text-align: left; }
  .archive, .lab, .poster-section { padding-block: 76px; }
  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 5px; }
  .filter { white-space: nowrap; }
  .tree-toolbar { align-items: start; flex-direction: column; }
  .specimen-panel { padding: 25px 20px 22px; min-height: 720px; }
  .catalog-number { margin-bottom: 38px; }
  .panel-actions { left: 20px; right: 20px; bottom: 22px; grid-template-columns: 1fr; }
  .index-grid { grid-template-columns: 1fr; }
  .calculator-controls { padding: 26px 18px; }
  .input-pair { grid-template-columns: 1fr 130px; }
  .input-pair-fixed { grid-template-columns: 1fr 64px; }
  .result-card { min-height: 380px; padding: 34px 22px; }
  .result-number { font-size: clamp(48px, 15vw, 75px); }
  .poster-actions > div { display: grid; }
  .methodology { grid-template-columns: 1fr; gap: 10px; padding-inline: 4px; }
  .methodology-number { font-size: 55px; }
  .site-footer { padding-block: 30px; align-items: start; flex-direction: column; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .hero > * { transform: none; opacity: 1; }
  .tree-branch { stroke-dashoffset: 0; }
  .tree-group-label, .tree-group-date, .tree-node { opacity: 1; transform: none; }
  .poster-frame img { transform: none; filter: none; }
  .poster-reveal-copy { opacity: 1; }
  .motion-ready .motion-reveal { opacity: 1; transform: none; }
}
