/* The architecture begins almost lost in black and is locally exposed by the pointer. */
.scene {
  filter: brightness(.27) contrast(1.12) saturate(.72);
}

.exposure {
  filter: brightness(.9) contrast(1.13) saturate(.9);
  mask-image: radial-gradient(ellipse 260px 230px at var(--mx, 50%) var(--my, 50%), #000 0%, rgba(0, 0, 0, .92) 30%, rgba(0, 0, 0, .34) 68%, transparent 100%);
  transition: opacity .85s ease;
}

.hero.is-active .exposure {
  opacity: .78;
}

.architecture:after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .38), rgba(0, 0, 0, .07) 70%), linear-gradient(0deg, #070708 0%, transparent 24%);
}

.cursor-smoke {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .68;
  filter: blur(7px);
  mix-blend-mode: screen;
}

.hero-copy,
.hero .section-marker,
.peripheral {
  z-index: 2;
}

.section-marker span {
  margin-top: 0;
}

.lower:before {
  opacity: .09;
}

/* Scroll drives a fixed stack of chapters instead of moving a long page. */
html {
  scroll-snap-type: none;
}

body {
  overscroll-behavior-y: contain;
}

.js main {
  position: relative;
  height: 580svh;
}

/* Deep-purple halftone accents replace the original diagonal crosshatching. */
.hatch {
  background-color: #70438a;
  background-image:
    radial-gradient(circle, #080709 0 1.15px, transparent 1.35px),
    radial-gradient(circle, #080709 0 .75px, transparent 1px);
  background-position: 0 0, 3px 3px;
  background-size: 6px 6px;
}

.js .lower {
  display: contents;
}

.js .lower:before {
  display: none;
}

.js .hero,
.js .statement,
.js .development,
.js footer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100svh;
  min-height: 0;
  overflow: hidden;
}

.js .hero {
  z-index: 1;
}

.js .statement {
  z-index: 2;
  background: rgba(7, 7, 8, .86);
}

.js .development {
  z-index: 3;
  background: rgba(7, 7, 8, .84);
}

.js .development.footer-merge {
  z-index: 5;
  background: transparent;
  pointer-events: none;
}

.js .development h2,
.js .development .serif,
.js .development .hatch,
.js .development .section-marker {
  transition: opacity .55s ease-out, filter .7s ease-out, transform .7s ease-out;
}

.js .development.footer-merge .serif {
  text-shadow: 0 2px 18px rgba(7, 7, 8, .96);
}

.detail-character,
.detail-ending {
  display: inline-block;
  vertical-align: baseline;
}

.detail-character {
  white-space: pre;
  will-change: opacity, filter;
}

.detail-ending {
  transition: color .85s ease-out;
}

.detail-ending.is-purple {
  color: #9560b2;
}

.js footer {
  z-index: 4;
  background: rgba(7, 7, 8, .74);
}

footer {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

footer .footer-bottom {
  margin-top: auto;
  padding-top: 68px;
}

.js .reveal {
  opacity: 1;
}

.js .chapter {
  will-change: opacity, transform, filter;
  transform-origin: 50% 50%;
  pointer-events: none;
  transition: opacity .5s ease-out, transform .62s cubic-bezier(.2, .7, .2, 1), filter .56s ease-out;
}

.js .chapter.is-current {
  pointer-events: auto;
}

@media (max-width: 560px) {
  .scene {
    filter: brightness(.34) contrast(1.08) saturate(.72);
  }

  .cursor-smoke {
    display: none;
  }

  .architecture:after {
    background: linear-gradient(90deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .12)), linear-gradient(0deg, #070708, transparent 27%);
  }

  footer {
    justify-content: flex-start;
  }

  .js footer {
    overflow-y: auto;
  }

  footer .footer-bottom {
    padding-top: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-snap-type: none;
  }

  .cursor-smoke {
    display: none;
  }

  .scene {
    filter: brightness(.37) contrast(1.08) saturate(.72);
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }

  .js .chapter {
    position: relative;
    inset: auto;
    width: auto;
    height: auto;
    min-height: 100svh;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    pointer-events: auto;
    transition: none;
  }

  .js main {
    height: auto;
  }

  .js .lower {
    display: block;
  }

  .js .hero {
    height: 100svh;
  }
}
