/* RESET LIGHT */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: -0.2px;
    background: #ffffff;
    color: #111;
    line-height: 1.5;
}

/* GLOBAL SPACING */
section {
    padding: 40px 0;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
@media (min-width: 1025px) {
    section {
        padding: 80px 0 !important;
    }
}
section.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* DESKTOP — reduce vertical spacing between sections */
@media (min-width: 1025px) {
    section {
        padding: 15px 0 !important;
    }
}

.container {
    width: min(1100px, 90%);
    margin: auto;
}

/* NAVBAR – base */
.navbar {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 999;
    background: rgba(255, 255, 255, 0.4); /* traslucido iniziale */
    backdrop-filter: blur(10px); /* effetto vetro macOS */
    transition: background 0.3s ease, padding 0.3s ease;
    padding: 0px;
  }
  
  .navbar .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  .nav-logo {
      display: flex;
      align-items: center;
      gap: 10px;
  }
  .nav-logo img {
      height: 54px;
      width: auto;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
      transition: transform 0.35s ease, filter 0.35s ease;
  }
  .navbar.navbar--scrolled .nav-logo img {
      transform: scale(0.92);
      filter: drop-shadow(0 1px 3px rgba(0,0,0,0.06));
  }
  @media (max-width: 768px) {
      .nav-logo img {
          height: 48px;
      }
  }
  
  .nav-links a {
    margin-left: 32px;
    font-size: 1rem;
    color: #111;
    text-decoration: none;
    transition: color 0.2s ease;
  }
  .nav-links a:hover {
    color: #007AFF;
  }
  
  /* Stato scrolled */
  .navbar.navbar--scrolled {
    background: rgba(255, 255, 255, 0.9);
    padding: 0px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  /* Fade-in all links on load */
  .navbar {
    opacity: 0;
    animation: fadeInNav 0.8s ease forwards 0.4s;
  }
  @keyframes fadeInNav {
    to { opacity: 1; }
  }
  
  /* MOBILE VERSION – hamburger */
  @media (max-width: 768px) {
    .nav-links {
      display: none;
    }
    .nav-menu-toggle {
      display: block;
      font-size: 1.5rem;
      cursor: pointer;
      color: #111;
    }
  }
  
  /* (Puoi poi aggiungere il panel mobile al click) */

/* HAMBURGER BUTTON BASE */
.nav-menu-toggle {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    user-select: none;
}

/* MOBILE MENU PANEL */
.mobile-menu {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 70%;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    box-shadow: -4px 0 16px rgba(0,0,0,0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 998;
    display: flex;
    flex-direction: column;
    padding: 120px 30px;
}

.mobile-menu a {
    margin-bottom: 24px;
    font-size: 1.4rem;
    text-decoration: none;
    color: #111;
}

/* OPEN STATE */
.mobile-menu--open {
    transform: translateX(0);
}

/* SHOW HAMBURGER AND HIDE LINKS ON MOBILE */
/* SECTION TITLE */
.section-title {
    color: black;
    font-size: 4rem;
    font-weight: 600;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 20px;
    opacity: 1;
    transform: translateY(20px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: 0.3s;
}

/* SECTION SUBTITLE (APPLE STYLE) */
.section-subtitle {
    font-size: 1.6rem;
    font-weight: 300;
    color: rgba(0,0,0,0.7);
    text-align: center;
    max-width: 700px;
    margin: 0 auto 20px auto;
    letter-spacing: 0.3px;
    line-height: 1.55;
    opacity: 1;
    transform: translateY(12px);
    transition: opacity 1s ease, transform 1s ease;
    transition-delay: 0.45s;
}

.section-subtitle.in-view {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }
    .nav-menu-toggle {
        display: block;
    }
}

/* MOBILE HERO */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3.2rem;
        line-height: 1.15;
    }
    .hero-subtitle {
        font-size: 1.4rem;
        line-height: 1.4;
        font-weight: 800;
    }
    .highlight {
        font-size: 2.4rem;
        line-height: 1.2;
    }
    .scroll-indicator {
        bottom: 20px;
        height: 30px;
    }
}


/* --------------------------------------------------
   BACK TO TOP — EFFECTS (Glow, Breathing, Pulsation)
--------------------------------------------------- */
/* BACK TO TOP — base */
#back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;

    /* Glass effect */
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    background: rgba(255, 255, 255, 0.32);
    border: 1px solid rgba(255, 255, 255, 0.45);

    box-shadow:
        inset 0 0 22px rgba(255,255,255,0.45),
        inset 0 8px 18px rgba(0,0,0,0.06),
        0 10px 25px rgba(0,0,0,0.10);
    box-shadow:
        inset 0 0 22px rgba(255,255,255,0.45),
        inset 0 8px 18px rgba(0,0,0,0.06),
        0 10px 25px rgba(0,0,0,0.10),
        0 18px 35px rgba(0,0,0,0.12); /* floating shadow */

    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition:
        opacity .4s ease,
        transform .4s ease,
        visibility .4s ease;
    z-index: 2000 !important;
    overflow: hidden;
}

@media (max-width: 768px) {
    #back-to-top {
        bottom: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        box-shadow:
            inset 0 0 16px rgba(255,255,255,0.35),
            inset 0 6px 14px rgba(0,0,0,0.05),
            0 8px 18px rgba(0,0,0,0.08),
            0 14px 24px rgba(0,0,0,0.10);
    }

    #back-to-top i {
        font-size: 1.2rem;
    }

    #back-to-top::after {
        width: 250%;
        height: 250%;
        top: -125%;
        left: -125%;
    }
}

#back-to-top i {
    font-size: 1.4rem;
    color: rgba(0,0,0,0.75);
}

