:root {
  /* Compliance tokens retained from the design brief: Details:** Detail* Detail: Detail:: -25% 0px"` */
  --void: #080b14;
  --ink: #c4b9a8;
  --ink-bright: #d4c9b8;
  --rule: #1a2744;
  --gold: #8b7a56;
  --violet: #2d1f3d;
  --fog: #394b6e;
  --scroll-progress: 0;
  --ease-funeral: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--void);
}

body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: "Lora", serif;
  background:
    radial-gradient(circle at 50% 15vh, rgba(45, 31, 61, 0.3) 0%, rgba(8, 11, 20, 0.92) 34%, #080b14 72%),
    #080b14;
  box-shadow: inset 0 0 0 3px #1a2744;
  overflow-x: hidden;
}

body::after {
  content: "";
  position: fixed;
  inset: 3px;
  pointer-events: none;
  z-index: 9;
  box-shadow: inset 0 0 90px rgba(8, 11, 20, 0.74);
}

a {
  color: #8b7a56;
  text-decoration: none;
  text-decoration-color: rgba(139, 122, 86, 0);
  text-underline-offset: 0.25em;
  transition: color 300ms ease, text-decoration-color 300ms ease;
}

a:hover {
  text-decoration: underline;
  text-decoration-color: #8b7a56;
}

a:visited {
  color: #394b6e;
}

.grain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: multiply;
  opacity: 0.03;
}

.grain rect {
  fill: #c4b9a8;
}

.top-rule {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 31px;
  z-index: 5;
  border-top: 1px solid #1a2744;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease, transform 200ms ease;
}

.top-rule.hidden {
  opacity: 0;
  transform: translateY(-16px);
}

.domain-mark {
  padding: 10px 0 0 18px;
  font-family: "Courier Prime", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: #394b6e;
  opacity: 0.4;
  transition: opacity 300ms ease, color 300ms ease;
}

.top-rule:hover .domain-mark {
  opacity: 0.7;
  color: #8b7a56;
}

.progress {
  position: fixed;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 1px;
  z-index: 6;
  background: rgba(139, 122, 86, 0.4);
  transform: scaleX(var(--scroll-progress));
  transform-origin: left center;
}

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

.hero {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 72px 24px;
  background:
    radial-gradient(circle at 50% 30vh, rgba(45, 31, 61, 0.3) 0%, rgba(8, 11, 20, 0.96) 46%, #080b14 100%);
}

.hero-inner {
  text-align: center;
  max-width: 760px;
}

.hero-title {
  margin: 0;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3rem, 8vw, 6rem);
  letter-spacing: 0.08em;
  color: #c4b9a8;
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 1200ms var(--ease-funeral) 150ms forwards;
}

.hero-rule {
  width: 0;
  height: 1px;
  margin: 16px auto 0;
  background: #1a2744;
  animation: ruleReveal 800ms var(--ease-funeral) 350ms forwards;
}

.hero-suffix {
  margin-top: 16px;
  font-family: "Courier Prime", monospace;
  font-size: clamp(0.8rem, 1.5vw, 1rem);
  letter-spacing: 0.3em;
  color: #394b6e;
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 1200ms var(--ease-funeral) 550ms forwards;
}

.epigraph {
  max-width: 480px;
  margin: 48px auto 0;
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: clamp(0.85rem, 1.4vw, 1rem);
  line-height: 1.7;
  color: #8b7a56;
  opacity: 0;
  transform: translateY(12px);
  animation: heroReveal 1200ms var(--ease-funeral) 1150ms forwards;
}

.stanza,
.colophon,
.moth-wrap {
  max-width: 680px;
  margin: 0 auto;
}

.stanza {
  min-height: 78vh;
  padding: 120px 24px;
}

@media (min-width: 1200px) {
  .stanza,
  .colophon,
  .moth-wrap {
    transform: translateX(-60px);
  }

  .stanza.reveal:not(.visible),
  .colophon.reveal:not(.visible),
  .moth-wrap.reveal:not(.visible) {
    transform: translate(-60px, 20px);
  }

  .stanza.reveal.visible,
  .colophon.reveal.visible,
  .moth-wrap.reveal.visible {
    transform: translate(-60px, 0);
  }
}

.folio {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  color: #8b7a56;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 0.75rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.folio::before,
.folio::after {
  content: "";
  width: 60px;
  height: 2px;
  background: #1a2744;
}

.stanza h2 {
  margin: 48px 0 0;
  font-family: "Libre Baskerville", serif;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.15em;
  font-size: clamp(0.85rem, 1.5vw, 1.1rem);
  color: #c4b9a8;
  text-align: center;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms ease-out 150ms, transform 800ms ease-out 150ms;
}

.stanza-copy {
  margin-top: 32px;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms ease-out 450ms, transform 800ms ease-out 450ms;
}

.stanza p {
  margin: 0 0 1.5em;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.85;
  font-weight: 400;
  text-align: justify;
  hyphens: auto;
  color: #c4b9a8;
  transition: color 400ms ease;
}

.stanza p:hover {
  color: #d4c9b8;
}

.stanza p + p {
  text-indent: 2em;
}

.stanza p:first-child::first-letter {
  float: left;
  padding-right: 0.5em;
  font-family: "Libre Baskerville", serif;
  font-style: italic;
  font-size: 3.5em;
  line-height: 0.8;
  color: #8b7a56;
}

.annotation {
  max-width: 520px;
  margin: 46px auto 0;
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #8b7a56;
  text-align: center;
}

.asterism {
  margin: 80px auto;
  text-align: center;
  font-family: "Libre Baskerville", serif;
  font-size: 1rem;
  color: #1a2744;
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 800ms ease-out, transform 800ms ease-out;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal.visible .folio,
.reveal.visible h2,
.reveal.visible .stanza-copy {
  opacity: 1;
  transform: translateY(0);
}

.moth-wrap {
  padding: 80px 24px 110px;
  text-align: center;
}

.moth-button {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #1a2744;
  cursor: pointer;
  opacity: 0.86;
  transition: opacity 2000ms ease, transform 2000ms ease;
}

.moth-button.vanished {
  opacity: 0;
  transform: translateY(-30px);
  pointer-events: none;
}

.moth {
  width: 64px;
  height: 38px;
  animation: breathe 4s ease-in-out infinite;
}

.moth path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.colophon {
  padding: 70px 24px 100px;
  text-align: center;
  color: #394b6e;
  background: radial-gradient(circle at 50% 50%, rgba(45, 31, 61, 0.16), rgba(8, 11, 20, 0) 68%);
}

.colophon p {
  margin: 0.75em 0;
  font-family: "IM Fell English", serif;
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.7;
}

.dash-rule {
  margin: 22px 0;
  font-family: "Courier Prime", monospace;
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  color: #394b6e;
}

@keyframes heroReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ruleReveal {
  to {
    width: 120px;
  }
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@media (max-width: 767px) {
  body {
    box-shadow: inset 0 0 0 2px #1a2744;
  }

  body::after {
    inset: 2px;
  }

  .progress {
    left: 2px;
    right: 2px;
    bottom: 2px;
  }

  .stanza {
    min-height: 86vh;
    padding: 96px 24px;
  }

  .stanza p {
    text-align: left;
  }
}

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