.threshold {
  position: relative;
  min-height: 100svh;
  height: 100svh;
  overflow: hidden;
  color: var(--color-paper);
  isolation: isolate;
}

.threshold__stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

/* Full-bleed from the start — portal clip only used on scroll exit */
.threshold__aperture {
  position: absolute;
  inset: 0;
  clip-path: inset(0% 0% 0% 0%);
  transform: scale(1);
  will-change: clip-path, transform;
  opacity: 1;
}

.threshold__room {
  position: absolute;
  inset: -3%;
  transform: scale(1.1);
  transform-origin: 62% 40%;
  will-change: transform, filter;
  /* Cool, veiled arrival grade — light-as-time warms this */
  filter: brightness(0.86) contrast(0.92) saturate(0.82) sepia(0.04);
}

.threshold__picture,
.threshold__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 42%;
}

/* Fixed-direction ambient — never travels as a sweep */
.threshold__daylight {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse 70% 60% at 72% 38%,
    rgba(255, 214, 170, 0.22) 0%,
    rgba(255, 200, 150, 0.08) 42%,
    rgba(255, 200, 150, 0) 72%
  );
  mix-blend-mode: soft-light;
  opacity: 0;
  will-change: opacity;
}

/* Dual occlusion panels — the crossing */
.threshold__veil {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  opacity: 0;
}

.threshold__veil-panel {
  position: relative;
  flex: 0 0 45.5%;
  height: 100%;
  overflow: hidden;
  background: var(--color-canvas);
  will-change: transform, filter, opacity;
  box-shadow: inset 0 0 0 1px rgba(39, 33, 29, 0.06);
}

.threshold__veil-panel img {
  width: 140%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  mix-blend-mode: multiply;
  filter: contrast(0.95) brightness(1.06);
}

.threshold__veil-panel--left img {
  object-position: 100% center;
  margin-left: -10%;
}

.threshold__veil-panel--right img {
  object-position: 0% center;
}

.threshold__jamb {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(39, 33, 29, 0.28);
}

.threshold__veil-panel--left .threshold__jamb {
  right: 0;
}

.threshold__veil-panel--right .threshold__jamb {
  left: 0;
}

/* Narrow central gap — pressure before release */
.threshold__veil-panel--left {
  transform: translateX(4%);
}

.threshold__veil-panel--right {
  transform: translateX(-4%);
}

/* Type */
.threshold__type {
  position: relative;
  z-index: 3;
  min-height: 100svh;
  pointer-events: none;
}

.threshold__type > * {
  pointer-events: auto;
}

.threshold__wordmark {
  position: absolute;
  left: var(--content-pad);
  top: 18%;
  margin: 0;
  max-width: 11ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--type-display-xl);
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--color-charcoal);
  opacity: 0;
  isolation: isolate;
  text-shadow:
    0 0 14px rgba(250, 248, 244, 0.85),
    0 0 34px rgba(250, 248, 244, 0.55),
    0 1px 2px rgba(39, 33, 29, 0.18);
}

.threshold__wordmark::before {
  content: "";
  position: absolute;
  inset: -0.08em -0.25em;
  z-index: -1;
  border-radius: 3px;
  backdrop-filter: blur(2.5px) brightness(1.03);
  -webkit-backdrop-filter: blur(2.5px) brightness(1.03);
  background: rgba(250, 248, 244, 0.22);
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
  pointer-events: none;
}

.threshold.is-type-visible .threshold__wordmark::before {
  opacity: 1;
}

.threshold.is-exiting .threshold__wordmark,
.threshold.is-exiting .threshold__statement,
.threshold.is-exiting .threshold__enter {
  color: var(--color-charcoal);
}

.threshold__wordmark-line {
  display: block;
  overflow: hidden;
}

.threshold__wordmark-inner {
  display: block;
}

.threshold__statement {
  position: absolute;
  right: var(--content-pad);
  bottom: 28%;
  margin: 0;
  max-width: 14ch;
  text-align: right;
  font-family: var(--font-display);
  font-weight: 400;
  font-style: italic;
  font-size: var(--type-statement);
  line-height: 1.35;
  letter-spacing: 0.01em;
  color: var(--color-charcoal);
  opacity: 0;
  isolation: isolate;
  text-shadow:
    0 0 12px rgba(250, 248, 244, 0.8),
    0 0 28px rgba(250, 248, 244, 0.5),
    0 1px 2px rgba(39, 33, 29, 0.16);
}

