/* =====================================================================
   NOTTURNO · Acqua e Luce
   Piscine Saronno + Impianti Integrati
   ===================================================================== */

/* ---------------------------------------------------------------- fonts */
@font-face {
  font-family: "Fraunces";
  font-style: normal;
  font-weight: 300 500;
  font-display: swap;
  src: url("../fonts/fraunces-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Fraunces";
  font-style: italic;
  font-weight: 300 500;
  font-display: swap;
  src: url("../fonts/fraunces-italic-var-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/manrope-var-latin.woff2") format("woff2");
}

/* ---------------------------------------------------------------- tokens */
/* Palette "Riva": due contesti di colore con gli stessi nomi.
   Ruoli: --notte sfondo · --ardesia superficie/card · --fumo campi · --linea filetti · --bordo bordi campi
          --avorio testo · --nebbia testo secondario · --cenere testo terziario · --acqua Piscine · --luce Impianti */

/* riva: sabbia, testo blu notte (pagina, fascia sotto l'hero, card dei form) */
:root, .hero__band, .card-form {
  --notte: #F2E8D5;
  --ardesia: #FBF5E8;
  --fumo: #FFFDF8;
  --linea: #D9CBB0;
  --bordo: #877960;
  --avorio: #12303B;
  --nebbia: #3E5863;
  --cenere: #526A73;
  --acqua: #0B6E7E;
  --luce: #A6481F;
  --corallo: #B3261E;
  --menta: #1B7A4B;
  --notte-rgb: 242 232 213;
  --avorio-rgb: 18 48 59;
  --acqua-rgb: 11 110 126;
  --luce-rgb: 166 72 31;
  --line-soft: rgb(var(--avorio-rgb) / .3);
}
/* mare: blu profondo, testo sabbia (sopra le foto, fasce scure, footer, menu, navbar sull'hero) */
.hero, .phero, .tile, .lb, .pd__stage, .chapter__media, .final, .sec--slate, .foot, .menu,
html:not([data-page="contattami"], [data-page="404"]) .nav:not(.is-scrolled) {
  --notte: #0C3A4D;
  --ardesia: #0F4459;
  --fumo: #14506A;
  --linea: #1F5266;
  --bordo: #6E97A5;
  --avorio: #FAF3E3;
  --nebbia: #B9D0D6;
  --cenere: #93B0B8;
  --acqua: #56D3E2;
  --luce: #F2B46A;
  --corallo: #FF9D8F;
  --menta: #7FDDAF;
  --notte-rgb: 12 58 77;
  --avorio-rgb: 250 243 227;
  --acqua-rgb: 86 211 226;
  --luce-rgb: 242 180 106;
  --line-soft: rgb(var(--avorio-rgb) / .3);
  color: var(--avorio);
}
.hero__band, .card-form { color: var(--avorio); }

:root {
  --abisso: #082A38;
  --abisso-rgb: 8 42 56;

  --accent: var(--avorio);
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;

  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-io: cubic-bezier(.7, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  --nav-h: 88px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --wrap: 1320px;
  --sec: clamp(80px, 10vw, 128px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  interpolate-size: allow-keywords;
}
body[data-accent="piscine"] { --accent: var(--acqua); }
body[data-accent="impianti"] { --accent: var(--luce); }
/* l'accento va ricalcolato a ogni cambio di contesto: una variabile ereditata resta quella del contesto esterno */
:is(.hero, .phero, .tile, .lb, .pd__stage, .chapter__media, .final, .sec--slate, .foot, .menu, .nav, .hero__band, .card-form) { --accent: var(--avorio); }
body[data-accent="piscine"] :is(.phero, .tile, .lb, .pd__stage, .chapter__media, .final, .sec--slate, .foot, .menu, .nav, .card-form) { --accent: var(--acqua); }
body[data-accent="impianti"] :is(.phero, .tile, .lb, .pd__stage, .chapter__media, .final, .sec--slate, .foot, .menu, .nav, .card-form) { --accent: var(--luce); }
.t-acqua { --accent: var(--acqua); }
.t-luce { --accent: var(--luce); }

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 84px;
  background: var(--notte);
  scrollbar-color: var(--bordo) var(--notte);
  scrollbar-width: thin;
}
body {
  margin: 0;
  background: var(--notte);
  color: var(--avorio);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, picture, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
::selection { background: rgb(var(--avorio-rgb) / .9); color: var(--notte); }
[hidden] { display: none !important; }

.i {
  width: 24px; height: 24px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
.tnum { font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; left: 16px; top: 12px; z-index: 100;
  padding: 12px 18px; background: var(--avorio); color: var(--notte);
  font-weight: 600; font-size: 15px; border-radius: 2px;
  transform: translateY(-160%); transition: transform .2s var(--ease);
}
.skip:focus { transform: none; }

/* focus: outline nell'accento + offset + ombra Notte per restare visibile anche sulle foto */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--notte);
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------------------------------------------------------------- type */
.h1, .h2, .display {
  font-family: var(--serif);
  font-weight: 400;
  font-optical-sizing: auto;
  text-wrap: balance;
}
.h1 {
  font-size: clamp(36px, 3.6vw + 16px, 72px);
  line-height: 1.05;
  letter-spacing: -.01em;
  font-variation-settings: "opsz" 72;
}
.h2 {
  font-size: clamp(30px, 2.2vw + 16px, 46px);
  line-height: 1.1;
  letter-spacing: -.005em;
}
.h1 em, .h2 em, .display em { font-style: italic; }
.h3 {
  font-family: var(--sans);
  font-size: clamp(20px, .4vw + 18px, 22px);
  line-height: 1.3;
  font-weight: 600;
}
.overline {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 12px; line-height: 1; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent);
}
.lead { font-size: clamp(17px, .3vw + 16px, 19px); color: var(--nebbia); max-width: 60ch; }
.muted { color: var(--nebbia); }
.small { font-size: 14px; line-height: 1.5; font-weight: 500; letter-spacing: .01em; color: var(--cenere); }
.prose p + p { margin-top: 1em; }
.prose p { color: var(--nebbia); max-width: 64ch; }
.prose strong { color: var(--avorio); font-weight: 600; }

/* segnaposto per dati mancanti (visibili, mai inventati) */
.ph {
  display: inline; padding: 1px 7px;
  border: 1px dashed rgb(var(--avorio-rgb) / .28);
  border-radius: 2px;
  color: var(--cenere); font-size: .82em; font-weight: 500; letter-spacing: .01em;
  white-space: normal;
}

/* ---------------------------------------------------------------- layout */
.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow { --wrap: 1120px; }
.sec { padding-block: var(--sec); position: relative; }
.sec--slate { background: var(--notte); }
.grid12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 24px); }

/* titolo di sezione: filetto verticale a sinistra con punto 6px nel colore dell'attività */
.sh { position: relative; padding-left: 28px; max-width: 760px; }
.sh::before {
  content: ""; position: absolute; left: 2px; top: 2px; bottom: 2px; width: 1px;
  background: linear-gradient(to bottom, var(--line-soft), rgb(var(--avorio-rgb) / 0));
  transform-origin: top;
}
.sh__dots { position: absolute; left: 0; top: 0; display: grid; gap: 4px; }
.sh .overline { margin-bottom: 18px; }
.sh .h2 + .lead { margin-top: 20px; }
.sh--center { margin-inline: auto; padding-left: 0; text-align: center; max-width: 820px; }
.sh--center::before { display: none; }
.sh--center .lead { margin-inline: auto; }
.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: none; font-style: normal;
}
.dot--acqua { background: var(--acqua); }
.dot--luce { background: var(--luce); }
.dot--ivory { background: var(--avorio); }

/* ---------------------------------------------------------------- logo discs */
.disc {
  --s: 56px;
  display: inline-grid; place-items: center; flex: none;
  width: var(--s); height: var(--s); border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgb(var(--avorio-rgb) / .14);
  overflow: hidden;
}
.disc img { width: 100%; height: 100%; object-fit: contain; }

/* ---------------------------------------------------------------- buttons */
.btn {
  --h: 52px;
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  height: var(--h); padding: 0 28px;
  border-radius: 2px; border: 1px solid transparent;
  font-size: 15px; font-weight: 600; letter-spacing: .02em; line-height: 1;
  white-space: nowrap; overflow: hidden;
  transition: background-color .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
}
.btn .i { width: 18px; height: 18px; }
.btn__label {
  --roll: 2.6em;
  display: inline-block;
  text-shadow: 0 var(--roll) currentColor;
  transition: transform .5s var(--ease-out);
}
.btn__arrow { width: 16px !important; height: 16px !important; transition: transform .4s var(--ease-out); }
@media (hover: hover) {
  .btn:hover .btn__label { transform: translateY(calc(-1 * var(--roll))); }
  .btn:hover .btn__arrow { transform: translateX(4px); }
}
.btn--ivory { background: var(--avorio); color: var(--notte); }
.btn--ivory:hover { background: color-mix(in oklab, var(--avorio), var(--notte) 14%); }
.btn--outline { border-color: rgb(var(--avorio-rgb) / .4); color: var(--avorio); }
.btn--outline:hover { border-color: rgb(var(--avorio-rgb) / .85); }
.btn--acqua { background: var(--acqua); color: var(--notte); --accent: var(--acqua); }
.btn--acqua:hover { background: color-mix(in oklab, var(--acqua), var(--avorio) 22%); }
.btn--luce { background: var(--luce); color: var(--notte); --accent: var(--luce); }
.btn--luce:hover { background: color-mix(in oklab, var(--luce), var(--avorio) 22%); }
.btn--accent { background: var(--accent); color: var(--notte); }
.btn--accent:hover { background: color-mix(in oklab, var(--accent), var(--avorio) 22%); }
.btn--sm { --h: 40px; padding: 0 18px; font-size: 14px; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  color: var(--avorio);
  padding-block: 6px;
  background: linear-gradient(var(--accent), var(--accent)) 0 100% / 100% 1px no-repeat;
  transition: background-size .45s var(--ease-out), color .3s;
}
.link-arrow .i { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.link-arrow:hover .i { transform: translateX(4px); }
.link-arrow:hover { background-size: 0% 1px; background-position: 100% 100%; }
.link-arrow--acqua { --accent: var(--acqua); }
.link-arrow--luce { --accent: var(--luce); }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px 0 10px;
  border: 1px solid rgb(var(--avorio-rgb) / .22); border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .01em; color: var(--avorio);
  background: rgb(var(--notte-rgb) / .35);
}
.pill .i { width: 18px; height: 18px; color: var(--accent); stroke-width: 1.8; }

