:root {
  --site-width: 1160px;
  --hero-blue: #082d40;
  --rule-fade: linear-gradient(90deg, var(--color-copper), var(--color-lichen) 34%, transparent);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: var(--font-body);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: var(--color-copper);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-atlantic);
}

a:focus-visible {
  outline: 3px solid var(--color-lichen);
  outline-offset: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--color-paper);
  color: var(--color-ink);
  font-weight: 700;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  background:
    linear-gradient(135deg, rgba(8, 45, 64, 0.98), rgba(22, 71, 102, 0.94) 52%, rgba(63, 111, 78, 0.9)),
    var(--hero-blue);
  color: var(--color-white);
}

.nav,
.hero,
.evidence-band,
.section,
.footer {
  width: min(var(--site-width), calc(100% - 32px));
  margin: 0 auto;
}

.nav {
  display: flex;
  gap: 28px;
  align-items: center;
  padding: 24px 0;
}

.brand,
.footer-brand {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  text-decoration: none;
}

.brand {
  margin-right: auto;
}

.nav-links {
  display: flex;
  gap: 22px;
  align-items: center;
  overflow-x: auto;
  font-size: 0.94rem;
  font-weight: 700;
  white-space: nowrap;
}

.nav-links a {
  text-decoration: none;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 64px;
  align-items: center;
  padding: 58px 0 48px;
}

.eyebrow,
.section-marker span,
.source-note strong,
.place-grid article > span,
.item-list a > span,
.source-groups article > span,
.note-card > span,
.note-source > span,
.insight-summary article > span,
.region > span {
  font-family: var(--font-utility);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 16px;
  color: var(--color-lichen);
}

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

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 24px;
  font-size: 8.4rem;
  line-height: 0.88;
}

h1::after,
h2::after {
  content: "";
  display: block;
  width: min(440px, 100%);
  height: 5px;
  margin-top: 26px;
  background: var(--rule-fade);
}

h2 {
  max-width: 760px;
  margin-bottom: 28px;
  font-size: 5rem;
  line-height: 0.96;
}

h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin-bottom: 20px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.36rem;
  line-height: 1.56;
}

.hero-copy > p:not(.eyebrow):not(.lead) {
  max-width: 700px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 1.08rem;
  line-height: 1.68;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: var(--color-paper);
  color: var(--color-ink);
}

.button.secondary {
  color: var(--color-paper);
}

.hero-card {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(247, 243, 234, 0.08);
}

.hero-card img {
  display: block;
  width: 172px;
  margin: 0 auto 18px;
}

.hero-card dl {
  display: grid;
  gap: 16px;
  margin: 0;
}

.hero-card div {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-card dt {
  margin-bottom: 5px;
  color: var(--color-lichen);
  font-family: var(--font-utility);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-card dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.96rem;
  line-height: 1.55;
}

.evidence-band {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  padding-bottom: 28px;
}

.evidence-band div {
  min-height: 116px;
  padding: 18px 20px;
  background: rgba(247, 243, 234, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.evidence-band > div > span {
  display: block;
  margin-bottom: 12px;
  color: var(--color-lichen);
  font-family: var(--font-utility);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.evidence-band strong {
  display: block;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.03rem;
  line-height: 1.45;
}

.section {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 56px;
  padding: 88px 0;
  border-top: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
}

.section-marker {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.section-marker img {
  width: 44px;
  height: 44px;
}

.section-marker span {
  margin-top: 13px;
  color: var(--color-atlantic);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 340px);
  gap: 36px;
  align-items: start;
}

.prose {
  max-width: 760px;
}

.prose p {
  color: color-mix(in srgb, var(--color-ink) 82%, transparent);
  font-size: 1.08rem;
  line-height: 1.72;
}

.prose p:last-child,
.source-note p:last-child {
  margin-bottom: 0;
}

.source-note {
  border-left: 4px solid var(--color-copper);
  padding: 18px 20px;
  background: color-mix(in srgb, var(--color-limestone) 34%, var(--color-white));
}

.source-note.wide {
  margin-top: 32px;
}

.source-note strong {
  display: block;
  margin-bottom: 10px;
}

.source-note p {
  color: color-mix(in srgb, var(--color-ink) 74%, transparent);
  font-size: 0.95rem;
  line-height: 1.55;
}

.section-insights {
  width: 100%;
  padding-right: max(16px, calc((100% - var(--site-width)) / 2));
  padding-left: max(16px, calc((100% - var(--site-width)) / 2));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--color-limestone) 24%, transparent), transparent 38%),
    var(--color-paper);
}

.section-insights .section-body {
  min-width: 0;
}

.section-insights p {
  line-height: 1.68;
}

.insight-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 34px;
}

