@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-400-italic.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --font-serif: "Source Serif 4", Georgia, serif;
  --font-sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "Courier New", monospace;
  --paper: #faf8f4;
  --surface: #f2efe8;
  --ink: #1a1b1e;
  --ink-muted: #52565e;
  --rule: #d3cec3;
  --page: #0f1116;
  --panel: #171a20;
  --panel-soft: #1e222a;
  --text: #f4f3ef;
  --muted: #c6c1b7;
  --faint: #969da8;
  --line: rgba(244, 243, 239, 0.16);
  --line-strong: rgba(212, 165, 89, 0.48);
  --brass: #d4a559;
  --brass-dark: #8f6831;
  --blue: #4f8fd6;
  --red: #d44f64;
  --cyan: #27c6d2;
  --green: #55ad8c;
  --carmine: #a62639;
  --act-1-accent: #1e4d8c;
  --act-2-accent: #a62639;
  --act-3-accent: #00a8b5;
  --act-4-accent: #7a121c;
  --act-4-contemporary: #2e6f5e;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 6rem;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 78% 8%, rgba(30, 77, 140, 0.22), transparent 33rem),
    radial-gradient(circle at 8% 54%, rgba(0, 168, 181, 0.09), transparent 28rem),
    linear-gradient(180deg, #101218 0%, #0f1116 46%, #0b0d11 100%);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(244, 243, 239, 0.026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(244, 243, 239, 0.026) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, black, transparent 76%);
}

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

img {
  height: auto;
}

a {
  color: inherit;
  text-decoration-color: rgba(212, 165, 89, 0.64);
  text-underline-offset: 0.2em;
}

a:focus-visible,
.button:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--page);
  font-weight: 700;
  transform: translateY(-180%);
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem clamp(1rem, 4vw, 3rem);
  border-bottom: 1px solid var(--line);
  background: rgba(15, 17, 22, 0.84);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  gap: 0.7rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  min-width: 3.25rem;
  min-height: 2rem;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(0.35rem, 1.5vw, 1.15rem);
  overflow-x: auto;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.55rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.site-nav .nav-download {
  margin-inline-start: 0.25rem;
  padding-inline: 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--brass);
}

.hero,
.section-grid,
.acts,
.genealogy,
.chapters,
.download-panel,
.site-footer {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 410px);
  align-items: center;
  gap: clamp(2.5rem, 7vw, 6rem);
  padding-block: clamp(4rem, 10vw, 8.5rem) clamp(3.5rem, 8vw, 7rem);
}

.hero-copy {
  max-width: 46rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 1rem;
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.02;
  text-wrap: balance;
}

h1 {
  max-width: 9ch;
  font-size: clamp(3.1rem, 1.7rem + 7vw, 7.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  text-transform: uppercase;
}

h1 em {
  display: block;
  color: var(--brass);
  font-family: var(--font-serif);
  font-size: 0.68em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.03em;
  text-transform: lowercase;
}

.subtitle {
  margin: 1.25rem 0 0;
  color: var(--text);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1.05rem + 1.6vw, 2.2rem);
  font-style: italic;
  line-height: 1.25;
}

