/* ============================================
   REGOLE GENERALI
   ============================================ */

   :root {
    --bg: #010101;
    --text: #F5F7FF;
    --muted: rgba(245, 247, 255, 0.72);
    --card: rgba(255, 255, 255, 0.04);
    --border: rgba(255, 255, 255, 0.10);
    --accent1: #565FF1;
    --accent2: #4D99FC;
    --accent3: #23E6F4;
  }
  
  * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  }
  
  /* Fallback per evitare “grigi” in bounce: stessa base ovunque */
  html {
    min-height: 100%;
    background: #000000;
  }
  
  body {
    min-height: 100%;
    background: #000000;
    color: var(--text);
    overflow-x: hidden; /* solo x */
  }
  
  /* wrapper contenuti */
  #app {
    position: relative;
    z-index: 1;
  }
  
  /* Background layer stabile */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url('Immagini/Landing/Desktop/hero-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  
  /* Overlay scuro */
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background: rgba(1, 1, 1, 0.30);
  }
  
  /* ============================================
     NAVBAR
     ============================================ */
  
  .hero-header {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 3rem;
    width: 100%;
  }
  
  .logo-container {
    position: absolute;
    left: 3rem;
    top: calc(2rem - 20px);
  }
  
  .logo {
    width: 90px;
    height: 90px;
    background-image: url('Immagini/Landing/logo.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  .nav {
    display: none;
  }
  
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
    z-index: 11;
  }
  
  .nav-toggle:hover {
    background: var(--card);
    border-color: var(--accent1);
  }
  
  .nav-toggle:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
  }
  
  .nav-toggle__icon {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    position: relative;
    transition: transform 0.25s ease, background 0.25s ease;
  }
  
  .nav-toggle__icon::before,
  .nav-toggle__icon::after {
    content: "";
    position: absolute;
    left: 0;
    width: 24px;
    height: 2px;
    background: currentColor;
    transition: transform 0.25s ease;
  }
  
  .nav-toggle__icon::before { top: -8px; }
  .nav-toggle__icon::after  { top: 8px; }
  
  body.menu-open .nav-toggle .nav-toggle__icon {
    background: transparent;
  }
  
  body.menu-open .nav-toggle .nav-toggle__icon::before {
    top: 0;
    transform: rotate(45deg);
  }
  
  body.menu-open .nav-toggle .nav-toggle__icon::after {
    top: 0;
    transform: rotate(-45deg);
  }
  
  /* ============================================
     OVERLAY MENU
     ============================================ */
  
  .nav-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
  }
  
  .nav-overlay[hidden] {
    display: none;
  }
  
  body.menu-open .nav-overlay {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* blocca scroll SOLO quando menu aperto (senza congelare sempre) */
  body.menu-open {
    overflow: hidden;
  }
  
  .nav-overlay__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(1, 1, 1, 0.7);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    cursor: pointer;
    opacity: 0;
    transition: opacity 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  
  @supports not (backdrop-filter: blur(1px)) {
    .nav-overlay__backdrop {
      background: rgba(1, 1, 1, 0.82);
    }
  }
  
  body.menu-open .nav-overlay__backdrop {
    opacity: 1;
  }
  
  .nav-overlay__panel {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(14px) scale(0.98);
    transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
                opacity 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  
  .nav-overlay__panel > * {
    pointer-events: auto;
  }
  
  body.menu-open .nav-overlay__panel {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  
  .nav-overlay__accent {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--accent3));
    transition: width 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    margin-bottom: 2rem;
  }
  
  body.menu-open .nav-overlay__accent {
    width: 120px;
  }
  
  .nav-overlay__nav {
    display: flex;
    flex-direction: column;
    gap: 24px;
    text-align: center;
    align-items: center;
  }
  
  .nav-overlay__link {
    color: var(--text);
    text-decoration: none;
    font-size: clamp(22px, 4vw, 34px);
    font-weight: 500;
    line-height: 1.4;
    padding: 0.25em 0;
    background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--accent3)) bottom / 0 2px no-repeat;
    transition: background-size 0.25s ease, color 0.25s ease;
  }
  
  .nav-overlay__link:hover,
  .nav-overlay__link:focus-visible {
    background-size: 100% 2px;
    color: var(--accent2);
    outline: none;
  }
  
  .nav-overlay__link:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 4px;
    border-radius: 4px;
  }
  
  .nav-overlay__cta {
    margin-top: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent1), var(--accent2));
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  
  .nav-overlay__cta:hover,
  .nav-overlay__cta:focus-visible {
    opacity: 0.95;
    transform: translateY(-2px);
    outline: none;
  }
  
  .nav-overlay__cta:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 4px;
  }
  
  @media (prefers-reduced-motion: reduce) {
    .nav-overlay__backdrop,
    .nav-overlay__panel,
    .nav-overlay__accent {
      transition: none;
    }
    body.menu-open .nav-overlay__panel {
      transform: none;
    }
  }
  
  /* ============================================
     HERO CONTENT
     ============================================ */
  
  /* Niente height:100vh rigido: usa min-height viewport-safe */
  .hero {
    position: relative;
    width: 100%;
    min-height: 100svh;
    min-height: 100dvh;
    min-height: 100vh;
    height: auto;
    display: flex;
    flex-direction: column;
  }
  
  .hero-content {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
  }
  
  .hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    letter-spacing: 0.02em;
  }
  
  .hero-subtitle {
    font-size: 1.5rem;
    color: var(--muted);
    margin-bottom: 2.5rem;
    max-width: 700px;
    line-height: 1.6;
  }
  
  .btn-cta {
    display: inline-block;
    padding: 1rem 2.5rem;
    background-color: #9674FD;
    color: #FFFFFF;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    border: 2px solid #9674FD;
  }
  
  .btn-cta:hover {
    background-color: #7D5AE8;
    border-color: #7D5AE8;
    transform: translateY(-2px);
  }
  
  /* ============================================
     SEZIONE 2
     ============================================ */
  
  .sezione2 {
    padding: 4rem 2rem;
    width: 100%;
    background-image: url('Immagini/Landing/Desktop/sezione2-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  .sezione2-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 4rem;
  }
  
  .sezione2-rectangle {
    max-width: 900px;
    margin: calc(4rem + 100px) auto;
    position: relative;
    z-index: 1;
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 30px;
    border: 1px solid var(--border);
    box-shadow: 0 0 0 1px var(--accent2), 0 4px 12px rgba(86, 95, 241, 0.15);
    display: grid;
    grid-template-columns: 35% 65%;
    gap: 3rem;
    padding: 3rem;
    align-items: center;
  }
  
  .rectangle-accent { display: none; }
  
  .rectangle-content {
    position: relative;
    z-index: 1;
  }
  
  .rectangle-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.5rem;
    line-height: 1.2;
  }
  
  .rectangle-description {
    font-size: 1.1rem;
    color: var(--muted);
    line-height: 1.6;
    margin-bottom: 0;
    max-width: 100%;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  
  .rectangle-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    grid-column: 1 / -1;
    margin-top: calc(1rem - 60px);
    margin-left: -27px;
    width: 100%;
  }
  
  .rectangle-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background-color: #9674FD;
    border: 1px solid #9674FD;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #FFFFFF;
    font-weight: 500;
  }
  
  .rectangle-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 300px;
  }
  
  .rectangle-image {
    width: 100%;
    height: 100%;
    background-image: url('Immagini/Landing/about-visual.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 12px;
  }
  
  /* Card Styles */
  .card-link {
    position: relative;
    display: block;
    background-color: #000000;
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    overflow: hidden;
  }
  
  .card-link:hover,
  .card-link:focus {
    transform: translateY(-2px);
    border-color: var(--accent2);
    box-shadow: 0 0 0 1px var(--accent2), 0 4px 12px rgba(86, 95, 241, 0.15);
  }
  
  .card-link:focus-visible {
    outline: 2px solid var(--accent2);
    outline-offset: 2px;
  }
  
  .card-accent {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent1), var(--accent2), var(--accent3));
  }
  
  .card-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 60px;
    margin-bottom: 1rem;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
  }
  
  .card-link:nth-child(1) .card-badge { background-image: url('Immagini/Landing/badge-1.png'); }
  .card-link:nth-child(2) .card-badge { background-image: url('Immagini/Landing/badge-2.png'); }
  
  .card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.2;
  }
  
  .card-title-large { font-size: 3rem; }
  
  .card-link:nth-child(3) .card-title { margin-top: -85px; }
  
  .card-description {
    font-size: 1rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }
  
  .card-link:nth-child(3) .card-description { margin-top: 30px; }
  
  .card-bullets {
    list-style: none;
    margin-bottom: 2rem;
  }
  
  .card-link:nth-child(3) .card-bullets { margin-top: 40px; }
  
  .card-bullets li {
    font-size: 0.95rem;
    color: var(--muted);
    padding: 0.25rem 0;
    position: relative;
    padding-left: 1rem;
  }
  
  .card-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent2);
  }
  
  .card-arrow {
    position: absolute;
    bottom: 2rem;
    right: 2rem;
    font-size: 1.5rem;
    color: var(--accent2);
    font-weight: 700;
    transition: transform 0.3s ease;
  }
  
  .card-link:hover .card-arrow,
  .card-link:focus .card-arrow {
    transform: translateX(4px);
  }
  
  /* ============================================
     RESPONSIVE
     ============================================ */
  
  @media (max-width: 1024px) {
    body::before {
      background-image: url('Immagini/Landing/Tablet/Portrait/hero-background.png');
    }
  
    .hero-header { padding: 1.5rem 2rem; }
  
    .logo-container {
      left: 2rem;
      top: calc(1.5rem - 10px);
    }
  
    .logo {
      width: 70px;
      height: 70px;
    }
  
    .hero-title {
      font-size: 3rem;
      margin-bottom: 1rem;
    }
  
    .hero-subtitle {
      font-size: 1.2rem;
      margin-bottom: 2rem;
    }
  
    .btn-cta {
      padding: 0.9rem 2rem;
      font-size: 1rem;
    }
  

        .sezione2-container {
          grid-template-columns: repeat(2, 1fr);
          gap: 1.5rem;
        }
      
        /* centra la terza card (Servizi) senza cambiare dimensioni */
        .sezione2-container .card-link:nth-child(3) {
          grid-column: 1 / 2; /* reset */
          justify-self: stretch; /* reset */
        }
      
        .sezione2-container .card-link:nth-child(3) {
          grid-column: 1 / 3;      /* mantiene la riga da 2 colonne */
          width: auto;             /* non forzo larghezze */
          justify-self: center;    /* centra il box */
        }
      
        /* questa è la chiave: gli do la stessa “dimensione colonna” */
        .sezione2-container .card-link:nth-child(3) {
          max-width: none;         /* evita cambi dimensione */
        }
      
        /* e lo centro usando una colonna fittizia */
        .sezione2-container {
          grid-template-columns: 1fr 1fr;
        }
      
        .sezione2-container .card-link:nth-child(3) {
          grid-column: 1 / -1;
          display: block;
          width: calc((100% - 1.5rem) / 2); /* stessa larghezza delle altre */
          justify-self: center;
        }

      
  
    .sezione2 { background-image: none; }
  }
  
  @media (max-width: 768px) {
    body::before {
      background-image: url('Immagini/Landing/Mobile/Portrait/hero-background.png');
    }
  
    .hero-header { padding: 1rem; }
  
    .logo {
      width: 60px;
      height: 60px;
    }
  
    .hero-content { padding: 1rem; }
  
    .hero-title {
      font-size: 2.5rem;
      margin-bottom: 1rem;
    }
  
    .hero-subtitle {
      font-size: 1.1rem;
      margin-bottom: 1.5rem;
    }
  
    .btn-cta {
      padding: 0.9rem 2rem;
      font-size: 0.95rem;
    }
  
    .sezione2 {
      padding: 3rem 1rem;
      background-image: none;
    }
  
    .sezione2-container {
      grid-template-columns: 1fr;
      gap: 1.5rem;
    }
  
    .card-link { padding: 1.5rem; }
  
    .card-title-large { font-size: 2rem; }

      /* annulla la regola tablet che dimezza la card 3 */
  .sezione2-container .card-link:nth-child(3) {
    width: 100%;
    grid-column: auto;
    justify-self: stretch;
  }
  }
  
  /* ============================================
     FOOTER
     ============================================ */
  
  .footer {
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.4) 15%, #000000 50%);
    padding: 3rem 2rem;
    z-index: 2;
  }
  
  .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
  }
  
  .footer-logo {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #FFFFFF;
  }
  
  .footer-info {
    font-size: 0.9rem;
    color: #FFFFFF;
    margin-bottom: 1.5rem;
  }
  
  .footer-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .footer-link {
    color: #FFFFFF;
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
  }
  
  .footer-link:hover { opacity: 0.7; }
  
  .footer-separator {
    color: #FFFFFF;
    margin: 0 0.25rem;
  }

  /* ============================================
   NAV ORIZZONTALE: DESKTOP + TABLET LANDSCAPE
   ============================================ */