.insight-summary article {
  min-height: 182px;
  padding: 22px;
  border-top: 5px solid var(--color-copper);
  background: var(--color-white);
}

.insight-summary article > span,
.region > span {
  display: block;
  margin-bottom: 12px;
  color: var(--color-atlantic);
}

.insight-summary strong {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1.12;
}

.insight-summary p,
.viz-note,
.viz-method,
.confidence-method {
  margin-bottom: 0;
  color: color-mix(in srgb, var(--color-ink) 74%, transparent);
  line-height: 1.68;
}

.viz-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.viz-panel {
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
  background: var(--color-white);
}

.panel-heading {
  min-height: 142px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
}

.panel-heading .eyebrow {
  margin-bottom: 10px;
  color: var(--color-moss);
}

.network-map {
  position: relative;
  min-height: 340px;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49%, color-mix(in srgb, var(--color-atlantic) 14%, transparent) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, color-mix(in srgb, var(--color-atlantic) 10%, transparent) 50%, transparent 51%),
    color-mix(in srgb, var(--color-limestone) 36%, var(--color-white));
}

.network-map::before,
.network-map::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 78%;
  height: 1px;
  background: color-mix(in srgb, var(--color-atlantic) 24%, transparent);
  transform-origin: 0 0;
}

.network-map::before {
  transform: rotate(28deg) translate(-50%, -50%);
}

.network-map::after {
  transform: rotate(-26deg) translate(-50%, -50%);
}

.node {
  position: absolute;
  z-index: 1;
  display: inline-flex;
  min-width: 90px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--color-ink) 18%, transparent);
  border-radius: 999px;
  background: var(--color-paper);
  box-shadow: 0 10px 22px rgba(21, 21, 21, 0.08);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}

.node.core {
  left: 50%;
  top: 50%;
  min-width: 138px;
  min-height: 58px;
  background: var(--color-atlantic);
  color: var(--color-white);
  transform: translate(-50%, -50%);
}

.node.strong {
  background: color-mix(in srgb, var(--color-moss) 18%, var(--color-white));
}

.node.lead {
  background: color-mix(in srgb, var(--color-lichen) 30%, var(--color-white));
}

.node.separate {
  background: color-mix(in srgb, var(--color-copper) 20%, var(--color-white));
}

.node.n1 { left: 10%; top: 16%; }
.node.n2 { right: 12%; top: 15%; }
.node.n3 { left: 11%; bottom: 18%; }
.node.n4 { right: 12%; bottom: 20%; }
.node.n5 { left: 38%; top: 9%; }
.node.n6 { left: 39%; bottom: 9%; }

.viz-note {
  padding: 18px 24px 22px;
  font-size: 0.96rem;
}

.viz-method {
  padding: 16px 24px 0;
  color: color-mix(in srgb, var(--color-ink) 68%, transparent);
  font-size: 0.9rem;
}

.region-bars {
  display: grid;
  gap: 12px;
  padding: 24px;
}

.region {
  display: grid;
  grid-template-columns: minmax(92px, 130px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  min-height: 76px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
  background: color-mix(in srgb, var(--color-limestone) 22%, var(--color-white));
  text-decoration: none;
}

.region::after {
  content: "";
  grid-column: 1 / -1;
  height: 12px;
  background: linear-gradient(90deg, var(--color-atlantic) var(--weight), color-mix(in srgb, var(--color-limestone) 55%, var(--color-white)) var(--weight));
}

.region.high {
  --weight: 92%;
}

.region.medium {
  --weight: 54%;
}

.region.compare {
  --weight: 68%;
}

.region strong {
  font-size: 1.02rem;
  line-height: 1.35;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 18px 24px 6px;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 0 0 22px;
  border-left: 3px solid color-mix(in srgb, var(--color-atlantic) 24%, transparent);
}

.timeline time {
  margin-left: -3px;
  padding-left: 12px;
  color: var(--color-atlantic);
  font-family: var(--font-utility);
  font-weight: 800;
}

.timeline span {
  line-height: 1.5;
}

.timeline a {
  font-weight: 800;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 24px;
}

.topic-grid a {
  display: flex;
  min-height: 80px;
  align-items: flex-end;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--color-atlantic) 10%, transparent), transparent),
    color-mix(in srgb, var(--color-limestone) 26%, var(--color-white));
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.05;
  text-decoration: none;
}

