/* ══════════════════════════════════════════
   HERO 3D v5 — hero-3d.css
   Torri 3D + auto-costruzione + no immagini
   ══════════════════════════════════════════ */

#hero-3d-wrap { position: relative; height: 650vh; }

#hero-3d {
  position: sticky; top: 0; width: 100%; height: 100vh;
  overflow: hidden;
  background: linear-gradient(160deg, #060a10 0%, #0c1a1c 40%, #0a0e14 100%);
}

#hero-canvas { position: absolute; inset: 0; z-index: 1; }
#hero-canvas canvas { display: block; }

#hero-3d::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: .03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

#hero-content-layer { position: absolute; inset: 0; z-index: 5; pointer-events: none; }

/* ── SLIDES ── */
.hero-slide-panel {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 0 48px;
  padding-bottom: 180px;
  pointer-events: none; opacity: 0;
}
.hero-slide-panel.active { pointer-events: auto; }

.slide-text {
  max-width: 520px; z-index: 2;
  will-change: opacity, transform;
}

/* Posizionamento testo SX o DX */
.slide-pos-left  { justify-content: flex-start; }
.slide-pos-right { justify-content: flex-end; }
.slide-pos-right .slide-text { text-align: right; }
.slide-pos-right .slide-actions { justify-content: flex-end; }

/* ── TYPOGRAPHY ── */
.slide-tag {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 4px;
  text-transform: uppercase; margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px; border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03); color: var(--orange);
}
.slide-headline {
  font-family: var(--font-display); font-size: clamp(40px, 6vw, 80px);
  font-weight: 800; line-height: 0.88; color: #fff;
  margin-bottom: 20px; letter-spacing: -1px;
}
.slide-sub {
  font-size: 16px; font-weight: 300;
  color: rgba(255,255,255,0.55); line-height: 1.75; margin-bottom: 28px;
}
.slide-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.sbtn {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; padding: 14px 28px; border-radius: 8px;
  text-decoration: none; font-weight: 700; border: none; cursor: pointer;
  transition: box-shadow 0.3s, background 0.3s;
}
.sbtn-fill { color: #fff; }
.sbtn-fill:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,0.35); }
.sbtn-ghost {
  color: rgba(255,255,255,0.45); background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.sbtn-ghost:hover { color: #fff; border-color: rgba(255,255,255,0.2); }

.slide-tag, .slide-headline, .slide-sub, .slide-actions {
  will-change: opacity, transform;
}

/* ── UI ── */
.hero-dots {
  position: absolute; right: 28px; top: 50%; transform: translateY(-50%);
  z-index: 10; display: flex; flex-direction: column; gap: 10px;
}
.hdot {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  cursor: pointer; padding: 0; transition: all 0.4s;
}
.hdot.on { background: var(--orange); box-shadow: 0 0 14px var(--orange); transform: scale(1.4); }

.hero-scroll-cue {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: opacity 0.5s;
}
.hero-scroll-cue span {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: 4px;
  color: rgba(255,255,255,0.2); text-transform: uppercase;
  animation: hero3dPulse 2.5s ease infinite;
}
.hero-scroll-cue-line { width: 1px; height: 24px; background: linear-gradient(to bottom, rgba(255,255,255,0.18), transparent); }
.phase-counter {
  position: absolute; bottom: 28px; right: 28px; z-index: 10;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 2px;
  color: rgba(255,255,255,0.15);
}
.phase-counter strong { color: var(--orange); font-weight: 700; }

.hero-phase-bar {
  position: absolute; bottom: 0; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--orange), rgba(0,229,200,0.6));
  z-index: 10; box-shadow: 0 0 10px rgba(255,92,0,0.4);
}

@keyframes hero3dPulse { 0%,100% { opacity: .2; } 50% { opacity: .8; } }

/* ── CONTRASTO — desktop + mobile ── */
.slide-headline {
  text-shadow: 0 2px 30px rgba(0,0,0,0.6);
}
.slide-sub {
  color: rgba(255,255,255,0.55);
}
.slide-tag {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  #hero-3d-wrap { height: 550vh; }

  .hero-slide-panel {
    align-items: flex-start;
    padding: 80px 20px 0;
    padding-bottom: 0;
  }

  .slide-pos-left,
  .slide-pos-right { justify-content: flex-start; }
  .slide-pos-right .slide-text { text-align: left; }
  .slide-pos-right .slide-actions { justify-content: flex-start; }

  .slide-text {
    max-width: 100%;
    position: static;
    will-change: auto;
  }

  .slide-tag {
    font-size: 9px;
    padding: 5px 12px;
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    margin-bottom: 14px;
  }

  .slide-headline {
    font-size: clamp(32px, 10vw, 52px) !important;
    line-height: 0.88 !important;
    margin-bottom: 14px !important;
    text-shadow: 0 2px 40px rgba(0,0,0,0.7);
  }

  .slide-sub {
    font-size: 13px !important;
    line-height: 1.65 !important;
    color: rgba(255,255,255,0.6) !important;
    margin-bottom: 0 !important;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Bottoni in basso fissi dentro la slide */
  .slide-actions {
    position: absolute;
    bottom: 100px;
    left: 20px;
    right: 20px;
    flex-direction: column;
    gap: 8px;
  }
  .sbtn {
    padding: 14px 24px;
    font-size: 11px;
    width: 100%;
    justify-content: center;
  }
  .sbtn-fill { box-shadow: 0 4px 20px rgba(0,0,0,0.3); }

  .hero-dots { right: 10px; gap: 8px; }
  .hdot { width: 6px; height: 6px; }
  .phase-counter { bottom: 16px; right: 16px; }
  .hero-scroll-cue { bottom: 16px; }
}