:root {
  --night: #101216;
  --night-2: #16191e;
  --stone: #8d8f90;
  --stone-dim: #4a4d52;
  --ivory: #e6dfd0;
  --ivory-dim: #9a948a;
  --ember: #c9793a;
  --rule: rgba(230, 223, 208, 0.14);
  --measure: 42rem;
  --gutter: clamp(16px, 6vw, 96px);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--night);
  color: var(--ivory);
  font-family: "Alegreya", Georgia, serif;
  font-size: 1.125rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  min-height: 100vh;
}

/* atmosphere: cold light from the top left, warmer dark below */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 70% at 15% -10%, rgba(141, 143, 144, 0.16), transparent 60%),
    radial-gradient(80% 50% at 90% 110%, rgba(201, 121, 58, 0.07), transparent 60%),
    linear-gradient(var(--night), var(--night-2));
}

/* grain */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 3;
  pointer-events: none;
  opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.4s steps(4) infinite;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  25% { transform: translate(-2%, 3%); }
  50% { transform: translate(3%, -1%); }
  75% { transform: translate(-1%, -3%); }
  100% { transform: translate(2%, 2%); }
}

a { color: inherit; text-decoration: none; }

.trail {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1;
  pointer-events: none;
}

.trail svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  overflow: visible;
}

.step {
  fill: var(--stone);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  transform: scale(0.7);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.step.on {
  opacity: var(--step-alpha, 0.32);
  transform: scale(1);
}

.nav {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 4;
  padding: 20px var(--gutter);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ivory-dim);
}

.nav a { padding: 6px 4px; transition: color 0.3s; }
.nav a:hover { color: var(--ivory); }
.nav a[aria-current] { color: var(--ivory); border-bottom: 1px solid var(--ember); }
.nav span { padding: 0 6px; opacity: 0.5; }

main {
  position: relative;
  z-index: 2;
  padding: 0 var(--gutter);
}

.hero {
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding: 18vh 0 12vh;
  max-width: 64rem;
  margin-left: auto;
  margin-right: auto;
}

.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin: 0 0 1.6rem 0.2em;
  opacity: 0;
  animation: rise 1.4s 0.3s ease forwards;
}

.title {
  font-family: "Fraunces", "Times New Roman", serif;
  font-variation-settings: "opsz" 144, "SOFT" 40, "WONK" 1;
  font-weight: 300;
  font-size: clamp(3.2rem, 13vw, 11rem);
  line-height: 0.92;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ivory);
  text-wrap: balance;
}

.title .w { display: inline-block; white-space: nowrap; }

.title .l {
  display: inline-block;
  opacity: 0;
  filter: blur(10px);
  transform: translateY(0.12em);
  animation: letter 1.6s cubic-bezier(0.2, 0.7, 0.1, 1) forwards;
  animation-delay: calc(0.55s + var(--i) * 0.07s);
}

@keyframes letter {
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes rise {
  to { opacity: 1; }
}

.hook {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 48, "SOFT" 60, "WONK" 1;
  font-style: italic;
  font-weight: 300;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.3;
  max-width: 28ch;
  margin: 2.6rem 0 0 0.12em;
  color: var(--ivory-dim);
  opacity: 0;
  animation: rise 1.8s 1.8s ease forwards;
}

.scroll-cue {
  margin: 10vh 0 0 0.3em;
  width: 10px;
  height: 14px;
  opacity: 0;
  animation: rise 2s 2.6s ease forwards;
}
.scroll-cue path {
  fill: none;
  stroke: var(--ember);
  stroke-width: 1.2;
  stroke-dasharray: 40;
  animation: cue 2.4s 3s ease-in-out infinite;
}
@keyframes cue {
  0%, 100% { transform: translateY(0); opacity: 0.9; }
  50% { transform: translateY(5px); opacity: 0.35; }
}

section {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 18vh 0;
}

.prose p {
  font-size: clamp(1.25rem, 2.2vw, 1.55rem);
  line-height: 1.5;
  margin: 0 0 1.6em;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.prose p.on { opacity: 1; transform: none; }
.prose p:last-child { margin-bottom: 0; }

.books { padding-top: 10vh; }

.label {
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ivory-dim);
  margin: 0 0 2.4rem;
}

.books ol {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}

.books li {
  display: grid;
  grid-template-columns: 3.5rem 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
  position: relative;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 1s ease, transform 1s ease;
}
.books li.on { opacity: 1; transform: none; }
.books li:nth-child(2).on { transition-delay: 0.15s; }
.books li:nth-child(3).on { transition-delay: 0.3s; }

.books li::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 1px;
  width: 0;
  background: var(--ember);
  transition: width 0.7s cubic-bezier(0.2, 0.7, 0.1, 1);
}
.books li:hover::after { width: 100%; }

.num {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 72, "SOFT" 20, "WONK" 0;
  font-weight: 300;
  font-size: 1.6rem;
  color: var(--ivory-dim);
  transition: color 0.4s, transform 0.5s;
}
.books li:hover .num { color: var(--ember); transform: translateX(3px); }

.bt {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 72, "SOFT" 30, "WONK" 1;
  font-weight: 400;
  font-size: clamp(1.5rem, 3.4vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.books li.later .bt { color: var(--ivory-dim); }

.state {
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ember);
  white-space: nowrap;
}
.books li.later .state { color: var(--stone-dim); }

.excerpt {
  border-left: 1px solid var(--rule);
  padding-left: clamp(1.2rem, 4vw, 2.4rem);
  max-width: 36rem;
}
.excerpt .label { margin-bottom: 1.8rem; }
.excerpt p {
  font-size: 1.15rem;
  line-height: 1.6;
  margin: 0 0 1.1em;
  color: var(--ivory);
  opacity: 0;
  transition: opacity 1.4s ease;
}
.excerpt p.on { opacity: 0.92; }
.excerpt .label + p::first-letter {
  font-family: "Fraunces", serif;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  font-weight: 300;
  font-size: 3.4em;
  float: left;
  line-height: 0.8;
  padding: 0.08em 0.1em 0 0;
  color: var(--ember);
}
.excerpt small {
  display: block;
  margin-top: 1.6rem;
  font-size: 0.85rem;
  color: var(--ivory-dim);
  font-style: italic;
}

footer {
  position: relative;
  z-index: 2;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 10vh var(--gutter) 8vh;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
  font-size: 0.85rem;
  color: var(--ivory-dim);
  border-top: 1px solid var(--rule);
}
footer .motto {
  font-family: "Fraunces", serif;
  font-style: italic;
  font-variation-settings: "opsz" 48, "SOFT" 60, "WONK" 1;
  font-size: 1.1rem;
  color: var(--ivory);
  width: 100%;
  margin: 0 0 1rem;
}
footer a:hover { color: var(--ivory); }

@media (max-width: 640px) {
  .books li { grid-template-columns: 2.4rem 1fr; }
  .state { grid-column: 2; font-size: 0.7rem; }
  .step { --step-alpha: 0.18; }
  section { padding: 12vh 0; }
}

@media (prefers-reduced-motion: reduce) {
  body::after { animation: none; }
  .kicker, .hook, .scroll-cue, .title .l { animation: none; opacity: 1; filter: none; transform: none; }
  .scroll-cue path { animation: none; }
  .prose p, .books li, .excerpt p, .step { transition: none; opacity: 1; transform: none; }
  .excerpt p { opacity: 0.92; }
  .step { opacity: var(--step-alpha, 0.32); }
}
