/* The portal room: door, hero, the walk through the ring, the fork, the stops.
   The stage is a sticky canvas; everything on it is drawn in three.js. */

/* ---------- the door (the lead's markup; the world renders behind it) ---------- */
.door {
  background:
    radial-gradient(ellipse 70% 60% at 50% 52%, rgba(5, 4, 9, 0.42) 0%, rgba(5, 4, 9, 0.7) 55%, rgba(5, 4, 9, 0.92) 100%);
  transition: opacity 1s cubic-bezier(.4, 0, .2, 1) 0.2s, visibility 1s 0.2s;
}
.door__go { gap: 18px; padding: 48px 32px; }
.door__mark { width: min(56vw, 250px); transition: transform 0.5s cubic-bezier(.2, .7, .1, 1); }
.door__go:hover .door__mark { transform: scale(1.03); }
.door__line { font-weight: 700; font-size: clamp(20px, 2.6vw, 30px); letter-spacing: -0.005em; color: var(--ink); margin-top: 6px; }
.door__hint { font-size: 12px; font-weight: 500; color: var(--ink-2); display: inline-flex; align-items: center; gap: 12px; }
.door__hint::before { content: ''; width: 28px; height: 2px; background: var(--fire); }
.door__go:focus-visible { outline: 2px solid var(--portal); outline-offset: -8px; }

.pt-flymark { position: fixed; z-index: 70; margin: 0; transform-origin: 0 0; pointer-events: none; will-change: transform; }

/* ---------- stage ---------- */
/* two moves, two sticky runs: the walk and the fork, then the warp out. The
   second overlaps the first by a screen, so it pins as the first lets go. */
#portal { background: #030207; }
#portal .pt-run { position: relative; }
#portal .pt-run--a { height: calc(100vh * var(--pt-a, 2.14)); height: calc(100lvh * var(--pt-a, 2.14)); }
#portal .pt-run--b { height: calc(100vh * var(--pt-b, 2.08)); height: calc(100lvh * var(--pt-b, 2.08)); margin-top: -100vh; margin-top: -100lvh; }
#portal .pt-frame { position: absolute; inset: 0; }
#portal .pt-stage { position: sticky; top: 0; height: 100vh; height: 100lvh; overflow: hidden; }
/* the warp-out stage overlaps the fork by a screen and stays empty until the
   frame moves into it; empty, it must not swallow taps on the doorways */
#portal .pt-run--b { pointer-events: none; }
#portal .pt-run--b .pt-stage:not(:empty) { pointer-events: auto; }
#portal .pt-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; }
#portal .pt-ui { position: absolute; left: 0; right: 0; top: 0; height: 100vh; height: 100svh; pointer-events: none; }

/* ---------- hero: the mark, one line, one button ---------- */
#portal .pt-hero {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
  padding: 0 var(--pad); gap: 26px;
  opacity: calc(1 - var(--out, 0)); transform: translateY(calc(var(--out, 0) * -60px));
}
#portal .pt-hero.is-gone { visibility: hidden; }
#portal .pt-mark { width: clamp(220px, 23vw, 330px); height: auto; visibility: hidden; margin-left: -12px; }
#portal .pt-hero__foot { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; }
#portal .pt-line {
  margin: 0; font-family: var(--display); font-weight: 900; font-size: clamp(30px, 3.6vw, 54px); line-height: 1.02; letter-spacing: -0.01em; text-transform: uppercase;
  color: var(--ink); max-width: 12ch;
  opacity: 0; transform: translateY(14px); transition: opacity 0.8s ease 1.05s, transform 0.9s cubic-bezier(.2, .7, .1, 1) 1.05s;
}
#portal .pt-walk { pointer-events: auto; opacity: 0; transform: translateY(14px); transition: opacity 0.8s ease 1.3s, transform 0.9s cubic-bezier(.2, .7, .1, 1) 1.3s, background-color 0.2s; }
#portal.is-entered .pt-line, #portal.is-entered .pt-walk { opacity: 1; transform: none; }
#portal .pt-hero.is-gone .pt-walk { pointer-events: none; }

/* ---------- the fork: each night's label, under its flyer ---------- */
#portal .pt-fork { position: absolute; inset: 0; opacity: var(--on, 0); visibility: hidden; }
#portal .pt-fork.is-shown { visibility: visible; }
#portal .pt-night {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; gap: 6px;
  min-width: 44px; min-height: 44px; padding: 10px 14px 12px; border: 0; background: transparent; cursor: pointer; text-align: center;
  color: var(--ink); pointer-events: none;
}
#portal .pt-fork.is-on .pt-night { pointer-events: auto; }
#portal .pt-night__name { font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(22px, 2.3vw, 34px); line-height: 1; letter-spacing: -0.015em; white-space: nowrap; }
#portal .pt-night__when { font-weight: 600; font-size: 16px; color: var(--ink-2); white-space: nowrap; }
#portal .pt-night::after { content: ''; width: 0; height: 3px; background: var(--portal); transition: width 0.35s cubic-bezier(.2, .7, .1, 1); margin-top: 6px; }
#portal .pt-night.is-lit::after { width: 64px; }
#portal .pt-night.is-lit .pt-night__when { color: var(--ink); }
#portal .pt-night:focus-visible { outline: 2px solid var(--portal); outline-offset: 2px; }

