/* --- 1. IMPOSTAZIONI GLOBALI E VARIABILI --- */
:root {
  --title-shine-duration: 6s;
  --brand1: #7c3aed;
  --brand2: #8b5cf6;
  --brand3: #06b6d4;
  --brand-grad: linear-gradient(90deg, var(--brand1) 0%, var(--brand2) 42%, var(--brand3) 100%);
  --bg: #f7f5fa;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #334155;
  --radius: 22px;
  --shadow: 0 10px 25px rgba(0, 0, 0, .05), 0 5px 10px rgba(0, 0, 0, .02);
  --header-h: 82px;
  --font-title: 'Playfair Display', serif;
  --font-body: 'Lato', sans-serif;
}

/* --- 2. STILI BASE E SFONDO IMMERSIVO DAL LAB --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background-color: var(--bg);
  /* SFONDO LAB */
  background-image: url("/images/lab-bg.jpg");
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}
.container { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
h1, h2, h3 { font-family: var(--font-body); font-weight: 800; color: var(--brand1); }

/* --- 3. HEADER --- */
.app-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--brand-grad);
  box-shadow: 0 14px 36px rgba(124, 58, 237, .25);
}
.header-wrap { display: flex; align-items: center; justify-content: center; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; }
.brand .logo { width: 38px; height: 38px; }
.title {
  margin: 0; font-weight: 800;
  font-size: clamp(20px, 3.2vw, 32px); color: #fff;
}
.title strong { font-weight: 800; }
.title--gloss::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.55) 15%, transparent 30%);
  background-size: 200% 100%; mix-blend-mode: screen;
  animation: gloss var(--title-shine-duration) linear infinite;
  pointer-events: none;
}
@keyframes gloss { from { background-position-x: 200%; } to { background-position-x: -200%; } }

/* --- 4. HERO --- */
.hero { padding: clamp(16px, 4vh, 24px) 0; }
.hero-content-wrap {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: center;
}
.intro { text-align: center; }

/* migliore leggibilità su mobile */
@media (max-width: 767.98px) {
  .intro {
    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: 0 10px 24px rgba(0,0,0,.08);
  }
}

.intro h1 {
  font-size: clamp(24px, 6vw, 36px); 
  line-height: 1.25;
  margin: 0 0 0.8rem;
}
.intro p {
  font-size: clamp(15px, 3.5vw, 17px);
  color: var(--muted);
  line-height: 1.6;
  margin: 0 auto 1.2rem;
  max-width: 520px;
}
.hero-media-container { display: flex; justify-content: center; }
.hero-media { max-width: 250px; }
.hero-media img {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 15px 30px -10px rgba(124, 58, 237, .4);
}

/* Desktop hero a 2 colonne (glass-card) */
@media (min-width: 768px) {
  .hero { padding: 48px 0; }
  .hero-content-wrap {
    grid-template-columns: 1fr 0.8fr;
    gap: 3rem;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.8);
    border-radius: var(--radius);
    padding: 3rem;
  }
  .intro { text-align: left; }
  .intro h1 { font-size: clamp(30px, 4vw, 42px); }
  .intro p { margin-left: 0; }
  .intro .cta { justify-content: flex-start; }
  .hero-media-container { justify-content: center; }
  .hero-media { max-width: 100%; }
}

/* --- 5. SEZIONI SUCCESSIVE --- */

/* Offset per anchor-scroll */
.scroll-anchor { scroll-margin-top: calc(var(--header-h) + 12px); }

/* Sezioni generiche */
.philosophy-section, .benefits-section, .final-cta-section, .meaning-section {
  padding-top: clamp(50px, 8vh, 80px);
  padding-bottom: clamp(50px, 8vh, 80px);
}

/* === Sezione "Cos'è SynapSenseS" === */

/* Layout mobile (default) */
.meaning-section {
  display: block; /* Semplificato per evitare conflitti */
}