.confidence-ledger {
  margin-top: 18px;
  padding: 24px;
  background: var(--color-ink);
  color: var(--color-white);
}

.confidence-ledger h3 {
  margin-bottom: 12px;
}

.confidence-method {
  max-width: 820px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.96rem;
}

.confidence-method a {
  color: var(--color-white);
}

.confidence-ledger dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.confidence-ledger div {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
  background: rgba(255, 255, 255, 0.08);
}

.confidence-ledger dt {
  margin: 0;
  color: var(--color-lichen);
  font-family: var(--font-display);
  font-size: 2.35rem;
  line-height: 1.18;
}

.confidence-ledger dd {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.68;
}

.place-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.place-grid article,
.item-list a,
.source-list,
.source-groups article,
.note-card,
.note-source {
  border: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
  background: var(--color-white);
}

.place-grid article {
  min-height: 170px;
  padding: 18px;
}

.place-grid article > span,
.item-list a > span {
  color: var(--color-atlantic);
}

.place-grid strong {
  display: block;
  margin: 14px 0 10px;
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
}

.place-grid p {
  margin-bottom: 0;
  color: color-mix(in srgb, var(--color-ink) 72%, transparent);
  line-height: 1.5;
}

.item-list {
  display: grid;
  gap: 12px;
}

.item-list a {
  display: block;
  padding: 18px;
  text-decoration: none;
}

.item-list strong {
  display: block;
  margin-top: 10px;
  color: var(--color-ink);
  font-size: 1rem;
  line-height: 1.45;
}

.item-list p {
  margin: 10px 0 0;
  color: color-mix(in srgb, var(--color-ink) 70%, transparent);
  line-height: 1.45;
}

.mark-feature {
  display: grid;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.mark-feature > img {
  border: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
  background: var(--color-white);
}

.heraldry-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.gallery-intro {
  grid-column: 1 / -1;
  max-width: 780px;
}

.gallery-intro h3 {
  margin: 0;
  font-size: 1.42rem;
  text-align: left;
}

.gallery-intro p:not(.eyebrow) {
  color: color-mix(in srgb, var(--color-ink) 74%, transparent);
  line-height: 1.45;
}

.heraldry-gallery article {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--color-ink) 14%, transparent);
  background: var(--color-white);
}

.gallery-image-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 220px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
  background: var(--color-paper);
}

.gallery-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  padding: 14px;
  object-fit: contain;
}

.gallery-image--matched-scale {
  max-width: 100%;
  max-height: 100%;
}

.heraldry-gallery article span {
  color: var(--color-atlantic);
  font-family: var(--font-utility);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.heraldry-gallery h4 {
  margin: 5px 0 0;
  font-size: 1rem;
  line-height: 1.25;
}

.heraldry-gallery article p {
  margin: 6px 0 0;
  color: color-mix(in srgb, var(--color-ink) 72%, transparent);
  font-size: 0.9rem;
  line-height: 1.36;
}

.gallery-links {
  font-size: 0.82rem;
}

.heraldry-caution {
  margin-top: 10px;
}

.source-list {
  margin: 0;
  padding: 18px 20px 18px 36px;
}

.source-list li {
  margin-bottom: 12px;
  line-height: 1.45;
}

.source-list li:last-child {
  margin-bottom: 0;
}

.source-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 34px;
}

.source-groups article {
  padding: 20px;
}

.source-groups article > span,
.note-card > span,
.note-source > span {
  display: block;
  margin-bottom: 12px;
  color: var(--color-atlantic);
}

.source-groups h3,
.note-card h2,
.note-card h3,
.note-source h3 {
  margin-bottom: 14px;
}