/* ---------- a night's stop ---------- */
#portal .pt-stop {
  position: absolute; inset: 0; display: flex; align-items: center; padding: 0 var(--pad);
  opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0.5s;
}
#portal .pt-stop.is-on { opacity: 1; visibility: visible; }
#portal .pt-stop__card {
  pointer-events: auto; width: min(460px, 100%); display: flex; flex-direction: column; gap: 14px;
  transform: translateY(18px); transition: transform 0.7s cubic-bezier(.2, .7, .1, 1);
}
#portal .pt-stop.is-on .pt-stop__card { transform: none; }
#portal .pt-stop__name { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; font-size: clamp(34px, 4vw, 58px); line-height: 0.98; letter-spacing: -0.025em; color: var(--ink); }
#portal .pt-stop__when { margin: 0; font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--flame); }
#portal .pt-stop__where { margin: 0 0 6px; font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); }
#portal .pt-tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
#portal .pt-tiers li {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 48px; padding: 0 18px;
  background: rgba(6, 5, 10, 0.78); border-left: 3px solid var(--fire);
}
#portal .pt-tiers span { font-weight: 600; font-size: 16px; color: var(--ink); }
#portal .pt-tiers b { font-family: var(--display); font-weight: 700; font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
#portal .pt-stop__go { display: flex; gap: 10px; margin-top: 8px; }
#portal .pt-stop__go .zp-cta { flex: 1; }
#portal .pt-back {
  min-height: 52px; min-width: 104px; padding: 0 22px; border: 0; background: rgba(6, 5, 10, 0.78); color: var(--ink); cursor: pointer;
  font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  transition: background-color 0.2s;
}
#portal .pt-back:hover { background: rgba(30, 26, 40, 0.9); }
#portal .pt-back:focus-visible { outline: 2px solid var(--portal); outline-offset: 3px; }

/* ---------- phones ---------- */
@media (max-width: 759px) {
  #portal .pt-hero { justify-content: space-between; align-items: center; padding: 64px 20px calc(44px + env(safe-area-inset-bottom)); text-align: center; }
  #portal .pt-mark { width: min(54vw, 220px); margin: 0; }
  #portal .pt-hero__foot { align-items: center; gap: 20px; }
  #portal .pt-line { font-size: 32px; max-width: none; }
  #portal .pt-night { padding: 6px 10px 8px; gap: 4px; }
  #portal .pt-night__name { font-size: 22px; }
  #portal .pt-night__when { font-size: 15px; }
  #portal .pt-night::after { margin-top: 4px; }
  #portal .pt-stop { align-items: flex-end; padding: 0 16px calc(20px + env(safe-area-inset-bottom)); }
  #portal .pt-stop__card { width: 100%; gap: 10px; }
  #portal .pt-stop__name { font-size: 34px; }
  #portal .pt-stop__when { font-size: 16px; }
  #portal .pt-stop__where { font-size: 15px; margin: 0; }
  #portal .pt-tiers li { min-height: 44px; padding: 0 14px; }
  #portal .pt-tiers span { font-size: 15px; }
  #portal .pt-tiers b { font-size: 16px; }
  #portal .pt-stop__go { margin-top: 4px; margin-right: 56px; }
}

@media (prefers-reduced-motion: reduce) {
  #portal .pt-mark { visibility: visible; }
  #portal .pt-hero { transform: none; }
  #portal .pt-line, #portal .pt-walk { transition-delay: 0s; }
}

/* a touch leaves no hover behind */
@media (hover: none) {
  #portal .zp-cta:hover { background: var(--fire); }
  #portal .pt-back:hover { background: rgba(6, 5, 10, 0.78); }
}

/* the stop's card sits in the dark side of its world: a scrim from that edge */
#portal .pt-stop::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(4, 6, 8, 0.72) 0%, rgba(4, 6, 8, 0.45) 34%, rgba(4, 6, 8, 0) 58%); pointer-events: none; }
#portal .pt-stop__card { position: relative; }
@media (max-width: 759px) {
  #portal .pt-stop::before { background: linear-gradient(0deg, rgba(4, 6, 8, 0.82) 0%, rgba(4, 6, 8, 0.6) 48%, rgba(4, 6, 8, 0) 66%); }
}
