/* --- apertura: la foto vera del sito, a piena larghezza da desktop in su -- */
.apertura {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; align-content: center;
  padding: clamp(4rem, 10vh, 6.5rem) 0 clamp(3rem, 7vh, 5rem);
}
.apertura > .container { position: relative; z-index: 2; }

.apertura-foto { position: relative; margin-top: clamp(2.5rem, 7vh, 4rem); }
.apertura-foto img { display: block; width: 100%; height: auto; }

/* da mobile la foto resta sotto al testo, ma ritagliata più verticale e spinta a
   destra: le due figure riempiono il riquadro e si leggono, invece di perdersi
   nel bianco della scena larga */
@media (max-width: 899px) {
  .apertura-foto img {
    aspect-ratio: 4 / 5; height: auto;
    object-fit: cover; object-position: 70% 18%;
  }
}

/* da 900px: la foto diventa lo sfondo a piena larghezza della sezione, il
   testo le sta sopra con un velo per restare leggibile */
@media (min-width: 900px) {
  .apertura { min-height: min(92vh, 880px); }
  .apertura-foto {
    position: absolute; inset: 0; z-index: 0; margin: 0;
  }
  .apertura-foto img {
    position: absolute; inset: 0; width: 100%; height: 100%;
    object-fit: cover; object-position: 68% 50%;
  }
  .apertura::after {
    content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
    background: linear-gradient(100deg,
      rgb(255 255 255 / 95%) 0%,
      rgb(255 255 255 / 88%) 26%,
      rgb(255 255 255 / 48%) 44%,
      rgb(255 255 255 / 0%) 64%);
  }
}

.apertura-testo { max-width: 33rem; }
.apertura .occhiello-apertura { margin-bottom: clamp(1.5rem, 3.4vh, 2.4rem); }
.apertura h1 {
  /* la misura scende con la finestra quanto basta perché ogni riga stia intera */
  font-size: clamp(1.6rem, 8vw, 4.1rem);
  white-space: nowrap;
  line-height: 1.04; letter-spacing: -0.038em; margin-bottom: 0.4em;
}
@media (min-width: 620px) { .apertura h1 { font-size: clamp(2.4rem, 4.6vw, 4.1rem); } }
.apertura h1 em { font-style: normal; color: var(--verde-scuro); }
.apertura .lead {
  max-width: 27rem; margin-bottom: 0;
  font-size: clamp(1.05rem, 1rem + 0.45vw, 1.25rem);
}
.apertura .actions { margin-top: clamp(2rem, 4.5vh, 3rem); }

.indizio-scorrimento {
  display: inline-flex; align-items: center; gap: 0.7rem;
  margin-top: clamp(2.6rem, 7vh, 4.5rem);
  font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--grigio);
  text-decoration: none;
}
.indizio-scorrimento::before {
  content: ''; width: 36px; height: 1px; background: var(--grigio-chiaro);
  animation: allunga 2.6s ease-in-out infinite;
}
@keyframes allunga { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(1.55); } }

/* --- il segno del marchio come taglio tra "Dove" e la sezione dopo -------- */
/* uno solo, grande, bianco, leggermente inclinato: a cavallo del confine. Il contenitore ha altezza 0, il segno è centrato sul
   confine; le due sezioni adiacenti si allargano per non finirci sotto. */
:root { --taglio-l: clamp(420px, 78vw, 1180px); }

.fascia-marchio {
  position: relative; z-index: 3; height: 0;
  overflow-x: clip;
}
.fascia-marchio-pezzo {
  position: absolute; right: 2%; top: 0;
  width: var(--taglio-l); aspect-ratio: 1492 / 401;
  translate: 0 -50%; rotate: -2.5deg;
  will-change: transform;
  filter: drop-shadow(0 12px 26px rgb(21 21 21 / 14%));
}
/* entra da destra: un tratto più lungo della normale rivelazione a scorrimento,
   coerente con la scala dell'elemento */
.fascia-marchio-pezzo[data-rivela] { transform: translate3d(12%, 0, 0); transition-duration: 0.9s; }
.fascia-marchio-pezzo[data-rivela].visibile { transform: none; }
.fascia-marchio-segno {
  position: absolute; inset: 0; background: #fff;
  -webkit-mask: url('../img/marchio-fascia.svg') no-repeat center / contain;
  mask: url('../img/marchio-fascia.svg') no-repeat center / contain;
}
/* spazio per il taglio: metà altezza del segno, meno il respiro che c'è già */
section:has(+ .fascia-marchio) { padding-bottom: calc(clamp(3.5rem, 7vw, 6.5rem) + var(--taglio-l) * 0.09); }
.fascia-marchio + section { padding-top: calc(clamp(3.5rem, 7vw, 6.5rem) + var(--taglio-l) * 0.09); }

