/* ============================================
   HERO CON RIQUADRO CINEMATOGRAFICO AUTOMATICO
   Loop: poster 6x3 (zoom auto) → maxi affissione
   → stazione con totem digitale → ricomincia
   ============================================ */

.hero-auto {
  /* lo sfondo tecnologico (aurora + griglia) è sul body */
  position: relative;
  background: transparent;
  color: #fff;
  padding: 56px 0 80px;
  overflow: hidden;
}
/* fasci di energia dietro il riquadro */
.hero-auto::before {
  content: '';
  position: absolute;
  inset: -10% -20%;
  background:
    radial-gradient(50% 42% at 50% 82%, rgba(238, 125, 0, .3), transparent 65%),
    linear-gradient(118deg, transparent 38%, rgba(238, 125, 0, .14) 47%, transparent 56%),
    linear-gradient(62deg, transparent 44%, rgba(90, 120, 210, .16) 52%, transparent 60%);
  animation: heroBeams 12s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes heroBeams {
  0%   { transform: translateX(-3%) scale(1); opacity: .8; }
  100% { transform: translateX(3%) scale(1.06); opacity: 1; }
}
.hero-auto .container { position: relative; }

.hero-copy {
  max-width: 1100px;
  margin: 0 auto 40px;
  text-align: center;
}
.hero-copy .eyebrow {
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3.5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.hero-copy h1 {
  /* dimensionato per stare su UN solo rigo sul desktop */
  font-size: clamp(30px, 3.9vw, 50px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -1px;
  line-height: 1.08;
  text-shadow: 0 0 44px rgba(238, 125, 0, .3);
}
.hero-copy h1 .accent { text-shadow: 0 0 30px rgba(238, 125, 0, .65); }
.hero-copy h1 .accent { color: var(--accent); }
.hero-copy p.lead {
  font-size: clamp(16px, 2vw, 19px);
  color: rgba(255, 255, 255, .78);
  margin: 18px auto 28px;
}
.hero-copy .hero-actions { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }

/* ---------- Giostra 3D dei mezzi ---------- */
.ring-stage {
  position: relative;
  height: 540px;
  margin-top: 10px;
  perspective: 1500px;
  /* il trascinamento orizzontale ruota la giostra, quello verticale scorre la pagina */
  touch-action: pan-y;
}
.ring {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  will-change: transform;
}
.ring-card {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 290px;
  height: 420px;
  margin: -210px 0 0 -145px;
  border-radius: 16px;
  overflow: hidden;
  background: #0c0e15;
  border: 1px solid rgba(255, 255, 255, .16);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .5);
  cursor: pointer;
  text-decoration: none !important;
  transition: border-color .3s, box-shadow .3s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none; /* iOS: niente drag&drop/anteprima del link col dito */
  -webkit-tap-highlight-color: transparent;
}
.ring-card:hover {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 1.5px rgba(238, 125, 0, .5), 0 18px 60px rgba(0, 0, 0, .6), 0 0 46px rgba(238, 125, 0, .22);
}
.ring-card img,
.ring-card svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ring-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 44px 18px 16px;
  background: linear-gradient(to top, rgba(4, 6, 10, .92), transparent);
  color: #fff;
  font-family: var(--font-head);
  text-align: center;
}
.ring-label b { display: block; font-size: 19px; font-weight: 700; }
.ring-label small { display: block; font-size: 13.5px; color: var(--text-soft); margin-top: 3px; font-weight: 400; }

/* card CTA contatti */
.ring-cta { background: linear-gradient(160deg, #ff9224, #b85e00); display: flex; align-items: center; }
.ring-cta-inner { padding: 30px 26px; font-family: var(--font-head); text-align: center; }
.ring-cta-inner b { display: block; font-size: 26px; line-height: 1.2; font-weight: 800; color: #1a0c00; }
.ring-cta-inner small { display: block; font-size: 15px; margin: 14px 0 22px; color: rgba(26, 12, 0, .8); font-family: var(--font-body); }
.ring-cta-btn { display: inline-block; background: #14161d; color: #fff; padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: 15px; }

@media (max-width: 680px) {
  .ring-stage { height: 400px; }
  .ring-card { width: 218px; height: 320px; margin: -160px 0 0 -109px; }
  .ring-label b { font-size: 16px; }
  .ring-label small { font-size: 12.5px; }
  .ring-cta-inner b { font-size: 20px; }
}

/* ---------- Riquadro dell'animazione ---------- */
.cinema-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 72vh;
  margin: 0 auto;
  border-radius: 16px;
  overflow: hidden;
  background: #05070c;
  border: 1px solid rgba(255, 255, 255, .12);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, .55),
    0 0 70px rgba(238, 125, 0, .1),
    0 0 0 1px rgba(238, 125, 0, .08);
  perspective: 1100px;
}

/* riflesso che attraversa periodicamente il riquadro */
.cinema-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 6;
  background: linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .1) 50%, transparent 58%);
  transform: translateX(-130%) skewX(-6deg);
  animation: frameSheen 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes frameSheen {
  0%, 55%   { transform: translateX(-130%) skewX(-6deg); }
  75%, 100% { transform: translateX(130%) skewX(-6deg); }
}

.scene {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
.scene svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Foto reale sopra l'illustrazione di fallback */
.scene-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Velo scuro in basso per leggibilità didascalie */
.scene-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(5,7,12,.6) 0%, rgba(5,7,12,0) 32%);
  pointer-events: none;
}

