:root {
  color-scheme: dark;
  color: #f1eade;
  background: #101716;
  font: 16px/1.6 "Segoe UI", system-ui, sans-serif;
  --text: #f1eade;
  --muted: #c0c6ba;
  --gold: #e3c18c;
  --line: #ffffff24;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
img { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .22em; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 5px; }
p, h1, h2, h3, figure, dl, dd { margin: 0; }
section[id], article[id] { scroll-margin-top: 1.25rem; }
.wrap { width: min(1180px, 100% - clamp(2rem, 9vw, 8rem)); margin-inline: auto; }
.skip { position: absolute; left: 1rem; top: 1rem; z-index: 4; padding: .75rem; background: #101716; transform: translateY(-180%); }
.skip:focus { transform: none; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: clamp(37rem, 90svh, 55rem);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #243132;
}
.hero-image, .hero::after { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.hero-image { object-fit: cover; object-position: center 52%; }
.hero::after {
  content: "";
  background: linear-gradient(0deg, #101716 0%, #101716b5 23%, transparent 64%),
    linear-gradient(90deg, #0c1314cf, #1017162e 63%, transparent),
    linear-gradient(180deg, #0c1314c9, transparent 26%);
}
.masthead { display: flex; align-items: center; gap: 1rem 2rem; padding-block: 1.25rem; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: .65rem; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; text-decoration: none; }
.masthead nav { display: flex; align-items: center; gap: clamp(.75rem, 2.2vw, 2rem); margin-inline: auto; }
.masthead nav a { display: block; padding-block: .5rem; text-decoration: none; }
.masthead nav a:hover, .jump a:hover, .notes a:hover { color: var(--gold); }
.hero-copy { padding-block: 5rem clamp(3.5rem, 9vw, 7rem); }
.eyebrow, .era {
  color: var(--accent, var(--gold));
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: .7rem; }
.rule { display: inline-block; width: 2rem; height: 1px; background: currentColor; flex: none; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; text-wrap: balance; }
h1 { margin-block: 1rem; font-size: clamp(3.45rem, 8.7vw, 7.8rem); line-height: .93; letter-spacing: -.055em; }
.hero-copy > p:not(.eyebrow) { max-width: 35rem; color: #ede7dc; font-size: clamp(1.05rem, 2.5vw, 1.24rem); }
.read { display: inline-flex; min-height: 44px; align-items: center; gap: .85rem; margin-top: 1.6rem; color: var(--gold); font-weight: 600; text-decoration: none; }
.read span { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid #e3c18c77; border-radius: 50%; }
.read:hover span { background: var(--gold); color: #17201c; }
.soundtrack { display: grid; gap: .35rem; margin-top: .9rem; color: var(--muted); font-size: .88rem; }
.soundtrack audio { display: block; width: min(100%, 20rem); height: 48px; }
.soundtrack audio:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.chapter { padding-block: clamp(3rem, 7vw, 6rem); }
.chapter-intro { max-width: 49rem; }
.history-lead {
  display: grid;
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  align-items: center;
  gap: clamp(1.2rem, 4vw, 3rem);
}
h2 { font-size: clamp(2.5rem, 5vw, 4.5rem); line-height: 1.07; letter-spacing: -.045em; margin-block: .6rem .8rem; }
.chapter-intro > p:not(.eyebrow) { color: var(--muted); font-size: 1.13rem; max-width: 42rem; }
.epochs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.75rem; padding: 0; margin: 2.15rem 0 0; list-style: none; }
.epochs li { border-top: 1px solid #d6bc8b80; padding-top: 1rem; }
.epochs h3 { font-size: 1.6rem; line-height: 1.16; margin-block: .5rem .55rem; }
.epochs li > p:last-child { color: var(--muted); }

.peoples { background: #151e1b; border-block: 1px solid var(--line); }
.jump { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .9rem; }
.jump a { display: inline-flex; align-items: center; min-height: 44px; font-size: .94rem; }
.faction {
  --accent: #dfb477;
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(1.2rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
  margin-top: 2.6rem;
  padding-top: 2rem;
}
.faction.covenant { --accent: #a5ddbf; }
.faction.swarm { --accent: #e6a499; }
figure a { display: block; border: 1px solid var(--line); background: #0b1110; }
figure img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
figcaption { margin-top: .55rem; color: var(--muted); font-size: .83rem; }
.faction h3 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; margin-block: .45rem .75rem; }
.faction-copy > p:not(.eyebrow) { color: var(--muted); margin-bottom: .75rem; }
.faction dl { display: grid; gap: .55rem; margin-top: 1rem; }
.faction dl div { display: grid; grid-template-columns: 6.25rem minmax(0, 1fr); gap: .55rem; border-top: 1px solid var(--line); padding-top: .5rem; }
.faction dt { color: var(--accent); font-size: .82rem; font-weight: 650; }
.faction dd { font-size: .9rem; }

.closing .chapter-intro { max-width: 45rem; }
.closing .chapter-intro > p + p { margin-top: .85rem; }
.notes { max-width: 44rem; margin-top: 1.5rem; border-block: 1px solid var(--line); padding: .2rem 0; color: var(--muted); }
.notes + .notes { margin-top: 0; border-top: 0; }
.notes summary { min-height: 44px; align-content: center; cursor: pointer; color: var(--text); }
.notes p + p { margin-top: .7rem; }
.notes ul { padding-left: 1.3rem; }
.terms { padding: .2rem 0 .8rem; }
.terms div { display: grid; grid-template-columns: minmax(5rem, 8rem) minmax(0, 1fr); gap: .6rem; padding-block: .35rem; }
.terms dt { color: var(--gold); font-weight: 600; }
.back-top { margin-top: .8rem; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .6rem 1rem; border-top: 1px solid var(--line); padding-block: 1rem; color: var(--muted); font-size: .82rem; }
.footer-contact { font-style: normal; }
.footer-contact a { margin-inline-start: .3em; color: var(--gold); }

@media (max-width: 1020px) {
  .epochs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .hero { min-height: 35rem; }
  .hero-image { object-position: 56% center; }
  .masthead { flex-wrap: wrap; justify-content: space-between; gap: .4rem .75rem; padding-block: .8rem; }
  .masthead nav { order: 3; width: 100%; margin: 0; }
  .hero-copy { padding-block: 4rem 3rem; }
  .epochs, .faction, .history-lead { grid-template-columns: 1fr; }
  .epochs { gap: 1.4rem; }
  .faction { margin-top: 1.6rem; padding-top: 1.3rem; }
}
@media (max-width: 365px) {
  h1 { font-size: 3.05rem; }
  .brand { font-size: .82rem; gap: .4rem; }
}
