:root {
  --bg: #101716;
  --bg-soft: #17211f;
  --paper: #e8e1d3;
  --ink: #26302c;
  --muted: #8f9a94;
  --gold: #d0a955;
  --gold-soft: rgba(208, 169, 85, .18);
  --line: rgba(208, 169, 85, .28);
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", Arial, sans-serif;
  --reading-size: 1.16rem;
}

html[data-theme="light"] {
  --bg: #ddd4c3;
  --bg-soft: #eee8dc;
  --paper: #fffaf0;
  --ink: #24302b;
  --muted: #65706b;
  --gold: #8b6729;
  --gold-soft: rgba(139, 103, 41, .12);
  --line: rgba(82, 68, 38, .22);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--paper);
  font-family: var(--serif);
  transition: background-color .25s ease, color .25s ease;
}

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

a { color: inherit; }

.reading-progress {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 3px;
  background: rgba(255,255,255,.05);
}

.reading-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #8f6a2e, #f3cb72);
  box-shadow: 0 0 14px rgba(243, 203, 114, .55);
}

.hero {
  position: relative;
  min-height: 96vh;
  overflow: hidden;
  display: grid;
  align-items: end;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.hero__image,
.hero__veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__image {
  z-index: -3;
  object-fit: cover;
  object-position: 53% center;
  scale: 1.02;
  animation: settle 1.8s ease-out both;
}

.hero__veil {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(5, 12, 12, .94) 0%, rgba(5, 12, 12, .68) 36%, rgba(5, 12, 12, .04) 70%),
    linear-gradient(0deg, #101716 0%, rgba(16, 23, 22, .1) 30%, rgba(0,0,0,.16) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.1) .55px, transparent .55px);
  background-size: 5px 5px;
  opacity: .16;
  pointer-events: none;
}

.topbar {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px clamp(22px, 5vw, 76px);
  font-family: var(--sans);
}

.sigil {
  color: #f0e3c7;
  font: 600 .74rem/1 var(--sans);
  letter-spacing: .35em;
  text-decoration: none;
  border: 1px solid rgba(240, 227, 199, .35);
  padding: 11px 10px 11px 14px;
}

.topbar__actions { display: flex; gap: 9px; }

.icon-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(240, 227, 199, .32);
  background: rgba(8, 14, 13, .35);
  color: #f0e3c7;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background .2s, transform .2s;
}

.icon-button:hover { background: rgba(208, 169, 85, .24); transform: translateY(-2px); }

.hero__content {
  width: min(720px, 90vw);
  margin: 0 0 clamp(70px, 10vh, 118px) clamp(22px, 8vw, 128px);
  animation: rise .9s .15s ease-out both;
}

.eyebrow,
.chapter__number {
  margin: 0 0 18px;
  color: #e3ba63;
  font: 600 .72rem/1.3 var(--sans);
  letter-spacing: .3em;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  color: #f3ead7;
  font-size: clamp(3rem, 7vw, 6.8rem);
  font-weight: 400;
  line-height: .94;
  letter-spacing: -.045em;
  text-wrap: balance;
  text-shadow: 0 5px 30px rgba(0,0,0,.45);
}

.hero__lead {
  max-width: 570px;
  margin: 30px 0 34px;
  color: rgba(243, 234, 215, .78);
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  line-height: 1.65;
}

.read-button {
  display: inline-flex;
  gap: 28px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #d7ad55;
  color: #f3ead7;
  font: 600 .76rem/1 var(--sans);
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: gap .2s, background .2s;
}

.read-button:hover { gap: 38px; background: rgba(208,169,85,.1); }

.hero__caption {
  position: absolute;
  right: clamp(22px, 5vw, 76px);
  bottom: 32px;
  margin: 0;
  color: rgba(240,227,199,.56);
  font: 500 .68rem/1 var(--sans);
  letter-spacing: .26em;
  text-transform: uppercase;
}

main {
  position: relative;
  background:
    radial-gradient(circle at 15% 15%, rgba(49, 78, 67, .22), transparent 27%),
    var(--bg);
}

