/* Galeria espacial (gallery.js): as telas do app num carrossel 3D com
   reflexo no piso. --d é a distância ao centro (com sinal) e --a o módulo. */
/* As telas vizinhas e o piso passam da largura da página: corta na seção. */
#recursos {
  overflow-x: clip;
}
.shots.orbit {
  --w: 260px;
  --gap: 290px;
  position: relative;
  display: block;
  height: 620px;
  margin-top: 56px;
  perspective: 1400px;
  perspective-origin: 50% 35%;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
  outline: none;
}
.shots.orbit.dragging {
  cursor: grabbing;
}
.shots.orbit:focus-visible {
  box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.5);
  border-radius: 24px;
}
.orbit-stage {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease-out);
  pointer-events: none;
}
.shots.orbit figure:nth-child(n) {
  position: absolute;
  left: 50%;
  top: 8px;
  width: var(--w);
  margin: 0;
  transform: translateX(-50%) translateX(calc(var(--d, 0) * var(--gap)))
    translateZ(calc(var(--a, 0) * -240px)) rotateY(calc(var(--d, 0) * -34deg));
  opacity: clamp(0, calc(1.7 - var(--a, 0) * 0.85), 1);
  filter: brightness(calc(1.05 - var(--a, 0) * 0.4));
  transform-style: preserve-3d;
  will-change: transform, opacity;
  pointer-events: auto;
}
.shots.orbit figure.is-far {
  pointer-events: none;
}
.shots.orbit figcaption {
  display: none;
}
.shots.orbit img {
  pointer-events: none;
  -webkit-box-reflect: below 14px linear-gradient(transparent 72%, rgba(255, 255, 255, 0.22));
  transition: box-shadow 0.45s var(--ease-ui);
}
.shots.orbit figure:hover img {
  transform: none;
}
.shots.orbit figure.is-active img {
  box-shadow:
    0 0 0 1px rgba(0, 240, 255, 0.45),
    0 0 60px rgba(0, 240, 255, 0.18),
    0 30px 60px -20px rgba(0, 0, 0, 0.9);
  animation: drift 6s ease-in-out infinite;
}
@keyframes drift {
  50% {
    transform: translateY(-8px);
  }
}
.shots.orbit.dragging figure.is-active img {
  animation-play-state: paused;
}

/* Piso: poça de luz sob a tela ativa e grade em perspectiva. */
.orbit-floor {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(1000px, 140vw);
  height: 200px;
  transform: translateX(-50%);
  background: radial-gradient(50% 40% at 50% 30%, rgba(0, 240, 255, 0.2), transparent 70%);
  pointer-events: none;
}
.orbit-floor::before {
  content: "";
  position: absolute;
  inset: 0 -20%;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.16) 1px, transparent 1px);
  background-size: 44px 44px;
  background-position: 50% 0;
  transform: perspective(260px) rotateX(62deg);
  transform-origin: 50% 0;
  mask-image:
    radial-gradient(60% 70% at 50% 0%, #000, transparent), linear-gradient(transparent, #000 35%);
  mask-composite: intersect;
}

/* Controles: botões de vidro, contador, nome e pontos. */
.orbit-ui {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 4px;
}
.orbit-btn {
  position: relative;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: var(--text);
  font: 400 1.6rem/1 var(--body);
  background: rgba(140, 230, 255, 0.06);
  box-shadow:
    inset 0 1px 0 var(--edge-hi),
    inset 0 0 0 1px var(--edge);
  cursor: pointer;
  transition:
    background-color 0.2s ease-out,
    transform 0.2s ease-out;
}
.orbit-btn:hover {
  background: rgba(0, 240, 255, 0.12);
}
.orbit-btn:active {
  transform: scale(0.94);
}
.orbit-meta {
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 170px;
}
.orbit-count {
  font: 400 0.68rem/1 var(--mono);
  letter-spacing: 0.2em;
  color: var(--text-3);
}
.orbit-name {
  font: 700 1.15rem/1 var(--display);
  color: var(--text);
}
.orbit-dots {
  display: flex;
  gap: 8px;
}
.orbit-dots button {
  width: 8px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.22);
  cursor: pointer;
  transition:
    width 0.45s var(--ease-ui),
    background-color 0.2s ease-out;
}
.orbit-dots button[aria-current="true"] {
  width: 26px;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}
.orbit-hint {
  margin: 16px 0 0;
  text-align: center;
  font: 400 0.62rem/1 var(--mono);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-3);
}

@media (max-width: 900px) {
  .shots.orbit {
    --w: 230px;
    --gap: 240px;
    height: 560px;
  }
}
@media (max-width: 520px) {
  .shots.orbit {
    --w: 196px;
    --gap: 170px;
    height: 480px;
  }
  .orbit-ui {
    gap: 14px;
  }
}
