:root {
  --bg: #07070a;
  --ink: #ece7dc;
  --soft: #b9b4a9;
  --mute: #8a877f;
  --gold: #f2b25c;
  --rule: rgba(236, 231, 220, .14);
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --text: "Newsreader", "Iowan Old Style", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --p: 0;
  --sx: 0;
  --sy: 0;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.15rem, .95rem + .7vw, 1.6rem);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  /* shown only when WebGL is unavailable */
  background: radial-gradient(120% 80% at 50% 0%, #14141d 0%, var(--bg) 60%);
}

::selection { background: var(--gold); color: var(--bg); }

a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- fixed layers (home) ---------- */

#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.glow {
  position: fixed;
  left: calc(50% + var(--sx) * 50vw);
  top: calc(50% - var(--sy) * 50vh);
  width: 70vmin;
  height: 70vmin;
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 244, 224, .55), rgba(242, 178, 92, .16) 35%, transparent 70%);
  opacity: clamp(0, calc((var(--p) - 2.6) * 2.5), 1);
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: 1;
}

.veil {
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(7, 7, 10, .8) 100%);
  pointer-events: none;
  z-index: 1;
}

.grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .07;
  mix-blend-mode: overlay;
  pointer-events: none;
  z-index: 2;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold));
  transform-origin: 0 50%;
  transform: scaleX(calc(var(--p) / 3));
  z-index: 6;
}

/* ---------- top bar ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 1.25rem clamp(1.25rem, 3vw, 2.5rem);
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}

.bar::before {
  content: "";
  position: absolute;
  inset: 0 0 -2.5rem 0;
  background: linear-gradient(var(--bg) 35%, rgba(7, 7, 10, 0));
  z-index: -1;
  pointer-events: none;
}

.mark { text-decoration: none; color: var(--ink); }
.mark span { color: var(--gold); }

.nav { display: flex; gap: clamp(1rem, 2.2vw, 2.2rem); }
.nav a, .nav-jump { text-decoration: none; color: var(--soft); transition: color .3s; }
.nav a:hover, .nav-jump:hover, .nav a[aria-current="page"] { color: var(--gold); }
.nav-jump { display: none; }

.hud {
  position: fixed;
  right: clamp(1.25rem, 3vw, 2.5rem);
  bottom: 1.25rem;
  z-index: 5;
  display: flex;
  gap: .9em;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
  opacity: 0;
  transition: opacity .5s var(--ease);
  pointer-events: none;
}
.hud.on { opacity: 1; }
.hud b {
  font-weight: 500;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  min-width: 8.5em;
  text-align: right;
}

/* ---------- shared type ---------- */

main { position: relative; z-index: 3; }

.eyebrow, .when, .stamp, figcaption, .foot, .cue, .more, .crumbs, .meta, .onward {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.eyebrow { color: var(--gold); margin: 0; }

h1, h2, h3 { font-weight: 400; margin: 0; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.wrap.narrow { width: min(100% - 2.5rem, 46rem); }

.section-title {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: .98;
  letter-spacing: -.015em;
  margin: .25em 0 0;
  text-shadow: 0 0 40px var(--bg);
}

.onward { margin: 2.2rem 0 0; }
.onward a { color: var(--gold); text-decoration: none; border-bottom: 1px solid rgba(242, 178, 92, .4); padding-bottom: .25em; }
.onward a:hover { border-bottom-color: var(--gold); }

/* ---------- hero ---------- */

.hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 6rem 1.25rem 8rem;
  position: relative;
}

.hero h1 {
  font-size: clamp(4rem, 15.5vw, 13.5rem);
  line-height: .86;
  letter-spacing: -.02em;
  margin: .28em 0 .32em;
  text-shadow: 0 0 60px rgba(7, 7, 10, .9);
}
h1 em { font-style: italic; color: var(--gold); }

.line { display: block; overflow: hidden; padding: .06em .08em .1em; margin: -.06em -.08em -.1em; }
.line > span { display: block; }

.lede {
  max-width: 34ch;
  margin: 0;
  color: var(--soft);
  text-shadow: 0 0 24px var(--bg), 0 0 8px var(--bg);
}

.cue {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  translate: -50% 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .9rem;
  color: var(--mute);
  text-decoration: none;
}
.cue i {
  width: 1px;
  height: 3.2rem;
  background: linear-gradient(var(--gold), transparent);
  transform-origin: 50% 0;
  animation: drip 2.4s var(--ease) infinite;
}

@keyframes drip {
  0% { transform: scaleY(0); opacity: 1; }
  60% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1); opacity: 0; }
}

