/* gate: first-visit boarding-pass swipe entrance (3D pass + card reader).
   The stage only exists while html.gate-on is set (decided inline in 00-gate.html before paint). */

.pass-stage { display: none; }

html.gate-on { overflow: hidden; }
html.gate-on body { overflow: hidden; }

/* Hold the page reveal until the gate lets the visitor in: removing html.gate-on restarts
   the shared reveal keyframes from frame 0, so the page plays its normal entrance. */
html.gate-on .reveal,
html.gate-on .path-curve,
html.gate-on .folio-path {
  animation: none;
  opacity: 0;
}

html.gate-on .pass-stage {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.pass-canvas-wrap {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s ease;
}
.pass-stage[data-state="ready"] .pass-canvas-wrap,
.pass-stage[data-state="reading"] .pass-canvas-wrap,
.pass-stage[data-state="error"] .pass-canvas-wrap,
.pass-stage[data-state="granted"] .pass-canvas-wrap { opacity: 1; }

.pass-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

/* Invisible DOM twins of the 3D pass and the reader slot: keyboard focus target and test hooks.
   Positioned every frame from the 3D scene. */
.pass-hit,
.pass-slot {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
}
.pass-hit:focus-visible {
  outline: 2px solid #1e9e52;
  outline-offset: 6px;
  border-radius: 10px;
}

.pass-hint {
  position: absolute;
  left: 50%;
  top: 684px;
  transform: translateX(-50%);
  margin: 0;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.05rem;
  line-height: 26px;
  letter-spacing: -.006em;
  color: #757575;
  opacity: 0;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .45s ease;
}
.pass-stage:not([data-state="loading"]) .pass-hint { opacity: .85; }
.pass-hint span {
  background-image: linear-gradient(90deg, #757575 0 42%, #060606 50%, #757575 58% 100%);
  background-size: 250% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pass-shimmer 2.2s linear infinite;
}
.pass-stage[data-state="granted"] .pass-hint span {
  background: none;
  color: #757575;
  animation: none;
}
@keyframes pass-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}

.pass-skip {
  position: absolute;
  right: 40px;
  bottom: 40px;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-weight: 500;
  font-size: .95rem;
  line-height: 1.25;
  letter-spacing: -.015em;
  color: #989898;
  cursor: pointer;
  transition: color .2s ease;
}
.pass-skip:hover { color: #6c6c6c; }

.pass-fade {
  position: absolute;
  inset: 0;
  background: var(--bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .7s ease;
}
.pass-stage.is-fading .pass-fade { opacity: 1; }

body.pass-grabbing,
body.pass-grabbing * { cursor: grabbing !important; }

@media (max-width: 768px) {
  .pass-hint { font-size: .95rem; }
  .pass-skip { font-size: .85rem; }
}
@media (max-width: 480px) {
  .pass-hint { font-size: .85rem; line-height: 21px; }
  .pass-skip { font-size: .8rem; }
}
@media (max-height: 500px) {
  .pass-hint { font-size: .85rem; line-height: 21px; }
}

[data-theme="dark"] .pass-hint { color: #8a8989; }
[data-theme="dark"] .pass-hint span {
  background-image: linear-gradient(90deg, #8a8989 0 42%, #f5f3f0 50%, #8a8989 58% 100%);
}
[data-theme="dark"] .pass-stage[data-state="granted"] .pass-hint span { color: #8a8989; }
[data-theme="dark"] .pass-skip { color: #767575; }
[data-theme="dark"] .pass-skip:hover { color: #9a9999; }

@media (prefers-reduced-motion: reduce) {
  .pass-hint span { animation: none; background: none; color: inherit; }
  .pass-fade, .pass-canvas-wrap, .pass-hint { transition-duration: .01s; }
}