.source-groups ul,
.note-card ul,
.note-source ul {
  margin: 0;
  padding-left: 20px;
}

.source-groups li,
.note-card li,
.note-source li {
  margin-bottom: 12px;
  color: color-mix(in srgb, var(--color-ink) 76%, transparent);
  line-height: 1.55;
}

.source-groups li:last-child,
.note-card li:last-child,
.note-source li:last-child {
  margin-bottom: 0;
}

.note-page .site-header {
  min-height: 0;
}

.note-hero {
  width: min(var(--site-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.note-hero h1 {
  max-width: 940px;
  font-size: 6.2rem;
}

.note-hero .lead {
  max-width: 780px;
}

.note-main {
  width: min(var(--site-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 88px;
}

.note-grid,
.note-source-grid {
  display: grid;
  gap: 18px;
}

.note-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 22px;
}

.note-card,
.note-source {
  padding: 22px;
}

.note-card h2,
.note-card h3,
.note-source h3 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  line-height: 1.06;
}

.note-card h2::after {
  content: none;
}

.note-card p,
.note-source p {
  color: color-mix(in srgb, var(--color-ink) 76%, transparent);
  line-height: 1.62;
}

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

.note-source-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  gap: 42px;
  padding: 48px 0 56px;
  border-top: 5px solid var(--color-copper);
}

.footer p {
  max-width: 760px;
  color: color-mix(in srgb, var(--color-ink) 72%, transparent);
  line-height: 1.62;
}

.footer nav {
  display: grid;
  gap: 10px;
  align-content: start;
}

@media (max-width: 920px) {
  .nav {
    align-items: flex-start;
  }

  .nav-links {
    max-width: 68vw;
    padding-bottom: 6px;
  }

  .hero,
  .evidence-band,
  .section,
  .content-grid,
  .mark-feature,
  .insight-summary,
  .viz-grid,
  .confidence-ledger dl,
  .source-groups,
  .note-grid,
  .note-source-grid,
  .footer {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 36px;
    padding: 50px 0 42px;
  }

  .hero-card {
    max-width: 310px;
  }

  .heraldry-gallery article {
    padding: 12px;
  }

  .heraldry-gallery {
    grid-template-columns: 1fr;
  }

  .gallery-image-frame {
    height: 240px;
  }

  .evidence-band {
    gap: 10px;
    padding-bottom: 28px;
  }

  h1 {
    font-size: 4.5rem;
  }

  .note-hero h1 {
    font-size: 4.5rem;
  }

  h2 {
    font-size: 3rem;
  }
}

@media (max-width: 560px) {
  .site-header {
    min-height: 0;
  }

  .nav {
    gap: 16px;
  }

  .brand {
    font-size: 1.25rem;
  }

  .nav-links {
    gap: 14px;
    max-width: 60vw;
    font-size: 0.82rem;
  }

  .hero,
  .section {
    padding: 56px 0;
  }

  .section-insights {
    padding-right: 16px;
    padding-left: 16px;
  }

  .heraldry-gallery article {
    padding: 10px;
  }

  .gallery-image-frame {
    height: 210px;
  }

  .hero {
    padding-bottom: 34px;
  }

  .evidence-band {
    padding-bottom: 24px;
  }

  .confidence-ledger div {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 14px;
    padding: 16px;
  }

  .confidence-ledger dt {
    font-size: 2rem;
  }

  h1 {
    font-size: 3.45rem;
  }

  .note-hero h1 {
    font-size: 3.2rem;
  }

  h2 {
    font-size: 2.5rem;
  }

  .lead {
    font-size: 1.12rem;
  }

  .panel-heading {
    min-height: 0;
  }

  .network-map {
    display: grid;
    gap: 10px;
    min-height: 0;
    padding: 18px;
  }

  .network-map::before,
  .network-map::after {
    display: none;
  }

  .node {
    position: static;
    width: 100%;
    font-size: 0.9rem;
    transform: none;
  }

  .node.core {
    min-width: 0;
    transform: none;
  }

  .region,
  .timeline li,
  .topic-grid,
  .place-grid {
    grid-template-columns: 1fr;
  }

  .timeline li {
    gap: 8px;
  }
}

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