/* ---------- ledger ---------- */

.ledger { padding: 12vh 0 22vh; }

.col {
  width: min(100% - 2.5rem, 36rem);
  margin-left: clamp(1.25rem, 9vw, 10rem);
}

.intro {
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.1;
  margin: .5em 0 0;
  max-width: 16ch;
}

.entries {
  list-style: none;
  margin: 8vh 0 0;
  padding: 0;
  border-left: 1px solid var(--rule);
}

.entry {
  position: relative;
  padding: 10vh 0 10vh 2rem;
}
.entry::before {
  content: "";
  position: absolute;
  left: -4px;
  top: calc(10vh + .28rem);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 14px 1px rgba(242, 178, 92, .7);
}

.when { color: var(--gold); display: block; }

.entry h2 {
  font-size: clamp(2.7rem, 6.6vw, 5.6rem);
  line-height: .95;
  letter-spacing: -.015em;
  margin: .3em 0 .28em;
  text-shadow: 0 0 40px var(--bg);
}

.entry p {
  margin: 0;
  max-width: 28ch;
  color: var(--soft);
  text-shadow: 0 0 24px var(--bg), 0 0 8px var(--bg);
}

.entry.unknown h2 {
  font-style: italic;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: none;
}
.entry.unknown::before { background: #fff; box-shadow: 0 0 18px 3px rgba(255, 255, 255, .8); }

.caret {
  display: inline-block;
  width: .06em;
  height: .78em;
  margin-left: .12em;
  background: var(--gold);
  vertical-align: baseline;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.aside {
  padding: 8vh 0 8vh 2rem;
  font-style: italic;
  font-size: clamp(1.5rem, 2.8vw, 2.3rem);
  line-height: 1.15;
  color: var(--gold);
  max-width: 22ch;
  text-shadow: 0 0 24px var(--bg);
}

.chapter { padding: 14vh 0 4vh 2rem; }
.chapter .intro { margin-top: .5em; }

.ledger .onward { padding-left: 2rem; }

/* ---------- quote ---------- */

.quote {
  min-height: 130vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9vh;
  padding: 18vh 1.25rem;
  text-align: center;
}

.plate { position: relative; margin: 0; }
.plate::before {
  content: "";
  position: absolute;
  inset: -14% -8%;
  background: radial-gradient(closest-side, rgba(7, 7, 10, .72), rgba(7, 7, 10, 0));
  z-index: -1;
}

.quote blockquote {
  margin: 0 auto;
  max-width: 17ch;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1.02;
  letter-spacing: -.012em;
}

figcaption { margin-top: 2.2rem; color: var(--mute); line-height: 1.7; }
figcaption cite { font-style: normal; color: var(--soft); }

.gloss { max-width: 32rem; }
.gloss p { margin: 0 0 1em; color: var(--soft); }
.gloss p:nth-of-type(2) { color: var(--ink); }
.gloss .onward { margin-top: 2.4rem; }

/* ---------- guide cards ---------- */

.guide { padding: 14vh 0 10vh; }

.cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin-top: 3.2rem;
  background: var(--rule);
  border: 1px solid var(--rule);
}

.card {
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: clamp(1.5rem, 3.2vw, 2.8rem);
  background: rgba(9, 9, 12, .9);
  text-decoration: none;
  transition: background .4s var(--ease);
}
.card:hover { background: rgba(24, 20, 14, .94); }

.card h3 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
  line-height: 1;
  letter-spacing: -.01em;
}
.card p {
  margin: 0;
  font-family: var(--text);
  font-size: clamp(1.02rem, .95rem + .25vw, 1.2rem);
  line-height: 1.5;
  color: var(--soft);
}
.more { color: var(--gold); margin-top: auto; padding-top: 1rem; }

/* ---------- faq ---------- */

.faq { padding: 10vh 0 18vh; }
.faq .section-title { margin-bottom: 2.6rem; }

details { border-top: 1px solid var(--rule); background: rgba(7, 7, 10, .55); }
details:last-of-type { border-bottom: 1px solid var(--rule); }