.lede {
  max-width: 39rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.78rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button-primary {
  border-color: #e6bd74;
  background: linear-gradient(180deg, #e8bd70, #c99343);
  color: #171207;
  box-shadow: 0 12px 34px rgba(212, 165, 89, 0.2);
}

.button-secondary {
  border-color: var(--line);
  background: rgba(244, 243, 239, 0.04);
  color: var(--text);
}

.button-large {
  min-width: min(100%, 18rem);
  min-height: 56px;
}

.book-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 43rem;
  margin: 2.5rem 0 0;
  border: 1px solid var(--line);
  background: var(--line);
}

.book-facts div {
  min-width: 0;
  padding: 0.9rem;
  background: rgba(15, 17, 22, 0.86);
}

.book-facts dt {
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.book-facts dd {
  margin: 0.15rem 0 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.hero-cover {
  position: relative;
  margin: 0;
}

.hero-cover::before {
  position: absolute;
  inset: 5% 0 -5% 9%;
  z-index: -1;
  border: 1px solid rgba(212, 165, 89, 0.28);
  content: "";
}

.hero-cover img {
  width: 100%;
  aspect-ratio: 1588 / 2040;
  border: 1px solid rgba(244, 243, 239, 0.2);
  box-shadow: var(--shadow);
  object-fit: cover;
}

.hero-cover figcaption,
.genealogy-figure figcaption {
  margin-top: 0.7rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  line-height: 1.5;
}

.section-grid {
  display: grid;
  grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(2rem, 6vw, 5.5rem);
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}

h2 {
  font-size: clamp(2rem, 1.3rem + 3vw, 4.15rem);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.intro-copy {
  color: var(--muted);
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.22rem);
  line-height: 1.75;
}

.intro-copy p {
  margin: 0;
}

.intro-copy p + p {
  margin-top: 1.25rem;
}

.intro-copy blockquote {
  margin: 2rem 0 0;
  padding: 1.3rem 0 0;
  border-top: 1px solid var(--line-strong);
  color: var(--text);
  font-size: clamp(1.2rem, 1rem + 1vw, 1.7rem);
  font-style: italic;
  line-height: 1.45;
}

.acts,
.genealogy,
.chapters,
.download-panel {
  padding-block: clamp(4rem, 8vw, 7rem);
  border-top: 1px solid var(--line);
}

.section-heading {
  max-width: 53rem;
}

.section-heading > p:not(.section-kicker),
.genealogy-copy > p:not(.section-kicker),
.download-panel p {
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 0.94rem + 0.3vw, 1.15rem);
}

.act-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 2.5rem;
  border: 1px solid var(--line);
  background: var(--line);
}

.act-card {
  position: relative;
  min-height: 20rem;
  padding: 1.35rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(244, 243, 239, 0.035), transparent),
    var(--panel);
}

.act-card::before {
  display: block;
  width: 100%;
  height: 3px;
  margin-bottom: 2rem;
  background: var(--card-accent);
  content: "";
}

.act-card::after {
  position: absolute;
  right: -1.5rem;
  bottom: -3.7rem;
  color: rgba(244, 243, 239, 0.035);
  content: attr(data-numeral);
  font-family: var(--font-serif);
  font-size: 11rem;
  font-weight: 600;
  line-height: 1;
}

.act-one {
  --card-accent: var(--blue);
}

.act-two {
  --card-accent: var(--red);
}

.act-three {
  --card-accent: var(--cyan);
}

.act-four {
  --card-accent: var(--green);
}

.act-number {
  color: var(--card-accent);
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1;
}

.act-card h3 {
  margin-top: 1.15rem;
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.8rem);
  letter-spacing: -0.025em;
}

.act-card p {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.act-chapters {
  display: block;
  margin-top: 1.6rem;
  color: var(--faint);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.genealogy {
  display: grid;
  grid-template-columns: minmax(15rem, 0.43fr) minmax(0, 1fr);
  align-items: start;
  gap: clamp(2rem, 5vw, 4rem);
}

.genealogy-copy {
  position: sticky;
  top: 6.5rem;
}

.genealogy-copy h2 {
  font-size: clamp(2rem, 1.35rem + 2.1vw, 3.15rem);
}

.genealogy-figure {
  margin: 0;
  padding: clamp(0.7rem, 2vw, 1.15rem);
  overflow-x: auto;
  border: 1px solid var(--line);
  background: rgba(244, 243, 239, 0.045);
  scrollbar-color: var(--brass) rgba(244, 243, 239, 0.08);
}

.genealogy-figure svg {
  width: 100%;
  min-width: 720px;
  height: auto;
  border: 1px solid rgba(15, 17, 22, 0.18);
  background: var(--paper);
}

.chapter-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 2.5rem 0 0;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--line);
  list-style: none;
}

.chapter-list li {
  display: grid;
  grid-template-columns: 4.8rem minmax(0, 1fr);
  gap: 1rem;
  min-width: 0;
  padding: 1.25rem;
  background: rgba(15, 17, 22, 0.9);
}

