/* Passage — a photo tunnel you glide through.
   The canvas is the tunnel; the list underneath is the same fourteen frames in
   a plain grid, and it is the only thing a reader with reduced motion (or no
   WebGL) ever sees. */
.b-passage {
  margin: 0;
}

.passage {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-tile);
  background: #08090a;
  cursor: grab;
  touch-action: pan-y;
  outline: none;
}
/* The tunnel needs a stage; the fallback grid must be free to grow. */
.passage.is-live {
  height: clamp(520px, 74vh, 860px);
}
.passage:focus-visible {
  outline: 1px solid var(--line-strong);
  outline-offset: 4px;
}
.passage.is-grabbing {
  cursor: grabbing;
}

.passage__stage {
  position: absolute;
  inset: 0;
}
.passage__stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.passage.is-loading .passage__stage::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 1px solid rgb(255 255 255 / 0.16);
  border-top-color: rgb(255 255 255 / 0.6);
  border-radius: 50%;
  animation: passage-spin 0.9s linear infinite;
}
@keyframes passage-spin {
  to { transform: rotate(360deg); }
}

.passage__hint {
  position: absolute;
  left: 16px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  gap: 16px;
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgb(255 255 255 / 0.38);
  pointer-events: none;
}

.passage__focus {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgb(6 7 8 / 0.86);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.passage__focus[hidden] {
  display: none;
}
.passage__focus.is-open {
  opacity: 1;
}
.passage__focus img {
  max-width: 92%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 24px 70px rgb(0 0 0 / 0.6);
  transform: scale(0.97);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.passage__focus.is-open img {
  transform: scale(1);
}
.passage__close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgb(255 255 255 / 0.18);
  border-radius: 50%;
  color: #fff;
  background: rgb(12 14 15 / 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
.passage__close:hover {
  border-color: rgb(255 255 255 / 0.4);
}

/* Progressive enhancement: the plain grid is the real content and is visible
   by default. Only once the tunnel is actually running does the list step back
   into the accessibility layer — so a script that never loads, or a browser
   without WebGL, still shows all fourteen frames instead of an empty box. */
.passage__list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
}
.passage__list li {
  list-style: none;
}
.passage__list img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-tile);
  background: #08090a;
}
.passage.is-live .passage__list {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
  display: block;
}

/* The fallback path: same frames, no canvas, no motion. The grid above is
   already visible; this only releases the fixed tunnel height. */
.passage.is-static {
  height: auto;
  background: none;
  cursor: default;
}
.passage.is-static .passage__hint {
  display: none;
}
.passage.is-static .passage__note {
  margin: 14px 0 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--text-3);
}

@media (max-width: 820px) {
  .passage.is-live {
    height: clamp(420px, 68vh, 640px);
  }
  .passage__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .passage__focus {
    transition: none;
  }
  .passage__focus img {
    transition: none;
    transform: none;
  }
}