/* ---------------------------------------------------------------- NAV */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  border-bottom: 1px solid transparent;
  transition: height .2s var(--ease), background-color .25s var(--ease), border-color .25s var(--ease), transform .4s var(--ease);
  view-transition-name: nav;
}
.nav.is-scrolled {
  --nav-h: 64px;
  background: var(--notte);
  border-bottom-color: var(--linea);
}
.nav__inner {
  height: 100%;
  width: min(100% - 2 * var(--gutter), 1440px); margin-inline: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  column-gap: clamp(28px, 3.2vw, 56px);
}
.nav__side { display: flex; align-items: center; gap: clamp(24px, 2.6vw, 44px); }
.nav__side--l { justify-content: flex-end; }
.nav__side--r { justify-content: flex-start; }
.nav__links { display: flex; align-items: center; gap: clamp(24px, 2.6vw, 44px); }
.nav__link {
  position: relative; display: inline-flex; align-items: center; height: 44px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  color: rgb(var(--avorio-rgb) / .86);
  transition: color .25s;
}
.nav__link span { position: relative; }
.nav__link span::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 1px;
  background: var(--u, var(--avorio));
  transform: scaleX(0); transition: transform .45s var(--ease-out);
}
.nav__link:hover { color: var(--avorio); }
.nav__link:hover span::after { transform: scaleX(1); }
.nav__link[aria-current="page"] { color: var(--avorio); }
.nav__link[aria-current="page"] span::after { transform: scaleX(1); }
.nav__link--piscine { --u: var(--acqua); }
.nav__link--impianti { --u: var(--luce); }

.nav__mark {
  display: flex; align-items: center; justify-self: center;
  padding: 6px; border-radius: 40px;
}
.nav__mark .disc { --s: 48px; transition: transform .5s var(--ease-out); }
.nav__mark .disc + .disc { margin-left: -10px; }
.nav.is-scrolled .nav__mark .disc { --s: 40px; }
.nav__mark:hover .disc--piscine { transform: translateX(-3px); }
.nav__mark:hover .disc--impianti { transform: translateX(3px); }

.nav__phone {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 4px;
  font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  color: var(--avorio);
  transition: opacity .3s;
}
.nav__phone .i { width: 18px; height: 18px; }
.nav__phone-num { transition: opacity .3s, max-width .4s var(--ease); max-width: 160px; overflow: hidden; white-space: nowrap; }
.nav__cta {
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s .35s;
  margin-left: -8px;
}
body.past-hero .nav__cta {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .35s var(--ease), transform .35s var(--ease), visibility 0s;
}
body.past-hero .nav__phone-num { opacity: 0; max-width: 0; }
.nav__burger, .nav__call--m { display: none; }

/* ---------------------------------------------------------------- MENU (mobile, dialog) */
.menu {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0 20px calc(24px + var(--safe-b));
  border: 0; background: var(--notte); color: var(--avorio);
  overflow-y: auto;
  opacity: 0;
  transition: opacity .2s var(--ease), overlay .2s allow-discrete, display .2s allow-discrete;
}
.menu[open] { opacity: 1; display: flex; flex-direction: column; }
@starting-style { .menu[open] { opacity: 0; } }
.menu::backdrop { background: transparent; }
.menu__top { height: 64px; display: flex; align-items: center; justify-content: center; position: relative; flex: none; }
.nav__mark--menu .disc { --s: 40px; }
.menu__close {
  position: absolute; right: -6px; top: 10px;
  height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 8px;
  font-size: 15px; font-weight: 600;
}
.menu__links { display: grid; margin-top: 28px; }
.menu__links a {
  display: flex; align-items: center; gap: 16px;
  font-family: var(--serif); font-size: 40px; line-height: 1.2;
  padding: 12px 0; border-bottom: 1px solid var(--linea);
}
.menu__links a .dot { width: 8px; height: 8px; }
.menu__foot { margin-top: auto; padding-top: 36px; display: grid; gap: 14px; }
.menu__phone {
  display: inline-flex; align-items: center; gap: 12px; justify-content: center;
  height: 52px; border: 1px solid rgb(var(--avorio-rgb) / .4); border-radius: 2px;
  font-weight: 600; font-size: 16px;
}
.menu__phone .i { width: 18px; height: 18px; }
.menu__mail { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 15px; color: var(--nebbia); }
.menu__mail .disc { --s: 32px; }
.menu__mail b { display: block; color: var(--avorio); font-weight: 600; }
.menu__mail span { line-height: 1.35; }

