/* =========================================
   VARIABILI & PALETTE (Dal banner centrale)
   ========================================= */
:root {
  --bg-dark: #0A0E17;
  --bg-surface: #111726;
  --bg-surface-hover: #172035;
  --text-main: #FFFFFF;
  --text-muted: #A0AEC0;
  --text-dim: #718096;

  /* Gradiente del logo */
  --cyan: #00D2FF;
  --purple: #7A5AF8;
  --magenta: #E11D8B;
  --brand-gradient: linear-gradient(90deg, var(--cyan) 0%, var(--purple) 52%, var(--magenta) 100%);
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

#neural-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.container {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition);
}

/* =========================================
   NAVBAR
   ========================================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 1.1rem 0;
  transition: var(--transition);
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  padding: 0.8rem 0;
  background: rgba(10, 14, 23, 0.94);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-logo-icon {
  width: 40px;
  height: 30px;
}

.nav-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.12em;
}

.nav-title span {
  font-weight: 400;
  color: #E2E8F0;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  font-size: 0.95rem;
  font-weight: 500;
}

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

.btn-nav {
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(122, 90, 248, 0.5);
  font-weight: 500;
}

.btn-nav:hover {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #FFF;
}

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

.mobile-toggle span {
  width: 24px;
  height: 2px;
  background-color: var(--text-main);
  transition: var(--transition);
}

/* =========================================
   HERO SECTION (Riproduzione fedele banner)
   ========================================= */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 7.5rem 0 4.5rem;
}

.hero-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.banner-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  width: 100%;
  max-width: 960px;
  padding: 2rem 1rem;
}

.hero-brain-wrapper {
  flex: 0 0 auto;
  width: 270px;
}

.hero-brain-svg {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(122, 90, 248, 0.22));
}

.hero-divider {
  width: 1.5px;
  height: 165px;
  background-color: rgba(255, 255, 255, 0.75);
  flex-shrink: 0;
}

.hero-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.brand-name {
  font-family: var(--font-display);
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  text-transform: uppercase;
}

.brand-name .line-bold {
  font-size: clamp(2.2rem, 4.5vw, 3.35rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #FFFFFF;
}

.brand-name .line-light {
  font-size: clamp(2.1rem, 4.3vw, 3.2rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  color: #F7FAFC;
  margin-top: 0.15rem;
}

.brand-payoff {
  font-family: var(--font-display);
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  margin-top: 1.1rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Sotto il banner: Un progetto del gruppo Materia */
.hero-sub-brand {
  text-align: center;
  max-width: 680px;
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.group-badge {
  display: inline-block;
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
}

.group-badge strong {
  color: #FFFFFF;
  font-weight: 600;
}

.hero-description {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 2.2rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* =========================================
   PULSANTI
   ========================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.8rem;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.btn-primary {
  background: var(--brand-gradient);
  color: #FFFFFF;
  box-shadow: 0 4px 20px rgba(122, 90, 248, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 26px rgba(0, 210, 255, 0.45);
}

.btn-outline {
  background: transparent;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.btn-outline:hover {
  border-color: var(--cyan);
  background: rgba(0, 210, 255, 0.08);
}

.btn-full {
  width: 100%;
}

/* =========================================
   SEZIONI GENERALI
   ========================================= */
.section {
  padding: 6rem 0;
}

.section-alt {
  background-color: rgba(17, 23, 38, 0.65);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 3.8rem;
}

.section-tag {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.65rem;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.2vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* =========================================
   CHI SIAMO
   ========================================= */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.75rem;
}

.about-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 2rem;
  transition: var(--transition);
}

.about-card:hover {
  transform: translateY(-4px);
  border-color: rgba(122, 90, 248, 0.45);
}

.about-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
  color: #FFFFFF;
}

.about-card p {
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* =========================================
   APPROCCIO (3 PILASTRI)
   ========================================= */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.pillar-item {
  position: relative;
  padding: 2rem;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.pillar-number {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.75rem;
}

.pillar-item h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 0.75rem;
}

.pillar-item p {
  color: var(--text-muted);
  font-size: 0.96rem;
}

/* =========================================
   SERVIZI
   ========================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 1.75rem;
}

.service-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  padding: 2.2rem 1.8rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--brand-gradient);
  opacity: 0;
  transition: var(--transition);
}

.service-card:hover {
  background: var(--bg-surface-hover);
  transform: translateY(-5px);
}

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

.service-icon {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(122, 90, 248, 0.12);
  color: var(--cyan);
  margin-bottom: 1.4rem;
}

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

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
}

.service-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* =========================================
   CONTATTI
   ========================================= */
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 3.5rem;
  align-items: start;
}

.contact-info h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.3rem);
  margin-bottom: 1rem;
  line-height: 1.2;
}

.contact-info p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.contact-direct {
  padding: 1.25rem 1.5rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.contact-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 0.3rem;
}

.contact-email {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--cyan);
  word-break: break-all;
}

.contact-email:hover {
  text-decoration: underline;
}

.contact-form {
  background: var(--bg-dark);
  padding: 2.2rem;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
  color: #E2E8F0;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: #FFFFFF;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(122, 90, 248, 0.18);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: #06090F;
  border-top: 1px solid var(--border-subtle);
  padding-top: 3.5rem;
}

.footer-container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
  padding-bottom: 2.5rem;
}

.footer-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.footer-title span {
  font-weight: 400;
}

.footer-payoff {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  margin-top: 0.4rem;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

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

.footer-details p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.footer-details a:hover {
  color: var(--cyan);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* =========================================
   ANIMAZIONI SCROLL
   ========================================= */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================
   RESPONSIVE (Tablet & Mobile)
   ========================================= */
@media (max-width: 860px) {
  .banner-showcase {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .hero-brain-wrapper {
    width: 220px;
  }

  .hero-divider {
    width: 140px;
    height: 1.5px;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    top: 64px;
    right: -100%;
    width: 100%;
    height: calc(100vh - 64px);
    background: rgba(10, 14, 23, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    font-size: 1.2rem;
    transition: right 0.35s ease;
  }

  .nav-links.open {
    right: 0;
  }
}