/* RESET BASE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Orbitron', sans-serif;
  background: linear-gradient(to bottom, #0e0e11, #1c1c2a);
  color: #e0e0e0;
  overflow-x: hidden;
  position: relative;
}

main, section, .hero-header {
  position: relative;
  z-index: 1;
}

/* BACKGROUND PATTERN */
#background-pattern {
  position: fixed;
  width: 100%;
  height: 100%;
  background: url('../assets/pattern.gif') repeat;
  opacity: 0.02;
  z-index: -10;
  pointer-events: none;
}

/* CANVAS */
#data-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* LOGO */
.logo {
  width: 130px;
  animation: glow 2s infinite alternate;
  filter: drop-shadow(0 0 10px #00f2ff);
}

@keyframes glow {
  from { filter: drop-shadow(0 0 10px #00f2ff); }
  to   { filter: drop-shadow(0 0 30px #00f2ff); }
}

/* HERO HEADER */
.hero-header {
  position: relative;
  text-align: center;
  padding: 100px 20px 60px;
  background: radial-gradient(ellipse at center, #001720 0%, #0e0e11 100%);
  overflow: hidden;
}

.hero-fade-out {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 60px;
  background: linear-gradient(to bottom, rgba(14,14,17,0.8), #0e0e11);
  z-index: 2;
  pointer-events: none;
}

.overlay-gradient {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0,242,255,0.2), transparent);
  z-index: 1;
  pointer-events: none;
}

.logo-container {
  position: relative;
  z-index: 2;
}

.animated-text {
  font-size: 26px;
  color: #00f2ff;
  margin-top: 20px;
  height: 30px;
  z-index: 2;
  position: relative;
  font-weight: bold;
  text-shadow: 0 0 8px #00f2ff80;
}

#phrase {
  animation: pulseFade 1.2s ease forwards, glitchPulse 2s infinite;
  display: inline-block;
}

@keyframes glitchPulse {
  0% { text-shadow: 0 0 6px #00f2ff55; transform: translate(0); }
  50% { text-shadow: 1px 0 #00f2ffaa, -1px 0 #00f2ff66; transform: translateX(0.5px); }
  100% { text-shadow: 0 0 6px #00f2ff55; transform: translate(0); }
}

@keyframes pulseFade {
  0%   { opacity: 0; transform: scale(0.95); }
  30%  { opacity: 1; transform: scale(1.02); }
  70%  { transform: scale(1); }
  100% { opacity: 1; }
}
/* CTA Hero */
.hero-cta {
  margin-top: 40px;
  font-size: 16px;
  background: transparent;
  border: 2px solid #00f2ff;
  color: #00f2ff;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  z-index: 2;
  position: relative;
  transition: background 0.3s;
}

.hero-cta:hover {
  background: #00f2ff;
  color: #000;
}

/* Fade-in scroll */
.fade-in-section {
  opacity: 0;
  transform: translateY(60px);
  transition: all 1.2s ease-out;
  will-change: transform, opacity;
}

.fade-in-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ORBITA */
#icone-servizi-explode {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 420px;
  margin: 80px auto;
  opacity: 0;
  transform: scale(0.3);
  transition: all 1s ease-out;
}

#icone-servizi-explode.show {
  opacity: 1;
  transform: scale(1);
}

#cta-esplosione {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

#cta-esplosione button {
  background: transparent;
  border: 2px solid #00f2ff;
  color: #00f2ff;
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s ease;
}

#cta-esplosione button:hover {
  background: #00f2ff;
  color: #000;
}




.orbital-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin: -40px;
  font-size: 36px;
  color: #00f2ff;
  background: rgba(0,242,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(var(--angle)) translate(140px) rotate(calc(-1 * var(--angle)));
  animation: orbit 12s linear infinite;
  transform-origin: center center;
  z-index: 1;
}

.orbital-icon:hover {
  background: rgba(0,242,255,0.2);
  box-shadow: 0 0 20px rgba(0,242,255,0.4);
  transform: rotate(var(--angle)) translate(130px) rotate(calc(-1 * var(--angle))) scale(1.15);
}

@keyframes orbit {
  from {
    transform: rotate(var(--angle)) translate(140px) rotate(calc(-1 * var(--angle)));
  }
  to {
    transform: rotate(calc(360deg + var(--angle))) translate(140px) rotate(calc(-360deg - var(--angle)));
  }
}

/* About */
#about {
  padding-top: 160px;
  min-height: 600px;
  padding: 80px 20px;
  background: rgba(15, 15, 20, 0.85);
  color: #cceeff;
  backdrop-filter: blur(4px);
  overflow: visible;
  position: relative;
}

.about-container {
  display: flex;
  flex-wrap: wrap;
  max-width: 1100px;
  margin: 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 50px;
}

.about-text {
  flex: 1 1 500px;
}

.about-text h2 {
  font-size: 36px;
  font-weight: 800;
  color: #00f2ff;
  margin-bottom: 20px;
  text-shadow: 0 0 10px #00f2ff33;
}

.about-text p {
  font-size: 18px;
  line-height: 1.7;
  color: #cceeff;
  text-shadow: 0 0 4px rgba(0, 242, 255, 0.05);
}

.about-image {
  flex: 1 1 400px;
  transform: translateY(20px);
  transition: transform 1.5s ease;
}

.fade-in-section.is-visible .about-image {
  transform: translateY(0);
}

.about-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
  object-fit: cover;
}

/* Servizi griglia */
.servizi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 30px;
  max-width: 100px;
  margin: 0 auto;
  padding: 0 20px;
  justify-content: center;
}