/* ---------------------------------------------------------------- HERO (home, split) */
.hero {
  position: relative;
  height: clamp(640px, 100svh, 1000px);
  background: var(--notte);
  isolation: isolate;
  overflow: clip;
}
.hero__stage { position: absolute; inset: 0; display: flex; }
.hero__panel {
  position: relative; flex: 1 1 0; min-width: 0;
  display: flex; align-items: flex-end;
  color: var(--avorio);
  transition: flex-grow .45s var(--ease);
  outline-offset: -6px;
}
.hero__panel:focus-visible { outline: none; box-shadow: none; }
.hero__panel::after {
  content: ""; position: absolute; inset: 10px; z-index: 6; pointer-events: none;
  border: 2px solid var(--accent); border-radius: 2px;
  box-shadow: 0 0 0 4px rgb(var(--notte-rgb) / .9), inset 0 0 0 4px rgb(var(--notte-rgb) / .5);
  opacity: 0; transition: opacity .2s;
}
.hero__panel:focus-visible::after { opacity: 1; }
.hero__panel--piscine { --accent: var(--acqua); }
.hero__panel--impianti { --accent: var(--luce); }
.hero__media, .hero__media img {
  position: absolute; inset: 0; width: 100%; height: 100%;
}
.hero__media { z-index: 1; }
.hero__media img { object-fit: cover; transition: filter .45s var(--ease); }
.hero__panel--piscine .hero__media img { object-position: 50% 55%; }
.hero__panel--impianti .hero__media img { object-position: 65% 40%; }
/* gradiente inferiore: blu mare 90% → 0 sul 45% basso */
.hero__shade {
  position: absolute; inset: auto 0 0 0; height: 64%; z-index: 3; pointer-events: none;
  background: linear-gradient(to top,
    rgb(var(--notte-rgb) / .92) 0%, rgb(var(--notte-rgb) / .88) 14%, rgb(var(--notte-rgb) / .8) 26%,
    rgb(var(--notte-rgb) / .66) 40%, rgb(var(--notte-rgb) / .48) 54%, rgb(var(--notte-rgb) / .29) 68%,
    rgb(var(--notte-rgb) / .13) 82%, rgb(var(--notte-rgb) / .03) 93%, rgb(var(--notte-rgb) / 0) 100%);
}
.hero__content {
  position: relative; z-index: 4;
  display: grid; gap: 16px; justify-items: start;
  padding: 0 64px calc(72px + 60px);
  max-width: min(560px, 100%);
}
.hero__h2 { display: grid; gap: 16px; font-weight: 400; }
.hero__title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 1.4vw + 16px, 38px); line-height: 1.12; letter-spacing: -.005em;
  text-wrap: balance;
}
.pseudo-btn {
  display: inline-flex; align-items: center; gap: 12px;
  height: 48px; padding: 0 22px;
  border: 1px solid rgb(var(--avorio-rgb) / .4); border-radius: 2px;
  font-size: 15px; font-weight: 600; letter-spacing: .02em;
  background:
    linear-gradient(var(--accent), var(--accent)) 50% 100% / 0% 2px no-repeat,
    rgb(var(--notte-rgb) / .25);
  transition: background-size .5s var(--ease-out), border-color .3s;
  margin-top: 8px;
}
.pseudo-btn .i { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.hero__panel .pseudo-btn { box-shadow: inset 0 -2px 0 var(--accent); }
.hero[data-on="piscine"] .hero__panel--piscine .pseudo-btn,
.hero[data-on="impianti"] .hero__panel--impianti .pseudo-btn { border-color: rgb(var(--avorio-rgb) / .8); background-color: rgb(var(--notte-rgb) / .5); }
.hero[data-on="piscine"] .hero__panel--piscine .pseudo-btn .i,
.hero[data-on="impianti"] .hero__panel--impianti .pseudo-btn .i { transform: translateX(4px); }
.hero__content .overline, .hero__title { text-shadow: 0 1px 18px rgb(var(--notte-rgb) / .55); }
.hero__mlogo { display: none; }

/* gradiente superiore: legibilità navbar + titolo (85% → 0) */
.hero__top {
  position: absolute; inset: 0 0 auto 0; height: min(52%, 460px); z-index: 3; pointer-events: none;
  background: linear-gradient(to bottom, rgb(var(--notte-rgb) / .85), rgb(var(--notte-rgb) / .55) 45%, rgb(var(--notte-rgb) / 0));
}
.hero__head {
  position: absolute; z-index: 6; left: 50%; top: 124px; transform: translateX(-50%);
  width: min(880px, 100% - 2 * var(--gutter));
  text-align: center; pointer-events: none;
}
.hero__h1 { font-size: clamp(38px, 2.6vw + 18px, 58px); line-height: 1.06; }
.hero__h1 .w-p, .hero__h1 .w-i { transition: color .5s var(--ease); }
.hero[data-on="piscine"] .w-p { color: color-mix(in oklab, var(--avorio) 55%, var(--acqua)); }
.hero[data-on="impianti"] .w-i { color: color-mix(in oklab, var(--avorio) 55%, var(--luce)); }
.hero__sub { margin-top: 18px; font-size: 18px; font-weight: 500; color: var(--avorio); text-shadow: 0 1px 14px rgb(var(--notte-rgb) / .7); }

/* divisore: elemento flex di larghezza 0 che segue lo split */
.hero__div { position: relative; flex: 0 0 0; z-index: 5; pointer-events: none; }
.hero__line {
  position: absolute; left: -.5px; top: 0; bottom: 0; width: 1px;
  background: var(--line-soft);
  transition: background-color .45s var(--ease);
  -webkit-mask: linear-gradient(#000 0 var(--gap-a, 0px), transparent calc(var(--gap-a, 0px) + 24px) calc(var(--gap-b, 0px) - 24px), #000 var(--gap-b, 0px));
          mask: linear-gradient(#000 0 var(--gap-a, 0px), transparent calc(var(--gap-a, 0px) + 24px) calc(var(--gap-b, 0px) - 24px), #000 var(--gap-b, 0px));
}
.hero[data-on="piscine"] .hero__line { background: var(--acqua); }
.hero[data-on="impianti"] .hero__line { background: var(--luce); }
.hero.gl-on .hero__line { opacity: 0; }
.hero__discs {
  position: absolute; left: 0; top: var(--disc-y, 42%);
  display: flex; transform: translate(-50%, -50%);
}
.hero__discs .disc {
  --s: var(--disc, 128px);
  box-shadow: 0 0 0 2px #fff, 0 18px 50px -12px rgb(0 0 0 / .55);
  transition: box-shadow .45s var(--ease);
}
.hero__discs .disc + .disc { margin-left: -12px; }
.hero[data-on="piscine"] .hero__discs .disc--piscine { box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgb(var(--acqua-rgb) / .9), 0 18px 50px -12px rgb(0 0 0 / .55); }
.hero[data-on="impianti"] .hero__discs .disc--impianti { box-shadow: 0 0 0 2px #fff, 0 0 0 5px rgb(var(--luce-rgb) / .9), 0 18px 50px -12px rgb(0 0 0 / .55); }

.hero__gl {
  position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%;
  opacity: 0; pointer-events: none;
}
.hero.gl-on .hero__gl { opacity: 1; }

/* fascia CTA inferiore */
.hero__band {
  position: absolute; z-index: 7; inset: auto 0 0 0; height: 72px;
  background: var(--notte);
  border-top: 1px solid var(--linea);
}
.hero__band-in {
  height: 100%;
  width: min(100% - 2 * var(--gutter), 1440px); margin-inline: auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px;
}
.hero__free { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; }
.hero__free .i { color: var(--acqua); width: 20px; height: 20px; stroke-width: 1.8; }
.hero__tel {
  display: inline-flex; align-items: center; gap: 10px; justify-self: center;
  font-size: 16px; font-weight: 600; letter-spacing: .02em; height: 44px;
}
.hero__tel .i { width: 18px; height: 18px; }
.hero__tel span { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size .45s var(--ease-out); padding-bottom: 2px; }
.hero__tel:hover span { background-size: 100% 1px; }
.hero__band .btn { justify-self: end; }

/* hover (solo puntatore preciso): 56/44, l'altro pannello all'80% di luminosità */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  .hero[data-on="piscine"] .hero__panel--piscine,
  .hero[data-on="impianti"] .hero__panel--impianti { flex-grow: 1.2727; }
}
.hero[data-on="piscine"] .hero__panel--impianti .hero__media img,
.hero[data-on="impianti"] .hero__panel--piscine .hero__media img { filter: brightness(.8); }

/* intro "accensione" (JS): stato iniziale */
.hero.no-anim *, .hero.no-anim *::before, .hero.no-anim *::after { transition: none !important; animation: none !important; }
.js .hero.is-pre .hero__media,
.js .hero.is-pre .hero__line,
.js .hero.is-pre .hero__discs,
.js .hero.is-pre .hero__content,
.js .hero.is-pre .hero__band,
.js .hero.is-pre .hero__sub { opacity: 0; }
.js .hero.is-pre .hero__h1 .wl > span { transform: translateY(105%); }
.hero__media { transition: opacity .9s var(--ease); }
/* pannello Piscine: foto che si alternano (senza WebGL è una dissolvenza) */
.hero__slide { opacity: 0; transition: opacity 1.2s var(--ease); }
.hero__slide.is-on { opacity: 1; }
.hero__content { transition: opacity .9s var(--ease) .45s, transform .9s var(--ease) .45s; }
.js .hero.is-pre .hero__content { transform: translateY(18px); }
.hero__band { transition: opacity .8s var(--ease) .6s, transform .9s var(--ease-out) .6s; }
.js .hero.is-pre .hero__band { transform: translateY(100%); }
.hero__sub { transition: opacity 1s var(--ease) .55s; }
.hero__h1 .wl { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: top; padding-bottom: .06em; }
.hero__h1 .wl > span { display: inline-block; transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 70ms); }
.hero__discs { transition: opacity .35s var(--ease); }
.hero.is-rolling .disc { animation: roll 1.5s var(--ease-out) .12s both; }
.hero.is-rolling .disc--piscine { --from: calc(var(--roll-d, 400px) * -1); }
.hero.is-rolling .disc--impianti { --from: var(--roll-d, 400px); animation-delay: .2s; }
@keyframes roll {
  from { transform: translateY(var(--from)) rotate(var(--roll-a, 360deg)); }
  to { transform: none; }
}
.hero__line { transform-origin: top; }
.hero.is-drawing .hero__line { animation: draw .8s var(--ease-io) both; }
@keyframes draw { from { transform: scaleY(0); } to { transform: none; } }

/* ---------------------------------------------------------------- reveal */
.js [data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js [data-reveal].is-in { opacity: 1; transform: none; }
.js [data-reveal="fade"] { transform: none; }
.js [data-split] .wl { display: inline-block; overflow: clip; overflow-clip-margin: .12em; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.js [data-split] .wl > span { display: inline-block; transform: translateY(108%); transition: transform 1s var(--ease-out); transition-delay: calc(var(--i, 0) * 55ms); }
.js [data-split].is-in .wl > span { transform: none; }
/* immagini che "si accendono" entrando nel viewport */
.js .lit img { filter: brightness(.18) saturate(.6); transform: scale(1.06); transition: filter 1.6s var(--ease), transform 1.8s var(--ease-out); }
.js .lit.is-in img { filter: none; transform: none; }
.js .draw-y { transform: scaleY(0); transform-origin: top; transition: transform 1.4s var(--ease-io); }
.js .draw-y.is-in { transform: none; }
.js .draw-x { transform: scaleX(0); transform-origin: left; transition: transform 1.4s var(--ease-io); }
.js .draw-x.is-in { transform: none; }

/* ---------------------------------------------------------------- HOME: come possiamo aiutarti */
.help__thread { position: absolute; left: 50%; width: 1px; transform-origin: top; pointer-events: none; }
.help__thread--top { top: 0; height: calc(var(--sec) - 28px); background: linear-gradient(to bottom, var(--line-soft), rgb(var(--avorio-rgb) / .08)); }
.help__thread--mid { top: calc(-1 * clamp(56px, 6vw, 88px) + 16px); height: calc(clamp(56px, 6vw, 88px) - 16px); background: linear-gradient(to bottom, rgb(var(--avorio-rgb) / .08), var(--line-soft)); left: 50%; }
.help__grid {
  position: relative;
  margin-top: clamp(56px, 6vw, 88px);
  display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  column-gap: clamp(40px, 6vw, 104px);
}
.help__line { position: relative; background: var(--line-soft); transition: background-color .45s var(--ease); }
.help__line::before {
  content: ""; position: absolute; left: 50%; top: 0; width: 7px; height: 7px; border-radius: 50%;
  transform: translate(-50%, -50%); background: var(--avorio); transition: background-color .45s var(--ease), top 1s var(--ease);
}
.help[data-on="piscine"] .help__line { background: rgb(var(--acqua-rgb) / .7); }
.help[data-on="impianti"] .help__line { background: rgb(var(--luce-rgb) / .7); }
.help[data-on="piscine"] .help__line::before { background: var(--acqua); }
.help[data-on="impianti"] .help__line::before { background: var(--luce); }
.help__col { display: flex; flex-direction: column; }
.help__head { display: flex; align-items: center; gap: 20px; margin-bottom: 36px; }
.help__head .disc { --s: 56px; }
.help__head .overline { margin-bottom: 10px; }
.svc-list { border-top: 1px solid var(--linea); }
.svc {
  position: relative;
  display: grid; grid-template-columns: 40px 1fr 24px; align-items: center; gap: 20px;
  padding: 24px 12px 24px 4px;
  border-bottom: 1px solid var(--linea);
  transition: background-color .35s var(--ease);
}
.svc::before {
  content: ""; position: absolute; left: 0; top: -1px; bottom: -1px; width: 2px;
  background: var(--accent); transform: scaleY(0); transform-origin: bottom;
  transition: transform .45s var(--ease-out);
}
.svc .i { color: var(--accent); width: 26px; height: 26px; justify-self: center; }
.svc__t { display: block; font-size: 20px; font-weight: 600; line-height: 1.3; }
.svc__d { display: block; font-size: 15px; color: var(--nebbia); margin-top: 4px; line-height: 1.5; }
.svc__a { width: 18px !important; height: 18px !important; color: var(--avorio) !important; opacity: .5; transition: transform .45s var(--ease-out), opacity .3s; }
.svc:hover { background: linear-gradient(90deg, rgb(var(--avorio-rgb) / .04), transparent); }
.svc:hover::before, .svc:focus-visible::before { transform: none; transform-origin: top; }
.svc:hover .svc__a { transform: translateX(4px); opacity: 1; }
.help__cta { margin-top: 40px; }

/* ---------------------------------------------------------------- HOME: lavori (mosaico) */
.works__head { display: flex; align-items: end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.mosaic {
  margin-top: clamp(48px, 5vw, 72px);
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px;
}
.tile {
  position: relative; display: block; overflow: hidden; border-radius: 4px;
  background: var(--ardesia);
  text-align: left; width: 100%;
  cursor: zoom-in;
}
.tile--8 { grid-column: span 8; aspect-ratio: 16 / 10; }
.tile--4 { grid-column: span 4; }
.tile picture, .tile img { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile img { object-fit: cover; transition: transform .6s var(--ease), filter 1.6s var(--ease) !important; }
.tile::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgb(var(--notte-rgb) / .85), rgb(var(--notte-rgb) / 0) 55%);
  opacity: .55; transition: opacity .5s var(--ease);
}
.tile__meta { position: absolute; z-index: 2; left: 20px; right: 20px; bottom: 20px; display: grid; gap: 12px; justify-items: start; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--accent); background: rgb(var(--notte-rgb) / .72);
  font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--avorio);
}
.tag--acqua { --accent: var(--acqua); }
.tag--luce { --accent: var(--luce); }
.tile__cap {
  font-size: 15px; line-height: 1.45; color: var(--avorio); max-width: 46ch;
  opacity: 0; transform: translateY(10px); transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.tile__zoom {
  position: absolute; z-index: 2; right: 16px; top: 16px; width: 40px; height: 40px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgb(var(--notte-rgb) / .7); opacity: 0; transition: opacity .4s var(--ease);
}
.tile__zoom .i { width: 18px; height: 18px; }
@media (hover: hover) {
  .tile:hover img { transform: scale(1.03); }
  .tile:hover::after, .tile:focus-visible::after { opacity: 1; }
  .tile:hover .tile__cap, .tile:focus-visible .tile__cap { opacity: 1; transform: none; }
  .tile:hover .tile__zoom, .tile:focus-visible .tile__zoom { opacity: 1; }
}
@media (hover: none) {
  .tile::after { opacity: 1; }
  .tile__cap { opacity: 1; transform: none; }
}
.works__links { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 16px 40px; }

/* ---------------------------------------------------------------- processo */
.steps-wrap { margin-top: clamp(56px, 6vw, 88px); position: relative; }
.steps {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(20px, 2.4vw, 32px);
}
.steps__rail {
  position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--linea);
}
.steps__fill {
  position: absolute; left: 0; top: 0; height: 1px; width: 100%;
  background: var(--avorio); transform-origin: left; transform: scaleX(var(--p, 0));
}
.steps__dot {
  position: absolute; top: 0; left: calc(var(--p, 0) * 100%); width: 7px; height: 7px; border-radius: 50%;
  background: var(--avorio); transform: translate(-50%, -50%);
  box-shadow: 0 0 0 5px var(--notte);
}
.step { position: relative; padding-top: 36px; }
.step::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; }
.step--key::before { height: 2px; top: -1px; background: var(--avorio); }
.step__n {
  display: block; font-family: var(--serif); font-size: 64px; line-height: 1; font-weight: 400;
  color: rgb(var(--avorio-rgb) / .55); font-variant-numeric: lining-nums;
  transition: color .8s var(--ease);
}
.step.is-reached .step__n { color: rgb(var(--avorio-rgb) / .9); }
.step--key .step__n { color: rgb(var(--avorio-rgb) / .9); }
.step .h3 { margin-top: 20px; }
.step p { margin-top: 10px; color: var(--nebbia); font-size: 16px; }
.step .pill { margin-top: 18px; }

/* ---------------------------------------------------------------- CTA finale */
.final { background: var(--notte); position: relative; overflow: hidden; }
.final::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  opacity: 0; transition: opacity .8s var(--ease);
  background: radial-gradient(520px 380px at var(--mx, 50%) var(--my, 60%), var(--spill, transparent), transparent 72%);
}
.final[data-on]::before { opacity: 1; }
.final[data-on="piscine"] { --spill: rgb(var(--acqua-rgb) / .12); }
.final[data-on="impianti"] { --spill: rgb(var(--luce-rgb) / .12); }
.final::after {
  content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, rgb(var(--avorio-rgb) / .12) 30%, rgb(var(--avorio-rgb) / .12) 70%, transparent);
}
.final__in, .pdgo__in { position: relative; z-index: 1; text-align: center; display: grid; justify-items: center; gap: 22px; }
.final__in .lead, .pdgo__in .lead { margin: 0 auto; }
.final__btns, .pdgo__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 14px; }
.final__btns .btn, .pdgo__btns .btn { min-width: 220px; }
.final__or { display: flex; align-items: center; gap: 16px; color: var(--cenere); font-size: 14px; margin-top: 18px; }
.final__or::before, .final__or::after { content: ""; width: 48px; height: 1px; background: var(--linea); }
.bigphone {
  font-family: var(--serif); font-size: clamp(34px, 2vw + 22px, 44px); line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.005em;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  padding-bottom: 4px; transition: background-size .6s var(--ease-out);
}
.bigphone:hover { background-size: 100% 1px; }

