:root{
  /* Palette */
  --black:#0b0b0d; 
  --white:#f5f5f5;
  --brand-50:#0c6ec280; 
  --brand-20:#0c6ec233;
  --text:var(--white); 
  --bg:var(--black);
  --maxw:1200px;
  --header-height: 70px;

  /* Misure fisse riquadro immagine prodotto */
  --prod-w: 420px;
  --prod-h: 520px;
  --prod-w-sm: 320px;
  --prod-h-sm: 400px;

  /* Intensità parallax (in gradi) */
  --tilt-x: 6;   /* rotazione orizzontale (Y) max */
  --tilt-y: 4;   /* rotazione verticale (X) max */
  --tilt-persp: 900px;

    /* intensità glow */
  --glow-radius: 360px;   /* prima era ~600px */
  --glow-blur: 24px;      /* prima era 40px */
  --glow-opacity: .45;    /* prima era .8 */
}

/* ---------- HERO ---------- */
.hero{
  position:relative;
  min-height: calc(100vh - var(--header-height));
  display:grid;
  place-items:center;
  isolation:isolate;
  background: #0b0b0d;
  padding: 0;
}

/* layout desktop */
.hero-container{
  width: min(94vw, var(--maxw));
  display:grid;
  grid-template-columns: 1fr 1fr;
  align-items:center;
  gap: clamp(20px, 3vw, 40px);
  padding: 0;
}

