/* ---------- fotos em vidro 3D ---------- */
/* pan-y: a rolagem vertical continua nativa; o arrasto lateral inclina a foto */
.foto { touch-action: pan-y; outline: none; }
.foto:focus-visible .casca { box-shadow: 0 0 0 2px rgba(232, 181, 111, 0.7), 0 30px 60px -24px rgba(16, 6, 14, 0.85); }
.voo { transform-style: preserve-3d; }
.casca { transform-origin: 50% 50%; }

/* véu: deixa a foto um pouco apagada longe do centro e nítida no centro */
.veu {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 45%, rgba(14, 8, 16, 0.55), rgba(10, 6, 12, 0.85));
  opacity: 0;
}
.reflexo { transform: translateX(calc(var(--brilho-x, -30%) + var(--brilho-t, 0%))); }

/* ---------- tela cheia ---------- */
.tc {
  position: fixed;
  inset: 0;
  z-index: 60;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
.tc[hidden] { display: none; }
.tc-fundo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: rgba(9, 5, 10, 0.66);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
}
/* a própria foto, borrada, tinge o ambiente */
.tc-ambiente {
  position: absolute;
  inset: -15%;
  background: var(--blur) center / cover;
  opacity: 0.32;
  transform: scale(1.15);
  -webkit-mask-image: radial-gradient(70% 55% at 50% 38%, #000 30%, transparent 75%);
  mask-image: radial-gradient(70% 55% at 50% 38%, #000 30%, transparent 75%);
}
.tc-conteudo {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: calc(18px + var(--topo)) 20px calc(16px + var(--base));
}
.tc-alca {
  flex: none;
  width: 38px;
  height: 5px;
  border-radius: 99px;
  background: rgba(245, 237, 230, 0.32);
  margin-bottom: 14px;
}
.tc-voa { flex: none; transform-origin: 50% 50%; }
.tc-casca {
  position: relative;
  padding: 9px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.05) 40%, rgba(255, 255, 255, 0.02)),
    var(--blur) center / cover;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 40px 80px -30px rgba(12, 4, 10, 0.9),
    0 0 70px -20px rgba(232, 181, 111, 0.28);
  cursor: grab;
}
.tc-nucleo {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--blur) center / cover;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.tc-nucleo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
}
.tc-reflexo {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.12) 46%, transparent 60%);
  mix-blend-mode: screen;
  transform: translateX(calc(-8% + var(--brilho-t, 0%)));
}
.tc-painel {
  flex: 0 1 auto;
  min-height: 0;
  width: min(100%, 460px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 20px 22px 22px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 24px 50px -28px rgba(12, 4, 10, 0.9);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  -webkit-user-select: text;
  user-select: text;
}
.tc-painel[hidden] { display: none; }
.tc-data {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  font-variant-numeric: lining-nums;
  color: var(--dourado);
}
.tc-data[hidden] { display: none; }
.tc-texto p {
  margin: 0 0 0.9em;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--tinta);
  text-wrap: pretty;
}
.tc-texto p:last-child { margin-bottom: 0; }
.tc-fecha {
  position: absolute;
  top: calc(12px + var(--topo));
  right: calc(14px + env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--tinta);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(14px) saturate(180%);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  transition: transform var(--rapido) var(--curva);
}
.tc-fecha:active { transform: scale(0.94); }

@media (prefers-reduced-transparency: reduce) {
  .tc-fundo { backdrop-filter: none; -webkit-backdrop-filter: none; background: rgba(9, 5, 10, 0.96); }
  .tc-painel, .tc-fecha { backdrop-filter: none; -webkit-backdrop-filter: none; background: #1d1519; }
}

/* ================================================================
   Vidro estilo Apple (ticket 12): a foto paira, o aro tem espessura
   e um brilho especular, e a sombra respira embaixo. Só transform/opacity.
   ================================================================ */
.voo { position: relative; }
.flutua {
  transform-style: preserve-3d;
  animation: ft-flutua 9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  animation-play-state: paused;
}
.sombra {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -30px;
  height: 44px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(closest-side, rgba(10, 3, 9, 0.62), rgba(10, 3, 9, 0.28) 55%, rgba(10, 3, 9, 0));
  animation: ft-sombra 9s cubic-bezier(0.45, 0, 0.55, 1) infinite;
  animation-play-state: paused;
}
.foto.no-ar .flutua, .foto.no-ar .sombra { animation-play-state: running; }
@keyframes ft-flutua {
  0%, 100% { transform: translate3d(0, -7px, 0) rotateX(1.6deg) rotateY(-1.2deg) rotateZ(-0.35deg); }
  50% { transform: translate3d(0, 6px, 0) rotateX(-1.4deg) rotateY(1.2deg) rotateZ(0.35deg); }
}
/* quando a foto sobe, a sombra se afasta (menor e mais clara) */
@keyframes ft-sombra {
  0%, 100% { transform: translate3d(0, 10px, 0) scale(0.84, 0.8); opacity: 0.5; }
  50% { transform: translate3d(0, 0, 0) scale(1.02, 1); opacity: 1; }
}

/* aro de vidro: anel do tamanho da moldura (máscara estática) */
.aresta {
  position: absolute;
  inset: 0;
  border-radius: 26px;
  padding: 9px;
  pointer-events: none;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.06) 26%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0.05) 74%, rgba(255, 255, 255, 0.22));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 -1px 0 rgba(255, 255, 255, 0.12),
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    inset -1px 0 0 rgba(255, 255, 255, 0.08);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
}
.aresta-giro { position: absolute; inset: 0; }
.aresta-luz {
  position: absolute;
  left: 20%;
  top: -35%;
  width: 60%;
  height: 170%;
  background: radial-gradient(closest-side, rgba(255, 252, 245, 0.95), rgba(255, 236, 210, 0.35) 45%, rgba(255, 236, 210, 0));
}
/* a borda interna do aro refrata: linha clara fina em volta da foto */
.nucleo::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14), inset 0 10px 18px -12px rgba(255, 255, 255, 0.35), inset 0 -14px 22px -16px rgba(10, 3, 9, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .flutua, .sombra { animation: none; }
}

/* fotos fora da tela não recebem toque: no 3D a projeção delas pode cobrir a tela inteira */
.foto:not(.no-ar), .foto:not(.no-ar) * { pointer-events: none !important; }

/* desempenho: longe da tela (fotos.js, > 1 tela de distância) não pinta nem vira camada */
.foto.longe > * { visibility: hidden; }