/* ---------------------------------------------------------------- FOOTER */
.foot { background: var(--abisso); padding: 80px 0 40px; position: relative; }
.foot__id { display: grid; grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr); column-gap: clamp(40px, 6vw, 104px); }
.foot__line { background: var(--line-soft); }
.foot__biz { display: grid; justify-items: start; gap: 12px; align-content: start; }
.foot__biz .disc { --s: 64px; margin-bottom: 8px; }
.foot__name { font-family: var(--serif); font-size: 30px; line-height: 1.15; }
.foot__desc { color: var(--nebbia); font-size: 15px; max-width: 40ch; }
.foot__mail { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; color: var(--avorio); padding-block: 6px; }
.foot__mail .i { width: 18px; height: 18px; color: var(--cenere); }
.foot__mail:hover { color: var(--acqua); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.foot__row {
  margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--linea);
  display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px;
}
.foot__nav { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; font-weight: 600; }
.foot__nav a { padding-block: 10px; color: rgb(var(--avorio-rgb) / .85); }
.foot__nav a:hover { color: var(--avorio); }
.foot__phone { margin-left: auto; font-size: 26px; font-weight: 600; letter-spacing: .01em; }
.foot__phone:hover { color: var(--acqua); }
.foot__legal { margin-top: 40px; font-size: 14px; color: var(--cenere); line-height: 1.7; }
.foot__legal .ph { font-size: 13.5px; }

/* ---------------------------------------------------------------- barra mobile */
.mbar { display: none; }

