/* Scroll depth only: keep the site's palette and original artwork filters. */
.parallax-control {
  position: absolute;
  top: 112px;
  right: 6vw;
  z-index: 7;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  min-height: 44px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  font: 10px/1.5 var(--mono);
  letter-spacing: 0.06em;
  cursor: pointer;
}
.parallax-control[hidden] {
  display: none;
}
.parallax-control span {
  color: var(--cyan);
}
.parallax-control:hover {
  color: var(--ink);
}

@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  /* Individual translate preserves the door/CV rotations and image hover transforms.
     The stage container and draggable figure never receive a transform. */
  .parallax-ready .parallax-layer {
    translate: 0 var(--parallax-y, 0px);
  }
  .parallax-ready [data-parallax-active] .parallax-layer {
    will-change: translate;
  }
  .parallax-ready .stage-video {
    top: -128px;
    height: calc(100% + 256px);
    pointer-events: none;
  }

  /* Move the image inside its stationary frame, never its text or link hitbox.
     76px overscan covers the capped 72px travel at either edge. */
  .parallax-ready [data-parallax-scene="image"] {
    position: relative;
    overflow: hidden;
    background-size: 0 0;
    background-repeat: no-repeat;
  }
  .parallax-ready [data-parallax-scene="image"]::before {
    content: "";
    position: absolute;
    inset: -76px 0;
    background-image: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    translate: 0 var(--parallax-y, 0px);
    pointer-events: none;
  }
  .parallax-ready [data-parallax-scene="image"][data-parallax-active]::before {
    will-change: translate;
  }
}

/* Layered door frames share the homepage's architectural collage vocabulary.
   Only CSS geometry scales; photographic cutouts remain at fixed sizes. */
