/* Portfólio — pilha de cards (desktop) / cover flow vertical (mobile).
   Posição, escala, blur e opacidade de cada card são calculados em js/work.js a cada frame
   (somente transform/opacity/filter, tudo na GPU). */
.work { position: relative; background: var(--white); }
.work__pin { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding: 88px 0 40px; overflow: hidden; }
.work__grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(24px, 5vw, 72px); align-items: center; }

.work__text { max-width: 440px; }
.work__title {
  font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; color: var(--blue);
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; margin: 12px 0 0; padding-bottom: 16px;
  border-bottom: 2px solid rgba(0, 204, 255, 0.55);
}
.work__desc { margin-top: 20px; color: var(--muted); min-height: 4.6em; }
.work__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; min-height: 2em; }
.work__tags li { font-size: 0.78rem; font-family: var(--display); font-weight: 700; color: var(--blue); padding: 5px 12px; border-radius: 999px; border: 1.5px solid rgba(15, 90, 140, 0.3); }
.work__actions { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 28px; }
.work__ctrl { display: flex; align-items: center; gap: 12px; font-family: var(--display); font-weight: 700; font-size: 0.85rem; color: var(--blue); }
.work__ctrl button {
  width: 42px; height: 42px; border-radius: 50%; border: 1.5px solid var(--blue); background: #fff; color: var(--blue);
  font-size: 1.1rem; cursor: pointer; transition: background 0.3s, color 0.3s, transform 0.3s var(--ease);
}
.work__ctrl button:hover { background: var(--blue); color: #fff; transform: scale(1.08); }

/* Palco: perspectiva 3D; cada card é posicionado absoluto no centro e movido via transform */
.work__stage-wrap { position: relative; min-width: 0; }
.work__hint { text-align: center; margin-top: 10px; font-size: 0.78rem; letter-spacing: 0.04em; color: var(--muted); }
.hint--m { display: none; }
.work__stage { touch-action: pan-y; cursor: grab; position: relative; height: clamp(320px, 52vh, 520px); perspective: 1400px; transform-style: preserve-3d; }
.wcard {
  position: absolute; left: 50%; top: 50%; width: var(--cw, 560px); aspect-ratio: 16 / 10;
  border-radius: 20px; overflow: hidden; background: #fff; display: block;
  box-shadow: 0 30px 60px -28px rgba(4, 28, 60, 0.55), 0 0 0 1px rgba(15, 90, 140, 0.12);
  will-change: transform, opacity, filter; backface-visibility: hidden; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.wcard img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.wcard.is-front { cursor: pointer; }

@media (max-width: 760px) {
  .work__pin { align-items: flex-start; padding-top: 76px; }
  .work__grid { grid-template-columns: 1fr; gap: 12px; }
  .work__stage-wrap { order: -1; }
  .work__stage { height: min(46vh, 400px); }
  .hint--d { display: none; }
  .hint--m { display: inline; }
  .wcard { aspect-ratio: 3 / 4; border-radius: 16px; }
  .work__text { max-width: none; text-align: left; }
  .work__title { font-size: 1.7rem; padding-bottom: 10px; }
  .work__desc { min-height: 4.2em; margin-top: 12px; font-size: 0.95rem; }
  .work__tags { margin-top: 10px; }
  .work__actions { margin-top: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .wcard { will-change: auto; }
}