summary {
  position: relative;
  list-style: none;
  cursor: pointer;
  padding: 1.35rem 2.6rem 1.35rem 0;
  font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  line-height: 1.12;
}
summary::-webkit-details-marker { display: none; }
summary::after {
  content: "+";
  position: absolute;
  right: .3rem;
  top: 50%;
  translate: 0 -50%;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: var(--gold);
}
details[open] summary::after { content: "\2212"; }

details p {
  margin: 0 0 1.6rem;
  max-width: 40rem;
  font-family: var(--text);
  font-size: clamp(1.05rem, .98rem + .25vw, 1.22rem);
  line-height: 1.55;
  color: var(--soft);
}
details p a { color: var(--gold); text-underline-offset: .18em; }

/* ---------- finale ---------- */

.finale {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  text-align: center;
  position: relative;
}

.finale-inner {
  margin-top: auto;
  padding: 0 1.25rem 11vh;
}

.finale h2 {
  font-size: clamp(4.5rem, 17vw, 14rem);
  line-height: .9;
  letter-spacing: -.02em;
  font-style: italic;
  margin: .12em 0 .2em;
  text-shadow: 0 0 60px var(--bg);
}

.stamp { color: var(--mute); margin: 0; }
.stamp span { color: var(--ink); }

/* ---------- footer ---------- */

.foot {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.2rem 2rem;
  padding: 1.6rem clamp(1.25rem, 3vw, 2.5rem);
  color: var(--mute);
  border-top: 1px solid var(--rule);
  background: var(--bg);
}
.foot nav { display: flex; flex-wrap: wrap; gap: .8rem 1.8rem; }
.foot a { color: var(--soft); text-decoration: none; }
.foot a:hover { color: var(--gold); }
.foot p { margin: 0; }

/* ---------- article pages ---------- */

body.page {
  background:
    radial-gradient(70% 45% at 85% -8%, rgba(242, 178, 92, .13), transparent 62%),
    radial-gradient(60% 40% at 0% 0%, rgba(120, 140, 200, .08), transparent 60%),
    var(--bg);
  background-repeat: no-repeat;
}

.article {
  width: min(100% - 2.5rem, 44rem);
  margin: 0 auto;
  padding: 8.5rem 0 6rem;
}

.crumbs { color: var(--mute); margin: 0; }
.crumbs a { color: var(--soft); text-decoration: none; }
.crumbs a:hover { color: var(--gold); }
.crumbs span { margin: 0 .6em; }

.article h1 {
  font-size: clamp(2.9rem, 7.4vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.018em;
  margin: 1.4rem 0 1.5rem;
}

.standfirst {
  font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem);
  line-height: 1.25;
  margin: 0;
  color: var(--ink);
}

.meta {
  color: var(--mute);
  margin: 2.2rem 0 0;
  padding-bottom: 1.6rem;
  border-bottom: 1px solid var(--rule);
}

.body {
  font-family: var(--text);
  font-size: clamp(1.1rem, 1rem + .35vw, 1.3rem);
  line-height: 1.62;
  color: #d5d0c5;
}

.body p { margin: 0 0 1.15em; }
.body > :first-child { margin-top: 2.4rem; }

.body h2 {
  font-family: var(--serif);
  font-size: clamp(1.95rem, 4.2vw, 2.7rem);
  line-height: 1.04;
  letter-spacing: -.012em;
  color: var(--ink);
  margin: 3.2rem 0 1rem;
  scroll-margin-top: 5rem;
}

.body h3 {
  font-family: var(--serif);
  font-size: 1.5em;
  line-height: 1.1;
  color: var(--ink);
  margin: 2.2rem 0 .6rem;
}

.body a { color: var(--gold); text-underline-offset: .18em; text-decoration-thickness: 1px; }
.body strong { font-weight: 500; color: var(--ink); }
.body em { font-style: italic; }

.body ul, .body ol { margin: 0 0 1.3em; padding-left: 1.3em; }
.body li { margin-bottom: .55em; }
.body li::marker { color: var(--gold); }

.body blockquote {
  margin: 2.2rem 0;
  padding: .2rem 0 .2rem 1.4rem;
  border-left: 2px solid var(--gold);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.45em;
  line-height: 1.22;
  color: var(--ink);
}
.body blockquote footer {
  margin-top: .9rem;
  font-family: var(--mono);
  font-style: normal;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}