.servizio-dettaglio {
  padding: 30px;
  max-width: 400px;
  margin: 0 auto;
  border-radius: 12px;
  background: rgba(15, 15, 20, 0.7);
  border: 1px solid rgba(0, 242, 255, 0.3);
  box-shadow: 0 0 15px rgba(0, 242, 255, 0.12);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.servizio-dettaglio:hover {
  transform: scale(1.04);
}

.servizio-dettaglio i {
  font-size: 38px;
  color: #00f2ff;
  margin-bottom: 12px;
}

.servizio-dettaglio h3 {
  color: #00f2ff;
  margin-bottom: 10px;
}

.servizio-dettaglio p {
  font-size: 15px;
  color: #d0eaff;
  text-align: center;
  line-height: 1.6;
}

.img-servizio,
.video-servizio {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin: 0 auto 15px;
  display: block;
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.25);
}

/* MODALE CONTATTI */
.modal {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #111;
  padding: 30px;
  border: 2px solid #00f2ff;
  z-index: 100;
  border-radius: 10px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 0 30px rgba(0, 242, 255, 0.15);
  opacity: 0;
  transition: opacity 0.4s ease, transform 0.3s ease;
}

.modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.modal.orbit-mode {
  top: 60%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
}

.modal form {
  display: flex;
  flex-direction: column;
  gap: 15px;
  width: 100%;
}

.modal input,
.modal textarea {
  background: #0e0e11;
  border: 1px solid #00f2ff;
  padding: 12px;
  color: #fff;
  border-radius: 6px;
  font-family: inherit;
  width: 100%;
}

.modal img {
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 0 8px #00f2ffcc);
}

/* FORM & TOAST */
.form-loader {
  width: 24px;
  height: 24px;
  border: 3px solid #00f2ff;
  border-top: 3px solid transparent;
  border-radius: 50%;
  margin: 10px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: #00f2ff;
  color: #000;
  padding: 14px 20px;
  border-radius: 6px;
  font-weight: bold;
  z-index: 9999;
  animation: toastSlide 0.6s ease;
}

@keyframes toastSlide {
  0% { opacity: 0; transform: translateY(40px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(15, 15, 20, 0.95);
  color: #e0e0e0;
  border: 1px solid #00f2ff40;
  padding: 20px;
  border-radius: 8px;
  z-index: 2000;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  box-shadow: 0 0 12px rgba(0, 242, 255, 0.1);
  animation: slide-up 0.6s ease forwards;
}

.cookie-banner button {
  background: #00f2ff;
  color: #000;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.cookie-banner button:hover {
  background: #00bcd4;
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(100px); }
  to { opacity: 1; transform: translateY(0); }
}

/* CUBO 3D */
.about-cube-container {
  margin-top: 40px; /* spinge il cubo più in basso */
  width: 240px;
  height: 240px;
  margin: 0 auto;
  margin-bottom: 60px;
  perspective: 1000px;
}

@media (max-width: 768px) {
  .about-cube-container {
    width: 180px;
    height: 180px;
  }
}
 

.cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 1s ease;
  will-change: transform;
  cursor: grab;
}

.cube-wrapper {
  width: 100%;
  height: 100%;
  animation: cubeRotate 20s linear infinite;
  transform-style: preserve-3d;
}

@keyframes cubeRotate {
  0%   { transform: rotateX(0deg) rotateY(0deg); }
  100% { transform: rotateX(360deg) rotateY(360deg); }
}

.face {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom right, rgba(0,242,255,0.3), rgba(0,120,255,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 28px;
  color: #00f2ff;
  border: 1px solid rgba(0,242,255,0.2);
  box-shadow: 0 0 30px rgba(0, 242, 255, 0.1);
  backdrop-filter: blur(2px);
}

.front  { transform: rotateY(  0deg) translateZ(140px); }
.back   { transform: rotateY(180deg) translateZ(140px); }
.right  { transform: rotateY( 90deg) translateZ(140px); }
.left   { transform: rotateY(-90deg) translateZ(140px); }
.top    { transform: rotateX( 90deg) translateZ(140px); }
.bottom { transform: rotateX(-90deg) translateZ(140px); }

/* RESPONSIVE */
@media (max-width: 768px) {
  .about-container {
    flex-direction: column;
  }

  .about-image {
    order: -1;
  }

  .orbital-icon {
    width: 60px;
    height: 60px;
    margin: -30px;
    font-size: 28px;
  }

  #icone-servizi-explode {
    height: 300px;
  }
}
button#openForm,
button#openFormOrbit {
  background: transparent;
  border: 2px solid #00f2ff;
  color: #00f2ff;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

button#openForm:hover,
button#openFormOrbit:hover {
  background: #00f2ff;
  color: #000;
}
footer {
  background: #0e0e11;
  color: #ccc;
  padding: 40px 20px 20px;
  font-size: 14px;
  border-top: 1px solid rgba(0,242,255,0.2);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.footer-left p {
  margin: 6px 0;
  line-height: 1.6;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: #00f2ff;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  font-size: 13px;
  color: #888;
}


.modal button {
  background: #00f2ff;
  color: #000;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.modal button:hover {
  background: #00bcd4;
}
.hidden {
  display: none !important;
}