section.cosmic-depth {
  position: relative;
  min-height: 100svh;
  padding: 0;
  border-top: 0;
  background: #08090a;
}
.cosmic-depth-sticky {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
}
.cosmic-depth-art {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #08090a;
  clip-path: inset(var(--depth-frame-y, 0) var(--depth-frame-x, 0));
}
.passage-frame {
  position: absolute;
  left: 64%;
  top: 50%;
  width: 42vw;
  height: 78vh;
  border: 24px solid #292725;
  border-right-color: #121313;
  border-bottom-color: #363330;
  box-shadow: inset 1px 0 #efeae245, 1px 0 #efeae230, 22px 22px 0 #0004;
  transform-origin: 50% 65%;
  pointer-events: none;
}
.passage-near { transform: translate(-50%, -50%) scale(var(--door-near, 1)); }
.passage-mid { width: 29vw; height: 60vh; border-width: 15px; border-color: #4b2623 #211817 #2e1e1c #78342d; transform: translate(-50%, -50%) scale(var(--door-mid, 1)); }
.passage-far { width: 19vw; height: 43vh; border-width: 9px; transform: translate(-50%, -50%) scale(var(--door-far, 1)); }
.passage-window { position: absolute; width: 19vw; height: 43vh; top: 28.5%; left: 54.5%; background: linear-gradient(155deg, #a6c7ce20, #08090a 75%); }
.passage-floor { position: absolute; inset: 70% -40% -80%; background: repeating-linear-gradient(90deg, transparent 0 119px, #efeae211 120px 121px), repeating-linear-gradient(0deg, #171616 0 119px, #efeae211 120px 121px); transform: perspective(450px) rotateX(65deg); transform-origin: center top; }
.passage-house { position: absolute; width: min(20vw, 300px); left: 56%; bottom: 22%; opacity: .7; transform: translateY(var(--cutout-y, 0)); }
.passage-ruin { position: absolute; width: min(32vw, 400px); right: 8%; bottom: 4%; transform: translateY(calc(var(--cutout-y, 0px) * -0.6)); }
.cosmic-depth-sticky::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, #08090aee 0%, #08090a70 28%, transparent 58%);
}
.cosmic-depth-content {
  position: relative;
  z-index: 2;
  width: min(1280px, 88vw);
  margin: auto;
  padding: 9vh 0;
  text-shadow: 0 2px 25px #08090a99;
}
.cosmic-depth-kicker {
  margin: 0 0 24px;
  color: var(--cyan);
  font: 10px/1.5 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.cosmic-depth-content h2 {
  max-width: 8em;
  margin: 0;
  font: normal clamp(82px, 10vw, 160px) / 0.89 var(--serif);
  letter-spacing: -0.075em;
  transform: translate3d(0, var(--depth-title-y, 0), 0);
}
.cosmic-depth-lead {
  max-width: 26em;
  margin: 28px 0 0;
  color: var(--ink);
  font-size: clamp(16px, 1.5vw, 21px);
}
.cosmic-depth-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px 34px;
  margin-top: 34px;
}
.cosmic-depth-links a {
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid var(--red);
  color: var(--ink);
  font-size: 12px;
  text-shadow: 0 2px 15px #08090a;
}
.cosmic-depth-links a:hover,
.cosmic-depth-links a:focus-visible {
  color: var(--cyan);
}
.cosmic-depth-links span {
  margin-left: 20px;
}
.cosmic-depth-track {
  position: absolute;
  z-index: 2;
  bottom: 8vh;
  left: 6vw;
  width: min(260px, 32vw);
  height: 1px;
  background: #efeae258;
}
.cosmic-depth-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--cyan);
  transform-origin: left;
  transform: scaleX(var(--depth-progress, 1));
}
.cosmic-depth-live .cosmic-depth {
  height: 280svh;
}
.cosmic-depth-live .cosmic-depth-sticky {
  position: sticky;
  top: 0;
  height: 100svh;
}
.cosmic-depth-live .cosmic-depth-content h2 {
  will-change: transform;
}
.cosmic-depth-live .cosmic-depth-links {
  opacity: calc(0.58 + 0.42 * var(--depth-links-opacity, 0));
  transform: translate3d(0, calc(26px * (1 - var(--depth-links-opacity, 0))), 0);
}
.cosmic-depth-live .cosmic-depth-links:focus-within {
  opacity: 1;
}

@media (max-width: 760px) {
  .cosmic-depth-live .cosmic-depth {
    height: 220svh;
  }
  .cosmic-depth-sticky::after {
    background: linear-gradient(90deg, #08090ad8, #08090a55 80%);
  }
  .cosmic-depth-content {
    width: calc(100% - 48px);
    padding-bottom: 15vh;
  }
  .passage-frame { left: 73%; width: 85vw; height: 65vh; }
  .passage-mid { width: 62vw; height: 50vh; }
  .passage-far { width: 39vw; height: 36vh; }
  .passage-window { left: 53.5%; top: 32%; width: 39vw; height: 36vh; }
  .passage-house { left: 55%; width: 150px; bottom: 30%; }
  .passage-ruin { width: 230px; right: -12%; bottom: 12%; }
  .cosmic-depth-content h2 {
    font-size: clamp(65px, 16vw, 92px);
  }
  .cosmic-depth-lead {
    max-width: 18em;
  }
  .cosmic-depth-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 28px;
  }
  .cosmic-depth-track {
    left: 24px;
    width: 38vw;
  }
}

@media (prefers-reduced-motion: reduce), print {
  .cosmic-depth-art,
  .cosmic-depth-content h2,
  .cosmic-depth-links,
  .cosmic-depth-track span {
    transform: none !important;
    clip-path: none !important;
  }
  .cosmic-depth-links {
    opacity: 1 !important;
  }
}

@media (max-width: 760px), (prefers-reduced-motion: reduce), print {
  .parallax-control {
    display: none;
  }
}
@media print {
  .parallax-ready .parallax-layer {
    translate: none;
  }
  .parallax-ready .stage-video {
    top: 0;
    height: 100%;
  }
  .parallax-ready [data-parallax-scene="image"] {
    background-size: cover;
  }
  .parallax-ready [data-parallax-scene="image"]::before {
    display: none;
  }
}