.chapter-list li:nth-child(4n + 2),
.chapter-list li:nth-child(4n + 3) {
  background: rgba(23, 26, 32, 0.92);
}

.chapter-number {
  color: var(--brass);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chapter-list h3 {
  font-size: 1.1rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.chapter-list p {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.bookend-item .chapter-number {
  color: var(--cyan);
}

.download-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(3rem, 7vw, 6rem);
  padding-inline: clamp(1rem, 3vw, 2rem);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(circle at 84% 16%, rgba(212, 165, 89, 0.16), transparent 18rem),
    linear-gradient(135deg, rgba(30, 77, 140, 0.18), rgba(15, 17, 22, 0.82)),
    var(--panel);
}

.download-panel > div {
  max-width: 43rem;
}

.site-footer {
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 0.82rem;
}

.site-footer p {
  max-width: 62rem;
  margin: 0;
}

.site-footer p + p {
  margin-top: 0.7rem;
}

.site-footer a {
  color: var(--muted);
}

.svg-bg {
  fill: var(--paper);
}

.svg-panel {
  fill: var(--surface);
  stroke: var(--rule);
  stroke-width: 0.8;
}

.svg-grid {
  stroke: var(--rule);
  stroke-width: 0.6;
}

.svg-axis {
  stroke: var(--ink);
  stroke-width: 1.1;
}

.svg-title {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-weight: 700;
}

.svg-subtitle {
  fill: var(--ink-muted);
  font-family: var(--font-sans);
  font-weight: 400;
}

.svg-label {
  fill: var(--ink);
  font-family: var(--font-sans);
  font-weight: 600;
}

.svg-meta {
  fill: var(--ink-muted);
  font-family: var(--font-mono);
  font-weight: 400;
}

.svg-act-1 {
  fill: var(--act-1-accent);
  stroke: var(--act-1-accent);
}

.svg-act-2 {
  fill: var(--act-2-accent);
  stroke: var(--act-2-accent);
}

.svg-act-3 {
  fill: var(--act-3-accent);
  stroke: var(--act-3-accent);
}

.svg-act-4 {
  fill: var(--act-4-accent);
  stroke: var(--act-4-accent);
}

.svg-act-4c {
  fill: var(--act-4-contemporary);
  stroke: var(--act-4-contemporary);
}

@media (hover: hover) and (pointer: fine) {
  .site-nav a,
  .button,
  .site-footer a {
    transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
  }

  .site-nav a:hover,
  .site-footer a:hover {
    color: var(--text);
  }

  .site-nav .nav-download:hover {
    border-color: var(--brass);
    color: var(--brass);
  }

  .button-primary:hover {
    background: linear-gradient(180deg, #f0c97f, #d4a559);
  }

  .button-secondary:hover {
    border-color: rgba(244, 243, 239, 0.34);
    background: rgba(244, 243, 239, 0.08);
  }
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    padding-top: 3rem;
  }

  .hero-copy {
    max-width: 100%;
  }

  .hero-cover {
    width: min(430px, 100%);
    margin-inline: auto;
  }

  .act-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .act-card {
    min-height: 16rem;
  }

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

  .genealogy-copy {
    position: static;
    max-width: 50rem;
  }
}

@media (max-width: 760px) {
  html {
    scroll-padding-top: 7.5rem;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.1rem;
    padding-block: 0.65rem 0.35rem;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 0.2rem;
  }

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

  .chapter-list {
    grid-template-columns: 1fr;
  }

  .download-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .download-panel .button {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .hero,
  .section-grid,
  .acts,
  .genealogy,
  .chapters,
  .download-panel,
  .site-footer {
    width: min(100% - 1.1rem, 1180px);
  }

  .brand {
    font-size: 0.86rem;
  }

  .site-nav a {
    padding-inline: 0.35rem;
    font-size: 0.82rem;
  }

  .site-nav .nav-download {
    padding-inline: 0.65rem;
  }

  h1 {
    max-width: 8ch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .book-facts {
    grid-template-columns: 1fr;
  }

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

  .act-card {
    min-height: auto;
  }

  .chapter-list li {
    grid-template-columns: 1fr;
    gap: 0.45rem;
    padding: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