/* <<< MODIFICA QUI >>> Aumentata dimensione immagine su mobile */
.meaning-visual {
  max-width: 200px; /* Era 160px */
  margin: 0 auto 2rem; /* Aggiunto spazio sotto */
  opacity: 0.85;
}

.meaning-text h2 {
  text-align: center;
  font-size: clamp(24px, 4vw, 36px);
  margin: 0 0 1rem;
}
.meaning-text h2 strong {
  background: var(--brand-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.meaning-text p, .meaning-text ul {
  text-align: left;
  font-size: clamp(16px, 2vw, 18px);
  line-height: 1.7;
  margin: 0 0 1.5rem;
}
.meaning-text ul {
  list-style: none;
  padding-left: 0;
}
.meaning-text ul li {
  padding-left: 1.5em;
  position: relative;
}
.meaning-text ul li:not(:last-child) {
  margin-bottom: 0.8rem;
}
.meaning-text ul li::before {
  content: '⚡️';
  position: absolute;
  left: 0;
  top: 2px;
}
.meaning-text p.meaning-conclusion {
  font-weight: bold;
  color: var(--text);
  margin-bottom: 0;
  text-align: left;
}

/* Card su Mobile */
@media (max-width: 767.98px) {
  .meaning-section .section-card {
    background: rgba(255, 255, 255, 0.86);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.95);
    border-radius: var(--radius);
    box-shadow: 0 10px 24px rgba(0, 0, 0, .08);
    padding: 24px 20px;
    margin: 0; /* Rimuoviamo il margine per coerenza */
  }
}

/* === Layout Desktop per le card === */
@media (min-width: 768px) {
  .section-card {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(30px, 4vw, 50px);
    max-width: 1080px;
    margin: 0 auto;
  }
  
  /* Card specifica per "Cos'è SynapSenseS" su desktop */
  .meaning-section .section-card {
    display: grid;
    grid-template-columns: 0.7fr 1fr; /* Rapporto modificato per dare più spazio all'immagine */
    gap: 3.5rem;
    align-items: center;
  }
  
  /* <<< MODIFICA QUI >>> Aumentata dimensione immagine su desktop e centrata */
  .meaning-visual {
    max-width: 280px; /* Era 220px */
    margin: 0 auto;   /* Centra l'immagine nella sua colonna */
  }

  .meaning-text h2,
  .meaning-text p,
  .meaning-text ul,
  .meaning-text p.meaning-conclusion {
    text-align: left;
  }
}


/* Philosophy */
.philosophy-section { display: flex; justify-content: center; align-items: center; }
.philosophy-content {
  max-width: 700px; text-align: center;
  padding: clamp(24px, 5vw, 40px);
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(8px);
  border-radius: var(--radius);
}
.philosophy-icon { font-size: 3rem; line-height: 1; margin-bottom: 1rem; }
.philosophy-content h2 { font-size: clamp(24px, 4vw, 38px); margin: 0 0 12px; }
.philosophy-content p { font-size: clamp(16px, 2vw, 19px); color: var(--muted); line-height: 1.7; margin: 0; }

/* Benefits */
.benefits-section { background: #fff; }
.benefits-section h2, .final-cta-section h2 { font-size: clamp(26px, 4.5vw, 44px); margin-bottom: clamp(24px, 5vw, 48px); text-align: center; }
.benefits-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.benefit-card { background: var(--card); border-radius: var(--radius); padding: 24px; text-align: center; box-shadow: var(--shadow); border: 1px solid #e5e7eb; }
.benefit-icon { font-size: 2.5rem; margin-bottom: 1rem; }

/* Final CTA */
.final-cta-section { text-align: center; }
.final-cta-section p { font-size: clamp(16px, 2vw, 19px); color: var(--muted); max-width: 600px; margin: 0 auto; }
.final-cta-section .cta { margin-top: 24px; }
.section-card.section-card--cta { text-align: center; }
.section-card.section-card--cta .cta { justify-content: center; }


/* --- Patch integrata: miglior leggibilità (ex sezione 7) --- */
.meaning-text p,
.meaning-text ul,
.meaning-text li,
.philosophy-content p,
.benefits-section p,
.final-cta-section p {
  color: var(--text);
}

.meaning-text h2 {
  text-shadow: 0 1px 2px rgba(0,0,0,.16);
}

/* Card glass su mobile (Final CTA) */
@media (max-width: 767.98px) {
  .final-cta-section {
    background: rgba(255,255,255,0.82);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.9);
    border-radius: var(--radius);
  }
}


/* --- 6. BOTTONI, MODAL, FOOTER --- */
.cta { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.btn {
  appearance: none; border: none; cursor: pointer;
  font-family: var(--font-body); font-weight: 700;
  font-size: clamp(14px, 1.6vw, 16px); line-height: 1; border-radius: 14px;
  padding: 13px 18px; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 10px;
  position: relative; overflow: hidden; color: #fff;
  background: var(--brand-grad);
  box-shadow: 0 14px 36px rgba(124, 58, 237, .34), inset 0 -2px 0 rgba(255,255,255,.2);
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 22px rgba(124,58,237,.55), 0 0 42px rgba(6,182,212,.35);
}
.btn:focus-visible {
  outline: 3px solid #06b6d4;
  outline-offset: 3px;
  box-shadow: 0 0 0 3px rgba(6,182,212,.35), 0 14px 36px rgba(124, 58, 237, .34);
}

.btn-hero {
  --shine: radial-gradient(140px 140px at var(--rx,50%) var(--ry,50%), #ffffff99, transparent 60%);
  padding: 16px 22px; border-radius: 16px; position: relative;
  isolation: isolate; overflow: hidden;
  box-shadow: 0 16px 40px rgba(124,58,237,.45), 0 0 0 2px rgba(255,255,255,.18) inset, 0 0 26px rgba(6,182,212,.25);
  background-image: linear-gradient(90deg, #7c3aed, #8b5cf6 45%, #06b6d4), var(--shine);
  background-blend-mode: screen, normal;
}
.btn-hero-lg { font-size: clamp(16px, 2.2vw, 20px); padding: 18px 24px; }
.btn-hero:hover {
  transform: translateY(-3px) scale(1.03);
  filter: saturate(1.06) brightness(1.03);
  box-shadow: 0 20px 48px rgba(124,58,237,.55), 0 0 0 2px rgba(255,255,255,.22) inset, 0 0 38px rgba(6,182,212,.35);
}
.btn-ico-spark { animation: spark 1.8s ease-in-out infinite; }
@keyframes spark { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

.overlay { position: fixed; inset: 0; background: rgba(17,24,39,.45); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; z-index: 120; }
.overlay.show { display: flex; }
.modal { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(560px,92vw); background: var(--card); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.25); border: 1px solid #e5e7eb; padding: 18px 18px 20px; }
.modal-header { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.modal-body { color: var(--muted); line-height: 1.65; }
.close-btn { width: 38px; height: 38px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #e5e7eb; background: #fff; cursor: pointer; margin-left: auto; }
.bulb { width:28px; height:28px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; background:radial-gradient(circle at 50% 40%, #fff 0%, #fef3c7 55%, #fde68a 90%); box-shadow:0 0 12px rgba(250,204,21,.8); animation:wiggle 2.8s ease-in-out infinite; }
@keyframes wiggle{0%,100%{transform:rotate(0)}10%{transform:rotate(-5deg)}20%{transform:rotate(5deg)}30%{transform:rotate(-3deg)}40%{transform:rotate(3deg)}50%{transform:rotate(0)}}

footer { padding: clamp(18px, 3.6vw, 24px) 0 28px; color: var(--muted); font-size: 14px; text-align: center; }
