.atmosphere__vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 50% 45%, transparent 35%, rgba(0, 0, 0, 0.55) 100%);
  opacity: 0.85;
}

.atmosphere__glow {
  position: absolute;
  inset: -10%;
  background:
    radial-gradient(ellipse 45% 35% at 50% 42%, rgba(185, 154, 97, 0.07), transparent 70%);
  opacity: 0.65;
  mix-blend-mode: soft-light;
}

.atmosphere__grain {
  position: absolute;
  inset: -20%;
  width: 140%;
  height: 140%;
  opacity: 0.07;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
  animation: grain-shift 0.45s steps(2) infinite;
}

.atmosphere__measure {
  position: absolute;
  left: clamp(1rem, 4vw, 3rem);
  top: 50%;
  width: 1px;
  height: min(38vh, 280px);
  transform: translateY(-50%);
  background: linear-gradient(to bottom, transparent, var(--border), transparent);
  opacity: 0;
}

.atmosphere__measure::before,
.atmosphere__measure::after {
  content: "";
  position: absolute;
  left: -4px;
  width: 9px;
  height: 1px;
  background: var(--border);
}

.atmosphere__measure::before {
  top: 0;
}

.atmosphere__measure::after {
  bottom: 0;
}

.chapter {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  padding:
    calc(var(--header-h) + var(--safe-top) + 1rem)
    clamp(1.25rem, 5vw, 5rem)
    calc(2rem + var(--safe-bottom));
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}

.chapter.is-active {
  visibility: visible;
}

.chapter[data-align="center"] {
  justify-items: center;
  text-align: center;
}

.chapter[data-align="left"] {
  justify-items: start;
  text-align: left;
}

.chapter[data-align="right"] {
  justify-items: end;
  text-align: right;
}

.chapter[data-align="split"] .chapter__content {
  width: min(72rem, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: end;
}

.chapter[data-align="split"] .chapter__title {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: clamp(2.4rem, 6.5vw, 6.5rem);
}

.chapter[data-align="split"] .chapter__title .word:last-child {
  text-align: right;
}

.chapter__content {
  width: min(34rem, 100%);
  display: grid;
  gap: 1rem;
}

.chapter[data-align="center"] .chapter__content {
  justify-items: center;
}

.chapter[data-zone="bottom"] {
  align-content: end;
  padding-bottom: calc(4rem + var(--safe-bottom));
}

.chapter[data-zone="edges"] {
  align-content: center;
}

.chapter__number {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.22em;
  color: var(--text-muted);
}

.chapter__title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6.2vw, 6.25rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.chapter__body {
  font-size: clamp(0.95rem, 1.2vw, 1.125rem);
  line-height: 1.55;
  color: var(--text-secondary);
  max-width: 34ch;
}

.chapter__scroll-hint {
  margin-top: 2rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.chapter__scroll-hint span {
  width: 1px;
  height: 42px;
  background: linear-gradient(to bottom, var(--champagne), transparent);
  animation: scroll-pulse 1.8s var(--ease-out) infinite;
}

.chapter[data-chapter="threshold"] .chapter__title {
  max-width: 16ch;
}

.chapter[data-chapter="threshold"].is-intro .chapter__title .word {
  overflow: hidden;
  display: inline-block;
  vertical-align: top;
}

.chapter[data-chapter="threshold"] .chapter__content {
  gap: 1.15rem;
}

.bg-title {
  position: absolute;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 18rem);
  line-height: 0.85;
  letter-spacing: -0.04em;
  color: rgba(242, 239, 232, 0.035);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.reduced-motion-fallback {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  background-size: cover;
  background-position: center;
}

html.is-reduced-motion .experience__canvas {
  opacity: 0;
}

html.is-reduced-motion .reduced-motion-fallback {
  display: block;
}

html.is-reduced-motion .atmosphere__grain {
  animation: none;
  opacity: 0.04;
}