/* ---------------------------------------------------------------- PAGINE INTERNE: hero */
.phero {
  position: relative; isolation: isolate;
  min-height: max(80svh, 600px);
  display: flex; align-items: flex-end;
  overflow: clip;
  background: var(--notte);
}
.phero__media { position: absolute; inset: 0; z-index: 0; }
.phero__media img { width: 100%; height: 100%; object-fit: cover; }
.phero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(90deg, rgb(var(--notte-rgb) / .9) 0%, rgb(var(--notte-rgb) / .78) 22%, rgb(var(--notte-rgb) / .42) 40%, rgb(var(--notte-rgb) / 0) 55%);
}
.phero::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to bottom, rgb(var(--notte-rgb) / .7), rgb(var(--notte-rgb) / 0) 160px);
}
.phero__in { position: relative; z-index: 2; width: 100%; padding: calc(var(--nav-h) + 48px) 0 clamp(48px, 6vw, 80px); }
.phero__col { grid-column: 1 / span 7; display: grid; justify-items: start; gap: 18px; }
.crumbs { display: flex; gap: 8px; font-size: 14px; color: var(--nebbia); }
.crumbs a { color: var(--nebbia); text-decoration: underline; text-decoration-color: rgb(var(--avorio-rgb) / .3); text-underline-offset: 4px; }
.crumbs a:hover { color: var(--avorio); }
.crumbs [aria-current] { color: var(--avorio); }
.phero .disc { --s: 88px; margin-top: 4px; }
.phero .h1 { max-width: 21ch; font-size: clamp(36px, 2.5vw + 18px, 60px); }
.phero .lead { color: var(--nebbia); max-width: 46ch; }
.phero .btn-row { margin-top: 8px; }
.phero__pill { margin-top: 4px; }
.js .phero.img-pre .phero__media img { filter: brightness(.08); transform: scale(1.06); }
.phero__media img { transition: filter 2.2s var(--ease), transform 2.6s var(--ease-out); }
.phero.no-img-anim .phero__media img { transition: none; }
.vt-in .phero .phero__media img { filter: none !important; transform: none !important; }
.phero__gl { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .6s var(--ease); pointer-events: none; }
.phero.gl-on .phero__gl { opacity: 1; }
.js .phero.is-pre .phero__col > * { opacity: 0; transform: translateY(16px); }
.phero__col > * { transition: opacity .8s var(--ease), transform .8s var(--ease); transition-delay: calc(var(--d, 0) * 80ms + 250ms); }

/* presentazione */
.intro { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 24px); align-items: center; }
.intro__text { grid-column: 1 / span 6; }
.intro__text .sh { margin-bottom: 32px; }
.intro__media { grid-column: 8 / span 5; position: relative; }
.intro__media picture { border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 5; }
.intro__media img { width: 100%; height: 100%; object-fit: cover; }
.intro__cap { margin-top: 14px; }
.facts { margin-top: 36px; display: grid; gap: 0; border-top: 1px solid var(--linea); }
.facts li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 0; border-bottom: 1px solid var(--linea); color: var(--avorio); }
.facts .i { color: var(--accent); margin-top: 1px; }

/* anno di fondazione (Impianti) */
.since { margin-top: 40px; padding: 28px 28px 24px; border: 1px solid var(--linea); border-radius: 4px; background: var(--ardesia); }
.since__row { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.since__y { font-family: var(--serif); font-size: clamp(44px, 3vw + 20px, 64px); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.since__y--now { color: rgb(var(--avorio-rgb) / .6); }
.since__track { position: relative; height: 1px; margin: 22px 0 16px; background: var(--linea); }
.since__fill { position: absolute; inset: 0; background: var(--luce); transform-origin: left; transform: scaleX(var(--p, 0)); }
.since__dot { position: absolute; top: 0; left: calc(var(--p, 0) * 100%); width: 9px; height: 9px; border-radius: 50%; background: var(--luce); transform: translate(-50%, -50%); box-shadow: 0 0 0 5px var(--ardesia); }
.since__txt { font-size: 15px; color: var(--nebbia); }
.since__count { color: var(--avorio); font-weight: 600; font-variant-numeric: tabular-nums; }

/* capitoli alternati */
.chapter { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 24px); align-items: center; }
.chapter + .chapter { margin-top: clamp(88px, 10vw, 150px); }
.chapter__media { grid-column: 1 / span 7; position: relative; }
.chapter__media picture { aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; }
.chapter__media img { width: 100%; height: 100%; object-fit: cover; }
.chapter__text { grid-column: 9 / span 4; }
.chapter--rev .chapter__media { grid-column: 6 / span 7; grid-row: 1; }
.chapter--rev .chapter__text { grid-column: 1 / span 4; grid-row: 1; }
.chapter__num {
  position: absolute; z-index: 2; top: 20px; left: 22px;
  font-family: var(--serif); font-size: 44px; line-height: 1; color: rgb(var(--avorio-rgb) / .92);
  text-shadow: 0 2px 24px rgb(0 0 0 / .45);
  pointer-events: none;
}
.chapter__media::before {
  content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; border-radius: 4px;
  background: linear-gradient(160deg, rgb(var(--notte-rgb) / .55), transparent 36%);
}
.chapter__text .overline { margin-bottom: 18px; }
.chapter__text .h2 { margin-bottom: 20px; }
.chapter__text > p:not(.overline) { color: var(--nebbia); }
.ticks { margin: 28px 0 32px; display: grid; }
.ticks li { position: relative; padding: 13px 0 13px 30px; border-top: 1px solid var(--linea); font-size: 16px; line-height: 1.45; }
.ticks li:last-child { border-bottom: 1px solid var(--linea); }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: 21px; width: 12px; height: 6px;
  border-left: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: rotate(-45deg);
}

/* dettagli e finiture */
.details { margin-top: clamp(48px, 5vw, 72px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.detail picture { aspect-ratio: 4 / 5; border-radius: 4px; overflow: hidden; }
.detail img { width: 100%; height: 100%; object-fit: cover; }
.detail figcaption { margin-top: 16px; display: grid; gap: 4px; }
.detail figcaption b { font-size: 17px; font-weight: 600; }
.detail figcaption span { font-size: 15px; color: var(--nebbia); }

/* galleria masonry */
.gallery { margin-top: clamp(48px, 5vw, 72px); columns: 3; column-gap: 16px; }
.gallery .tile { break-inside: avoid; margin-bottom: 16px; }
.gallery .tile picture, .gallery .tile img { position: relative; inset: auto; height: auto; }
.gallery .tile img { width: 100%; }

/* prima e dopo: confronto con barra + passaggio alla sera */
.pd { margin-top: clamp(48px, 5vw, 72px); display: grid; grid-template-columns: minmax(0, 1fr) 196px; gap: clamp(24px, 3vw, 48px); align-items: center; }
.pd__fig { min-width: 0; }
.pd__stage {
  position: relative; aspect-ratio: 1808 / 880; overflow: hidden; border-radius: 4px;
  background: var(--ardesia); isolation: isolate;
  touch-action: pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  cursor: ew-resize;
}
.pd__stage picture, .pd__stage img { position: absolute; inset: 0; width: 100%; height: 100%; }
.pd__stage img { object-fit: cover; -webkit-user-drag: none; }
/* il "dopo" sta a destra della barra: due traslazioni opposte (solo compositing, niente repaint) */
.pd__after { position: absolute; inset: 0; overflow: hidden; transform: translateX(var(--pos)); }
.pd__after > picture { transform: translateX(calc(-1 * var(--pos))); }
.pd.is-css .pd__stage > picture, .pd.is-css .pd__after { filter: brightness(calc(1 - .58 * var(--dusk, 0))) saturate(calc(1 - .35 * var(--dusk, 0))); }
.pd__night { position: absolute; inset: 0; z-index: 1; opacity: var(--night, 0); visibility: hidden; }
.pd.is-dark .pd__night, .pd.is-night .pd__night { visibility: visible; }
.pd.is-night .pd__night { opacity: 1; }
.pd__gl { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; pointer-events: none; visibility: hidden; }
.pd__gl.is-on { visibility: visible; }
.pd__line { position: absolute; inset: 0; z-index: 4; pointer-events: none; transform: translateX(var(--pos)); transition: opacity .35s var(--ease), visibility 0s; }
.pd__line::before { content: ""; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--avorio); box-shadow: 0 0 14px rgb(0 0 0 / .4); }
.pd__handle {
  position: absolute; left: 0; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: 1.5px solid var(--avorio); background: rgb(var(--notte-rgb) / .72); color: var(--avorio);
  pointer-events: auto; cursor: ew-resize;
  box-shadow: 0 6px 24px rgb(0 0 0 / .35);
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .3s var(--ease-out);
}
.pd__handle .i { width: 18px; height: 18px; margin: 0 -2px; }
.pd__handle:focus-visible { outline-offset: 4px; border-radius: 50%; }
.pd.is-drag .pd__handle, .pd__handle:hover { background: var(--acqua); color: var(--notte); border-color: var(--acqua); }
.pd.is-drag .pd__handle { transform: scale(1.08); }
.pd.is-dark .pd__line { opacity: 0; visibility: hidden; transition: opacity .35s var(--ease), visibility 0s .35s; }
.pd.is-busy .pd__stage { cursor: default; }
.pd__tag {
  position: absolute; z-index: 3; top: 16px;
  display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid rgb(var(--avorio-rgb) / .5); background: rgb(var(--notte-rgb) / .72);
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--avorio);
  pointer-events: none; transition: opacity .35s var(--ease);
}
.pd__tag .i { width: 15px; height: 15px; color: var(--acqua); }
.pd__tag--prima { left: 16px; }
.pd__tag--dopo { right: 16px; border-color: var(--acqua); }
.pd__tag--sera { left: 16px; border-color: var(--acqua); opacity: 0; }
.pd.hide-prima .pd__tag--prima, .pd.hide-dopo .pd__tag--dopo, .pd.is-dark .pd__tag--prima, .pd.is-dark .pd__tag--dopo { opacity: 0; }
.pd.is-night .pd__tag--sera { opacity: 1; }
.pd__cap { margin-top: 16px; max-width: 80ch; }

