/* PAGINA INIZIALE in 3D (solo index.html e en/index.html).
   Sopra app.css: la pagina diventa scura e cinematografica, con la scena
   three.js fissa dietro (#scene) e il testo in primo piano. Le schede entrano
   in prospettiva mentre scorri (home.js imposta --p da 0 a 1).
   Senza 3D (body.no3d) resta tutto leggibile: cambia solo lo sfondo. */

body.home {
  --bg: #07090d;
  --bg2: #0b0e14;
  --card: rgba(20, 25, 34, 0.72);
  --line: rgba(255, 255, 255, 0.09);
  --ink: #eef1f6;
  --ink2: #a3adbd;
  --shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
  background: radial-gradient(1200px 700px at 75% 20%, #121a2c 0%, #07090d 60%) fixed, #07090d;
  color: var(--ink);
}
body.home .bar {
  background: rgba(7, 9, 13, 0.62);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--line);
}
body.home .bar .brand, body.home .bar nav a:not(.cta) { color: var(--ink); }

#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; pointer-events: none; display: block; }
body.no3d #scene { display: none; }
body.home main, body.home footer { position: relative; z-index: 1; }
body.home footer { background: #05070a; }

/* ---------------------------------------------------------------- capitoli */

.chapter { min-height: 100vh; display: flex; align-items: center; padding: 110px 24px 70px; }
.chapter .in { width: 100%; }
.chapter .copy { max-width: 540px; }
.chapter .num { font: 600 13px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.18em; color: #7f9cff; text-transform: uppercase; margin: 0 0 18px; }
.chapter h1, .chapter h2 {
  font-size: clamp(40px, 6.6vw, 92px); line-height: 0.98; letter-spacing: -0.035em; font-weight: 800; margin: 0 0 22px;
  background: linear-gradient(180deg, #ffffff 30%, #9aa6ba); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.chapter h2 { font-size: clamp(34px, 5vw, 68px); }
.chapter p.lead { font-size: clamp(17px, 1.6vw, 20px); color: var(--ink2); margin: 0 0 28px; max-width: 40ch; }
.chapter .actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.chapter .badge { display: inline-block; margin-top: 22px; font-size: 14px; color: var(--ink2); }
.btn-ar { display: inline-flex; align-items: center; gap: 8px; }
.btn-ghost { background: rgba(255, 255, 255, 0.06); color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.16); }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* Su telefono il testo sta in basso, sopra una sfumatura: l'oggetto sopra. */
@media (max-width: 759px) {
  .chapter { align-items: flex-end; padding-bottom: 48px; }
  .chapter .copy { background: linear-gradient(180deg, rgba(7, 9, 13, 0) 0%, rgba(7, 9, 13, 0.86) 28%); margin: 0 -24px; padding: 90px 24px 4px; }
  body.no3d .chapter .copy { background: none; padding-top: 0; }
  body.no3d .chapter { min-height: auto; padding-top: 70px; }
}
body.no3d .chapter { min-height: 70vh; }

/* ---------------------------------------------------------------- galleria inclinata */

.reel { position: relative; height: 340px; overflow: hidden; perspective: 900px; margin: -40px 0 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.reel-track { position: absolute; left: 0; top: 30px; display: flex; gap: 22px; width: max-content;
  transform: rotateX(22deg) rotateZ(-4deg) translateZ(-40px); transform-origin: 50% 0;
  animation: reel 48s linear infinite; }
.reel figure { margin: 0; width: 360px; height: 240px; border-radius: 18px; overflow: hidden; position: relative;
  border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.55); flex: none; }
.reel img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85) contrast(1.05); }
.reel figcaption { position: absolute; left: 14px; bottom: 12px; font-weight: 700; font-size: 15px; color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7); }
@keyframes reel { to { transform: rotateX(22deg) rotateZ(-4deg) translateZ(-40px) translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .reel-track { animation: none; } }

/* ---------------------------------------------------------------- schede in prospettiva */

body.home section { background: transparent; }
body.home section.alt { background: transparent; }
body.home .panel { background: rgba(10, 13, 19, 0.7); border: 1px solid var(--line); border-radius: 28px; padding: 44px 34px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
@media (max-width: 759px) { body.home .panel { padding: 30px 18px; border-radius: 22px; } }
body.home .kicker { color: #7f9cff; }
body.home h2 { color: #fff; }
body.home .feat, body.home .tile, body.home .step { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
body.home .feat .ic { background: rgba(91, 140, 255, 0.14); color: #9fb8ff; }

.depth { --p: 1; transform: perspective(1100px) translateY(calc((1 - var(--p)) * 70px)) rotateX(calc((1 - var(--p)) * 28deg)) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)) scale(calc(0.92 + var(--p) * 0.08));
  transform-origin: 50% 100%; opacity: calc(0.15 + var(--p) * 0.85); will-change: transform; transition: box-shadow 0.25s; }
.depth:hover { box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(127, 156, 255, 0.28); }
@media (prefers-reduced-motion: reduce) { .depth { transform: none !important; opacity: 1 !important; } }

body.home .mission { color: #dde3ee; }
body.home .statement .no { color: #6b7587; }

/* ---------------------------------------------------------------- novità */

body.home .future { background: transparent; }
.nv-window { height: 78vh; }
body.no3d .nv-window { display: none; }
.pro-claim { text-align: center; max-width: 900px; margin: 0 auto; }
.pro-claim .eyebrow { display: inline-block; font: 700 12.5px/1 ui-monospace, Menlo, monospace; letter-spacing: 0.2em; text-transform: uppercase;
  color: #0b0e14; background: #e9eef7; border-radius: 999px; padding: 8px 14px; margin-bottom: 22px; }
.pro-claim h2 { font-size: clamp(40px, 7vw, 96px); line-height: 0.96; letter-spacing: -0.04em; font-weight: 800; margin: 0 0 18px;
  background: linear-gradient(180deg, #ffffff 35%, #8fa0bd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pro-claim p { font-size: clamp(18px, 2vw, 22px); color: #c4ccda; margin: 0 auto; max-width: 46ch; }
.pro-claim .vision { margin-top: 18px; font-size: 16px; color: var(--ink2); }

/* la scheda "strumenti dei professionisti" in testa e più grande */
#nv-grid .feat.nv-pro { grid-column: 1 / -1; border-color: rgba(127, 156, 255, 0.45);
  background: linear-gradient(135deg, rgba(40, 62, 120, 0.55), rgba(16, 20, 30, 0.75)); padding: 30px; }
#nv-grid .feat.nv-pro h3 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.02em; }
#nv-grid .feat.nv-pro p { font-size: 17px; color: #d7def0; max-width: 60ch; }

/* ---------------------------------------------------------------- AR */

#ar-overlay { position: fixed; inset: 0; z-index: 50; pointer-events: none; }
#ar-overlay[hidden] { display: none; }
#ar-overlay .ar-hint { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(0, 0, 0, 0.6);
  color: #fff; padding: 12px 18px; border-radius: 999px; font-size: 15px; white-space: nowrap; }
#ar-overlay .ar-close { pointer-events: auto; position: absolute; right: 18px; top: 18px; width: 48px; height: 48px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, 0.6); color: #fff; font-size: 22px; }
.toast3d { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: #e9eef7; color: #0b0e14;
  padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4); max-width: calc(100vw - 32px); }

/* il sollevamento di app.css sostituirebbe la prospettiva: si combinano */
body.home a.feat.go.depth:hover { transform: perspective(1100px) translateY(-4px) rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg)); }

/* ---------------------------------------------------------------- schede appariscenti
   (utente 2026-11-06: "rendi ogni minischeda appariscente, compresa quella
   dell'interessamento ai prodotti"). Bordo sfumato luminoso, alone, e in
   cima a ogni scheda il suo dispositivo 3D (home3d.js → startCards). */

#cards3d { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 5; pointer-events: none; display: block; }
body:not(.cards3d) #cards3d { display: none; }

body.home .feat {
  position: relative; border: 1px solid transparent; border-radius: 22px; padding: 18px 20px 22px;
  background:
    linear-gradient(rgba(15, 19, 29, 0.9), rgba(15, 19, 29, 0.9)) padding-box,
    linear-gradient(140deg, rgba(120, 160, 255, 0.85), rgba(255, 255, 255, 0.06) 42%, rgba(255, 150, 90, 0.6)) border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 46px rgba(70, 115, 255, 0.16);
}
body.home .feat h3 { font-size: 20px; letter-spacing: -0.01em; }
body.home .feat p { font-size: 15.5px; color: #b9c3d4; }
body.home a.feat.go .go-arrow { color: #8fb0ff; font-size: 16px; }

.dev { display: none; }
body.cards3d .dev {
  display: block; height: 170px; margin: 0 -6px 16px; border-radius: 16px;
  background:
    radial-gradient(55% 60% at 50% 52%, rgba(95, 140, 255, 0.5), rgba(40, 70, 170, 0.12) 55%, transparent 75%),
    radial-gradient(40% 10% at 50% 88%, rgba(0, 0, 0, 0.55), transparent 70%),
    linear-gradient(180deg, #141c31, #0b1020);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
body.cards3d .feat .ic { display: none; }

/* Novità: la scheda dei professionisti larga, col dispositivo grande a lato */
#nv-grid .feat.nv-pro { box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 70px rgba(90, 130, 255, 0.28); }
@media (min-width: 760px) {
  body.cards3d #nv-grid .feat.nv-pro { display: grid; grid-template-columns: 1fr 1.05fr; column-gap: 28px; align-items: start; }
  body.cards3d #nv-grid .feat.nv-pro > * { grid-column: 2; }
  body.cards3d #nv-grid .feat.nv-pro > .dev { grid-column: 1; grid-row: 1 / span 8; height: 300px; margin: 0; }
}

/* "Mi interessa": il pulsante più importante della sezione */
body.home .nv-row { gap: 12px; margin-top: 18px; flex-wrap: wrap; }
body.home .nv-like {
  flex: 1 1 200px; min-height: 54px; border-radius: 16px; border: 0; cursor: pointer;
  font: 800 17px/1 inherit; font-family: inherit; color: #fff;
  background: linear-gradient(135deg, #ff4f72, #ff8a45);
  box-shadow: 0 12px 30px rgba(255, 90, 100, 0.35);
  animation: nvPulse 2.4s ease-in-out infinite;
}
body.home .nv-like:hover { filter: brightness(1.08); }
body.home .nv-like.on { background: #fff; color: #d6334f; animation: none; box-shadow: 0 10px 26px rgba(255, 255, 255, 0.18); }
body.home .nv-count {
  min-width: 0; padding: 12px 14px; border-radius: 14px; font-size: 14.5px; font-weight: 800; color: #ffd9de;
  background: rgba(255, 80, 110, 0.14); border: 1px solid rgba(255, 110, 130, 0.35);
}
@keyframes nvPulse { 0%, 100% { box-shadow: 0 12px 30px rgba(255, 90, 100, 0.35), 0 0 0 0 rgba(255, 90, 110, 0.45); }
  50% { box-shadow: 0 12px 30px rgba(255, 90, 100, 0.35), 0 0 0 10px rgba(255, 90, 110, 0); } }
@media (prefers-reduced-motion: reduce) { body.home .nv-like { animation: none; } }
body.home .nv-mail summary { color: #ffd0a8; }

/* anche le schede con foto e i tre passi, con lo stesso bordo luminoso */
body.home .tile, body.home .step {
  border: 1px solid transparent; border-radius: 22px;
  background:
    linear-gradient(rgba(15, 19, 29, 0.9), rgba(15, 19, 29, 0.9)) padding-box,
    linear-gradient(140deg, rgba(120, 160, 255, 0.85), rgba(255, 255, 255, 0.06) 42%, rgba(255, 150, 90, 0.6)) border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 0 46px rgba(70, 115, 255, 0.16);
}
body.home .step::before { background: linear-gradient(135deg, #3d7bff, #7aa2ff); box-shadow: 0 6px 18px rgba(61, 123, 255, 0.45); }

/* ---------------------------------------------------------------- S-circuito
   (assets/scircuit.js) La scheda madre col logo resta ferma (sticky) mentre
   scorrono due finestre; compare all'ingresso e sparisce all'uscita. */
body.home section.scircuit { position: relative; background: #040a18; padding: 0; width: 100%; margin: 0; }
.scircuit .sc-stage {
  position: sticky; top: 0; height: 100vh; margin-bottom: -100vh; z-index: 0;
  opacity: 0; transition: opacity 0.2s linear; overflow: hidden;
}
.scircuit .sc-stage canvas { display: block; width: 100%; height: 100%; }
.scircuit .sc-win {
  position: relative; z-index: 1; min-height: 100vh; display: flex;
  align-items: center; justify-content: center; padding: 90px 20px;
}
.scircuit .sc-card {
  max-width: 660px; width: 100%; padding: 30px 30px 26px; border-radius: 22px;
  background: rgba(14, 20, 36, 0.86); border: 1px solid rgba(120, 160, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(255, 150, 90, 0.12) inset, 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 60px rgba(47, 107, 255, 0.25);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.scircuit .sc-card h2 { font-size: clamp(28px, 3.6vw, 44px); line-height: 1.05; margin: 0 0 14px; color: #fff; }
.scircuit .sc-card p:not(.kicker) { font-size: 18px; line-height: 1.55; color: #c3cbd9; margin: 0 0 18px; }
.scircuit .sc-card .kicker { color: #7f9cff; }
.scircuit.sc-off .sc-stage { display: none; }
@media (max-width: 759px) {
  .scircuit .sc-card { padding: 22px 20px 18px; }
  .scircuit .sc-card p:not(.kicker) { font-size: 16.5px; }
}