.metodo-griglia { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: 0.9fr 1.1fr; align-items: start; }

.aree-intestazione { display: flex; flex-wrap: wrap; gap: 1.5rem 2rem; align-items: end; justify-content: space-between; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.aree-intestazione h2 { margin: 0; }
.aree-intestazione p { margin: 0; }

.aree.aree-attive { padding: 0; }
.aree-pista {
  /* quanto scorrimento costa la scena: meno di prima, si attraversa in fretta
     anche risalendo */
  height: calc((var(--n, 7) + 1) * 46vh);
  height: calc((var(--n, 7) + 1) * 46svh);
}
.aree-fisso {
  position: sticky; top: 0;
  height: 100vh; height: 100svh;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(0.7rem, 2vh, 1.3rem);
  padding: calc(var(--altezza-header) + 0.2rem) 0 clamp(0.9rem, 2.5vh, 1.8rem);
  overflow: clip;
}
.aree-testata .aree-intestazione { margin-bottom: 0; align-items: center; }
.aree-testata .etichetta-sezione { margin-bottom: 0.5rem; }
.aree-testata h2 { font-size: clamp(1.35rem, 1rem + 1.5vw, 2.2rem); }
.aree-testata .btn { padding: 0.65rem 1.1rem; }

.aree-cornice {
  --zoom: 0;
  position: relative; min-height: 0;
  width: min(100% - 2 * var(--gutter), 1480px); margin-inline: auto;
  overflow: clip; background: var(--nero); color: #fff;
  clip-path: inset(
    calc((1 - var(--zoom)) * 26%)
    calc((1 - var(--zoom)) * 36%)
    round calc(56px - var(--zoom) * 44px));
}
.aree-zoom { position: absolute; inset: 0; transform: scale(1.18); will-change: transform; }
.aree-binario { display: flex; height: 100%; will-change: transform; }

.area-pannello {
  position: relative; display: block; flex: 0 0 100%; min-width: 0; height: 100%;
  overflow: clip; color: #fff; text-decoration: none;
}
.area-pannello::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(0deg, rgb(21 21 21 / 86%) 0%, rgb(21 21 21 / 38%) 38%, rgb(21 21 21 / 0%) 70%),
    linear-gradient(90deg, rgb(21 21 21 / 45%), rgb(21 21 21 / 0%) 60%);
}
.area-foto { position: absolute; inset: 0 -12%; will-change: transform; }
/* il pannello è quasi 2,2:1 e il cover toglie un terzo dell'altezza: ancorato
   in alto il taglio cade tutto sul pavimento invece che sulle teste */
.area-foto img {
  width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: var(--fuoco, 50% 0%);
  filter: grayscale(1) contrast(1.05);
  transition: filter 0.8s;
}
.area-pannello.attiva .area-foto img { filter: none; }