/* interruttore giorno / sera (una placca, come quella di un interruttore) */
.pd__side { display: grid; justify-items: center; }
.pd__switch { display: grid; justify-items: center; gap: 20px; text-align: center; color: var(--avorio); padding: 8px; border-radius: 4px; }
.pd__plate {
  display: grid; place-items: center; width: 96px; height: 156px; border-radius: 16px;
  background: linear-gradient(160deg, var(--fumo), var(--ardesia)); border: 1px solid var(--linea);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .6), 0 14px 34px rgb(var(--avorio-rgb) / .14);
  transition: border-color .4s var(--ease), box-shadow .6s var(--ease);
}
.pd__track { position: relative; width: 46px; height: 108px; border-radius: 999px; background: var(--notte); border: 1px solid var(--linea); }
.pd__thumb {
  position: absolute; left: 4px; top: 4px; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center; background: var(--avorio); color: var(--notte);
  transition: transform .7s var(--ease-out), background-color .6s var(--ease), box-shadow .6s var(--ease);
}
.pd__thumb .i { grid-area: 1 / 1; width: 20px; height: 20px; transition: opacity .4s var(--ease), transform .6s var(--ease-out); }
.pd__ic-moon { opacity: 0; transform: rotate(-60deg); }
.pd__switch[aria-pressed="true"] .pd__thumb { transform: translateY(62px); background: var(--acqua); box-shadow: 0 0 0 6px rgb(var(--acqua-rgb) / .14), 0 0 30px rgb(var(--acqua-rgb) / .6); }
.pd__switch[aria-pressed="true"] .pd__ic-sun { opacity: 0; transform: rotate(60deg); }
.pd__switch[aria-pressed="true"] .pd__ic-moon { opacity: 1; transform: none; }
.pd__switch[aria-pressed="true"] .pd__plate { border-color: rgb(var(--acqua-rgb) / .6); box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 14px 40px rgb(var(--acqua-rgb) / .2); }
.pd__switch:hover .pd__plate { border-color: rgb(var(--avorio-rgb) / .45); }
.pd__txt { display: grid; gap: 4px; }
.pd__txt b { font-size: 17px; font-weight: 600; line-height: 1.3; }
.pd__txt span { font-size: 14px; line-height: 1.45; color: var(--nebbia); }
html:not(.js) .pd { grid-template-columns: minmax(0, 1fr); }
html:not(.js) .pd__side, html:not(.js) .pd__line { display: none; }

/* perché sceglierci */
.why { margin-top: clamp(48px, 5vw, 72px); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.why__item {
  padding: 28px 24px; background: var(--ardesia); border: 1px solid var(--linea); border-radius: 4px;
  display: grid; gap: 14px; align-content: start;
  transition: border-color .35s var(--ease);
}
.why__item:hover { border-color: var(--accent); }
.why__item .i { color: var(--accent); width: 28px; height: 28px; }
.why__item b { font-size: 18px; font-weight: 600; line-height: 1.35; }
.why__item p { font-size: 15px; color: var(--nebbia); line-height: 1.55; }

/* tipologie (impianti) */
.types { margin-top: 48px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.type {
  position: relative; padding: 32px 28px; background: var(--ardesia); border: 1px solid var(--linea); border-radius: 4px;
  display: grid; gap: 16px; align-content: start;
}
.type .i { width: 32px; height: 32px; color: var(--luce); }
.type b { font-size: 20px; font-weight: 600; }
.type p { color: var(--nebbia); font-size: 15px; }
.types__note { margin-top: 20px; }

/* FAQ */
.faq { margin-top: clamp(40px, 4vw, 56px); border-top: 1px solid var(--linea); max-width: 900px; }
.faq details { border-bottom: 1px solid var(--linea); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 24px 4px; font-size: 19px; font-weight: 600; line-height: 1.4;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--accent); transition: transform .45s var(--ease-out); }
.faq details[open] summary .i { transform: rotate(45deg); }
.faq details::details-content { height: 0; overflow: clip; transition: height .45s var(--ease), content-visibility .45s allow-discrete; }
.faq details[open]::details-content { height: auto; }
.faq__a { padding: 0 48px 26px 4px; color: var(--nebbia); max-width: 70ch; }

/* CTA + mini-form (pagine attività) */
.ask { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 24px); align-items: start; }
.ask__text { grid-column: 1 / span 5; display: grid; gap: 24px; justify-items: start; }
.ask__card { grid-column: 7 / span 6; }
.card-form {
  background: var(--ardesia); border: 1px solid var(--linea); border-radius: 4px;
  padding: clamp(24px, 3.5vw, 48px);
}
.mini__svc { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--linea); font-size: 15px; color: var(--nebbia); }
.mini__svc .disc { --s: 40px; }
.mini__svc b { color: var(--avorio); font-weight: 600; display: block; }
.mini__full { margin-top: 18px; }

/* rimando incrociato */
.cross {
  display: grid; grid-template-columns: 220px 1fr auto; align-items: center; gap: 32px;
  padding: 16px 32px 16px 16px;
  background: var(--ardesia); border: 1px solid var(--accent); border-radius: 4px;
  transition: background-color .4s var(--ease);
}
.cross:hover { background: var(--fumo); }
.cross picture { aspect-ratio: 3 / 2; border-radius: 2px; overflow: hidden; }
.cross img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.cross:hover img { transform: scale(1.03); }
.cross__t { font-family: var(--serif); font-size: clamp(28px, 1.5vw + 16px, 36px); line-height: 1.15; }
.cross__t + p { margin-top: 8px; color: var(--nebbia); }
.cross__go { display: inline-flex; align-items: center; gap: 12px; font-weight: 600; font-size: 15px; }
.cross__go .i { width: 16px; height: 16px; transition: transform .4s var(--ease-out); }
.cross:hover .cross__go .i { transform: translateX(4px); }
.cross .overline { margin-bottom: 12px; }

/* ---------------------------------------------------------------- FORM */
.form { display: grid; gap: 22px; --accent: var(--form-accent, var(--avorio)); }
.form[data-svc="piscine"] { --form-accent: var(--acqua); }
.form[data-svc="impianti"] { --form-accent: var(--luce); }
.field { display: grid; gap: 8px; align-content: start; }
.field > label, .legend { font-size: 14px; font-weight: 600; color: var(--avorio); letter-spacing: .01em; }
.req { color: var(--nebbia); font-weight: 500; }
.input, .select, .textarea {
  width: 100%; min-height: 52px;
  background: var(--fumo); color: var(--avorio);
  border: 1px solid var(--bordo); border-radius: 2px;
  padding: 0 16px; font-size: 16px;
  transition: border-color .25s, box-shadow .25s;
}
.textarea { padding: 14px 16px; min-height: 148px; resize: vertical; line-height: 1.55; }
.select {
  appearance: none; -webkit-appearance: none;
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23526A73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.select option { background: var(--ardesia); }
.input::placeholder, .textarea::placeholder { color: var(--cenere); opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--avorio); }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent);
}
.field.has-err .input, .field.has-err .select, .field.has-err .textarea { border-color: var(--corallo); }
.help-t { font-size: 14px; color: var(--nebbia); line-height: 1.5; }
.err { display: none; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--corallo); }
.err .i { width: 18px; height: 18px; }
.has-err .err { display: flex; }
.row2 { display: grid; gap: 22px; align-items: start; }
@media (min-width: 1024px) { .row2 { grid-template-columns: 1fr 1fr; } }

.choice { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.check, .radio {
  position: relative; display: inline-flex; align-items: flex-start; gap: 12px; cursor: pointer;
  font-size: 16px; line-height: 1.45; min-height: 28px; padding-top: 2px;
}
.check input, .radio input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0;
  width: 22px; height: 22px; border: 1px solid var(--bordo); background: var(--fumo);
  display: grid; place-items: center; cursor: pointer;
  transition: border-color .2s, background-color .2s;
}
.check input { border-radius: 2px; }
.radio input { border-radius: 50%; }
.check input::after { content: ""; width: 10px; height: 5px; border-left: 2px solid var(--notte); border-bottom: 2px solid var(--notte); transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .2s var(--ease-out); }
.radio input::after { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--notte); transform: scale(0); transition: transform .2s var(--ease-out); }
.check input:checked, .radio input:checked { background: var(--accent); border-color: var(--accent); }
.check input:checked::after, .radio input:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
.radio input:checked::after { transform: scale(1); }
.check a { text-decoration: underline; text-underline-offset: 4px; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.svc-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.svc-tile { position: relative; display: block; cursor: pointer; }
.svc-tile input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.svc-tile__box {
  height: 120px; display: flex; align-items: center; gap: 16px;
  padding: 10px 44px 10px 10px;
  background: var(--fumo); border: 1px solid var(--bordo); border-radius: 4px;
  transition: border-color .3s, box-shadow .3s, background-color .3s;
}
.svc-tile__img { width: 98px; height: 98px; border-radius: 2px; overflow: hidden; flex: none; }
.svc-tile__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .6s; filter: brightness(.8); }
.svc-tile__name { display: grid; gap: 8px; justify-items: start; }
.svc-tile__name .disc { --s: 40px; }
.svc-tile__name b { font-size: 17px; font-weight: 600; line-height: 1.25; }
.svc-tile__check {
  position: absolute; right: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--bordo); color: var(--notte);
  transition: background-color .25s, border-color .25s;
}
.svc-tile__check .i { width: 15px; height: 15px; stroke-width: 2.4; opacity: 0; transition: opacity .2s; }
.svc-tile--piscine { --t: var(--acqua); }
.svc-tile--impianti { --t: var(--luce); }
.svc-tile:hover .svc-tile__box { border-color: var(--avorio); }
.svc-tile input:checked + .svc-tile__box { border-color: var(--t); box-shadow: inset 0 0 0 1px var(--t); background: color-mix(in oklab, var(--fumo), var(--t) 6%); }
.svc-tile input:checked + .svc-tile__box .svc-tile__img img { filter: none; transform: scale(1.04); }
.svc-tile input:checked + .svc-tile__box .svc-tile__check { background: var(--t); border-color: var(--t); }
.svc-tile input:checked + .svc-tile__box .svc-tile__check .i { opacity: 1; }
.svc-tile input:focus-visible + .svc-tile__box { outline: 2px solid var(--t); outline-offset: 2px; box-shadow: 0 0 0 4px var(--notte); }
.route {
  display: flex; align-items: center; gap: 10px; margin-top: 14px;
  font-size: 14px; color: var(--nebbia); min-height: 24px;
}
.route .i { width: 18px; height: 18px; color: var(--accent); }
.route b { color: var(--avorio); font-weight: 600; }
.route[hidden] { display: none; }