/* Testo a sinistra */
.hero-copy{ 
  width: 100%; 
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.hero-feature-list{
  margin: 4px 0 2px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 560px;
}

.hero-feature-item{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: rgba(245, 245, 245, 0.95);
  font-size: 0.98rem;
  line-height: 1.35;
}

.hero-feature-icon{
  width: 19px;
  height: 19px;
  color: var(--white);
  flex: 0 0 19px;
}

.hero-feature-icon svg{
  display: block;
  width: 100%;
  height: 100%;
}

.hero-feature-text{
  color: var(--white);
}

.hero h1{
  font-size: clamp(1.8rem, 3.5vw + 0.8rem, 3.5rem);
  line-height: 1.1;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.hero-accent{
  color: #c3a875;
  font-weight: 800;
}

.hero-cta-row{
  display: flex;
  gap: 16px;
  align-items: center;
  padding-left: 6%;
}

.hero-cta-badge{
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.hero-cta-badge:hover{
  transform: scale(1.07);
  filter: brightness(1.1);
}

.hero-cta-badge-img{
  height: 200px;
  width: auto;
  display: block;
}

/* Modello 3D a destra */
.hero-3d{
  position: relative;
  width: 100%;
  height: 750px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -150px;
}

.hero-3d model-viewer{
  flex: 1;
  min-height: 0;
}

/* Feature Popups */
.feature-popup{
  position: absolute;
  top: 10%;
  left: -20px;
  max-width: 320px;
  background: rgba(11, 11, 13, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(195, 168, 117, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: 0 8px 32px rgba(3, 18, 35, 0.6);
  transition: opacity 0.5s ease;
  z-index: 10;
}

.feature-popup h3{
  font-size: 1.3rem;
  margin: 0 0 8px 0;
  color: var(--white);
}

.popup-accent{
  background: linear-gradient(135deg, #c3a875, #a08960);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.feature-popup p{
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
  color: rgba(255, 255, 255, 0.85);
}

/* Popup positioning per diverse feature */
#popup-joystick{
  top: 25%;
  right: -20px;
  left: auto;
}

#popup-encoder{
  top: 30%;
  left: -20px;
}

#popup-keyswitch{
  top: 65%;
  left: -20px;
}

#popup-compact{
  top: 20%;
  right: -20px;
  left: auto;
}

/* Controlli navigazione */
.hero-3d-controls{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: -80px;
  position: relative;
  z-index: 10;
}

.hero-3d-nav-btn{
  background: transparent;
  border: none;
  color: var(--white);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.hero-3d-nav-btn svg{
  width: 100%;
  height: 100%;
  fill: rgba(255, 255, 255, 0.6);
  transition: fill 0.3s ease;
}

.hero-3d-nav-btn:hover svg{
  fill: rgba(255, 255, 255, 1);
}

.hero-3d-indicators{
  display: flex;
  gap: 8px;
}

.hero-indicator{
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.hero-indicator.active{
  background: linear-gradient(135deg, #0c6ec2, #094d8a);
  width: 32px;
  border-radius: 5px;
}

.hero-indicator:hover{
  background: rgba(255, 255, 255, 0.5);
}

/* Responsive */
@media (max-width: 900px){
  .hero{
    min-height: auto;
    display: block;
    margin: 10vh 0 10vh;
    padding: 0;
  }

  /* Su mobile: colonna unica — prima la riga titolo+badge, poi il 3D */
  .hero-container{
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 8px 0 0;
  }

  /* Titolo sopra e bottone sotto */
  .hero-copy{
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
  }

  .hero-feature-list{
    width: 100%;
    max-width: 560px;
    margin: 2px auto 4px;
    display: grid;
    justify-items: center;
    gap: 8px;
  }

  .hero-feature-item{
    width: auto;
    max-width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    row-gap: 6px;
    column-gap: 10px;
    font-size: 0.92rem;
    text-align: center;
    margin: 0 auto;
  }

  .hero-feature-text{
    text-align: center;
  }

  .hero-copy h1{
    font-size: clamp(2.25rem, 9vw, 3.15rem);
    margin: 0;
    text-align: center;
  }

  .hero-cta-row{
    display: none;
  }

  .hero-cta-badge-img{
    height: 90px;
  }

  /* 3D sotto, ridotto */
  .hero-3d{
    height: 460px;
    margin-top: 0;
    width: 100%;
  }

  .hero-3d-controls{
    margin-top: 10px;
  }

  .feature-popup{
    top: 26px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(86vw, 260px);
    max-width: none;
    padding: 10px 14px;
  }

  #popup-joystick,
  #popup-encoder,
  #popup-keyswitch{
    top: 42px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  #popup-compact{
    top: 26px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .feature-popup h3{
    font-size: 0.95rem;
    margin-bottom: 4px;
  }

  .feature-popup p{
    font-size: 0.75rem;
    line-height: 1.4;
  }
}

@media (max-width: 480px){
  .hero-cta-badge-img{
    height: 72.5px;
  }

  .hero-3d{
    height: 360px;
  }

  .hero-3d-controls{
    margin-top: 8px;
  }

  .feature-popup{
    width: min(90vw, 220px);
    padding: 8px 10px;
  }
}

/* ---------- PRODOTTO (destra) ---------- */
.hero-product{
  position:relative;
  border-radius: 22px;
  padding: clamp(14px, 2vw, 18px);
  /* box-shadow: 0 20px 60px -20px rgba(0,0,0,.8), 0 0 0 1px #000 inset; */
  filter: drop-shadow(0 0 16px var(--brand-20)) drop-shadow(0 0 40px var(--brand-20));
}

/* Riquadro immagine: trasparente e misure fisse */
.hero-product-figure{
  width: var(--prod-w);
  height: var(--prod-h);
  border-radius:16px;
  background: transparent;
  display:grid; place-items:center;
  overflow:hidden; position:relative;
  perspective: var(--tilt-persp);
}

/* cornice leggera (opzionale, elimina se non la vuoi) */
.hero-product-figure::before{
  content:""; position:absolute; inset:-1px;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  padding:1px; border-radius:inherit; opacity:.25;
}

/* wrapper inclinato in hover */
.hero-tilt{
  width:100%; height:100%;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 120ms ease;
}

/* immagine: dritta, non deformata, contenuta */
.hero-tilt > img{
  width:100%; height:100%;
  object-fit: contain;
  image-orientation: from-image; /* rispetta EXIF dove supportato */
  pointer-events:none;
  transform: translateZ(0);
}

.hero-tilt::after{
  content:""; position:absolute; inset:0;
  opacity:0; transition: opacity 180ms ease;
  pointer-events:none;
}
.hero-product-figure:hover .tilt::after{ opacity:1; }

/* didascalia */
.hero-caption{ margin-top:10px; color:#ffffffa8; font-size:.9rem; }
.hero-caption-accent{ color:var(--brand); }

/* mobile: riduci box a misure *sm* */
@media (max-width: 420px){
  .hero-product-figure{ width:var(--prod-w-sm); height:var(--prod-h-sm) }
}

/* Accessibilità: riduce/ferma animazioni su richiesta */
@media (prefers-reduced-motion: reduce){
  .hero::after{ display:none }
  .hero-cta{ transition:none }
  .hero-tilt{ transition:none !important; transform:none !important; }
}
