@font-face { font-family: Anton; src: url(fonts/anton.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: Montserrat; src: url(fonts/montserrat.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  /* colori del brand (handover AS; il blu è quello dei caroselli e del logo) */
  --blu: #0A2540;
  --verde: #0E7C42;
  --teal: #008CAB;
  --sabbia: #F4F1EB;
  --carbone: #18181B;
  --accento: var(--verde);

  --titolo: Anton, 'Arial Narrow', sans-serif;
  --testo: Montserrat, system-ui, sans-serif;

  /* cinque misure: titolo d'apertura, titolo di capitolo, affermazione, testo, piccolo */
  --s1: clamp(64px, 7.4vw, 136px);
  --s2: clamp(44px, 6vw, 96px);
  --s3: clamp(22px, 2.1vw, 32px);
  --s4: 18px;
  --s5: 15px;
  --s6: 22px;                      /* titoletti, frasi di servizio */
  --sub: clamp(32px, 3.2vw, 48px); /* sottotitoli in Anton */

  --m: clamp(16px, 2.2vw, 32px);   /* margine della pagina, uguale ai due lati */
  --g: 16px;                       /* spazio fra le colonne */
  --dur: 600ms;
  --curva: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 500 var(--s4)/1.55 var(--testo); color: var(--carbone); background: var(--blu); }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, ol, ul, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; }
::selection { background: var(--teal); color: var(--carbone); }

.grande { font: 400 var(--s2)/.95 var(--titolo); text-transform: uppercase; letter-spacing: -.01em; }
.affermazione { font-size: var(--s3); line-height: 1.25; font-weight: 600; max-width: 30ch; }

/* le foto: bianco e nero tinto col colore del capitolo, sempre lo stesso trattamento */
.tinta { background: var(--c); overflow: hidden; }
.tinta img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: luminosity; opacity: .92; }

.pulsante {
  display: inline-block; padding: 18px 30px; background: var(--blu); color: #fff; text-decoration: none;
  font: 700 var(--s4)/1 var(--testo); clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%, 0 10px);
  transition: transform 180ms var(--curva), background-color 180ms;
}
.pulsante:hover { background: var(--carbone); transform: translateY(-2px); }
.pulsante:active { transform: translateY(1px) scale(.98); }

