/* ==========================================================
   GATE
   ========================================================== */
.s0-gate {
  --persp: 1100px; --persp-y: 50%;
  --sh-op: .3; --sh-blur: 7px; --sh-x: 5px; --sh-y: 9px;
  --seal-b: 1;
  --s0-col: var(--stage-max, 520px);   /* same width as the site column */

  position: fixed; top: 0; bottom: 0; left: 50%;
  width: min(100vw, var(--s0-col));
  transform: translateX(-50%);
  container-type: size;
  z-index: 1000;
  overflow: hidden;
  touch-action: none;
  user-select: none; -webkit-user-select: none;
  cursor: pointer;                              /* the whole gate is the tap target */
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--fade, .5s) ease;
}
.s0-gate.is-open { cursor: default; }
.s0-gate:not(.is-ready) { visibility: hidden; }
.s0-gate.is-gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity var(--fade, .5s) ease, visibility 0s linear var(--fade, .5s); }

.s0-gate__stage {
  position: absolute; inset: 0;
  perspective: var(--persp);
  perspective-origin: 50% var(--persp-y);
}

/* ---------- panels (size/position set inline by script.js) ---------- */
.s0-panel { position: absolute; will-change: transform; }
.s0-panel img {
  position: absolute; display: block; max-width: none;
  pointer-events: none; -webkit-user-drag: none;
}
.s0-panel--left  { z-index: 1; }
.s0-panel--right { z-index: 2; }

.s0-panel__shadow {
  filter: brightness(0) blur(var(--sh-blur));
  opacity: var(--sh-op);
}
.s0-panel__shade { opacity: 0; }
.s0-panel__shade--dark  { filter: brightness(0); }
.s0-panel__shade--light { filter: brightness(0) invert(1); }

/* ---------- seal ---------- */
.s0-seal {
  position: absolute; z-index: 6;
  padding: 0; margin: 0; border: 0; background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: scale .2s ease;
}
.s0-seal:active { scale: .95; }
.s0-seal:focus-visible { outline: 2px dashed rgba(212, 160, 40, .9); outline-offset: 4px; border-radius: 50%; }
.s0-seal__img {
  position: absolute; display: block; max-width: none; pointer-events: none;
  filter: brightness(var(--seal-b)) drop-shadow(0 .9cqw 1.1cqw rgba(10, 20, 50, .45));
}
.s0-seal__hint {
  position: absolute; inset: 9%; border-radius: 50%; pointer-events: none;
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 0 0 1px rgba(10, 20, 50, .2);
  animation: s0-ping 2.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.s0-gate.no-hint .s0-seal__hint, .s0-gate.is-open .s0-seal__hint { display: none; }
@keyframes s0-ping {
  0%   { transform: scale(.9);  opacity: 0; }
  20%  { opacity: .95; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .s0-seal__hint { animation: none; opacity: .6; } }

/* ---------- ?debug outlines ---------- */
.s0-gate.debug .s0-panel { outline: 1px dashed #f0f; }
.s0-gate.debug .s0-panel--right { outline-color: #0aa; }
.s0-gate.debug .s0-seal  { outline: 1px dashed #f80; }

/* ---------- page lock while the gate is closed / opening ---------- */
html.s0-lock, html.s0-lock body { overflow: hidden; height: 100%; overscroll-behavior: none; }

/* ---------- "Tap to open" label (rides on the right door with the seal, so it swings away with it) ---------- */
.s0-seal__tap {
  position: absolute; left: 50%; top: 100%;
  transform: translateX(-50%);
  margin-top: 3cqw;
  white-space: nowrap; pointer-events: none;
  padding: 1.6cqw 4.2cqw 1.6cqw 4.6cqw;
  border-radius: 99px;
  background: rgba(34, 14, 2, .62);
  border: 1px solid rgba(240, 196, 72, .85);
  box-shadow: 0 0 14px rgba(240, 196, 72, .35), 0 2px 8px rgba(0, 0, 0, .45);
  font-family: var(--font-title);
  font-size: 3.9cqw; letter-spacing: .3em; text-transform: uppercase;
  color: #ffe9a8;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
  animation: s0-tap 2.2s ease-in-out infinite;
  transition: opacity .25s ease;
}
.s0-gate.is-open .s0-seal__tap { opacity: 0; animation: none; }
@keyframes s0-tap { 0%, 100% { opacity: .82; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .s0-seal__tap { animation: none; } }
