@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;600;800&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #050505;
  --text: #ffffff;
  --muted: #8e8e93;
  --glow-color: rgba(255, 255, 255, 0.08);
  --accent-glow: rgba(255, 255, 255, 0.15);
  --glass-bg: rgba(10, 10, 10, 0.4);
  --glass-border: rgba(255, 255, 255, 0.06);
}

/* RESET GLOBALE */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
}

/* SFONDO PARTICELLE INTERATTIVO */
#particles {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(circle at center, #0c0c0e 0%, #020202 100%);
}

/* ===================================================
   HEADER PREMIUM (APPLE-GLASS STYLE)
   =================================================== */
header.topbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 30px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

header.topbar.scrolled {
  top: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  border-left: none;
  border-right: none;
  background: rgba(5, 5, 5, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 35px;
  height: 35px;
  object-fit: cover;
  border-radius: 50%;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.3));
}

.logo-text {
  font-family: 'Orbitron', sans-serif;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: 2px;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--text);
}

/* ===================================================
   HERO SECTION & IMMERSIVE TYPING
   =================================================== */
.hero {
  min-height: 85vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 140px 20px 40px 20px;
  position: relative;
}

.status-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 11px;
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  color: var(--muted);
}

.status-pill .dot {
  width: 6px;
  height: 6px;
  background: #00ff88;
  border-radius: 50%;
  box-shadow: 0 0 10px #00ff88;
  animation: pulse 2s infinite;
}

.title-glow {
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(32px, 8vw, 84px);
  font-weight: 800;
  letter-spacing: 6px;
  line-height: 1.1;
  margin-bottom: 20px;
  text-transform: uppercase;
}

.title-glow span {
  display: inline-block;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
  cursor: default;
}

.title-glow span:hover {
  transform: translateY(-5px);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.typing {
  font-size: 15px;
  color: var(--muted);
  letter-spacing: 1px;
  min-height: 24px;
  margin-bottom: 40px;
  font-weight: 300;
  padding: 0 10px;
}

/* ===================================================
   BOTTONI CYBER FUTURISTICI
   =================================================== */
.hero-buttons {
  display: flex;
  gap: 20px;
}

.btn {
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  padding: 16px 35px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.btn.primary {
  background: #ffffff;
  color: #000000;
}

.btn.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(255, 255, 255, 0.25);
}

.btn.glass {
  background: rgba(255, 255, 255, 0.02);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn.glass:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* ===================================================
   WIDGETS INTERATTIVI (3D GLOW HOVER)
   =================================================== */
.widgets {
  max-width: 1200px;
  margin: 60px auto 100px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
}

.widget {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 40px 30px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.widget:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 30px rgba(255, 255, 255, 0.02);
}

.widget h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 16px;
  letter-spacing: 2px;
  margin-bottom: 15px;
  color: #ffffff;
}

.widget p {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}

/* =========================================================
   🍏 LOADING SCREEN MODERNA CON SFONDO EFFETTO BLOB ATTIVO
   ========================================================= */
.intro {
  position: fixed;
  inset: 0;
  /* Sfondo satinato molto elegante, non nero assoluto */
  background: #0b0b0e; 
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 1;
  visibility: visible;
  overflow: hidden;
  transition: opacity 0.8s cubic-bezier(0.25, 1, 0.5, 1), visibility 0.8s;
}

/* Sfera liquida sfocata (Blob) visibile da subito all'avvio */
.intro::before {
  content: "";
  position: absolute;
  width: 550px;
  height: 550px;
  /* Gradiente lussuoso tra viola e blu elettrico */
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  z-index: 1;
  animation: introBlobMove 12s infinite alternate ease-in-out;
}

.intro.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Finestra centrale vetrata stile macOS / iOS (Glassmorphism) */
.intro-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 40px 30px;
  border-radius: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 2;
}

.intro-header-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Logo animato Apple-like */
.intro-apple-logo {
  width: 72px;
  height: 72px;
  object-fit: contain;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 15px rgba(255,255,255,0.1));
  animation: applePulse 3s infinite ease-in-out;
}

.intro-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  color: #ffffff;
  margin-bottom: 6px;
}

.intro-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 35px;
}

/* Finestra finto terminale Mac-Style */
.intro-terminal-box {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 30px;
  position: relative;
}

.terminal-dots {
  display: flex;
  gap: 6px;
  position: absolute;
  left: 14px;
  top: 14px;
}

.terminal-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: block;
}
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

.intro-terminal {
  font-family: monospace;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
  min-height: 14px;
  letter-spacing: 0.5px;
}

/* Barra di caricamento minimale ed elegante */
.intro-loading-container {
  width: 100%;
  margin-bottom: 35px;
}

.intro-loading-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
}

.bar-progress {
  width: 0%;
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
  border-radius: 10px;
  transition: width 0.1s linear;
}

.intro-percentage {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: #ffffff;
  margin-top: 10px;
}

/* Footer info pillole */
.intro-footer-info {
  display: flex;
  gap: 15px;
}

.info-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 6px 14px;
  border-radius: 30px;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
}

.status-active { color: #27c93f; font-weight: 700; }
.status-secure { color: rgba(255, 255, 255, 0.8); font-weight: 700; }

/* Animazione di respiro del logo */
@keyframes applePulse {
  0%, 100% { transform: scale(1); opacity: 1; filter: drop-shadow(0 0 15px rgba(255,255,255,0.1)); }
  50% { transform: scale(1.04); opacity: 0.9; filter: drop-shadow(0 0 25px rgba(255,255,255,0.25)); }
}

/* Animazione per il movimento lento della luce colorata sullo sfondo intro */
@keyframes introBlobMove {
  0% { transform: translate(-8%, -8%) scale(1); }
  100% { transform: translate(8%, 8%) scale(1.1); }
}

/* ===================================================
   ANIMAZIONI DI TRANSIZIONE TRA PAGINE
   =================================================== */
.page-transition {
  position: fixed;
  inset: 0;
  background: #050505;
  z-index: 99999;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.page-transition.fade-in {
  opacity: 0;
}

.page-transition.fade-out {
  opacity: 1;
  pointer-events: all;
}

.page-content {
  opacity: 0;
  animation: contentReveal 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 0.1s;
}

@keyframes contentReveal {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 255, 136, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 255, 136, 0); }
}

/* ===================================================
   RESPONSIVENESS (MEDIA QUERIES)
   =================================================== */
@media screen and (max-width: 768px) {
  header.topbar {
    top: 0;
    width: 100%;
    max-width: 100%;
    height: 60px;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
    padding: 0 20px;
    background: rgba(5, 5, 5, 0.85);
  }

  .nav-links { gap: 15px; }
  .nav-links a { font-size: 12px; }
  .hero { padding-top: 120px; min-height: auto; }
  .title-glow { letter-spacing: 3px; margin-bottom: 15px; }

  .hero-buttons {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    gap: 12px;
  }

  .btn { width: 100%; padding: 14px 20px; text-align: center; }
  .widgets { margin-top: 40px; margin-bottom: 60px; gap: 15px; }
  .widget { padding: 30px 20px; }
}

@media screen and (max-width: 480px) {
  .logo-text { font-size: 13px; letter-spacing: 1px; }
  .nav-links { gap: 10px; }
  .nav-links a { font-size: 11px; }
}