/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #05070a;
  --bg-elevated: #0a0e14;
  --bg-card: #0d1219;
  --cyan: #00e5ff;
  --cyan-dim: #00b8d4;
  --cyan-glow: rgba(0, 229, 255, 0.35);
  --cyan-soft: rgba(0, 229, 255, 0.12);
  --text: #e8f4f8;
  --text-muted: #8ba3b0;
  --border: rgba(0, 229, 255, 0.15);
  --radius: 16px;
  --font-display: 'Orbitron', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ===== BACKGROUND EFFECTS ===== */
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(0, 229, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 229, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 20%, transparent 70%);
}

.bg-glow {
  position: fixed;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 120vw;
  height: 80vh;
  background: radial-gradient(ellipse at center, rgba(0, 180, 220, 0.12) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 1rem 0;
  transition: background 0.3s, backdrop-filter 0.3s, padding 0.3s;
}

.nav.scrolled {
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 0;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.12em;
}

.nav-logo-img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  letter-spacing: 0.03em;
}

.nav-links a:hover {
  color: var(--cyan);
}

.btn-nav {
  padding: 0.5rem 1.25rem !important;
  background: var(--cyan-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--cyan) !important;
}

.btn-nav:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--cyan);
}

.btn-nav-ai {
  display: inline-flex !important;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.15) !important;
  border: 1px solid rgba(239, 68, 68, 0.55) !important;
  color: #ff6b6b !important;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.18);
}

.btn-nav-ai:hover {
  background: rgba(239, 68, 68, 0.28) !important;
  border-color: #ef4444 !important;
  color: #ff8a8a !important;
  box-shadow: 0 0 28px rgba(239, 68, 68, 0.35);
}

.btn-nav-ai-icon {
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: 0.3s;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 1.5rem 4rem;
  z-index: 1;
  text-align: center;
}

.hero-content {
  max-width: 900px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.75rem;
}

.logo-container {
  position: relative;
  width: min(320px, 70vw);
  height: min(320px, 70vw);
  margin-bottom: 0.5rem;
}

.logo-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 40px rgba(0, 229, 255, 0.25));
}

.logo-ring {
  position: absolute;
  inset: -12%;
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 50%;
  animation: pulse-ring 4s ease-in-out infinite;
  z-index: 1;
}

.logo-ring-2 {
  inset: -22%;
  border-color: rgba(0, 229, 255, 0.1);
  animation-delay: 1.5s;
  animation-duration: 5s;
}

@keyframes pulse-ring {
  0%, 100% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.05); opacity: 1; }
}

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 4.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  display: flex;
  flex-direction: column;
  gap: 0.15em;
}

.title-line {
  display: block;
  padding: 0 0.5rem;
}

.title-line.accent {
  background: linear-gradient(135deg, var(--cyan) 0%, #7af0ff 50%, var(--cyan-dim) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-muted);
  max-width: 540px;
  font-weight: 400;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-top: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 1.75rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan) 0%, var(--cyan-dim) 100%);
  color: #031015;
  box-shadow: 0 0 30px var(--cyan-glow), 0 4px 20px rgba(0,0,0,0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 45px var(--cyan-glow), 0 8px 30px rgba(0,0,0,0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: var(--cyan-soft);
}

/* Scroll indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.7;
}

.mouse {
  width: 22px;
  height: 34px;
  border: 2px solid var(--text-muted);
  border-radius: 12px;
  position: relative;
}

.mouse::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 8px;
  background: var(--cyan);
  border-radius: 2px;
  animation: scroll-wheel 1.6s ease-in-out infinite;
}

@keyframes scroll-wheel {
  0% { opacity: 1; transform: translateX(-50%) translateY(0); }
  100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

/* ===== SECTIONS ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 6rem 1.5rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--cyan);
  margin-bottom: 1rem;
  text-transform: uppercase;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
}

.section-title .accent {
  color: var(--cyan);
}

/* ===== FEATURES ===== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}

.feature-card:hover {
  border-color: rgba(0, 229, 255, 0.35);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(0, 229, 255, 0.08);
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cyan-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1.25rem;
  color: var(--cyan);
}

.feature-icon svg {
  width: 24px;
  height: 24px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}

.feature-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* ===== TECH ===== */
.tech {
  background: linear-gradient(180deg, transparent 0%, rgba(0, 180, 220, 0.03) 50%, transparent 100%);
}

.tech-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 4rem;
  align-items: center;
}

.tech-visual {
  display: flex;
  justify-content: center;
}

.tech-logo-wrap {
  position: relative;
  width: 280px;
  height: 280px;
}

