.page-curtain {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
  background: #242628;
  border-block: 1px solid #9a9b98;
  transform: translateY(-101%);
}
.page-curtain::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 7%;
  width: 9%;
  height: 2px;
  background: #ff743c;
}
.h-stage h1 .reveal-word, .h-stage h1 .reveal-char {
  display: inline-block;
  color: inherit;
}
.reveal-word { clip-path: inset(-.1em -.14em -.15em); }
@keyframes glyph-in {
  from { transform: translateY(115%); }
  to { transform: translateY(0); }
}
#patterns .h-rows { gap: clamp(12px, 2vw, 24px); }
#patterns .h-rows > div {
  position: relative;
  isolation: isolate;
  padding: clamp(20px, 2.3vw, 34px);
  background: #191a1b;
  border: 1px solid #424446;
  border-radius: 4px;
}
#patterns .h-rows dt { color: #f5f5f3; }
#patterns .h-rows dd { color: #c9cbcd; }
@property --rim-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}
@keyframes rim-pass { to { --rim-angle: 360deg; } }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  #patterns .h-rows > div::before, #patterns .h-rows > div::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 180ms ease;
  }
  #patterns .h-rows > div::before {
    z-index: -1;
    background: radial-gradient(ellipse 245px 175px at var(--spot-x, 50%) var(--spot-y, 50%), #ff874124, #d0d0cc0b 65%, transparent);
  }
  #patterns .h-rows > div::after {
    inset: -1px;
    padding: 1px;
    background: conic-gradient(from var(--rim-angle), transparent 15%, #c3c6c84d 35%, #ff8957 42%, transparent 54%);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
  }
  #patterns .h-rows > .lit::before, #patterns .h-rows > .lit::after { opacity: 1; }
  #patterns .h-rows > .lit::after { animation: rim-pass 3.8s linear infinite; }
}
@media (prefers-reduced-motion: no-preference) {
  .reveal-char { animation: glyph-in 480ms cubic-bezier(.19,1,.22,1) var(--glyph-delay) backwards; }
}
@media (prefers-reduced-motion: reduce), print {
  .page-curtain { display: none; }
}

/* The four reading colors are the chapter stops from the V02 homepage. */
main.chapter-colors > #problem { --chapter-base: #e7e7e3; }
main.chapter-colors > #layer { --chapter-base: #181a1c; }
main.chapter-colors > #evidence { --chapter-base: #353739; }
main.chapter-colors > #pilot { --chapter-base: #0a0b0c; }
main.chapter-colors > :is(#problem, #layer, #evidence, #pilot) {
  background-color: var(--chapter-base);
}
main.chapter-colors > #problem { color: #000; }
main.chapter-colors > :is(#layer, #evidence, #pilot) { color: #fff; }
main.chapter-colors > :is(#layer, #evidence) .h-rows dd { color: #c2c2c2; }

/* A single solid surface changes with scroll progress, like the supplied video.
   There is no spatial gradient and no timer that resets a resting chapter. */
@media (prefers-reduced-motion: no-preference) {
  body.scroll-scenes { background: var(--scene-surface); }
  body.scroll-scenes main.chapter-colors > :is(#story, #problem, #approach, #layer, #evidence, #patterns, #pilot),
  body.scroll-scenes .site-foot {
    background: transparent;
    border-color: transparent;
    color: var(--scene-ink);
  }
  body.scroll-scenes main.chapter-colors > :is(#story, #problem, #approach, #layer, #evidence, #patterns, #pilot) .h-rows dd,
  body.scroll-scenes main.chapter-colors .h-label,
  body.scroll-scenes .foot-grid h2,
  body.scroll-scenes .foot-end { color: var(--scene-muted); }
  body.scroll-scenes main.chapter-colors #patterns :is(dt, dd) { color: #f5f5f3; }
}