/* ---------- testata ---------- */
.testa { position: absolute; inset: 0 0 auto; z-index: 5; display: flex; justify-content: flex-end; padding: 20px var(--m); color: #fff; }
.testa-link { font-size: var(--s5); font-weight: 700; text-decoration: none; padding: 8px 0; border-bottom: 2px solid transparent; transition: border-color 180ms; }
.testa-link:hover { border-color: currentColor; }
.tricolore { display: flex; width: 72px; height: 6px; }
.tricolore i { flex: 1; background: #0E7C42; }
.tricolore i:nth-child(2) { background: #fff; }
.tricolore i:nth-child(3) { background: #CE2B37; }

/* ---------- apertura: il simbolo grande e il nome ---------- */
.apertura {
  min-height: 100svh; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); align-items: center;
  padding: 96px var(--m) 64px; background: var(--blu); color: #fff;
}
.simbolo { grid-column: 1 / 7; width: 100%; max-height: 72svh; object-fit: contain; object-position: left center; }
.apertura-testo { grid-column: 7 / 13; }
.apertura h1 { font: 400 var(--s1)/.9 var(--titolo); text-transform: uppercase; letter-spacing: -.01em; }
.apertura .tricolore { margin-top: 32px; }
.apertura-testo p { margin-top: 32px; max-width: 34ch; font-size: var(--s6); line-height: 1.4; }
.apertura .pulsante { margin-top: 40px; background: var(--sabbia); color: var(--blu); }
.apertura .pulsante:hover { background: #fff; }

.perche, .sistemico, .futuro, .chi, .contatti {
  display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); padding: 160px var(--m); min-height: 90svh;
}

/* ---------- perché nasciamo: le tessere che crescono ---------- */
.perche { background: var(--sabbia); grid-template-rows: auto auto; align-items: end; }
.perche-titolo { grid-column: 1 / 8; grid-row: 1; align-self: start; }
.perche-titolo .affermazione { margin-top: 28px; }
.tessere { grid-column: 1 / 13; grid-row: 1 / 3; display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--g); align-items: end; }
.tessera { display: grid; align-content: end; }
.tessera.t1 { grid-column: 1 / 4; }
.tessera.t2 { grid-column: 4 / 8; }
.tessera.t3 { grid-column: 8 / 13; }
.tessera .tinta { height: 24vh; min-height: 170px; }
.tessera.t2 .tinta { height: 36vh; min-height: 250px; }
.tessera.t3 .tinta { height: 60vh; min-height: 380px; }
.tessera h3 { margin-top: 20px; font-size: var(--s6); line-height: 1.2; font-weight: 800; }
.tessera p { margin-top: 8px; max-width: 46ch; }
.perche { row-gap: 0; }
.perche-titolo { position: relative; z-index: 1; }

/* ---------- pensare in modo sistemico: la catena ---------- */
.sistemico { background: var(--verde); color: #fff; align-items: start; }
.sistemico-testo { grid-column: 1 / 6; }
.sistemico-testo .affermazione { margin-top: 36px; }
.sistemico-testo p:last-child { margin-top: 24px; max-width: 52ch; }
.catene { grid-column: 7 / 13; }
.scelte { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 40px; }
.scelte button {
  font: 700 var(--s5)/1 var(--testo); padding: 14px 18px; border: 0; cursor: pointer; background: rgba(255, 255, 255, .14); color: #fff;
  transition: background-color 180ms, transform 180ms var(--curva);
}
.scelte button:hover { background: rgba(255, 255, 255, .26); }
.scelte button:active { transform: scale(.97); }
.scelte button[aria-pressed="true"] { background: var(--sabbia); color: var(--carbone); }
.catena + .catena { margin-top: 48px; }
.catena h3 { font: 400 var(--sub)/1 var(--titolo); text-transform: uppercase; }
.catena ol { margin-top: 20px; counter-reset: passo; }
.catena li {
  position: relative; padding: 16px 0 16px 44px; font-size: var(--s3); line-height: 1.2; font-weight: 600;
  transition: opacity 400ms var(--curva), transform 400ms var(--curva);
}
.catena li::before { content: ''; position: absolute; left: 8px; top: 0; bottom: 0; width: 4px; background: rgba(255, 255, 255, .3); }
.catena li::after { content: ''; position: absolute; left: 0; top: 26px; width: 20px; height: 20px; background: var(--sabbia); transform: rotate(45deg); }
.js .catena.giocata li { opacity: .28; transform: translateX(-8px); }
.js .catena.giocata li.acceso { opacity: 1; transform: none; }
.chiusa { margin-top: 40px; font-size: var(--s4); font-weight: 700; }

/* ---------- il futuro: indice con anteprima ---------- */
.futuro { background: var(--carbone); color: var(--sabbia); grid-template-rows: auto 1fr; row-gap: 72px; }
.futuro-titolo { grid-column: 1 / 13; }
.futuro-titolo .affermazione { margin-top: 28px; max-width: 40ch; }
.indice { grid-column: 1 / 8; }
.indice li { padding: 28px 0; transition: opacity 240ms; cursor: default; }
.indice h3 { font: 400 var(--sub)/1 var(--titolo); text-transform: uppercase; }
.indice p { margin-top: 12px; max-width: 54ch; }
.indice .in-riga { display: none; }
.indice:hover li:not(.su), .indice:focus-within li:not(.su) { opacity: .45; }
.cornice { grid-column: 9 / 13; grid-row: 2; position: sticky; top: 15vh; align-self: start; aspect-ratio: 4 / 5; }
.cornice .tinta { position: absolute; inset: 0; opacity: 0; transition: opacity 240ms; }
.cornice .tinta.su { opacity: 1; }
.cornice .tinta:first-child { opacity: 1; }
.js .cornice .tinta:first-child:not(.su) { opacity: 0; }

/* ---------- chi siamo ---------- */
.chi { background: var(--teal); align-content: start; min-height: auto; }
.chi h2 { grid-column: 1 / 13; }
.chi-testo { grid-column: 1 / 10; margin-top: 48px; max-width: 56ch; font-size: var(--s6); line-height: 1.45; line-height: 1.3; font-weight: 500; }
.chi-testo p + p { margin-top: 1em; }
.chi-testo strong { font-weight: 800; }
mark { color: #fff; padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.m-blu { background: var(--blu); }
.m-verde { background: var(--verde); }
.m-sabbia { background: var(--sabbia); color: var(--carbone); }
.m-chiusa { display: inline; background: var(--blu); color: #fff; font-weight: 700; text-decoration: none; padding: 0 .12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; transition: background-color 180ms; }
.m-chiusa:hover { background: var(--verde); }

/* ---------- contatti ---------- */
.contatti { background: var(--blu); color: #fff; min-height: auto; row-gap: 64px; padding-top: 140px; padding-bottom: 64px; }
.contatti-frase { grid-column: 1 / 7; font-size: var(--s6); line-height: 1.35; font-weight: 600; }
.email {
  grid-column: 1 / 13; align-self: end; font: 500 clamp(36px, 6.4vw, 110px)/1 var(--testo); letter-spacing: -.03em;
  text-decoration: none; overflow-wrap: anywhere; transition: color 200ms;
}
.email:hover { color: var(--teal); }
.contatti-piede { grid-column: 1 / 13; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: var(--s5); }

/* ---------- piede a tessere ---------- */
.piede { background: var(--blu); padding: 0 var(--m) var(--m); display: grid; grid-template-columns: repeat(12, 1fr); gap: 8px; }
.p-tessera { padding: 32px; min-height: 220px; display: flex; flex-direction: column; justify-content: space-between; }
.p-nome { grid-column: 1 / 9; min-height: 320px; background: var(--carbone); color: #fff; flex-direction: row; align-items: center; justify-content: flex-start; gap: 4vw; }
.motto { font: 400 var(--sub)/1 var(--titolo); text-transform: uppercase; }
.p-nome img { width: clamp(120px, 14vw, 220px); }
.p-invito { grid-column: 9 / 13; min-height: 320px; background: var(--verde); color: #fff; text-decoration: none; font-size: var(--s6); line-height: 1.25; font-weight: 700; transition: background-color 200ms; }
.p-invito svg { align-self: end; transition: transform 200ms var(--curva); }
.p-invito:hover { background: #0B6A38; }
.p-invito:hover svg { transform: translate(4px, -4px); }
.crediti { grid-column: 1 / 13; max-width: 75ch; padding-top: 16px; color: #fff; font-size: var(--s5); line-height: 1.5; }

/* ---------- entrate ---------- */
.js [data-in] > * { opacity: 0; transform: translateY(24px); transition: opacity var(--dur) var(--curva), transform var(--dur) var(--curva); }
.js [data-in].dentro > * { opacity: 1; transform: none; }
.js [data-in].dentro > :nth-child(2) { transition-delay: 80ms; }
.js [data-in].dentro > :nth-child(3) { transition-delay: 160ms; }
.js [data-in].dentro > :nth-child(4) { transition-delay: 240ms; }
.js [data-in].dentro > :nth-child(5) { transition-delay: 320ms; }
.js h2[data-in] { opacity: 0; transform: translateY(24px); transition: opacity var(--dur) var(--curva), transform var(--dur) var(--curva); }
.js h2[data-in].dentro { opacity: 1; transform: none; }
.js .simbolo { animation: entra 900ms var(--curva) both; }
.js .apertura-testo > * { animation: sale 700ms var(--curva) both; }
.js .apertura-testo > :nth-child(2) { animation-delay: 90ms; }
.js .apertura-testo > :nth-child(3) { animation-delay: 180ms; }
.js .apertura-testo > :nth-child(4) { animation-delay: 270ms; }
@keyframes entra { from { opacity: 0; transform: scale(.94); } }
@keyframes sale { from { opacity: 0; transform: translateY(24px); } }

/* ---------- tablet ---------- */
@media (max-width: 1000px) {
  .sistemico-testo, .catene { grid-column: 1 / 13; }
  .catene { margin-top: 64px; }
  .apertura { align-content: center; }
  .simbolo { grid-column: 1 / 13; max-height: 34svh; object-position: left; }
  .apertura-testo { grid-column: 1 / 13; margin-top: 40px; }
  .chi-testo { grid-column: 1 / 13; }
  .p-nome, .p-invito { grid-column: 1 / 13; }
}

/* ---------- telefono ---------- */
@media (max-width: 640px) {
  .simbolo { max-height: 30svh; }
  .apertura h1 { font-size: 16vw; }
  .apertura-testo p { font-size: 18px; }
  .apertura .pulsante { display: block; text-align: center; }

  .perche, .sistemico, .futuro, .chi, .contatti { padding: 72px var(--m); min-height: 0; }
  .perche-titolo, .tessere { grid-column: 1 / 13; grid-row: auto; }
  .tessere { display: block; margin-top: 40px; }
  .tessera + .tessera { margin-top: 32px; }
  .tessera .tinta { height: 26vw; min-height: 0; }
  .tessera.t2 .tinta { height: 32vw; min-height: 0; }
  .tessera.t3 .tinta { height: 40vw; min-height: 0; }
  .futuro { row-gap: 32px; }
  .indice { grid-column: 1 / 13; }
  .indice:hover li:not(.su) { opacity: 1; }
  .cornice { display: none; }
  .contatti-frase { grid-column: 1 / 13; }
  .email { font-size: 6.6vw; }
  .email span { display: block; }
  .contatti-piede { flex-direction: column; }
  .piede { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .p-nome { grid-column: 1 / 3; }
  .p-invito { grid-column: 1 / 3; min-height: 160px; }
  .indice li { padding: 18px 0; }
  .contatti { row-gap: 40px; }
  .p-nome { flex-direction: column; gap: 12px; }
    .crediti { grid-column: 1 / 3; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 1ms !important; transition-delay: 0s !important; }
}