.chapter-rail {
  position: sticky;
  z-index: 10;
  top: 23vh;
  float: left;
  margin: 22vh 0 0 clamp(18px, 3.4vw, 54px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font: 600 .64rem/1 var(--sans);
  letter-spacing: .14em;
  text-transform: uppercase;
}

.chapter-rail span {
  writing-mode: vertical-rl;
  margin-bottom: 8px;
}

.chapter-rail a {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  text-decoration: none;
  transition: .2s;
}

.chapter-rail a:hover,
.chapter-rail a.active { color: var(--bg); background: var(--gold); }

.story {
  width: min(760px, calc(100% - 48px));
  margin: 0 auto;
  padding: 110px 0 130px;
}

.story__intro {
  margin: 0 auto 130px;
  text-align: center;
}

.ornament { color: var(--gold); font-size: 1.1rem; }

.dedication {
  max-width: 530px;
  margin: 30px auto 0;
  color: var(--muted);
  font-size: 1.08rem;
  font-style: italic;
  line-height: 1.75;
}

.chapter {
  scroll-margin-top: 40px;
  margin: 0 0 118px;
}

.chapter__number { margin-bottom: 13px; }

.chapter h2 {
  margin: 0 0 48px;
  color: var(--paper);
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.chapter > p,
.chapter blockquote p {
  color: color-mix(in srgb, var(--paper) 86%, var(--muted));
  font-size: var(--reading-size);
  line-height: 1.9;
  text-wrap: pretty;
}

.chapter > p { margin: 0 0 1.45em; }

.dropcap::first-letter {
  float: left;
  margin: .12em .13em 0 0;
  color: var(--gold);
  font-size: 4.65em;
  line-height: .7;
}

blockquote {
  margin: 38px 0 42px;
  padding: 8px 0 8px 28px;
  border-left: 1px solid var(--gold);
}

.chapter blockquote p {
  margin: .38em 0;
  color: var(--paper);
  font-style: italic;
}

.phrase-card {
  margin: -48px 0 118px;
  padding: 30px 32px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--gold-soft), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
}

.phrase-card span {
  color: var(--gold);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-style: italic;
}

.phrase-card button {
  flex: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 600 .7rem/1.5 var(--sans);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.pullquote {
  margin: -30px max(-8vw, -80px) 120px;
  padding: 65px 40px;
  border-block: 1px solid var(--line);
  text-align: center;
}

.pullquote p {
  max-width: 820px;
  margin: auto;
  color: var(--gold);
  font-size: clamp(1.8rem, 4.2vw, 3.4rem);
  font-style: italic;
  line-height: 1.25;
}

.story-visual {
  position: relative;
  width: auto;
  margin: -45px max(-16vw, -210px) 125px;
}

.story-visual::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgba(229, 191, 108, .22);
  box-shadow: inset 0 0 70px rgba(3, 8, 8, .45);
  pointer-events: none;
}

.story-visual img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--bg-soft);
  filter: saturate(.93) contrast(1.03);
}

.story-visual figcaption {
  max-width: 680px;
  margin: 17px auto 0;
  padding: 0 18px;
  color: var(--muted);
  font: italic .89rem/1.7 var(--serif);
  text-align: center;
}

.story-visual figcaption span {
  color: var(--gold);
  font-style: normal;
  letter-spacing: .04em;
}

.story-visual--ominous img { filter: saturate(.78) contrast(1.08); }
.story-visual--reunion img { filter: saturate(1.02) contrast(1.02); }

.german-line {
  margin-block: 40px !important;
  color: var(--gold) !important;
  font-size: 1.9rem !important;
  font-style: italic;
  text-align: center;
}

.spell {
  margin: 52px 0 !important;
  padding: 42px 20px;
  color: var(--gold) !important;
  font-size: clamp(2rem, 5vw, 3.7rem) !important;
  font-style: italic;
  line-height: 1.25 !important;
  text-align: center;
  text-shadow: 0 0 32px rgba(208,169,85,.28);
}

.story__footer {
  padding-top: 26px;
  text-align: center;
}

.story__footer > p:nth-child(2) {
  margin: 18px 0 38px;
  color: var(--paper);
  font-size: 2rem;
  font-style: italic;
}

.story__footer a {
  color: var(--muted);
  font: 600 .72rem/1 var(--sans);
  letter-spacing: .12em;
  text-decoration: none;
  text-transform: uppercase;
}

.site-footer {
  padding: 34px 24px;
  border-top: 1px solid var(--line);
  background: #0b1110;
  color: #77817c;
  font: .72rem/1.6 var(--sans);
  text-align: center;
}

html.large-text { --reading-size: 1.31rem; }

@keyframes rise {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes settle {
  from { opacity: .3; scale: 1.08; }
  to { opacity: 1; scale: 1.02; }
}

@media (max-width: 900px) {
  .hero { min-height: 88vh; }
  .hero__veil {
    background:
      linear-gradient(90deg, rgba(5,12,12,.88), rgba(5,12,12,.18)),
      linear-gradient(0deg, #101716 0%, rgba(16,23,22,.08) 45%);
  }
  .hero__content { margin-left: clamp(22px, 7vw, 70px); }
  .chapter-rail { display: none; }
}

@media (max-width: 620px) {
  .hero { min-height: 92svh; align-items: end; }
  .hero__image { object-position: 64% center; }
  .hero__veil {
    background:
      linear-gradient(0deg, #101716 1%, rgba(5,12,12,.86) 31%, rgba(5,12,12,.08) 75%),
      linear-gradient(90deg, rgba(5,12,12,.48), transparent);
  }
  .topbar { padding: 20px; }
  .hero__content { width: calc(100% - 40px); margin: 0 20px 74px; }
  h1 { font-size: clamp(2.6rem, 13vw, 4.4rem); }
  .hero__lead { margin: 22px 0 24px; font-size: .98rem; }
  .hero__caption { display: none; }
  .story { width: min(100% - 40px, 760px); padding-top: 80px; }
  .story__intro { margin-bottom: 90px; }
  .chapter { margin-bottom: 92px; }
  .chapter h2 { margin-bottom: 34px; }
  .chapter > p, .chapter blockquote p { line-height: 1.78; }
  blockquote { margin: 30px 0 34px; padding-left: 20px; }
  .phrase-card { margin-top: -32px; margin-bottom: 92px; padding: 24px; align-items: flex-start; flex-direction: column; }
  .pullquote { margin: -20px 0 94px; padding: 50px 12px; }
  .story-visual { margin: -30px -20px 95px; }
  .story-visual img { min-height: 260px; object-position: center; }
  .story-visual figcaption { padding: 0 20px; }
}

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