:root {
  --paper: #eee7d5;
  --paper-light: #f7f2e5;
  --ink: #1d2522;
  --ink-soft: #535b55;
  --green: #214b42;
  --green-deep: #102e2b;
  --green-bright: #3f7163;
  --gold: #a37935;
  --gold-light: #d2b471;
  --rust: #7f3e2d;
  --line: rgba(29, 37, 34, 0.2);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 18px 50px rgba(24, 31, 28, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, rgba(255,255,255,0.4), transparent 25rem),
    repeating-linear-gradient(90deg, transparent 0, transparent 3px, rgba(46, 42, 30, 0.015) 4px),
    var(--paper);
  font-family: var(--serif);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.18;
  z-index: 99;
  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='.12'/%3E%3C/svg%3E");
}

button, input {
  font: inherit;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.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;
  top: -4rem;
  left: 1rem;
  z-index: 200;
  padding: 0.7rem 1rem;
  color: white;
  background: var(--green-deep);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 82px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto minmax(220px, 1fr);
  align-items: center;
  gap: 2rem;
  padding: 0.75rem clamp(1rem, 4vw, 4.5rem);
  color: var(--paper-light);
  background: rgba(16, 46, 43, 0.97);
  border-bottom: 1px solid rgba(210, 180, 113, 0.6);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
  line-height: 1.05;
}

.brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.brand small {
  display: block;
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.brand .brand-owner {
  margin-bottom: 0.3rem;
  color: var(--paper-light);
  font-size: 0.58rem;
  letter-spacing: 0.22em;
}

.brand .brand-motto {
  margin-top: 0.3rem;
}

.brand-mark {
  width: 45px;
  height: 45px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--gold-light);
  border: 1px solid var(--gold);
  border-radius: 50% 50% 47% 53%;
  font-size: 1.8rem;
  font-style: italic;
}

#primary-nav {
  display: flex;
  gap: clamp(1rem, 2vw, 2.2rem);
  align-items: center;
  font-family: var(--sans);
}

#primary-nav a {
  position: relative;
  font-size: 0.73rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  text-transform: uppercase;
}

#primary-nav a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.45rem;
  left: 0;
  height: 1px;
  background: var(--gold-light);
  transform: scaleX(0);
  transition: transform 180ms ease;
}

#primary-nav a:hover::after,
#primary-nav a:focus-visible::after {
  transform: scaleX(1);
}

.catalog-search-button {
  justify-self: end;
  color: var(--paper-light);
  background: transparent;
  border: 1px solid rgba(238, 231, 213, 0.35);
  padding: 0.65rem 0.8rem;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.property-line {
  width: fit-content;
  margin: 0 0 1.1rem;
  padding-bottom: 0.35rem;
  color: var(--gold);
  border-bottom: 1px solid rgba(163, 121, 53, 0.5);
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.property-note {
  margin-top: 1.5rem;
  padding: 1rem 1.15rem;
  border-left: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.22);
}

kbd {
  margin-left: 0.5rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid rgba(238, 231, 213, 0.35);
  font-size: 0.65rem;
}

.menu-button {
  display: none;
}

.hero {
  min-height: calc(100vh - 82px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  align-items: center;
  gap: clamp(3rem, 9vw, 10rem);
  padding: clamp(5rem, 10vw, 9rem) clamp(1.5rem, 8vw, 9rem);
  color: var(--paper-light);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(8, 28, 25, 0.98) 0%, rgba(16, 46, 43, 0.92) 55%, rgba(20, 50, 45, 0.84) 100%),
    radial-gradient(circle at 75% 35%, rgba(210, 180, 113, 0.25), transparent 22rem);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.2;
  background:
    linear-gradient(30deg, transparent 49.5%, rgba(210, 180, 113, 0.2) 50%, transparent 50.5%) 0 0/90px 90px,
    linear-gradient(-30deg, transparent 49.5%, rgba(210, 180, 113, 0.12) 50%, transparent 50.5%) 0 0/90px 90px;
}

.hero-ornament {
  position: absolute;
  width: min(68vw, 900px);
  height: min(68vw, 900px);
  top: 50%;
  left: 65%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(210, 180, 113, 0.12);
  border-radius: 50%;
}

.hero-ornament::before,
.hero-ornament::after {
  content: "";
  position: absolute;
  inset: 8%;
  border: 1px solid rgba(210, 180, 113, 0.1);
  transform: rotate(45deg);
}

.hero-ornament::after {
  inset: 24%;
  border-radius: 50%;
  transform: none;
}

.hero-copy,
.accession-card {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--gold-light);
}

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