.form__submit { display: grid; gap: 12px; margin-top: 6px; }
.form[data-svc="piscine"] .form__submit .btn--ivory,
.form[data-svc="impianti"] .form__submit .btn--ivory { background: var(--accent); }
.form__submit .btn { width: 100%; white-space: normal; text-align: center; height: auto; min-height: 52px; padding-block: 14px; line-height: 1.3; }
.form__submit .btn__label { --roll: 6em; }
.form__submit .small { text-align: center; }
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn__label { opacity: .7; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; display: none; }
.btn.is-busy .spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.errsum {
  border: 1px solid var(--corallo); border-radius: 4px; padding: 18px 20px;
  background: color-mix(in srgb, var(--corallo) 7%, transparent);
}
.errsum b { display: flex; align-items: center; gap: 10px; color: var(--corallo); font-size: 16px; }
.errsum ul { margin-top: 10px; display: grid; gap: 6px; padding-left: 30px; list-style: disc; }
.errsum a { color: var(--avorio); text-decoration: underline; text-underline-offset: 4px; font-size: 15px; }
.done {
  text-align: left; display: grid; gap: 16px; justify-items: start;
  padding: 8px 0;
}
.done__ic { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--menta); color: var(--menta); }
.done__ic .i { width: 26px; height: 26px; stroke-width: 1.8; }
.done .h2 { font-size: clamp(28px, 1.4vw + 18px, 36px); }
.done p { color: var(--nebbia); }
.done--err .done__ic { border-color: var(--corallo); color: var(--corallo); }
.file-in { position: relative; }
.file-in input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.file-in__box {
  min-height: 52px; display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border: 1px dashed var(--bordo); border-radius: 2px; background: var(--fumo); font-size: 15px; color: var(--nebbia);
}
.file-in__box .i { color: var(--accent); }
.file-in input:focus-visible + .file-in__box { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------------------------------------------------------- CONTATTI */
.contact { padding-top: calc(var(--nav-h) + clamp(48px, 6vw, 88px)); padding-bottom: var(--sec); }
.contact__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: clamp(16px, 2vw, 24px); align-items: start; }
.contact__info { grid-column: 1 / span 5; display: grid; gap: 28px; justify-items: start; position: sticky; top: 104px; }
.contact__form { grid-column: 6 / span 7; padding: 48px; }
.contact__info .lead { max-width: 40ch; }
.ci { display: grid; gap: 0; width: 100%; border-top: 1px solid var(--linea); }
.ci > * { border-bottom: 1px solid var(--linea); }
.ci__mail { display: flex; align-items: center; gap: 16px; padding: 18px 0; }
.ci__mail .disc { --s: 40px; }
.ci__mail b { display: block; font-weight: 600; }
.ci__mail a { color: var(--nebbia); text-decoration: underline; text-decoration-color: rgb(var(--avorio-rgb) / .25); text-underline-offset: 4px; font-size: 16px; overflow-wrap: anywhere; }
.ci__mail a:hover { color: var(--avorio); text-decoration-color: currentColor; }
.ci__row { display: flex; align-items: flex-start; gap: 16px; padding: 18px 0; font-size: 16px; }
.ci__row .i { color: var(--cenere); margin-top: 1px; }
.ci__row b { display: block; font-weight: 600; margin-bottom: 2px; }


/* ---------------------------------------------------------------- lightbox */
.lb {
  width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgb(var(--abisso-rgb) / .985); color: var(--avorio);
  opacity: 0; transition: opacity .3s var(--ease), overlay .3s allow-discrete, display .3s allow-discrete;
}
.lb[open] { opacity: 1; display: grid; grid-template-rows: auto 1fr auto; }
@starting-style { .lb[open] { opacity: 0; } }
.lb::backdrop { background: transparent; }
.lb__bar { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px; gap: 20px; }
.lb__count { font-size: 14px; color: var(--nebbia); font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.lb__close { height: 44px; padding: 0 10px; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; }
.lb__stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 76px; }
.lb__stage picture { display: contents; }
.lb__stage img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
  border-radius: 2px; transition: opacity .35s var(--ease), transform .45s var(--ease-out);
}
.lb__stage img.is-swap { opacity: 0; transform: scale(.985); }
.lb__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid rgb(var(--avorio-rgb) / .3); background: rgb(var(--notte-rgb) / .6);
  transition: border-color .25s, background-color .25s;
}
.lb__nav:hover { border-color: var(--avorio); }
.lb__prev { left: 14px; }
.lb__next { right: 14px; }
.lb__cap { padding: 16px 20px 22px; display: flex; align-items: center; justify-content: center; gap: 14px; text-align: center; font-size: 15px; color: var(--nebbia); min-height: 70px; }

