/* ============================================
   FORGE.ARK — CAPA DE MOVIMIENTO
   Se carga DESPUÉS de style.css.
   No modifica nada del diseño, solo lo anima.
   ============================================ */

/* ---- 1. BARRA DE PROGRESO DE SCROLL ---- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, #6b6b6b, #e8c558);
  z-index: 200;
  pointer-events: none;
}

/* ---- 2. NAV QUE SE ENCOGE ---- */
.nav {
  transition: padding 0.35s ease, background 0.35s ease, backdrop-filter 0.35s ease;
}

.nav.shrunk {
  padding: 0.7rem 3rem;
  background: rgba(10, 10, 10, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---- 3. HERO: LA CÁMARA EMPUJA HACIA DENTRO ---- */
.hero {
  min-height: 100vh;
}

/* Anulamos el zoom por :hover del style.css: ahora lo manda el scroll */
.hero-bg {
  transition: none !important;
  transform: scale(1.05);
  will-change: transform;
}

.hero:hover .hero-bg {
  transform: scale(1.05); /* neutraliza la regla antigua */
}

.hero-content {
  will-change: transform, opacity;
}

/* ---- 4. SECCIÓN ZOOM CINEMÁTICO (la que te atraviesa) ---- */
.zoom-stage {
  height: 260vh;           /* altura de "pista" para el efecto */
  position: relative;
  background: #0a0a0a;
}

.zoom-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-bg {
  position: absolute;
  inset: -6%;
  background-image: url('https://images.unsplash.com/photo-1534438327276-14e5300c3a48?w=1600&q=80');
  background-size: cover;
  background-position: center;
  filter: brightness(0.12);
  transform: scale(1.25);
  will-change: transform, filter;
}

.zoom-veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, #0a0a0a 85%);
  pointer-events: none;
}

.zoom-word {
  position: relative;
  z-index: 2;
  font-size: clamp(48px, 11vw, 150px);
  font-weight: 300;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: #ffffff;
  text-transform: uppercase;
  white-space: nowrap;
  will-change: transform, opacity;
  transform-origin: center center;
}

.zoom-payoff {
  position: absolute;
  z-index: 3;
  text-align: center;
  max-width: 720px;
  padding: 0 2rem;
  opacity: 0;
  will-change: opacity, transform;
}

.zoom-payoff h2 {
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 300;
  color: #eaeef4;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.zoom-payoff p {
  font-size: 13px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #6b6b6b;
}

/* ---- 5. ENTRADAS CON ZOOM (sustituyen al simple "sube y aparece") ---- */
[data-anim] {
  opacity: 0;
  will-change: transform, opacity;
  transition:
    opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1),
    transform 1.1s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.9s ease;
}

[data-anim="zoom"]      { transform: scale(0.86) translateY(40px); filter: blur(6px); }
[data-anim="rise"]      { transform: translateY(60px); }
[data-anim="from-left"] { transform: translateX(-60px) scale(0.96); }
[data-anim="from-right"]{ transform: translateX(60px) scale(0.96); }

[data-anim].in {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* ---- 6. TARJETAS: PARALLAX INTERNO + INCLINACIÓN 3D ---- */
.services-grid {
  perspective: 1100px;
}

.service-card {
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateZ(0);
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s;
}

.service-img {
  /* La imagen ya no usa "transform" directo: usa variables.
     Así el parallax (--py) y el hover (--sc) conviven sin pelearse. */
  transform: translateY(var(--py, 0px)) scale(var(--sc, 1.12));
  transition: filter 0.4s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.service-card:hover .service-img {
  --sc: 1.2;
  filter: brightness(0.7);
}

/* ---- 7. CABECERAS DE SECCIÓN QUE SE ACERCAN ---- */
.section-header h2 {
  transition: letter-spacing 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.section-header.in h2 {
  letter-spacing: 1px;
}

/* ---- 8. STATS: LATIDO AL ENTRAR ---- */
.stat.in .stat-num {
  animation: forge-pop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes forge-pop {
  0%   { transform: scale(0.7); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

.stat-num { display: inline-block; }

/* ---- 9. RESPONSIVE ---- */
@media (max-width: 900px) {
  .zoom-stage { height: 200vh; }
  .service-card { transform: none !important; }
  .nav.shrunk { padding: 0.7rem 1.5rem; }
}

/* ---- 10. ACCESIBILIDAD: si el usuario pide menos movimiento, se apaga todo ---- */
@media (prefers-reduced-motion: reduce) {
  [data-anim] { opacity: 1 !important; transform: none !important; filter: none !important; }
  .zoom-stage { height: auto; }
  .zoom-sticky { position: relative; height: 60vh; }
  .zoom-word { transform: none !important; opacity: 1 !important; }
  .zoom-payoff { opacity: 1 !important; position: relative; }
  .hero-bg, .service-img { transform: none !important; }
}