h1 {
  max-width: 850px;
  margin-bottom: 1.5rem;
  font-size: clamp(3.8rem, 7.8vw, 8rem);
  font-weight: 400;
  line-height: 0.92;
  letter-spacing: -0.045em;
}

h1 em {
  color: var(--gold-light);
  font-weight: 400;
}

.hero-intro {
  max-width: 650px;
  color: rgba(247, 242, 229, 0.8);
  font-size: clamp(1.1rem, 1.7vw, 1.35rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: center;
  margin-top: 2.4rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.88rem 1.1rem;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.button-primary {
  color: var(--green-deep);
  background: var(--gold-light);
}

.button-secondary {
  color: var(--green-deep);
  border-color: var(--green);
}

.text-button {
  padding: 0.5rem 0;
  color: var(--paper-light);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(238, 231, 213, 0.4);
  cursor: pointer;
  font-size: 0.9rem;
}

.accession-card {
  max-width: 380px;
  justify-self: center;
  padding: 2.2rem;
  background: rgba(7, 25, 23, 0.54);
  border: 1px solid rgba(210, 180, 113, 0.5);
  box-shadow: 0 20px 55px rgba(0,0,0,0.18);
}

.accession-card::before,
.accession-card::after {
  content: "";
  position: absolute;
  width: 34px;
  height: 34px;
  border-color: var(--gold-light);
  opacity: 0.6;
}

.accession-card::before {
  top: 8px;
  left: 8px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.accession-card::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid;
  border-bottom: 1px solid;
}

.accession-number,
.record-code,
.system-label {
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.seal {
  width: 150px;
  height: 150px;
  display: grid;
  place-items: center;
  margin: 2rem auto;
  border: 1px solid rgba(210, 180, 113, 0.55);
  border-radius: 50%;
  text-align: center;
}

.seal span {
  grid-area: 1/1;
  color: var(--gold-light);
  font-size: 4.5rem;
  line-height: 1;
  opacity: 0.34;
}

.seal small {
  grid-area: 1/1;
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.18em;
}

.accession-card > p:not(.accession-number) {
  color: rgba(247, 242, 229, 0.78);
  font-size: 0.95rem;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.status i {
  width: 7px;
  height: 7px;
  background: #9dcbb8;
  border-radius: 50%;
  box-shadow: 0 0 12px #9dcbb8;
}

.system-trace {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  color: rgba(164, 211, 195, 0.35);
  font-family: monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
}

.reading-room {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(2rem, 8vw, 9rem);
  padding: 3.5rem clamp(1.5rem, 8vw, 9rem);
  background: var(--paper-light);
  border-bottom: 1px solid var(--line);
}

.reading-room h2 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 3rem);
  font-weight: 400;
  line-height: 1.1;
}

.reading-room > p {
  max-width: 820px;
  margin: 0;
  padding-left: 2rem;
  border-left: 1px solid var(--gold);
  color: var(--ink-soft);
  font-size: 1.08rem;
}

.section {
  padding: clamp(5rem, 9vw, 9rem) clamp(1.5rem, 8vw, 9rem);
}

.section-heading {
  display: grid;
  grid-template-columns: 1fr minmax(260px, 0.55fr);
  gap: 3rem;
  align-items: end;
  margin-bottom: 3.3rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.names-intro h2,
.poetry-copy h2,
.colophon h2 {
  margin-bottom: 0;
  font-size: clamp(2.5rem, 5vw, 5.3rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.section-heading > p {
  max-width: 480px;
  margin: 0;
  color: var(--ink-soft);
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
}

.record-card {
  position: relative;
  min-height: 460px;
  display: grid;
  grid-template-columns: 70px 1fr;
  background: rgba(247, 242, 229, 0.55);
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

.record-card:hover .record-index {
  color: var(--paper-light);
  background: var(--green);
}

.record-card-featured {
  grid-column: span 2;
  min-height: 400px;
}

.record-index {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: start center;
  padding-top: 2rem;
  border-right: 1px solid var(--line);
  color: var(--gold);
  font-size: 1.3rem;
  transition: color 180ms ease, background 180ms ease;
}

.record-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(2rem, 4vw, 4rem);
}

.record-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.4rem;
  color: var(--rust);
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.record-card h3 {
  margin-bottom: 1.3rem;
  font-size: clamp(2rem, 4vw, 4.1rem);
  font-weight: 400;
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.record-card p,
.record-card blockquote {
  max-width: 700px;
  color: var(--ink-soft);
  font-size: 1.03rem;
}

.record-card blockquote {
  margin: 0;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gold);
  font-style: italic;
}

.reliability {
  display: flex;
  gap: 2.5rem;
  margin: auto 0 1.8rem;
  padding-top: 1.8rem;
}

.reliability div {
  display: grid;
  gap: 0.1rem;
}

.reliability dt {
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reliability dd {
  margin: 0;
  color: var(--green);
  font-size: 0.95rem;
}

.record-link {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: auto;
  padding: 0.65rem 0;
  color: var(--green);
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: left;
  text-transform: uppercase;
}

.record-link span {
  transition: transform 180ms ease;
}

.record-link:hover span {
  transform: translateX(5px);
}

.image-card {
  color: white;
  background: #241b17;
}

.image-card > img,
.image-wash,
.lunar-grid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.image-card > img {
  object-fit: cover;
}

.image-wash {
  background: linear-gradient(90deg, rgba(16,20,18,0.97), rgba(16,20,18,0.66) 70%, rgba(16,20,18,0.4));
}

.image-card .record-index {
  border-color: rgba(255,255,255,0.2);
}

.image-card .record-meta,
.image-card .reliability dt {
  color: var(--gold-light);
}

.image-card p,
.image-card .reliability dd {
  color: rgba(255,255,255,0.78);
}

.record-link.light {
  color: var(--paper-light);
}

.lunar-card {
  color: #dcece6;
  background: #071d1d;
}

.lunar-grid {
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(122, 203, 185, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(122, 203, 185, 0.5) 1px, transparent 1px);
  background-size: 28px 28px;
}

.lunar-card .record-index {
  color: #82b9aa;
  border-color: rgba(130,185,170,0.3);
}

.lunar-card .record-meta {
  color: #82b9aa;
}

.lunar-card p {
  color: rgba(220,236,230,0.68);
}

.curator-quote {
  margin: auto 0 1.5rem;
  padding: 1rem;
  color: rgba(220,236,230,0.7);
  border: 1px solid rgba(130,185,170,0.24);
  font-family: monospace;
  font-size: 0.75rem;
}

.curator-quote span {
  display: block;
  margin-bottom: 0.45rem;
  color: #82b9aa;
  font-size: 0.63rem;
  letter-spacing: 0.15em;
}

.chronology-section {
  color: var(--paper-light);
  background: var(--green-deep);
}

.chronology-section .section-heading {
  border-color: rgba(238,231,213,0.2);
}

.chronology-section .section-heading > p {
  color: rgba(238,231,213,0.65);
}

.era-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-bottom: 4rem;
  border-bottom: 1px solid rgba(238,231,213,0.2);
}

.era-tabs button {
  padding: 0.9rem 1.2rem;
  color: rgba(238,231,213,0.55);
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.era-tabs button[aria-selected="true"] {
  color: var(--gold-light);
  border-color: var(--gold-light);
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 13px;
  right: 0;
  left: 0;
  height: 1px;
  background: rgba(210,180,113,0.4);
}

.timeline-event {
  position: relative;
  padding: 2.8rem 2rem 0 0;
}

.timeline-event::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 0;
  width: 10px;
  height: 10px;
  background: var(--green-deep);
  border: 2px solid var(--gold-light);
  border-radius: 50%;
}

.timeline-event time {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.timeline-event h3 {
  margin-bottom: 0.7rem;
  font-size: 1.45rem;
  font-weight: 400;
  line-height: 1.1;
}

.timeline-event p {
  color: rgba(238,231,213,0.56);
  font-size: 0.9rem;
}

.nations-section {
  background: var(--paper-light);
}

.nation-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(330px, 0.7fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.map-frame {
  position: relative;
  padding: 0.8rem;
  background: #c8b17c;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  transform: rotate(-0.4deg);
}

.map-frame::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(29,37,34,0.45);
  pointer-events: none;
}

.map-frame img {
  width: 100%;
  min-height: 460px;
  object-fit: cover;
  transition: opacity 200ms ease;
}

.map-frame > span {
  display: block;
  padding: 0.7rem 0.2rem 0.1rem;
  color: rgba(29,37,34,0.65);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-align: center;
  text-transform: uppercase;
}

.nation-record h3 {
  margin-bottom: 1.5rem;
  font-size: clamp(3.5rem, 6vw, 6rem);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.nation-record > p:not(.record-code) {
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.nation-holdings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 2rem 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.nation-holdings span {
  padding: 0.85rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nation-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.nation-switcher button {
  padding: 0.55rem 0.7rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.nation-switcher button.active {
  color: var(--paper-light);
  background: var(--green);
}

.names-section {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 4rem 7rem;
  color: var(--paper-light);
  background:
    linear-gradient(rgba(31,42,37,0.95), rgba(31,42,37,0.95)),
    var(--green-deep);
  overflow: hidden;
}

.folio-label {
  position: absolute;
  right: -3rem;
  top: 50%;
  color: rgba(210,180,113,0.15);
  transform: rotate(90deg);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.22em;
}

.names-intro p:not(.eyebrow) {
  max-width: 590px;
  color: rgba(238,231,213,0.66);
}

.name-example {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  border: 1px solid rgba(210,180,113,0.34);
}

.name-example > div:not(.lineage-lines) {
  position: relative;
  z-index: 2;
}

.name-example > div:nth-child(5) {
  grid-column: 1;
}

.name-example small {
  display: block;
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.name-example strong {
  display: block;
  font-size: clamp(1.8rem, 3.5vw, 3.4rem);
  font-weight: 400;
}

.name-example strong span {
  color: var(--gold-light);
}

.lineage-lines {
  position: absolute;
  top: 32%;
  left: 25%;
  width: 50%;
  height: 35%;
  border-top: 1px solid rgba(210,180,113,0.5);
  border-right: 1px solid rgba(210,180,113,0.5);
  transform: skewX(-20deg);
}

.lineage-lines.second {
  top: auto;
  bottom: 31%;
  transform: scaleY(-1) skewX(-20deg);
}

.registry-note {
  grid-column: 2;
  margin: 0;
  color: rgba(238,231,213,0.5);
  font-style: italic;
  font-size: 0.9rem;
}

.poetry-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.45fr);
  gap: clamp(3rem, 9vw, 10rem);
  align-items: center;
  background: var(--paper-light);
  overflow: hidden;
}

.poetry-mark {
  position: absolute;
  top: -5rem;
  left: 2rem;
  color: rgba(163,121,53,0.09);
  font-size: 35rem;
  line-height: 1;
}

.poetry-copy {
  position: relative;
}

.poetry-lead {
  max-width: 850px;
  margin: 2rem 0;
  color: var(--green);
  font-size: clamp(1.5rem, 3vw, 2.6rem);
  line-height: 1.25;
}

.poetry-copy > p:not(.eyebrow):not(.poetry-lead) {
  max-width: 680px;
  color: var(--ink-soft);
}

.poetry-accessions {
  max-width: 680px;
  margin-top: 2.2rem;
}

.poem-accession {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.2rem;
  padding: 1.1rem 1.2rem;
  color: var(--paper-light);
  background: var(--green);
  border: 1px solid var(--green-deep);
  cursor: pointer;
  text-align: left;
}

.poetry-catalog-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 1.2rem;
  padding: 1rem 1.2rem;
  color: var(--green-deep);
  background: transparent;
  border: 1px solid var(--green);
  cursor: pointer;
  text-align: left;
}

.poetry-catalog-button small,
.poetry-catalog-button strong {
  display: block;
}

.poetry-catalog-button small {
  margin-bottom: 0.2rem;
  color: var(--rust);
  font-family: var(--sans);
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.poetry-catalog-button strong {
  font-size: 1.05rem;
  font-weight: 400;
}

.poetry-catalog-button > span:last-child {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.poem-accession small,
.poem-accession strong {
  display: block;
}

.poem-accession small {
  margin-bottom: 0.25rem;
  color: var(--gold-light);
  font-family: var(--sans);
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.poem-accession strong {
  font-size: 1.35rem;
  font-weight: 400;
}

.poem-accession > span:last-child {
  flex: 0 0 auto;
  font-family: var(--sans);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.poetry-section aside {
  padding: 2rem;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.poetry-section aside > p {
  color: var(--rust);
  font-family: var(--sans);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.poetry-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.poetry-section li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}

.curator-interruption {
  position: relative;
  padding: clamp(5rem, 10vw, 9rem) clamp(1.5rem, 15vw, 16rem);
  color: #d6e7e2;
  background:
    linear-gradient(rgba(3,20,21,0.96), rgba(3,20,21,0.96)),
    repeating-linear-gradient(0deg, rgba(100,190,171,0.08) 0, rgba(100,190,171,0.08) 1px, transparent 1px, transparent 4px);
  text-align: center;
  overflow: hidden;
}

.curator-interruption::before {
  content: "LUNAR ARCHIVE";
  position: absolute;
  top: 50%;
  left: 50%;
  color: rgba(118,190,174,0.035);
  transform: translate(-50%, -50%);
  font-family: var(--sans);
  font-size: clamp(5rem, 14vw, 13rem);
  font-weight: 700;
  white-space: nowrap;
}

.scan-line {
  position: absolute;
  right: 0;
  left: 0;
  top: 0;
  height: 1px;
  background: rgba(118,190,174,0.45);
  box-shadow: 0 0 20px rgba(118,190,174,0.8);
  animation: scan 7s linear infinite;
}

@keyframes scan {
  to { transform: translateY(500px); }
}

.curator-interruption blockquote {
  position: relative;
  max-width: 1000px;
  margin: 2rem auto;
  color: #e8f4f0;
  font-size: clamp(1.7rem, 3.5vw, 3.4rem);
  line-height: 1.2;
}

.attribution {
  position: relative;
  color: rgba(118,190,174,0.7);
  font-family: monospace;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
}

.colophon {
  display: grid;
  grid-template-columns: 0.7fr 1fr 0.45fr;
  gap: clamp(2rem, 6vw, 7rem);
  align-items: center;
}

.creator-copy h3 {
  margin-bottom: 1rem;
  color: var(--green);
  font-size: 1.8rem;
  font-weight: 400;
}

.creator-copy p {
  color: var(--ink-soft);
}

.creator-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.creator-portrait {
  position: relative;
  margin: 0;
  padding: 0.75rem;
  background: #d8c79f;
  border: 1px solid var(--ink);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}

.creator-portrait::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 2;
  border: 1px solid rgba(29, 37, 34, 0.42);
  pointer-events: none;
}

.creator-portrait-frame {
  position: relative;
  overflow: hidden;
  background: var(--green-deep);
}

.creator-portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 60%, rgba(16, 46, 43, 0.3)),
    rgba(163, 121, 53, 0.08);
  pointer-events: none;
}

.creator-portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 48% center;
  filter: saturate(0.76) contrast(0.96) sepia(0.12);
}

.creator-portrait figcaption {
  padding: 0.8rem 0.35rem 0.2rem;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.63rem;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.creator-portrait figcaption span {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--rust);
  font-size: 0.54rem;
  letter-spacing: 0.16em;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2rem clamp(1.5rem, 5vw, 5rem);
  color: rgba(238,231,213,0.7);
  background: #071e1c;
  border-top: 1px solid rgba(210,180,113,0.4);
  font-size: 0.78rem;
}

.footer-system {
  margin: 0;
  color: rgba(118,190,174,0.38);
  font-family: monospace;
  font-size: 0.58rem;
}

.footer-meta {
  justify-self: end;
  text-align: right;
}

.copyright {
  margin: 0.35rem 0 0;
  color: rgba(238,231,213,0.55);
  font-family: var(--sans);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(3,14,13,0.82);
  backdrop-filter: blur(5px);
}

.record-dialog {
  width: min(920px, calc(100% - 2rem));
  max-height: 88vh;
  padding: 0;
  background: var(--paper-light);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow);
}

.dialog-close {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 1.3rem;
}

.record-dialog > .dialog-close {
  position: sticky;
  top: 1rem;
  z-index: 3;
  float: right;
  margin: 1rem 1rem 0 0;
}

.dialog-record {
  padding: clamp(2rem, 6vw, 5rem);
}

.dialog-record h2 {
  max-width: 700px;
  margin-bottom: 1rem;
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 0.95;
}

.dialog-record .dialog-summary {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 1.15rem;
}

.dialog-archive-plate {
  position: relative;
  max-width: 720px;
  margin: 2.2rem 0;
  padding: 0.65rem;
  background: #d5c59f;
  border: 1px solid var(--ink);
  box-shadow: 0 14px 36px rgba(24, 31, 28, 0.14);
}

.dialog-archive-plate::before {
  content: "";
  position: absolute;
  inset: 5px;
  z-index: 2;
  border: 1px solid rgba(29, 37, 34, 0.4);
  pointer-events: none;
}

.dialog-archive-plate img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center 30%;
  filter: saturate(0.76) contrast(0.98) sepia(0.08);
}

.dialog-archive-plate figcaption {
  padding: 0.75rem 0.35rem 0.15rem;
  color: var(--ink-soft);
  font-family: var(--sans);
  font-size: 0.61rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dialog-record hr {
  margin: 2rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.dialog-record h3 {
  margin: 2rem 0 0.5rem;
  color: var(--green);
  font-size: 1.2rem;
  font-weight: 400;
}

.dialog-record ul {
  padding-left: 1.2rem;
}

.processing-note {
  margin-top: 2.5rem;
  padding: 1rem;
  color: var(--green);
  background: rgba(33,75,66,0.08);
  border-left: 3px solid var(--green);
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.poem-dialog-record {
  min-height: min(760px, 82vh);
  padding: clamp(2rem, 6vw, 5rem);
  background:
    linear-gradient(90deg, transparent 0, transparent 3.5rem, rgba(127, 62, 45, 0.09) 3.55rem, transparent 3.6rem),
    repeating-linear-gradient(0deg, transparent 0, transparent 2rem, rgba(29, 37, 34, 0.04) 2.05rem),
    var(--paper-light);
}

.poem-dialog-record > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 6vw, 5rem);
  padding-bottom: 1.2rem;
  border-bottom: 1px solid var(--line);
}

.poem-dialog-record > header > div {
  min-width: 0;
}

.poem-dialog-record h2 {
  margin: 0;
  font-size: clamp(3rem, 7vw, 5.5rem);
  font-weight: 400;
  line-height: 0.9;
}

.poem-catalog-number {
  flex: 0 0 auto;
  color: var(--rust);
  font-family: var(--sans);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-align: right;
  text-transform: uppercase;
  white-space: nowrap;
}

.poem-text {
  width: min(100%, 690px);
  margin: 0 auto;
  font-size: clamp(1rem, 2vw, 1.18rem);
  line-height: 1.35;
}

.poem-stanza {
  margin: 0 0 1.15rem;
}

.poem-line {
  display: block;
  white-space: nowrap;
}

.poem-line.indent-1 { margin-left: 2em; }
.poem-line.indent-2 { margin-left: 4em; }
.poem-line.indent-3 { margin-left: 6em; }
.poem-line.indent-4 { margin-left: 8em; }
.poem-line.indent-5 { margin-left: 10em; }
.poem-line.indent-6 { margin-left: 12em; }
.poem-line.indent-7 { margin-left: 14em; }

.poem-turn {
  width: calc(100% - 7em);
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-left: 7em;
}

.poem-final {
  margin-top: 1.8rem;
}

.poem-credit {
  width: min(100%, 690px);
  margin: 3rem auto 0;
  padding-top: 1rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.poem-return {
  width: min(100%, 690px);
  margin: 1.2rem auto 0;
}

.poetry-catalog-record {
  min-height: min(760px, 82vh);
  padding: clamp(2rem, 5vw, 4.5rem);
  background: var(--paper-light);
}

.poetry-catalog-record > header {
  display: grid;
  grid-template-columns: 1fr minmax(240px, 0.45fr);
  gap: 2rem;
  align-items: end;
  margin-bottom: 2rem;
  padding-bottom: 1.3rem;
  border-bottom: 1px solid var(--line);
}

.poetry-catalog-record h2 {
  margin: 0;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 400;
  line-height: 0.95;
}

.poetry-catalog-intro {
  margin: 0;
  color: var(--ink-soft);
}

.poetry-catalog-search {
  width: 100%;
  margin-bottom: 1.4rem;
  padding: 0.9rem 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  outline: 0;
  font-size: 1.05rem;
}

.poetry-sort {
  display: flex;
  gap: 0;
  margin-bottom: 1rem;
}

.poetry-sort button {
  padding: 0.55rem 0.75rem;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line);
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.62rem;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.poetry-sort button + button {
  border-left: 0;
}

.poetry-sort button[aria-pressed="true"] {
  color: var(--paper-light);
  background: var(--green);
  border-color: var(--green);
}

.poetry-catalog-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.poetry-catalog-entry {
  min-height: 155px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.poetry-catalog-entry small {
  color: var(--rust);
  font-family: var(--sans);
  font-size: 0.57rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.poetry-catalog-entry strong {
  margin: 0.45rem 0;
  font-size: 1.35rem;
  font-weight: 400;
}

.poetry-catalog-entry p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.poem-source-block {
  margin: 0 0 0.8rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.poem-source-block.spaced {
  margin-top: 1.8rem;
}

.poem-source-block.center {
  text-align: center;
}

.poetry-catalog-empty {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  color: var(--ink-soft);
  text-align: center;
}

.search-dialog {
  width: min(760px, calc(100% - 2rem));
  padding: 0;
  background: var(--paper-light);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow);
}

.search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 1rem 1.4rem;
  color: var(--paper-light);
  background: var(--green-deep);
}

.search-header label {
  font-size: 1.2rem;
}

.search-header .dialog-close {
  width: 36px;
  height: 36px;
}

#catalog-search {
  width: calc(100% - 2rem);
  margin: 1rem;
  padding: 1rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  outline: 0;
  font-size: 1.25rem;
}

.search-results {
  max-height: 55vh;
  overflow: auto;
  padding: 0 1rem 1rem;
}

.search-result {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 1rem 0.4rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.search-result strong {
  font-size: 1.1rem;
  font-weight: 400;
}

.search-result span {
  color: var(--rust);
  font-family: var(--sans);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.search-empty {
  padding: 2rem 0.5rem;
  color: var(--ink-soft);
  text-align: center;
}

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 4px;
}

@media (max-width: 1100px) {
  .site-header {
    grid-template-columns: 1fr auto auto;
  }

  #primary-nav {
    position: fixed;
    top: 82px;
    right: 0;
    left: 0;
    display: none;
    padding: 1.5rem;
    background: var(--green-deep);
    border-bottom: 1px solid var(--gold);
  }

  #primary-nav.open {
    display: grid;
  }

  .menu-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-content: center;
    gap: 5px;
    color: white;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.3);
  }

  .menu-button span:not(.sr-only) {
    width: 20px;
    height: 1px;
    background: currentColor;
  }

  .hero {
    grid-template-columns: 1fr 0.65fr;
    gap: 3rem;
  }

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

  .record-card-featured {
    grid-column: auto;
  }

  .nation-feature {
    grid-template-columns: 1fr;
  }

  .map-frame img {
    min-height: 0;
  }

  .colophon {
    grid-template-columns: 1fr 1.2fr;
  }

  .creator-portrait {
    max-width: 280px;
    grid-column: 1 / -1;
    justify-self: center;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 72px;
    grid-template-columns: 1fr auto;
    gap: 0.6rem;
  }

  #primary-nav {
    top: 72px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 1.5rem;
  }

  .brand strong {
    font-size: 0.8rem;
  }

  .brand .brand-motto {
    display: none;
  }

  .brand .brand-owner {
    display: block;
    margin-bottom: 0.22rem;
    font-size: 0.48rem;
  }

  .catalog-search-button {
    display: none;
  }

  .hero {
    min-height: auto;
    grid-template-columns: 1fr;
    padding-top: 5rem;
  }

  h1 {
    font-size: clamp(3.6rem, 16vw, 5.5rem);
  }

  .accession-card {
    justify-self: stretch;
  }

  .reading-room,
  .section-heading,
  .names-section,
  .poetry-section,
  .colophon {
    grid-template-columns: 1fr;
  }

  .reading-room > p {
    padding: 1.5rem 0 0;
    border-top: 1px solid var(--gold);
    border-left: 0;
  }

  .section-heading {
    gap: 1.5rem;
  }

  .record-card {
    min-height: 480px;
    grid-template-columns: 45px 1fr;
  }

  .record-body {
    padding: 1.7rem;
  }

  .record-meta {
    display: grid;
  }

  .record-card h3 {
    font-size: 2.6rem;
  }

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

  .timeline::before {
    top: 0;
    bottom: 0;
    left: 5px;
    width: 1px;
    height: auto;
  }

  .timeline-event {
    padding: 0 0 2.7rem 2rem;
  }

  .timeline-event::before {
    top: 3px;
  }

  .nation-record h3 {
    font-size: 4rem;
  }

  .names-section {
    gap: 2rem;
  }

  .name-example {
    min-height: 440px;
    grid-template-columns: 1fr;
  }

  .name-example > div:nth-child(5) {
    grid-column: auto;
  }

  .lineage-lines {
    display: none;
  }

  .registry-note {
    grid-column: auto;
  }

  .poem-accession,
  .poetry-catalog-button {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .poem-dialog-record {
    padding: 2rem 1.2rem 3rem;
    overflow: hidden;
  }

  .poem-dialog-record > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .poem-catalog-number {
    text-align: left;
  }

  .poem-text {
    font-size: clamp(0.78rem, 3.6vw, 1rem);
  }

  .poem-line.indent-1 { margin-left: 1em; }
  .poem-line.indent-2 { margin-left: 2em; }
  .poem-line.indent-3 { margin-left: 3em; }
  .poem-line.indent-4 { margin-left: 4em; }
  .poem-line.indent-5 { margin-left: 5em; }
  .poem-line.indent-6 { margin-left: 6em; }
  .poem-line.indent-7 { margin-left: 7em; }

  .poem-turn {
    width: calc(100% - 2em);
    gap: 0.6rem;
    margin-left: 2em;
  }

  .poetry-catalog-record > header,
  .poetry-catalog-list {
    grid-template-columns: 1fr;
  }

  .poetry-catalog-entry {
    min-height: 135px;
  }

  .creator-portrait {
    grid-column: auto;
    width: min(100%, 310px);
    justify-self: center;
  }

  footer {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  .footer-meta {
    justify-self: center;
    text-align: center;
  }
}

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

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