/* ---------------------------------------------------------------- view transitions */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: .7s; animation-timing-function: cubic-bezier(.7, 0, .2, 1); }
::view-transition-old(root) { animation: vt-out .45s cubic-bezier(.7, 0, .2, 1) both; }
::view-transition-new(root) { animation: vt-in .75s cubic-bezier(.7, 0, .2, 1) both; }
@keyframes vt-out { to { opacity: 0; filter: brightness(.4); } }
@keyframes vt-in { from { clip-path: inset(0 50% 0 50%); } to { clip-path: inset(0 0 0 0); } }
::view-transition-old(media-piscine), ::view-transition-new(media-piscine),
::view-transition-old(media-impianti), ::view-transition-new(media-impianti) {
  height: 100%; width: 100%; object-fit: cover; overflow: clip;
}
::view-transition-group(media-piscine), ::view-transition-group(media-impianti) { overflow: clip; z-index: 1; }
::view-transition-group(logo-piscine), ::view-transition-group(logo-impianti) { z-index: 3; }
::view-transition-group(nav) { z-index: 5; animation: none; }
::view-transition-old(nav) { display: none; }
::view-transition-new(nav) { animation: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1279px) {
  .nav__phone-num { display: none; }
  .hero__band-in { grid-template-columns: auto 1fr auto; }
  .foot__phone { font-size: 22px; }
  .why { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  :root { --nav-h: 72px; }
  .nav__link { font-size: 14px; }
  .nav__inner { column-gap: 22px; }
  .nav__side, .nav__links { gap: 22px; }
  .hero__discs { --disc: 88px; }
  .hero__content { padding: 0 32px calc(72px + 40px); }
  .hero__title { font-size: 28px; }
  .hero__band .btn { padding: 0 20px; }
  .hero__band-in { gap: 12px; }
  .mosaic .tile--8, .mosaic .tile--4 { grid-column: span 6; aspect-ratio: 4 / 5; }
  .chapter__media, .chapter--rev .chapter__media { grid-column: 1 / -1; grid-row: auto; }
  .chapter__text, .chapter--rev .chapter__text { grid-column: 1 / -1; grid-row: auto; margin-top: 36px; max-width: 640px; }
  .intro__text { grid-column: 1 / -1; }
  .intro__media { grid-column: 1 / span 8; margin-top: 48px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 48px; }
  .steps__rail, .steps__fill, .steps__dot { display: none; }
  .step { border-top: 1px solid var(--linea); }
  .step--key { border-top-color: transparent; }
  .gallery { columns: 2; }
  .ask__text, .ask__card { grid-column: 1 / -1; }
  .ask__card { margin-top: 40px; }
  .contact__info { grid-column: 1 / -1; position: static; }
  .contact__form { grid-column: 1 / -1; margin-top: 48px; }
  .phero__col { grid-column: 1 / span 9; }
  .types { grid-template-columns: 1fr 1fr; }
  .cross { grid-template-columns: 160px 1fr; }
  .cross__go { grid-column: 2; }
  .pd { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .pd__side { justify-items: stretch; }
  .pd__switch { grid-template-columns: auto 1fr; justify-items: start; align-items: center; text-align: left; gap: 18px; width: 100%; padding: 14px 18px; background: var(--ardesia); border: 1px solid var(--linea); }
  .pd__plate { width: auto; height: auto; background: none; border: 0; box-shadow: none !important; border-radius: 0; }
  .pd__track { width: 84px; height: 46px; }
  .pd__switch[aria-pressed="true"] .pd__thumb { transform: translateX(38px); }
  .pd__switch[aria-pressed="true"] { border-color: rgb(var(--acqua-rgb) / .6); }
}
@media (max-width: 767px) {
  :root { --nav-h: 64px; }
  body { font-size: 17px; }
  .nav.is-scrolled { --nav-h: 64px; }
  .nav__inner { grid-template-columns: 44px 1fr auto; column-gap: 8px; width: calc(100% - 24px); }
  .nav__side, .nav__phone, .nav__cta { display: none !important; }
  .nav__call--m { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 2px; }
  .nav__call--m .i { width: 20px; height: 20px; }
  .nav__mark { grid-column: 2; }
  .nav__mark .disc, .nav.is-scrolled .nav__mark .disc { --s: 40px; }
  .nav__burger {
    display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 6px 0 10px;
    font-size: 15px; font-weight: 600; justify-self: end;
  }
  .nav__burger-lines { display: grid; gap: 6px; width: 20px; }
  .nav__burger-lines i { height: 1.5px; background: currentColor; border-radius: 2px; }
  .nav__burger-lines i:last-child { width: 70%; }

  /* hero impilato: titolo nel flusso, poi i due pannelli */
  .hero { height: auto; min-height: 0; overflow: visible; display: flex; flex-direction: column; }
  .hero__stage { position: relative; inset: auto; flex-direction: column; }
  .hero__head {
    position: relative; order: -1; left: auto; top: auto; transform: none; width: auto;
    padding: calc(var(--nav-h) + 28px) 24px 32px;
    background: radial-gradient(120% 80% at 50% 0%, var(--ardesia), var(--notte) 70%);
  }
  .hero__h1 { font-size: 36px; }
  .hero__sub { font-size: 17px; margin-top: 14px; }
  .hero__top { display: none; }
  .hero__panel { flex: none; height: max(42svh, 280px); transition: none; }
  .hero__content { padding: 0 24px 28px; gap: 10px; }
  .hero__h2 { gap: 10px; }
  .hero__title { font-size: 28px; }
  .pseudo-btn { height: 44px; margin-top: 4px; }
  .hero__shade { height: 70%; background: linear-gradient(to top, rgb(var(--notte-rgb) / .9), rgb(var(--notte-rgb) / .55) 45%, rgb(var(--notte-rgb) / 0)); }
  .hero__mlogo { display: block; position: absolute; z-index: 4; left: 20px; top: 20px; }
  .hero__mlogo .disc { --s: 64px; }
  .hero__div { flex: 0 0 1px; height: 1px; }
  .hero__line { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; mask: none; -webkit-mask: none; transform-origin: left; }
  .hero.is-drawing .hero__line { animation-name: draw-x; }
  .hero__discs { display: none; }
  .hero__band { position: relative; height: auto; background: var(--notte); border: 0; }
  .hero__band-in { grid-template-columns: 1fr; justify-items: stretch; padding: 24px 0 8px; gap: 14px; }
  .hero__free { justify-self: center; }
  .hero__tel { justify-self: stretch; justify-content: center; border: 1px solid rgb(var(--avorio-rgb) / .4); border-radius: 2px; height: 52px; }
  .hero__band .btn { justify-self: stretch; }
  .hero__panel .hero__media img { object-position: 50% 50%; }

  .help__grid { grid-template-columns: 1fr; row-gap: 56px; }
  .help__thread { display: none; }
  .help__line { height: 1px; }
  .help__line::before { left: 0; top: 50%; }
  .svc { padding: 20px 4px; gap: 16px; grid-template-columns: 32px 1fr 20px; }
  .svc__t { font-size: 18px; }
  .help__cta .btn { width: 100%; }

  .mosaic { grid-template-columns: 1fr; }
  .mosaic .tile--8, .mosaic .tile--4 { grid-column: auto; aspect-ratio: 4 / 5; }
  .tile__cap { opacity: 1; transform: none; }
  .steps { grid-template-columns: 1fr; row-gap: 36px; }
  .final__btns, .pdgo__btns { width: 100%; }
  .final__btns .btn, .pdgo__btns .btn { width: 100%; min-width: 0; }

  .foot { padding: 64px 0 calc(120px + var(--safe-b)); }
  .foot__id { grid-template-columns: 1fr; row-gap: 40px; }
  .foot__line { height: 1px; }
  .foot__row { flex-direction: column; align-items: flex-start; }
  .foot__phone { margin-left: 0; }
  .foot__row .btn { width: 100%; }

  .mbar {
    position: fixed; z-index: 45; left: 0; right: 0; bottom: 0;
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    padding: 10px 12px calc(10px + var(--safe-b));
    background: rgb(var(--notte-rgb) / .97); border-top: 1px solid var(--linea);
    transform: translateY(110%); transition: transform .45s var(--ease-out);
  }
  .mbar .btn { --h: 44px; padding: 0 12px; }
  body.past-hero .mbar { transform: none; }
  body[data-accent] .mbar[data-off] { display: none; }

  .phero { min-height: 0; display: block; }
  .phero__media { position: relative; aspect-ratio: 4 / 5; }
  .phero__gl { inset: 0 0 auto 0; height: auto; aspect-ratio: 4 / 5; }
  .phero::before { display: none; }
  .phero::after {
    height: 125vw; bottom: auto;
    background:
      linear-gradient(to bottom, rgb(var(--notte-rgb) / .7), rgb(var(--notte-rgb) / 0) 120px),
      linear-gradient(to top, var(--notte), rgb(var(--notte-rgb) / .6) 12%, rgb(var(--notte-rgb) / 0) 34%);
  }
  .phero__media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(to top, var(--notte), transparent); }
  .phero__in { padding: 0 0 56px; }
  .phero__col { grid-column: 1 / -1; gap: 16px; }
  .phero__logo { order: -1; margin-top: -40px; margin-bottom: 4px; }
  .phero .disc { --s: 72px; margin-top: 0; }
  .phero .btn-row { width: 100%; }
  .phero .btn-row .btn { width: 100%; }

  .intro__media { grid-column: 1 / -1; }
  .details { grid-template-columns: 1fr; gap: 36px; }
  .gallery { columns: 1; }
  .why { grid-template-columns: 1fr; }
  .types { grid-template-columns: 1fr; }
  .cross { grid-template-columns: 1fr; padding: 12px 12px 24px; gap: 20px; }
  .cross > div, .cross__go { padding-inline: 8px; grid-column: auto; }
  .cross picture { aspect-ratio: 4 / 3; }
  .chapter__media picture { aspect-ratio: 4 / 3; }
  .chapter__num { font-size: 36px; }
  .faq summary { font-size: 17px; }
  .faq__a { padding-right: 4px; }
  .contact__form { padding: 24px 18px; margin-left: calc(var(--gutter) * -0.5); margin-right: calc(var(--gutter) * -0.5); }
  .svc-pick { grid-template-columns: 1fr 1fr; }
  .svc-tile__box { height: 150px; flex-direction: column; align-items: flex-start; gap: 10px; padding: 10px; }
  .svc-tile__img { width: 100%; height: 64px; }
  .svc-tile__name { grid-auto-flow: column; align-items: center; gap: 10px; }
  .svc-tile__name .disc { --s: 32px; }
  .svc-tile__name b { font-size: 15px; }
  .lb__stage { padding: 0 8px; }
  .lb__nav { top: auto; bottom: -62px; transform: none; }
  .lb__prev { left: 20px; }
  .lb__next { right: 20px; }
  .lb__cap { padding: 16px 84px 22px; }
  .pd__stage { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
  .pd__handle { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
  .pd__tag { top: 10px; height: 26px; padding: 0 10px; font-size: 11px; }
  .pd__tag--prima, .pd__tag--sera { left: 10px; }
  .pd__tag--dopo { right: 10px; }
}
@keyframes draw-x { from { transform: scaleX(0); } to { transform: none; } }

/* ---------------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-delay: 0s !important; scroll-behavior: auto !important; }
  .hero__line, .help__line, .hero__h1 .w-p, .hero__h1 .w-i, .hero__media img, .final::before, .final::after, .nav, .btn, .tile::after { transition-duration: .35s !important; transition-property: background-color, color, filter, opacity, border-color !important; }
  .hero__panel { transition: none !important; flex-grow: 1 !important; }
  .btn:hover .btn__label, .btn:hover .btn__arrow, .link-arrow:hover .i { transform: none !important; }
  .tile:hover img, .cross:hover img { transform: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
html.rm [data-reveal] { opacity: 1 !important; transform: none !important; }
html.rm [data-split] .wl > span { transform: none !important; }
html.rm .lit img { filter: none !important; transform: none !important; }
html.rm .draw-x, html.rm .draw-y { transform: none !important; }

/* ---------------------------------------------------------------- 404 */
.nf { min-height: 100svh; display: grid; place-items: center; padding: calc(var(--nav-h) + 48px) var(--gutter) 96px; position: relative; overflow: hidden; }
.nf::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: linear-gradient(to bottom, transparent, var(--line-soft) 25%, var(--line-soft) 75%, transparent); }
.nf__in { position: relative; text-align: center; display: grid; justify-items: center; gap: 20px; max-width: 680px; background: var(--notte); padding: 28px 36px; }
.nf__discs { display: flex; margin-bottom: 20px; }
.nf__discs .disc { --s: 88px; }
.nf__discs .disc + .disc { margin-left: -12px; }
.nf__btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin: 8px 0 12px; }
.nf__btns .btn { min-width: 180px; }
