/* T.I.S. — supporto per motion.js */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* Titoli divisi in parole */
.w-mask { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .08em; margin-bottom: -.08em; }
.w { display: inline-block; will-change: transform; }
.btn-primary, .nav-cta { will-change: transform; }

/* Sipario tra le pagine */
.tis-curtain { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; pointer-events: none;
  background: linear-gradient(180deg, #05070a, #0a1016); }
.tis-curtain strong { font-family: var(--font-display, Georgia, serif); font-size: clamp(40px, 7vw, 76px); letter-spacing: .12em; color: #f3d8a3; }
.tis-curtain-gold { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, #c79a55, #f3d8a3, #c79a55); }
/* il vecchio effetto di uscita di app.js lascerebbe la pagina vuota sotto il sipario: lo neutralizzo */
html.tis-motion body.page-leave { opacity: 1 !important; transform: none !important; filter: none !important; }

/* Sfondo animato dell'hero */
.hero, .page-hero { position: relative; overflow: hidden; }
.tis-waves { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.hero-grid, .page-hero > .container, .page-hero > div:not(.hero-lines):not(.hero-orb) { position: relative; z-index: 2; }

/* Galleria bloccata: niente scorrimento automatico, immagini più grandi */
.rail.rail-pinned .rail-track { animation: none !important; will-change: transform; }
.rail.rail-pinned .rail-track img { width: calc(min(440px, 50vh) * .77); height: min(440px, 50vh); object-fit: cover; border-radius: 26px; }

/* Riflesso di luce che segue il mouse */
.tis-spot { position: relative; overflow: hidden; }
.tis-spot::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3;
  background: radial-gradient(320px circle at var(--sx, 50%) var(--sy, 50%), rgba(243, 216, 163, .28), transparent 60%);
  opacity: 0; transition: opacity .35s ease; mix-blend-mode: screen; }
.tis-spot:hover::after { opacity: 1; }

.marquee-track { will-change: transform; }

/* Nessuna schermata di caricamento iniziale: il sito si vede subito */
.preloader { display: none !important; }

/* Prima schermata visibile subito: niente comparsa sfocata/scorrevole all'apertura */
.hero .reveal, .page-hero .reveal, .hero .reveal-group > *, .page-hero .reveal-group > * {
  opacity: 1 !important; transform: none !important; filter: none !important;
  transition: none !important; animation: none !important;
}

/* ================= Dettagli idraulici (motion.js sezioni 6, 8, 9, 10) ================= */

/* Manometro sui contatori */
.lux-stat.tis-has-gauge { position: relative; }
.tis-gauge { position: absolute; top: 16px; right: 16px; width: 76px; height: 76px; filter: drop-shadow(0 6px 14px rgba(10, 16, 22, .22)); }
.tis-gauge .g-rim { fill: var(--tis-pipe, #c79a55); }
.tis-gauge .g-face { fill: var(--tis-pipe-dark, #0a1016); stroke: var(--tis-pipe-light, #f3d8a3); stroke-width: 1; stroke-opacity: .5; }
.tis-gauge .g-track { fill: none; stroke: rgba(255, 255, 255, .1); stroke-width: 5; stroke-linecap: round; }
.tis-gauge .g-water { fill: none; stroke: var(--tis-water, #7ad0d3); stroke-width: 5; stroke-linecap: round; }
.tis-gauge .g-ticks line { stroke: var(--tis-pipe-light, #f3d8a3); stroke-width: 1.4; stroke-linecap: round; opacity: .8; }
.tis-gauge .g-unit { fill: var(--tis-pipe-light, #f3d8a3); font: 700 9px/1 Inter, system-ui, sans-serif; text-anchor: middle; letter-spacing: .08em; opacity: .75; }
.tis-gauge .g-needle path { fill: #e8604c; }
.tis-gauge .g-hub { fill: var(--tis-pipe-light, #f3d8a3); stroke: var(--tis-pipe, #c79a55); stroke-width: 2; }
@media (max-width: 860px) { .tis-gauge { width: 58px; height: 58px; top: 12px; right: 12px; } }

/* Prima/Dopo: la maniglia è la manopola di una valvola */
.slider-handle.tis-valve-handle > span { display: none; }
.tis-valve { width: 76%; height: 76%; color: var(--tis-pipe-dark, #0a1016); transition: transform .08s linear; }

/* Marquee: gocce d'acqua al posto delle stelline */
.marquee-track span::before {
  content: "" !important; display: inline-block; width: 9px; height: 9px; margin: 0 16px 0 2px; vertical-align: 1px;
  background: linear-gradient(135deg, var(--tis-water-light, #bfeff0), var(--tis-water, #7ad0d3));
  border-radius: 50% 0 50% 50%;
  transform: rotate(-45deg) translate(calc(var(--tis-wob, 0) * 2px), calc(var(--tis-wob, 0) * -2px));
  box-shadow: 0 0 10px rgba(122, 208, 211, .45);
}
@media (prefers-reduced-motion: no-preference) {
  .marquee-track span::before { animation: tis-mq-drop 2.4s ease-in-out infinite; }
  .marquee-track span:nth-child(2n)::before { animation-delay: -1.2s; }
}
@keyframes tis-mq-drop { 0%, 100% { opacity: 1; } 50% { opacity: .65; } }

/* Galleria: tubo che si riempie d'acqua mentre le foto scorrono */
.tis-gallery-pipe { display: flex; align-items: center; margin: 26px auto 0; width: min(100%, 980px); }
.tis-flange { width: 14px; height: 30px; border-radius: 4px; flex: none;
  background: linear-gradient(180deg, var(--tis-pipe-light, #f3d8a3), var(--tis-pipe, #c79a55) 55%, #8d6a35); }
.tis-pipe-body { flex: 1; height: 18px; border-radius: 3px; overflow: hidden; position: relative;
  background: var(--tis-pipe-dark, #0a1016);
  box-shadow: inset 0 0 0 3px var(--tis-pipe, #c79a55), inset 0 4px 0 3px rgba(243, 216, 163, .35); }
.tis-pipe-water { position: absolute; left: 3px; right: 3px; top: 3px; bottom: 3px; border-radius: 2px; transform-origin: left center; display: block;
  background: repeating-linear-gradient(90deg, var(--tis-water, #7ad0d3) 0 18px, var(--tis-water-light, #bfeff0) 18px 26px); background-size: 52px 100%; }
@media (prefers-reduced-motion: no-preference) { .tis-pipe-water { animation: tis-mq-flow 0.9s linear infinite; } }
@keyframes tis-mq-flow { to { background-position: 52px 0; } }

/* ================= Dettagli d'acqua (motion.js sezione 12) ================= */

/* 12a. Gocce che scivolano sulle foto */
.rail, .cinema, .compare-box { position: relative; }
.tis-mq-drops { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; border-radius: inherit; }
.tis-mq-drop { position: absolute; width: 11px; height: 14px; margin: -7px 0 0 -5px; display: block;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.95) 0 14%, rgba(255,255,255,.25) 24%, rgba(191,239,240,.18) 55%, rgba(122,208,211,.45) 100%);
  box-shadow: inset 0 -2px 3px rgba(10,16,22,.25), 0 2px 4px rgba(10,16,22,.25);
  border: 1px solid rgba(255,255,255,.55); }
.tis-mq-drop b { position: absolute; left: 50%; bottom: 100%; width: 3px; height: 0; margin-left: -1.5px; border-radius: 3px;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.4)); }

/* 12b. Scia di goccioline nella hero */
.tis-mq-trail { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }

/* 12c. Schizzo dal manometro */
.tis-mq-splash { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; pointer-events: none; z-index: 5;
  background: radial-gradient(circle at 35% 35%, var(--tis-water-light, #bfeff0), var(--tis-water, #7ad0d3)); box-shadow: 0 0 6px rgba(122,208,211,.6); }

/* 12d. Goccia che cade dal marquee */
.tis-mq-fall { position: absolute; z-index: 8; width: 7px; height: 10px; margin-left: -3.5px; pointer-events: none; transform-origin: 50% 0;
  border-radius: 50% 50% 50% 50% / 35% 35% 65% 65%;
  background: radial-gradient(circle at 35% 35%, var(--tis-water-light, #bfeff0), var(--tis-water, #7ad0d3)); box-shadow: 0 0 8px rgba(122,208,211,.55); }