/* Desktop */
@media (min-width: 1025px) {
    .nav {
      display: flex;
      gap: 2.5rem;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }
  
    .nav-toggle { display: none; }
  }
  
  /* Tablet in landscape (>=768px) */
  @media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .nav {
      display: flex;
      gap: 2rem;
      position: absolute;
      left: 50%;
      transform: translateX(-50%);
    }
  
    .nav-toggle { display: none; }
  }
  
  /* Stile link (vale solo quando .nav è visibile) */
  @media (min-width: 768px) and (orientation: landscape), (min-width: 1025px) {
    .nav a {
      text-decoration: none;
      color: var(--text);
      font-size: 1rem;
      font-weight: 500;
      position: relative;
      transition: color 0.2s ease;
    }
  
    .nav a:hover { color: var(--accent2); }
  
    .nav a::after {
      content: "";
      position: absolute;
      left: 0;
      bottom: -6px;
      width: 0;
      height: 2px;
      background: linear-gradient(90deg, var(--accent1), var(--accent2));
      transition: width 0.25s ease;
    }
  
    .nav a:hover::after { width: 100%; }
  }

  @media (max-width: 768px) and (orientation: landscape) {

    .nav-overlay__nav {
      gap: 14px; /* meno spazio verticale */
    }
  
    .nav-overlay__link {
      font-size: 18px; /* font più compatto */
    }
  
  }
  
  