.keypoints {
  margin: 2.4rem 0;
  padding: 1.5rem 1.7rem 1.1rem;
  border: 1px solid var(--rule);
  background: rgba(236, 231, 220, .03);
}
.keypoints h2 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 1rem;
}
.keypoints ul { margin: 0; }

.table-scroll { overflow-x: auto; margin: 1.8rem 0 2rem; }
.body table { width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.4; }
.body th, .body td { text-align: left; vertical-align: top; padding: .8rem 1rem .8rem 0; border-bottom: 1px solid var(--rule); }
.body th {
  font-family: var(--mono);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
}
.body td:first-child { color: var(--ink); min-width: 9em; }

/* timeline + glossary lists */

.era {
  font-family: var(--mono) !important;
  font-size: .72rem !important;
  letter-spacing: .14em !important;
  text-transform: uppercase;
  color: var(--gold) !important;
  margin: 3.4rem 0 0 !important;
  padding-bottom: .9rem;
  border-bottom: 1px solid var(--rule);
}

.events { list-style: none; margin: 0 0 1rem; padding: 0; }
.events li {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0 1.5rem;
  padding: 1.5rem 0;
  margin: 0;
  border-bottom: 1px solid var(--rule);
}
.events time {
  font-family: var(--serif);
  font-size: 1.7em;
  line-height: 1;
  color: var(--gold);
}
.events h3 { margin: 0 0 .35rem; font-size: 1.45em; }
.events p { margin: 0; }
.events .open h3 { font-style: italic; }

.terms { margin: 0; }
.terms dt {
  font-family: var(--serif);
  font-size: 1.6em;
  line-height: 1.1;
  color: var(--ink);
  margin: 0;
  padding-top: 1.6rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 5rem;
}
.terms dt small {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--mute);
  margin-left: .6rem;
}
.terms dd { margin: .5rem 0 1.6rem; }

.next { margin-top: 4rem; }
.next h2 {
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
.next .cards { margin-top: 1.2rem; }
.next .card h3 { font-size: clamp(1.6rem, 3vw, 2.1rem); }

/* ---------- motion ---------- */

.js .line > span {
  transform: translateY(112%);
  animation: lift 1.3s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 150ms);
}
@keyframes lift { to { transform: none; } }

.js .rise {
  opacity: 0;
  animation: fade 1.4s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 110ms + 150ms);
}
@keyframes fade { from { opacity: 0; transform: translateY(.8rem); } to { opacity: 1; transform: none; } }
.js .cue.rise { animation-name: fade-cue; }
@keyframes fade-cue { from { opacity: 0; } to { opacity: 1; } }

.js .reveal {
  opacity: 0;
  transform: translateY(1.4rem);
  transition: opacity 1.1s var(--ease), transform 1.3s var(--ease), background .4s var(--ease);
  transition-delay: calc(var(--i, 0) * 120ms);
}
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- small screens ---------- */

@media (max-width: 899px) {
  .nav { display: none; }
  .nav-jump { display: block; }
  .col { margin-inline: auto; }
  .cards { grid-template-columns: 1fr; }
  .hud b { min-width: 0; }
  .veil { background: radial-gradient(ellipse at center, rgba(7, 7, 10, .35) 0%, rgba(7, 7, 10, .8) 100%); }
  .foot { font-size: .64rem; flex-direction: column; }
  .article { padding-top: 6.5rem; }
}

@media (max-width: 480px) {
  .bar, .hud, .eyebrow, .when, .stamp, figcaption, .cue, .more, .crumbs, .meta, .onward { font-size: .64rem; }
  .entry, .aside, .chapter, .ledger .onward { padding-left: 1.4rem; }
  .events li { grid-template-columns: 1fr; gap: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .line > span, .js .rise, .js .reveal { animation: none; transition: none; opacity: 1; transform: none; }
  .cue i, .caret { animation: none; }
}

/* ---------- 404 ---------- */

.lost {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  text-align: center;
  padding: 2rem 1.25rem;
}
.lost h1 { font-size: clamp(3rem, 11vw, 8rem); margin: 0; }
.lost p { margin: 0; color: var(--soft); max-width: 26ch; }
.lost a { font-family: var(--mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
