*,
    *::before,
    *::after {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    :root {
      --black: #0e0e0e;
      --white: #fafaf8;
      --gray-light: #f2f1ed;
      --gray-mid: #c8c6be;
      --gray-text: #5a5850;
      --accent: #1a1a1a;
      --section-pad: 7rem 2rem;
    }

    html {
      scroll-behavior: smooth;
      overflow-x: hidden;
    }

    body {
      font-family: 'Manrope', sans-serif;
      background-color: var(--white);
      color: var(--black);
      font-size: 17px;
      line-height: 1.7;
      overflow-x: hidden;
    }

    /* NAV */
    nav {
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      z-index: 100;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      padding: 1.25rem 2.5rem;
      background: #ffffff;
      border-bottom: 1px solid transparent;
      transition: all 0.3s;
    }

    nav.scrolled {
      border-bottom: 1px solid rgba(224, 223, 216, 0.5);
      background: #ffffff;
    }

    .nav-logo {
      display: none;
    }

    .nav-links {
      display: flex;
      gap: 2.5rem;
      list-style: none;
      flex-wrap: wrap;
      justify-content: center;
    }

    .nav-links a {
      font-size: 0.8rem;
      font-weight: 600;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--gray-text);
      text-decoration: none;
      transition: color 0.2s;
    }

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

    /* HERO */
    .hero {
      position: relative;
      height: 100vh;
      height: 100dvh; /* Altezza dinamica sui browser mobile per evitare problemi con la barra dell'indirizzo */
      min-height: 550px;
      display: flex;
      align-items: flex-end;
      justify-content: flex-start;
      overflow: hidden;
      background-color: #0e0e0e; /* Fallback scuro per rendere il titolo bianco visibile all'apertura prima del caricamento dell'immagine 36.png */
    }

    .hero-bg {
      position: absolute;
      inset: 0;
      background-image: url('36.png');
      background-size: cover;
      background-position: center;
      transform: scale(1.04);
      transition: transform 0.1s linear;
    }

    .hero-overlay {
      position: absolute;
      inset: 0;
      background: linear-gradient(to top,
          rgba(14, 14, 14, 0.72) 0%,
          rgba(14, 14, 14, 0.15) 55%,
          rgba(14, 14, 14, 0.05) 100%);
    }

    .hero-content {
      position: relative;
      z-index: 2;
      padding: 0 3rem 4rem;
      max-width: 780px;
      opacity: 0;
      transform: translateY(28px);
      animation: fadeUp 1.1s cubic-bezier(.22, 1, .36, 1) 0.3s forwards;
    }

    .hero-title {
      font-size: clamp(2.8rem, 8vw, 5.2rem);
      font-weight: 800;
      line-height: 1.06;
      color: #ffffff;
      letter-spacing: -0.02em;
    }

    .hero-title em {
      font-style: normal;
      font-weight: 300;
    }

    .scroll-hint {
      position: absolute;
      bottom: 2.2rem;
      left: 50%;
      transform: translateX(-50%);
      z-index: 2;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.5rem;
      color: rgba(255, 255, 255, 0.7);
      font-size: 0.7rem;
      font-weight: 500;
      letter-spacing: 0.14em;
      text-transform: uppercase;
      opacity: 0;
      animation: fadeUp 1s ease 1.2s forwards;
      cursor: pointer;
    }

    .scroll-arrow {
      width: 20px;
      height: 32px;
      border: 1.5px solid rgba(255, 255, 255, 0.4);
      border-radius: 10px;
      position: relative;
    }

    .scroll-arrow::after {
      content: '';
      position: absolute;
      top: 5px;
      left: 50%;
      transform: translateX(-50%);
      width: 3px;
      height: 7px;
      background: rgba(255, 255, 255, 0.7);
      border-radius: 2px;
      animation: scrollDot 1.6s ease infinite;
    }

    /* SECTIONS */
    section {
      padding: var(--section-pad);
      max-width: 1100px;
      margin: 0 auto;
    }

    section.full-bg {
      max-width: 100%;
      padding: 0;
    }

    .section-inner {
      max-width: 1100px;
      margin: 0 auto;
      padding: var(--section-pad);
    }

    .section-tag {
      font-size: 0.72rem;
      font-weight: 600;
      letter-spacing: 0.18em;
      text-transform: uppercase;
      color: var(--gray-mid);
      margin-bottom: 1rem;
      display: flex;
      align-items: center;
      gap: 0.8rem;
    }

    .section-tag::before {
      content: '';
      display: block;
      width: 28px;
      height: 1.5px;
      background: var(--gray-mid);
    }

    h2 {
      font-size: clamp(2rem, 5vw, 3.2rem);
      font-weight: 800;
      line-height: 1.1;
      letter-spacing: -0.025em;
      margin-bottom: 2rem;
    }

    .divider {
      width: 100%;
      height: 1px;
      background: #e8e7e0;
      margin: 0 auto;
      max-width: 1100px;
    }

    .divider-full {
      max-width: 100%;
      margin: 0;
    }

    /* IL PROGETTO */
    #progetto .lead {
      font-size: 1.18rem;
      font-weight: 500;
      line-height: 1.65;
      max-width: 680px;
      margin-bottom: 2.5rem;
      color: #2a2a2a;
    }

    #progetto p {
      max-width: 680px;
      color: var(--gray-text);
      margin-bottom: 1.2rem;
    }

    .highlight-box {
      background: var(--gray-light);
      border-left: 3px solid var(--black);
      padding: 1.6rem 2rem;
      margin-top: 2.5rem;
      max-width: 680px;
    }

    .highlight-box p {
      color: #3a3832;
      font-size: 1rem;
      margin: 0;
    }

    /* PASSEGGIATE */
    #passeggiate {
      background: var(--white);
    }

    .walk-list {
      display: flex;
      flex-direction: column;
      gap: 0;
      margin-top: 3rem;
    }

    .walk-item {
      display: grid;
      grid-template-columns: 100px 1fr;
      gap: 0 2.5rem;
      padding: 2.5rem 0;
      border-top: 1px solid #e8e7e0;
      align-items: start;
      opacity: 0;
      transform: translateY(20px);
      transition: opacity 0.6s ease, transform 0.6s ease;
    }

    .walk-item.visible {
      opacity: 1;
      transform: translateY(0);
    }

    .walk-item:last-child {
      border-bottom: 1px solid #e8e7e0;
    }

    .walk-body {
      min-width: 0; /* Impedisce l'espansione della colonna del grid track oltre il viewport su mobile */
    }

    .walk-year {
      font-size: 0.85rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      color: var(--gray-mid);
      text-transform: uppercase;
      padding-top: 0.35rem;
    }

    .walk-title {
      font-size: 1.25rem;
      font-weight: 700;
      margin-bottom: 0.4rem;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .walk-icon {
      font-size: 1.1rem;
    }

    .walk-event {
      font-size: 0.9rem;
      color: var(--gray-text);
      font-weight: 500;
      margin-bottom: 0.8rem;
      font-style: italic;
    }

    .walk-desc {
      font-size: 0.95rem;
      color: var(--gray-text);
      margin-bottom: 1.5rem;
      line-height: 1.6;
    }

    .walk-links {
      display: flex;
      flex-wrap: wrap;
      gap: 0.6rem;
    }

    .link-btn {
      font-size: 0.75rem;
      font-weight: 600;
      letter-spacing: 0.06em;
      padding: 0.45rem 1rem;
      border: 1.5px solid #d0cfc7;
      border-radius: 100px;
      color: var(--black);
      text-decoration: none;
      transition: all 0.2s;
      white-space: nowrap;
      text-transform: uppercase;
    }

    .link-btn:hover {
      background: var(--black);
      border-color: var(--black);
      color: var(--white);
    }

    .link-btn.primary {
      background: var(--black);
      border-color: var(--black);
      color: var(--white);
    }

    .link-btn.primary:hover {
      background: #333;
      border-color: #333;
    }

    /* GALLERY CAROUSEL */
    .gallery-carousel {
      display: flex;
      overflow-x: auto;
      gap: 1rem;
      padding: 1rem 0 1.5rem;
      margin: 1.5rem 0;
      scrollbar-width: thin;
      -webkit-overflow-scrolling: touch;
      width: 100%;
      max-width: 100%;
      touch-action: pan-x; /* Ottimizza l'interazione touch orizzontale */
    }

    .gallery-carousel::-webkit-scrollbar {
      height: 6px;
    }

    .gallery-carousel::-webkit-scrollbar-track {
      background: #f1f1f1;
      border-radius: 10px;
    }

    .gallery-carousel::-webkit-scrollbar-thumb {
      background: #c8c6be;
      border-radius: 10px;
    }

    .gallery-carousel img {
      height: 140px;
      width: auto;
      flex-shrink: 0;
      max-width: none;
      border-radius: 8px;
      object-fit: cover;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }

    .gallery-carousel img:hover {
      transform: translateY(-3px);
      box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
    }

    /* LIGHTBOX */
    .lightbox {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.9);
      z-index: 1000;
      display: none;
      justify-content: center;
      align-items: center;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .lightbox.active {
      display: flex;
      opacity: 1;
    }

    .lightbox-img {
      max-width: 90%;
      max-height: 85vh;
      border-radius: 4px;
      box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .lightbox-close {
      position: absolute;
      top: 20px;
      right: 30px;
      color: white;
      font-size: 2rem;
      cursor: pointer;
      background: none;
      border: none;
    }

    .lightbox-prev,
    .lightbox-next {
      position: absolute;
      top: 50%;
      transform: translateY(-50%);
      background: rgba(255, 255, 255, 0.2);
      color: white;
      border: none;
      border-radius: 50%;
      width: 50px;
      height: 50px;
      font-size: 1.5rem;
      cursor: pointer;
      transition: background 0.2s;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    .lightbox-prev:hover,
    .lightbox-next:hover {
      background: rgba(255, 255, 255, 0.4);
    }

    .lightbox-prev {
      left: 20px;
    }

    .lightbox-next {
      right: 20px;
    }

    /* CHI SONO */
    #chisono {
      background: var(--gray-light);
      max-width: 100%;
    }

    #chisono .section-inner {
      display: grid;
      grid-template-columns: 1fr 408px;
      gap: 5rem;
      align-items: center;
    }

    .chisono-text .section-tag {
      margin-bottom: 1rem;
    }

    .chisono-text h2 {
      margin-bottom: 1.5rem;
    }

    .chisono-text p {
      color: var(--gray-text);
      margin-bottom: 1.2rem;
      max-width: 540px;
    }

    .chisono-text p:last-of-type {
      margin-bottom: 0;
    }

    .chisono-photo-wrap {
      position: relative;
    }

    .chisono-photo {
      width: 100%;
      aspect-ratio: 1;
      object-fit: contain;
      border-radius: 0;
      display: block;
      mix-blend-mode: multiply;
    }

    .cv-link {
      display: inline-flex;
      align-items: center;
      gap: 0.5rem;
      margin-top: 2rem;
      font-size: 0.82rem;
      font-weight: 700;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      color: var(--black);
      text-decoration: none;
      border-bottom: 2px solid var(--black);
      padding-bottom: 2px;
      transition: opacity 0.2s;
    }

    .cv-link:hover {
      opacity: 0.55;
    }

    .cv-link svg {
      width: 14px;
      height: 14px;
    }

    /* CONTATTI */
    #contatti {
      text-align: center;
      padding: 7rem 2rem 8rem;
    }

    #contatti h2 {
      margin-bottom: 1.5rem;
    }

    #contatti p {
      color: var(--gray-text);
      max-width: 520px;
      margin: 0 auto 2.5rem;
    }

    .email-link {
      font-size: 1.05rem;
      font-weight: 700;
      color: var(--black);
      text-decoration: none;
      border-bottom: 2px solid var(--black);
      padding-bottom: 2px;
      transition: opacity 0.2s;
    }

    .email-link:hover {
      opacity: 0.5;
    }


    /* ANIMATIONS */
    @keyframes fadeUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    @keyframes scrollDot {

      0%,
      100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
      }

      50% {
        opacity: 0.3;
        transform: translateX(-50%) translateY(8px);
      }
    }

    /* RESPONSIVE */
    @media (max-width: 768px) {
      nav {
        padding: 1rem;
      }

      .nav-links {
        gap: 1rem;
        font-size: 0.7rem;
      }

      .nav-links a {
        font-size: 0.7rem;
      }

      .hero-content {
        padding: 0 1.5rem 3.5rem;
      }

      .hero-title {
        font-size: clamp(2.4rem, 10vw, 3.5rem);
      }

      #chisono .section-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
        padding: 4rem 1.5rem;
      }

      .chisono-photo-wrap {
        order: -1;
        max-width: 312px;
        margin: 0 auto;
      }

      .walk-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
      }

      .walk-year {
        margin-bottom: 0.5rem;
      }

      section {
        padding: 4rem 1.5rem;
      }

      .gallery-carousel img {
        height: 100px;
      }

      .lightbox-prev,
      .lightbox-next {
        width: 40px;
        height: 40px;
      }

      .email-link {
        font-size: 0.9rem;
        word-break: break-all;
      }

      .walk-links {
        gap: 0.4rem;
      }

      .link-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.65rem;
        white-space: normal;
        text-align: center;
      }

    }