.threshold__statement::before {
  content: "";
  position: absolute;
  inset: -0.2em -0.35em;
  z-index: -1;
  border-radius: 3px;
  backdrop-filter: blur(2.5px) brightness(1.03);
  -webkit-backdrop-filter: blur(2.5px) brightness(1.03);
  background: rgba(250, 248, 244, 0.22);
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
  pointer-events: none;
}

.threshold.is-type-visible .threshold__statement::before {
  opacity: 1;
}

.threshold__statement .statement-line {
  display: block;
  overflow: hidden;
}

.threshold__statement .statement-inner {
  display: block;
}

/* Architectural threshold marker — not a CTA button */
.threshold__enter {
  position: absolute;
  left: var(--content-pad);
  bottom: clamp(2rem, 6vh, 4rem);
  appearance: none;
  border: 0;
  background: transparent;
  padding: 1.1rem 1.25rem 1.1rem 0;
  min-height: 44px;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  color: var(--color-charcoal);
  cursor: pointer;
  opacity: 0;
  isolation: isolate;
  text-shadow:
    0 0 10px rgba(250, 248, 244, 0.75),
    0 0 22px rgba(250, 248, 244, 0.45);
}

.threshold__enter::before {
  content: "";
  position: absolute;
  inset: -0.3em -0.4em;
  z-index: -1;
  border-radius: 3px;
  backdrop-filter: blur(2.5px) brightness(1.03);
  -webkit-backdrop-filter: blur(2.5px) brightness(1.03);
  background: rgba(250, 248, 244, 0.22);
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
  pointer-events: none;
}

.threshold.is-type-visible .threshold__enter::before {
  opacity: 1;
}

.threshold__enter-mark {
  position: relative;
  display: block;
  width: 3.25rem;
  height: 0.75rem;
}

.threshold__enter-sill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: var(--color-charcoal);
  opacity: 0.75;
  transform: translateY(-50%);
}

.threshold__enter-tick {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: var(--color-charcoal);
  opacity: 0.85;
  transform-origin: top center;
  transition: height 0.45s var(--ease-out);
}

.threshold__enter-label {
  font-family: var(--font-sans);
  font-size: var(--type-label);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 400;
}

.threshold__enter:hover .threshold__enter-tick,
.threshold__enter:focus-visible .threshold__enter-tick {
  height: 1.15rem;
}

.threshold__enter:focus-visible {
  outline: 1px solid var(--color-bronze);
  outline-offset: 6px;
}

.threshold__noscript {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.threshold__noscript img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 1024px) {
  .threshold__wordmark {
    top: 14%;
    max-width: 10ch;
  }

  .threshold__statement {
    right: auto;
    left: var(--content-pad);
    bottom: 26%;
    text-align: left;
  }
}

@media (max-width: 767px) {
  .threshold__room {
    transform-origin: center 35%;
  }

  .threshold__img {
    object-position: center 35%;
  }

  .threshold__veil-panel--left {
    transform: translateX(3%);
  }

  .threshold__veil-panel--right {
    transform: translateX(-3%);
  }

  .threshold__wordmark {
    top: clamp(1.5rem, 8vh, 3rem);
    font-size: clamp(2.75rem, 14vw, 4.6rem);
    max-width: 9ch;
  }

  .threshold__statement {
    bottom: 22%;
    max-width: 12ch;
  }
}

.no-js .vestibule {
  display: none;
}

.no-js .threshold__veil {
  display: none;
}

.no-js .threshold__aperture {
  clip-path: none;
  transform: none;
  opacity: 1;
}

.no-js .threshold__room {
  transform: none;
  filter: brightness(1) contrast(1) saturate(1);
  inset: 0;
}

.no-js .threshold__daylight {
  opacity: 0.28;
}

.no-js .threshold__wordmark,
.no-js .threshold__statement,
.no-js .threshold__enter {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .threshold__veil {
    display: none;
  }

  .threshold__room {
    transform: none;
    filter: brightness(1) contrast(1) saturate(1);
  }

  .threshold__wordmark,
  .threshold__statement,
  .threshold__enter {
    opacity: 1;
  }
}