#back-to-top::after {
    content: "";
    position: absolute;
    top: -150%;
    left: -150%;
    width: 300%;
    height: 300%;
    background: linear-gradient(
        60deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.4) 45%,
        rgba(255,255,255,0) 80%
    );
    transform: translateX(-100%);
    opacity: 0.35;
    pointer-events: none;
    animation: shineSweep 6s ease-in-out infinite;
}
/* Glow quando appare */
#back-to-top.glow {
    box-shadow:
        inset 0 0 30px rgba(255,255,255,0.55),
        inset 0 12px 28px rgba(0,0,0,0.08),
        0 14px 32px rgba(0,0,0,0.15),
        0 0 14px rgba(255,255,255,0.55);
}

/* Effetto respiro stile MacBook */
@keyframes breathing {
    0%   { opacity: 0.92; transform: scale(1); }
    50%  { opacity: 1; transform: scale(1.03); }
    100% { opacity: 0.92; transform: scale(1); }
}

#back-to-top.breathing {
    animation: breathing 6s ease-in-out infinite;
}

/* Pulsazione accelerata a fondo pagina (JS la modifica automaticamente) */
@keyframes backtotop-glow {
    0% {
        box-shadow:
            inset 0 0 22px rgba(255,255,255,0.45),
            inset 0 8px 18px rgba(0,0,0,0.06),
            0 10px 25px rgba(0,0,0,0.10),
            0 0 0 rgba(255,255,255,0.0);
        opacity: 0.95;
    }
    50% {
        box-shadow:
            inset 0 0 34px rgba(255,255,255,0.60),
            inset 0 12px 24px rgba(0,0,0,0.08),
            0 16px 30px rgba(0,0,0,0.12),
            0 0 12px rgba(255,255,255,0.4);
        opacity: 1;
    }
    100% {
        box-shadow:
            inset 0 0 22px rgba(255,255,255,0.45),
            inset 0 8px 18px rgba(0,0,0,0.06),
            0 10px 25px rgba(0,0,0,0.10),
            0 0 0 rgba(255,255,255,0.0);
        opacity: 0.97;
    }
}
/* Protezione per evitare che le animazioni nascondano il pulsante */
#back-to-top.show {
    opacity: 1 !important;
    visibility: visible !important;
}

@keyframes shineSweep {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
    100% { transform: translateX(-100%); }
}

/* subtle parallax tilt support */
#back-to-top.tilt {
    transition: transform 0.15s ease;
}



/* -------------------------------------------
   SCROLL BACKGROUND TRANSITIONS (Body)
-------------------------------------------- */

/* Desktop transitions */
@media (min-width: 901px) {
    body.bg-1 {
        background: linear-gradient(180deg, #ffffff 0%, #f9f9fb 100%);
        transition: background 1s ease;
    }
    body.bg-2 {
        background: linear-gradient(180deg, #f9f9fb 0%, #f1f1f3 100%);
        transition: background 1s ease;
    }
    body.bg-3 {
        background: linear-gradient(180deg, #f1f1f3 0%, #e9e9eb 100%);
        transition: background 1s ease;
    }
}

/* Tablet transitions */
@media (max-width: 900px) and (min-width: 600px) {
    body.bg-1 {
        background: linear-gradient(180deg, #ffffff 0%, #f7f7f7 100%);
        transition: background 0.8s ease;
    }
    body.bg-2 {
        background: linear-gradient(180deg, #f7f7f7 0%, #ededed 100%);
        transition: background 0.8s ease;
    }
    body.bg-3 {
        background: linear-gradient(180deg, #ededed 0%, #e4e4e4 100%);
        transition: background 0.8s ease;
    }
}

/* Mobile transitions */
@media (max-width: 599px) {
    body.bg-1 {
        background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
        transition: background 0.6s ease;
    }
    body.bg-2 {
        background: linear-gradient(180deg, #fafafa 0%, #f0f0f0 100%);
        transition: background 0.6s ease;
    }
    body.bg-3 {
        background: linear-gradient(180deg, #f0f0f0 0%, #e7e7e7 100%);
        transition: background 0.6s ease;
    }
}

/* Deep scroll illumination */
body.deep-illumination {
    background: radial-gradient(
        circle at 50% 25%,
        rgba(255,255,255,0.95) 0%,
        rgba(255,255,255,0.55) 35%,
        rgba(255,255,255,0) 70%
    ), var(--current-bg);
    transition: background 0.6s ease;
}

body.scrolled-transition {
    transition: background 0.4s ease, filter 0.4s ease;
    filter: brightness(1.03);
}

/* Navbar sync */
.navbar.navbar--scrolled {
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(18px) saturate(180%);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: background 0.6s ease, box-shadow 0.6s ease;
}
/* ============================
   FOOTER — CLEAN APPLE STYLE
============================= */
.footer {
    width: 100%;
    padding: 40px 0;
    background: #f8f8f8;
    border-top: 1px solid rgba(0,0,0,0.06);
    text-align: center;
    margin-top: 0px;
}

.footer-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.footer-text {
    font-size: 0.95rem;
    color: #555;
    letter-spacing: -0.01em;
    line-height: 1.4;
}

/* LINK NEL FOOTER */
.footer-text a {
    color: #1d1d1f;
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s ease opacity;
}

.footer-text a:hover {
    opacity: 0.6;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .footer {
        padding: 30px 0;
        margin-top: 60px;
    }
    
    .footer-text {
        font-size: 0.85rem;
    }
}

/* MOBILE FIX — prevent horizontal overflow */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
    }
    section, .container, .navbar, .mobile-menu {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}

/* NAV UPPERCASE PUBLIC SITE */
.nav-links a,
.mobile-menu a {
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