/* Origine dello zoom: la vetratura del SUV nel poster (foto DR5) */
.s1 { transform-origin: 44% 18%; }
.s1.no-photo { transform-origin: 50.5% 52%; }
.s2 { opacity: 0; }
.s3 { opacity: 0; }
.s3 svg { transform-origin: 67% 56%; }
/* Origine dello zoom finale: lo schermo del totem nella foto stazione */
.s3 .scene-photo { transform-origin: 50.5% 44%; }

/* Testi dentro gli SVG di fallback */
.sv-head { font-family: 'Lexend', system-ui, sans-serif; font-weight: 800; }
.sv-sub  { font-family: 'Lexend', system-ui, sans-serif; font-weight: 500; }

/* Schermo digitale illustrato: pulsazione luminosa continua */
@keyframes screenPulse {
  0%, 100% { opacity: .55; }
  50% { opacity: .95; }
}
.screen-glow { animation: screenPulse 3.2s ease-in-out infinite; }

@keyframes screenSlide {
  0%, 42%  { transform: translateY(0); }
  50%, 92% { transform: translateY(-380px); }
  100%     { transform: translateY(0); }
}
.screen-feed { animation: screenSlide 7s ease-in-out infinite; }

/* Didascalie di scena, dentro il riquadro */
.cinema-caption {
  position: absolute;
  left: 28px;
  bottom: 24px;
  z-index: 5;
  pointer-events: none;
}
.cap {
  position: absolute;
  left: 0;
  bottom: 0;
  opacity: 0;
  white-space: nowrap;
  color: #fff;
  font-family: var(--font-head);
}
.cap .cap-num {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 3.5px;
  color: var(--accent);
  margin-bottom: 5px;
}
.cap .cap-title {
  font-size: clamp(17px, 2.2vw, 26px);
  font-weight: 700;
  letter-spacing: -.4px;
  text-shadow: 0 2px 18px rgba(0,0,0,.55);
}

/* Indicatori di avanzamento del loop */
.cinema-dots {
  position: absolute;
  right: 24px;
  bottom: 28px;
  z-index: 5;
  display: flex;
  gap: 8px;
}
.cinema-dots span {
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .28);
  transition: background .3s;
}
.cinema-dots span.on { background: var(--accent); }

/* Fallback statico: reduced-motion o GSAP non caricato */
.cinema-frame.static .s2,
.cinema-frame.static .s3 { display: none; }
.cinema-frame.static .cap-1 { opacity: 1; }
.cinema-frame.static .cinema-dots { display: none; }

@media (prefers-reduced-motion: reduce) {
  .screen-glow, .screen-feed { animation: none; }
}

@media (max-width: 680px) {
  .hero-auto { padding: 40px 0 60px; }
  .cinema-frame { aspect-ratio: 4 / 3; border-radius: 12px; }
  .cinema-caption { left: 18px; bottom: 16px; right: 90px; }
  .cap { white-space: normal; }
  .cap .cap-title { font-size: 15px; line-height: 1.3; }
  .cinema-dots { right: 16px; bottom: 20px; }
  .cinema-dots span { width: 18px; }
}