.tech-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 24px;
  position: relative;
  z-index: 2;
  filter: drop-shadow(0 0 50px rgba(0, 229, 255, 0.3));
}

.tech-pulse {
  position: absolute;
  inset: -15%;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.25);
  animation: tech-pulse 3s ease-in-out infinite;
}

.tech-pulse::after {
  content: '';
  position: absolute;
  inset: -12%;
  border-radius: 50%;
  border: 1px solid rgba(0, 229, 255, 0.12);
  animation: tech-pulse 3s ease-in-out infinite 0.8s;
}

@keyframes tech-pulse {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.08); opacity: 1; }
}

.tech-text {
  color: var(--text-muted);
  margin: 1.25rem 0 1.75rem;
  font-size: 1.05rem;
  line-height: 1.7;
}

.tech-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tech-list li {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.98rem;
  color: var(--text);
}

.check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--cyan-soft);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* ===== ABOUT ===== */
.about-content {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.about-content p {
  color: var(--text-muted);
  margin-top: 1.25rem;
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ===== CONTACT ===== */
.contact {
  padding-bottom: 4rem;
}

.contact-card {
  background: linear-gradient(145deg, var(--bg-card) 0%, #0a1520 100%);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 3.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.contact-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--cyan), transparent);
}

.contact-logo {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
}

.contact-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 16px;
  filter: drop-shadow(0 0 20px rgba(0, 229, 255, 0.3));
}

.contact-card h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  letter-spacing: 0.04em;
}

.contact-card > p {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 1.05rem;
}

.contact-actions {
  display: flex;
  justify-content: center;
}

/* ===== FOOTER ===== */
.footer {
  position: relative;
  z-index: 1;
  padding: 2.25rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border);
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  flex-shrink: 0;
}

.footer-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
}

.footer-legal {
  max-width: 640px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.65;
  text-align: right;
}

.footer-company {
  color: var(--text);
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.75rem;
  opacity: 0.9;
}

@media (max-width: 700px) {
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-legal {
    text-align: left;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 800px) {
  .tech-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
  
  .tech-logo-wrap {
    width: 220px;
    height: 220px;
  }
  
  .nav-links {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 7, 10, 0.95);
    backdrop-filter: blur(16px);
    padding: 1.5rem;
    gap: 1.25rem;
    border-bottom: 1px solid var(--border);
  }
}

@media (max-width: 500px) {
  .hero {
    padding-top: 5rem;
  }
  
  .logo-container {
    width: min(260px, 75vw);
    height: min(260px, 75vw);
  }
  
  .section {
    padding: 4rem 1.25rem;
  }
  
  .contact-card {
    padding: 2.5rem 1.5rem;
  }
}

/* ===== DEMO MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(2, 6, 12, 0.78);
  backdrop-filter: blur(8px);
}

.modal-overlay[hidden] {
  display: none !important;
}

.modal {
  position: relative;
  width: min(540px, 100%);
  max-height: min(90vh, 900px);
  overflow: auto;
  background: linear-gradient(165deg, #0d1520 0%, #0a1018 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.06), 0 24px 80px rgba(0, 0, 0, 0.55), 0 0 60px rgba(0, 229, 255, 0.08);
  padding: 1.75rem 1.5rem 1.5rem;
}

.modal h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.modal-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.modal-intro strong {
  color: var(--cyan);
  font-weight: 500;
}

.modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.85rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--cyan);
}

#demo-form .field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.95rem;
}

#demo-form .field span {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

#demo-form input,
#demo-form textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.98rem;
  padding: 0.75rem 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  resize: vertical;
}

#demo-form input:focus,
#demo-form textarea:focus {
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(0, 229, 255, 0.12);
}

#demo-form .hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

.form-status {
  margin: 0.25rem 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

.form-status.ok {
  background: rgba(0, 200, 120, 0.12);
  border: 1px solid rgba(0, 200, 120, 0.35);
  color: #7dffc0;
}

.form-status.err {
  background: rgba(255, 80, 80, 0.1);
  border: 1px solid rgba(255, 80, 80, 0.35);
  color: #ffb4b4;
}

body.modal-open {
  overflow: hidden;
}

button.btn {
  font: inherit;
  cursor: pointer;
  border: none;
}

/* Fix: ensure CTA and modal are always clickable */
.hero-content,
.hero-cta {
  position: relative;
  z-index: 5;
}

.scroll-indicator {
  pointer-events: none;
}

.modal-overlay:not([hidden]) {
  display: flex !important;
}

#btn-richiedi-demo,
.js-open-demo,
[data-open-demo] {
  position: relative;
  z-index: 6;
  pointer-events: auto;
  cursor: pointer;
}