.area-testo {
  position: absolute; z-index: 2;
  left: clamp(1.2rem, 4vw, 3.5rem); right: clamp(1.2rem, 4vw, 3.5rem);
  bottom: clamp(4rem, 11vh, 6.5rem); max-width: 36rem;
  display: grid; gap: 0.5rem; justify-items: start;
  will-change: transform, opacity;
}
.area-tag { font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--verde); }
.area-titolo {
  margin: 0; font-size: clamp(1.9rem, 1.1rem + 3.2vw, 4rem);
  line-height: 1.02; letter-spacing: -0.035em;
}
.area-descrizione { display: block; max-width: 28rem; margin-top: 0.15rem; color: rgb(255 255 255 / 82%); font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem); line-height: 1.5; }
.area-cta {
  display: inline-flex; align-items: center; gap: 0.75rem; margin-top: 1rem;
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
}
.area-cta::after { content: ''; width: 34px; height: 1px; background: currentColor; transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
.area-pannello:hover .area-cta::after { width: 56px; }

.aree-comandi {
  position: absolute; z-index: 5;
  display: flex; align-items: center; gap: clamp(0.9rem, 2.4vw, 2rem);
  left: clamp(1.2rem, 4vw, 3.5rem); right: clamp(1.2rem, 4vw, 3.5rem);
  bottom: clamp(1rem, 2.6vh, 1.7rem);
}
.aree-conteggio {
  font-size: 0.72rem; font-weight: 600; letter-spacing: 0.16em;
  font-variant-numeric: tabular-nums; white-space: nowrap;
  color: rgb(255 255 255 / 55%);
}
.aree-conteggio b { font-weight: 600; color: #fff; }

.aree-segmenti { flex: 1; display: flex; gap: 5px; }
.aree-segmento {
  position: relative; flex: 1; height: 20px; padding: 0; border: 0; background: none; cursor: pointer;
}
.aree-segmento::before,
.aree-segmento i {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; margin-top: -0.5px;
  transition: height 0.3s, margin-top 0.3s;
}
.aree-segmento::before { background: rgb(255 255 255 / 25%); }
.aree-segmento i { background: var(--verde); transform: scaleX(0); transform-origin: left; }
.aree-segmento:hover::before,
.aree-segmento:hover i { height: 3px; margin-top: -1.5px; }

.aree-frecce { display: flex; gap: 0.5rem; }
.aree-freccia {
  width: 40px; height: 40px; padding: 0; flex: none; cursor: pointer;
  display: inline-flex; flex-direction: row; align-items: center; justify-content: center;
  border: 1px solid rgb(255 255 255 / 28%); border-radius: 50%; background: none;
  transition: border-color 0.25s, background-color 0.25s, opacity 0.25s;
}
.aree-freccia::after {
  content: ''; width: 17px; height: 9px; flex: none; background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 8'%3E%3Cpath d='M26 4H3M7 1 3 4l4 3' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 8'%3E%3Cpath d='M26 4H3M7 1 3 4l4 3' fill='none' stroke='%23000' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat center / contain;
}
.aree-freccia--avanti::after { transform: scaleX(-1); }
.aree-freccia:hover { border-color: var(--verde); background: rgb(127 179 71 / 18%); }
.aree-freccia[disabled] { opacity: 0.3; cursor: default; }
.aree-freccia[disabled]:hover { border-color: rgb(255 255 255 / 28%); background: none; }

@media (max-width: 640px) {
  .aree-testata .btn,
  .aree-testata .etichetta-sezione { display: none; }
}
@media (max-height: 640px) {
  .aree-testata .etichetta-sezione { display: none; }
}

.principio::before { top: 0; }


@media (max-width: 900px) {
  .metodo-griglia { grid-template-columns: 1fr; }
}

/* --- la sezione scura sale sopra la metà bassa dello slider -------------- */
/* non è un taglio: è un foglio che scorre sopra la scena, con l'angolo
   arrotondato e un'ombra che stacca i due piani */
.aree.aree-attive { position: relative; z-index: 2; }
.aree-attive + .section--rialzata {
  position: relative; z-index: 1;
  margin-top: clamp(-38vh, -30vh, -20vh);
  padding-top: calc(30vh + clamp(3.5rem, 7vw, 6.5rem));
  border-radius: clamp(20px, 3vw, 34px) clamp(20px, 3vw, 34px) 0 0;
  box-shadow: 0 -34px 70px rgb(21 21 21 / 22%);
}
@media (max-width: 760px) {
  .aree-attive + .section--rialzata {
    margin-top: -22vh;
    padding-top: calc(22vh + clamp(3rem, 7vw, 5rem));
  }
}

/* --- uscita dalla scena: la terza freccia, quella che salta -------------- */
.aree-salta {
  width: auto; min-width: 0; height: 40px; padding: 0 1.15rem; gap: 0.55rem;
  border-radius: 999px; white-space: nowrap;
}
.aree-salta span {
  font-size: 0.68rem; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: #fff; line-height: 1;
}
.aree-salta::after {
  width: 11px; height: 15px; transform: none; transition: transform 0.3s;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 18'%3E%3Cpath d='M6 1v15M1 11l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 18'%3E%3Cpath d='M6 1v15M1 11l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
}
.aree-salta[data-verso="su"]::after { transform: rotate(180deg); }

/* il titolo approvato è lungo: un corpo più contenuto lo tiene in due righe */
#metodo h2 { font-size: clamp(1.5rem, 1.1rem + 1.3vw, 2.15rem); max-width: 24ch; }

/* Blocco generale dei professionisti: più staccato dalla ginnastica posturale che lo precede */
.section--team { padding-top: clamp(5rem, 11vw, 9.5rem); }
