/* ===== GATE (opening screen) =====
   Client-built gate: a fixed overlay with two doors + a wax seal. Tap ANYWHERE on the gate -> doors swing open -> overlay fades -> the website starts.
   Sizes/positions are calculated by js/sections/gate.js from js/gate.config.js (that is the file to edit; add ?debug to the URL to see outlines).
   The gate is see-through: while the doors swing open you see the (completely still) hero behind them.
   Until the gate has fully opened AND vanished the page cannot scroll (html.gate-lock) and the hero intro has not started. */
html.gate-lock, html.gate-lock body { overflow: hidden; height: 100%; }

.gate, .gate * { box-sizing: border-box; }
.gate {
  --persp: 1100px; --persp-y: 50%;
  --sh-op: .3; --sh-blur: 7px; --sh-x: 5px; --sh-y: 9px;
  --seal-b: 1;

  position: fixed; top: 0; bottom: 0; left: 50%;
  width: var(--W);                              /* same phone-width column as the website */
  transform: translateX(-50%);
  container-type: size;
  z-index: 100;
  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;
}
.gate:not(.is-ready) { background: #071a30; }                  /* page navy while the door art loads (no flash) */
.gate:not(.is-ready) .gate__stage { visibility: hidden; }
.gate.is-open { cursor: default; }
.gate.is-gone { opacity: 0; pointer-events: none; visibility: hidden; transition: opacity var(--fade, .5s) ease, visibility 0s linear var(--fade, .5s); }

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

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

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

/* ---------- seal ---------- */
.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;
}
.seal:active { scale: .95; }
.seal:focus-visible { outline: 2px dashed rgba(212, 160, 40, .9); outline-offset: 4px; border-radius: 50%; }
.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));
}
.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: ping 2.6s cubic-bezier(.2, .6, .3, 1) infinite;
}
.gate.no-hint .seal__hint, .gate.is-open .seal__hint { display: none; }
@keyframes ping {
  0%   { transform: scale(.9);  opacity: 0; }
  20%  { opacity: .95; }
  100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .seal__hint { animation: none; opacity: .6; } }

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

/* ---------- "Tap to open" label under the seal (dark pill so it reads on the busy gold ornament) ---------- */
.seal__tap {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  margin-top: 3cqw; white-space: nowrap; pointer-events: none;
  font-family: var(--font-serif, Georgia, serif); font-weight: 600;
  font-size: 3.3cqw; letter-spacing: .26em; text-transform: uppercase; line-height: 1;
  padding: 1.7cqw 3.6cqw 1.7cqw calc(3.6cqw + .26em);
  color: #ffe9a8;
  background: rgba(8, 26, 66, .78);
  border: 1px solid rgba(255, 224, 140, .75);
  border-radius: 999px;
  box-shadow: 0 .8cqw 2cqw rgba(0, 10, 40, .45), 0 0 0 .5cqw rgba(8, 26, 66, .25);
  animation: tap-pulse 2.2s ease-in-out infinite;
  transition: opacity .25s ease;
}
.gate.is-open .seal__tap { opacity: 0; animation: none; }
@keyframes tap-pulse { 0%, 100% { opacity: .82; box-shadow: 0 .8cqw 2cqw rgba(0,10,40,.45), 0 0 0 0 rgba(255,224,140,0); } 50% { opacity: 1; box-shadow: 0 .8cqw 2cqw rgba(0,10,40,.45), 0 0 2.4cqw .4cqw rgba(255,224,140,.55); } }
@media (prefers-reduced-motion: reduce) { .seal__tap { animation: none; opacity: .95; } }
