/* Fixed single-viewport stage: chapter changes never scroll the document. */
html.stage-mode,
html.stage-mode body {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.stage-mode body {
  position: fixed;
  inset: 0;
}

.stage-mode .chapters {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  isolation: isolate;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    radial-gradient(circle at 72% 44%, color-mix(in srgb, var(--orange) 8%, transparent), transparent 34%);
  background-size: 64px 64px, 64px 64px, 100% 100%;
  background-position: center;
  transition: background-color .35s ease, background-image .35s ease;
}

.stage-mode .chapters::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .34;
  background:
    linear-gradient(90deg, transparent 0 24%, var(--grid-line-strong) 24% calc(24% + 1px), transparent calc(24% + 1px) 76%, var(--grid-line-strong) 76% calc(76% + 1px), transparent calc(76% + 1px)),
    linear-gradient(var(--grid-line-strong) 1px, transparent 1px);
  background-size: 100% 100%, 100% 25%;
}

.stage-mode .chapter,
.stage-mode .contact-chapter {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  padding-top: 124px;
  padding-bottom: 72px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  overflow: hidden;
  background: transparent !important;
  transition: none;
}

.stage-mode .chapter::after { display: none; }
.stage-mode .chapter.is-current,
.stage-mode .chapter.is-entering,
.stage-mode .chapter.is-leaving { visibility: visible; }
.stage-mode .chapter.is-current,
.stage-mode .chapter.is-entering { opacity: 1; }
.stage-mode .chapter.is-current { z-index: 2; pointer-events: auto; }
.stage-mode .chapter.is-entering { z-index: 3; pointer-events: none; }
.stage-mode .chapter.is-leaving { z-index: 4; opacity: 1; }
.stage-mode .chapter.is-current .reveal,
.stage-mode .chapter.is-entering .reveal,
.stage-mode .chapter.is-leaving .reveal { opacity: 1; transform: none; }

.stage-mode .contact-chapter { color: var(--ink); }
.stage-mode .contact-chapter .eyebrow,
.stage-mode .contact-chapter .lead,
.stage-mode .final-support-copy,
.stage-mode .process-mini span,
.stage-mode .site-footer { color: var(--muted); }
.stage-mode .final-support { border-color: var(--line); }
.stage-mode .process-mini span { border-color: var(--line); }
.stage-mode .button-light { color: var(--ink); border-color: var(--ink); }
.stage-mode .site-footer a { color: var(--orange); }

:root[data-theme="dark"] .header-cta {
  color: #f2efe7;
  background: #102a43;
  border-color: rgba(242, 239, 231, .2);
}

:root[data-theme="dark"] .header-cta:hover {
  color: #f2efe7;
  background: #173b5d;
  border-color: var(--orange);
}

.stage-mode .chapter.is-leaving .chapter-copy,
.stage-mode .chapter.is-leaving .chapter-art,
.stage-mode .chapter.is-leaving .contact-art,
.stage-mode .chapter.is-entering .chapter-copy,
.stage-mode .chapter.is-entering .chapter-art,
.stage-mode .chapter.is-entering .contact-art {
  animation-duration: .72s;
  animation-timing-function: var(--ease);
  animation-fill-mode: both;
  will-change: transform, opacity;
}

.stage-mode .chapter.is-leaving[data-direction="forward"] .chapter-copy { animation-name: stage-text-out-up; }
.stage-mode .chapter.is-entering[data-direction="forward"] .chapter-copy { animation-name: stage-text-in-up; }
.stage-mode .chapter.is-leaving[data-direction="back"] .chapter-copy { animation-name: stage-text-out-down; }
.stage-mode .chapter.is-entering[data-direction="back"] .chapter-copy { animation-name: stage-text-in-down; }
.stage-mode .chapter.is-leaving[data-art-travel="left"] .chapter-art,
.stage-mode .chapter.is-leaving[data-art-travel="left"] .contact-art { animation-name: stage-art-out-left; }
.stage-mode .chapter.is-entering[data-art-travel="left"] .chapter-art,
.stage-mode .chapter.is-entering[data-art-travel="left"] .contact-art { animation-name: stage-art-in-right; animation-delay: .05s; }
.stage-mode .chapter.is-leaving[data-art-travel="right"] .chapter-art,
.stage-mode .chapter.is-leaving[data-art-travel="right"] .contact-art { animation-name: stage-art-out-right; }
.stage-mode .chapter.is-entering[data-art-travel="right"] .chapter-art,
.stage-mode .chapter.is-entering[data-art-travel="right"] .contact-art { animation-name: stage-art-in-left; animation-delay: .05s; }

@keyframes stage-text-in-up { from { opacity: 0; transform: translate3d(0, 78px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes stage-text-in-down { from { opacity: 0; transform: translate3d(0, -78px, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes stage-text-out-up { from { opacity: 1; transform: translate3d(0, 0, 0); } to { opacity: 0; transform: translate3d(0, -78px, 0); } }
@keyframes stage-text-out-down { from { opacity: 1; transform: translate3d(0, 0, 0); } to { opacity: 0; transform: translate3d(0, 78px, 0); } }
@keyframes stage-art-in-right { from { opacity: 0; transform: translate3d(110px, 0, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes stage-art-in-left { from { opacity: 0; transform: translate3d(-110px, 0, 0); } to { opacity: 1; transform: translate3d(0, 0, 0); } }
@keyframes stage-art-out-left { from { opacity: 1; transform: translate3d(0, 0, 0); } to { opacity: 0; transform: translate3d(-110px, 0, 0); } }
@keyframes stage-art-out-right { from { opacity: 1; transform: translate3d(0, 0, 0); } to { opacity: 0; transform: translate3d(110px, 0, 0); } }

@media (max-width: 700px) {
  .stage-mode .chapters { background-size: 42px 42px, 42px 42px, 100% 100%; }
  .stage-mode .chapters::after { opacity: .24; }
  .stage-mode .chapter,
  .stage-mode .contact-chapter { min-height: 0; height: 100%; padding: 92px 0 58px; }
  .stage-mode .chapter.is-leaving .chapter-copy,
  .stage-mode .chapter.is-entering .chapter-copy { animation-duration: .56s; }
  .stage-mode .chapter.is-leaving .chapter-art,
  .stage-mode .chapter.is-leaving .contact-art,
  .stage-mode .chapter.is-entering .chapter-art,
  .stage-mode .chapter.is-entering .contact-art { animation-duration: .62s; }
}

@media (prefers-reduced-motion: reduce) {
  .stage-mode .chapter.is-leaving .chapter-copy,
  .stage-mode .chapter.is-entering .chapter-copy,
  .stage-mode .chapter.is-leaving .chapter-art,
  .stage-mode .chapter.is-leaving .contact-art,
  .stage-mode .chapter.is-entering .chapter-art,
  .stage-mode .chapter.is-entering .contact-art { animation: none !important; }
}
