/* Pagine interne in 3D: lo stile condiviso.
   Ogni pagina parte nel cielo con un oggetto in plastica che si monta, poi la camera vola
   tra le tappe: ogni <section class="tappa"> è una fermata e ogni .lastra dentro è una
   lastra sospesa con il testo HTML vero sulla faccia. Senza WebGL, senza JS o con
   "riduci movimento" la stessa pagina si legge piatta, dall'alto in basso. */
/* I font del marchio, serviti dal sito e ridotti ai caratteri usati (assets/fonts) */
@font-face { font-family: "Bricolage Grotesque"; src: url(fonts/bricolage.woff2?v=73e81b5eb4) format("woff2"); font-weight: 600 800; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url(fonts/instrument.woff2?v=0752f386ee) format("woff2"); font-style: italic; font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito"; src: url(fonts/nunito.woff2?v=cd4e37b029) format("woff2"); font-weight: 400 800; font-display: swap; }
/* tra una pagina e l'altra: dissolvenza dopo l'intermezzo del marchio (assets/intermezzo.js) */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .28s; }
}
:root {
  --bg: #F6F8FB;
  --bg-deep: #EDF1F6;
  --surface: #FFFFFF;
  --text: #0E1A2B;
  --text-2: #1F2E44;
  --muted: #3F4D63;
  --faint: #56647A;
  --night: #0E1A2B;
  --night-2: #17273B;
  --orange: #FD7619;
  --orange-hover: #FF8B3D;
  --accent-text: #B54708;
  --blue: #0258F0;
  --ink: #14100C;
  --sky-1: #DCEBFF;
  --sky-2: #8EC5FF;
  --sky-3: #3E8BFF;
  --line: rgba(14, 26, 43, .12);
  --ok: #1F9D55;
  --on-night: #FFFFFF;
  --on-night-2: rgba(255, 255, 255, .78);

  --f-display: "Bricolage Grotesque", "Nunito", system-ui, sans-serif;
  --f-accent: "Instrument Serif", Georgia, "Times New Roman", serif;
  --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --wrap: 1240px;
  color-scheme: light;
}
@media (min-width: 720px) {
  :root { --gutter-l: max(32px, env(safe-area-inset-left, 0px)); --gutter-r: max(32px, env(safe-area-inset-right, 0px)); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
body {
  margin: 0; -ms-overflow-style: none;
  background: var(--bg); color: var(--text);
  font-family: var(--f-body); font-size: 1.0625rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; overflow-x: clip;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 650; line-height: 1.06; letter-spacing: -.025em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; }
em.acc { font-family: var(--f-accent); font-style: italic; font-weight: 400; letter-spacing: -.01em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 64px); margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }
.eyebrow { font-family: var(--f-body); font-weight: 800; font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-text); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 16px; }

/* Bottoni */
.btn {
  display: inline-flex; align-items: center; gap: .55em;
  min-height: 48px; padding: 0 22px; border-radius: 999px;
  font: 800 .975rem/1 var(--f-body); text-decoration: none; letter-spacing: .005em;
  transition: transform .25s cubic-bezier(.2,.8,.2,1), background-color .2s, box-shadow .25s;
  cursor: pointer; border: 0;
}
.btn:hover { transform: translateY(-2px); }
.btn-orange { background: var(--orange); color: var(--ink); box-shadow: 0 10px 30px -10px rgba(253,118,25,.7); }
.btn-orange:hover { background: var(--orange-hover); }
.btn-night { background: var(--night); color: var(--on-night); }
.btn-night:hover { background: var(--night-2); }
.btn-ghost { color: var(--text); background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 1px rgba(14,26,43,.18); }
.btn-ghost:hover { background: rgba(255,255,255,.85); }
.t-night .btn-ghost { color: var(--on-night); background: rgba(255,255,255,.08); box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
.btn .arr { transition: transform .25s; }
.btn:hover .arr { transform: translateX(3px); }
.ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.link { color: var(--accent-text); font-weight: 800; text-underline-offset: 3px; }
.t-night .link { color: #FFB27A; }

/* ---------- Barra ---------- */
.nav { position: fixed; z-index: 50; left: 0; right: 0; top: env(safe-area-inset-top, 0px); padding: 14px var(--gutter-r) 0 var(--gutter-l); pointer-events: none; }
.nav-pill {
  pointer-events: auto; max-width: var(--wrap); margin: 0 auto;
  display: flex; align-items: center; gap: 18px; padding: 8px 8px 8px 16px; border-radius: 999px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 12px 40px -18px rgba(14,26,43,.45);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 1.08rem/1 var(--f-display); letter-spacing: -.02em; color: var(--text); }
.brand img { width: 38px; height: auto; display: block; }
.nav-links { display: flex; gap: 2px; margin: 0 auto; list-style: none; padding: 0; }
.nav-links a { display: block; padding: 9px 13px; border-radius: 999px; text-decoration: none; font-weight: 700; font-size: .93rem; color: rgba(14,26,43,.78); }
.nav-links a:hover { background: rgba(14,26,43,.06); color: var(--text); }
.nav-links a[aria-current="page"] { background: var(--night); color: #fff; }
.lang { font-size: .8rem; font-weight: 800; display: flex; align-items: center; gap: 2px; color: var(--faint); }
.lang b { background: var(--night); color: #fff; border-radius: 999px; padding: 4px 8px; }
.lang a { text-decoration: none; padding: 4px 6px; }
.nav .btn { min-height: 42px; padding: 0 18px; font-size: .9rem; }
.menu-btn { display: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--night); color: #fff; cursor: pointer; }
.menu-btn span { display: block; width: 16px; height: 2px; margin: 4px auto; background: currentColor; border-radius: 2px; }
.nav-panel { pointer-events: auto; max-width: var(--wrap); margin: 8px auto 0; padding: 10px; border-radius: 24px; background: rgba(255,255,255,.96); backdrop-filter: blur(16px); box-shadow: 0 20px 50px -20px rgba(14,26,43,.5); }
.nav-panel ul { list-style: none; margin: 0; padding: 0; display: grid; }
.nav-panel a { display: block; padding: 12px 14px; border-radius: 14px; text-decoration: none; font-weight: 700; }
.nav-panel a:hover { background: var(--bg-deep); }
.nav-panel a[aria-current="page"] { background: var(--bg-deep); color: var(--accent-text); }
@media (max-width: 960px) { .nav-links, .nav .lang { display: none; } .nav .btn { margin-left: auto; } .menu-btn { display: block; } }
@media (max-width: 420px) { .brand span { display: none; } }

/* ---------- Apertura: l'oggetto 3D nel cielo ---------- */
.hero { position: relative; min-height: 100vh; min-height: 100svh; background: linear-gradient(180deg, #2C74FF 0%, #79B6FF 48%, #D8EBFF 100%); overflow: hidden; isolation: isolate; }
.hero-stage { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: flex-end; }
#scena { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#strato { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
/* la lastra sta dentro il contenitore che riceve la matrice 3D: niente posizioni proprie */
.k-involucro > * { position: relative; inset: auto; will-change: auto; }
.hero-copy {
  position: relative; z-index: 2; margin: 0 var(--gutter-r) clamp(28px, 6vh, 64px) var(--gutter-l);
  max-width: 640px; padding: 28px 30px 30px; border-radius: 28px;
  background: rgba(255,255,255,.62); backdrop-filter: blur(18px) saturate(1.5);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.75), 0 30px 60px -30px rgba(14,40,90,.45);
  will-change: opacity, transform;
}
.hero-copy .eyebrow { margin-bottom: 12px; display: block; }
.hero h1 { font-size: clamp(2.1rem, 4.6vw, 4rem); font-weight: 600; letter-spacing: -.035em; }
.hero h1 .acc { color: var(--blue); }
.hero .lead { margin-top: 16px; max-width: 52ch; font-size: clamp(.98rem, 1.15vw, 1.06rem); color: var(--text-2); }
.hero .lead + .lead { margin-top: 10px; }
.hero .ctas { margin-top: 22px; }
.scroll-hint {
  position: absolute; z-index: 2; left: 50%; bottom: 26px; translate: -50% 0;
  font: 800 .7rem/1 var(--f-body); letter-spacing: .18em; text-transform: uppercase; color: rgba(14,26,43,.6);
  display: none; flex-direction: column; align-items: center; gap: 10px;
}
.scroll-hint::after { content: ""; width: 1px; height: 34px; background: linear-gradient(rgba(14,26,43,.6), transparent); animation: hint 1.8s ease-in-out infinite; transform-origin: top; }
@keyframes hint { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
@media (max-width: 720px) {
  .hero-copy { padding: 20px 20px 22px; border-radius: 22px; }
  .hero-copy .eyebrow { display: none; }
  .hero .lead { font-size: .93rem; margin-top: 12px; }
  .hero .lead + .lead { display: none; }
  .hero .ctas { margin-top: 16px; }
}

.nuvole { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
/* le tre nuvole sono file veri: si scaricano presto e non costano lavoro al JS */
.nuvola { --img: url(nuvola-1.webp); }
.nuvola:nth-child(3n+2) { --img: url(nuvola-2.webp); }
.nuvola:nth-child(3n) { --img: url(nuvola-3.webp); }
.nuvola { position: absolute; width: var(--w, 420px); aspect-ratio: 2 / 1; background: var(--img) center / contain no-repeat; opacity: var(--o, .9); animation: deriva var(--d, 90s) linear infinite alternate; }
@keyframes deriva { from { transform: translateX(-6vw); } to { transform: translateX(6vw); } }

/* ---------- Le tappe, lette in piano ---------- */
.tappe { background: linear-gradient(180deg, var(--sky-1) 0, var(--bg) 420px); padding-block: 40px 80px; }
.tappa { padding-block: 40px; }
.tappa > .wrap { display: grid; gap: 22px; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); align-items: start; }
.tappa[data-disposizione="coppia"] > .wrap { --cols: 2; }
.tappa[data-disposizione="fila"] > .wrap { --cols: 3; }
.tappa[data-disposizione="griglia"] > .wrap { --cols: var(--colonne, 2); }
.tappa[data-disposizione="testa"] > .wrap { --cols: var(--colonne, 3); }
.tappa[data-disposizione="testa"] > .wrap > .lastra:first-child { grid-column: 1 / -1; }
.tappa[data-disposizione="uno"] > .wrap > .lastra { max-width: 900px; }
.tappa[data-disposizione="uno"] > .wrap > .lastra.finestra { max-width: 1080px; width: 100%; margin: 0 auto; }
@media (max-width: 860px) { .tappa > .wrap { --cols: 1 !important; } }

.lastra {
  position: relative; min-width: 0; border-radius: 28px; padding: 32px 34px 34px;
  background: linear-gradient(165deg, #FFFFFF 0%, #F2F5F9 100%); color: var(--text);
  box-shadow: 0 0 0 1px rgba(14,26,43,.06), 0 30px 60px -40px rgba(14,26,43,.5);
  display: grid; gap: 14px; align-content: start;
}
.lastra h2 { font-size: clamp(1.8rem, 3.2vw, 2.7rem); }
.lastra h2 .acc { color: var(--blue); }
.lastra h3 { font-size: 1.32rem; letter-spacing: -.015em; }
.lastra p, .lastra li, .lastra dd { color: var(--muted); }
.lastra p.forte { color: var(--text-2); font-size: 1.1em; }
.lastra .nota { font-size: .9em; color: var(--faint); }
.lastra ul, .lastra ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.punti li { position: relative; padding-left: 32px; }
.punti li::before { content: "✓"; position: absolute; left: 0; top: .15em; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .72em; font-weight: 800; background: var(--orange); color: var(--ink); }
.punti.no li::before { content: "–"; background: var(--bg-deep); color: var(--faint); }
.t-night .punti.no li::before { background: rgba(255,255,255,.12); color: var(--on-night-2); }
.lastra .n { font: 700 .8rem/1 var(--f-body); letter-spacing: .16em; color: var(--accent-text); }
.lastra .num { font: 700 3.2rem/1 var(--f-display); letter-spacing: -.05em; color: transparent; -webkit-text-stroke: 1.5px #D9600A; }
.cifra { font: 700 clamp(3rem, 6vw, 5.2rem)/.95 var(--f-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; color: var(--text); }
.cifra small { font-size: .36em; letter-spacing: -.01em; margin-left: .1em; }
.cifra.blu { color: var(--blue); }
.cifra.vuota { color: transparent; -webkit-text-stroke: 2px var(--orange); }
.lastra img.foto { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: 0 0 0 1px var(--line); }
.browser { border-radius: 16px; overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.browser-bar { height: 28px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: var(--bg-deep); }
.browser-bar i { width: 9px; height: 9px; border-radius: 50%; background: #FF5F57; }
.browser-bar i:nth-child(2) { background: #FEBC2E; }
.browser-bar i:nth-child(3) { background: #28C840; }
.browser img { display: block; width: 100%; height: auto; aspect-ratio: 840 / 477; object-fit: cover; }
.meta { font-size: .85rem; font-weight: 800; color: var(--faint); letter-spacing: .01em; }
/* le demo preparate per un'attività, non siti di clienti: va detto sulla scheda */
.tag-demo { display: inline-block; margin-right: 4px; padding: 2px 8px; border-radius: 999px; border: 1.5px solid currentColor; color: var(--accent-text); font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.t-night .tag-demo { color: var(--orange); }
.t-orange .tag-demo { color: var(--ink); }

/* Domande frequenti: risposta sempre visibile, è testo che deve leggersi e citarsi */
.faq { display: grid; gap: 0; }
.faq dt { font: 700 1.12rem/1.3 var(--f-display); letter-spacing: -.01em; color: var(--text); padding-top: 16px; border-top: 1px solid var(--line); }
.faq dt:first-child { border-top: 0; padding-top: 0; }
.faq dd { margin: 6px 0 16px; }
.faq dd:last-child { margin-bottom: 0; }

/* Tabelle */
.tabella { width: 100%; border-collapse: collapse; font-size: .98em; }
.tabella th { text-align: left; font: 800 .72rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 0 12px 12px 0; }
.tabella td { padding: 14px 12px 14px 0; border-top: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.tabella td:first-child { color: var(--text); font-weight: 800; }
.tabella td.c { font: 700 1.5em/1 var(--f-display); letter-spacing: -.03em; color: var(--text); white-space: nowrap; }

/* Varianti di colore della lastra */
.t-night { background: linear-gradient(165deg, #1A2A42 0%, #0E1A2B 70%); color: #fff; }
.t-night h2, .t-night h3, .t-night .cifra, .t-night dt { color: #fff; }
.t-night p, .t-night li, .t-night dd, .t-night td { color: var(--on-night-2); }
.t-night p.forte { color: #fff; }
.t-orange p.forte { color: var(--ink); }
.t-night .eyebrow, .t-night .n { color: #FFB27A; }
.t-night h2 .acc { color: var(--orange); }
.t-orange { background: linear-gradient(165deg, #FF9550 0%, #FD7619 60%); color: var(--ink); }
.t-orange p, .t-orange li, .t-orange dd { color: rgba(20,16,12,.86); }
.t-orange .eyebrow, .t-orange .n { color: var(--ink); }
.t-orange h2 .acc { color: #fff; }
.t-orange .cifra.vuota { -webkit-text-stroke-color: var(--ink); }
.t-orange .link { color: var(--ink); }

/* La finestra finale: il cielo dentro una finestra del browser */
.lastra.finestra { padding: 0 14px 14px; background: linear-gradient(170deg, #FBFCFE 0%, #EEF2F7 100%); gap: 0; }
.finestra-bar { height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
.finestra-bar i { width: 12px; height: 12px; border-radius: 50%; background: #FF5F57; }
.finestra-bar i:nth-child(2) { background: #FEBC2E; }
.finestra-bar i:nth-child(3) { background: #28C840; }
.finestra-cielo {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 22px;
  background: linear-gradient(180deg, #2C74FF 0%, #79B6FF 55%, #D8EBFF 100%);
  padding: clamp(48px, 8vw, 104px) clamp(22px, 6vw, 72px);
  display: grid; justify-items: center; text-align: center; gap: 16px; color: #fff;
}
.finestra-cielo h2 { font-size: clamp(2.2rem, 5.4vw, 4.4rem); color: #fff; text-shadow: 0 2px 30px rgba(10,40,110,.35); }
.finestra-cielo h2 .acc { color: #fff; }
.finestra-cielo p { max-width: 46ch; color: var(--text); font-weight: 600; font-size: 1.06rem; }
.finestra-cielo .ctas { justify-content: center; margin-top: 8px; }

/* ---------- Footer ---------- */
.footer { background: var(--bg-deep); padding-block: 72px 36px; font-size: .95rem; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 1.3fr repeat(3, 1fr); gap: 36px; }
.footer .brand { margin-bottom: 14px; }
.footer h3 { font: 800 .75rem/1 var(--f-body); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.footer a { text-decoration: none; }
.footer a:hover { color: var(--accent-text); }
.footer-bottom { margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .85rem; color: var(--faint); }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }

/* ---------- Modalità 3D ---------- */
.is-3d .hero { min-height: 0; background: #8EC5FF; overflow: visible; }
.is-3d .hero-stage { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 0; overflow: hidden; }
.is-3d .hero .nuvole { display: none; }
.is-3d .scroll-hint { display: flex; }
.is-3d .tappe { display: none; }
.is-3d .lastra {
  /* misure fisse: la camera fa da zoom, così l'impaginazione non cambia con la finestra */
  width: 640px; font-size: 17px; padding: 36px 40px 40px; border-radius: 30px;
  box-shadow: none; user-select: text !important; animation: none !important;
}
.is-3d .lastra.l-s { width: 400px; }
.is-3d .lastra.l-m { width: 520px; }
.is-3d .lastra.l-l { width: 820px; }
.is-3d .lastra.l-xl { width: 1000px; }
.is-3d .lastra h2 { font-size: 44px; }
.is-3d .lastra.l-s h2, .is-3d .lastra.l-m h2 { font-size: 36px; }
.is-3d .lastra h3 { font-size: 23px; }
.is-3d .lastra .eyebrow { font-size: 12px; }
.is-3d .lastra .cifra { font-size: 88px; }
.is-3d .lastra.finestra { padding: 0 14px 14px; border-radius: 36px; }
.is-3d .finestra-cielo { padding: 96px 72px; }
.is-3d .finestra-cielo h2 { font-size: 64px; }
.is-3d .finestra-cielo p { font-size: 18px; }
.is-3d.portrait .lastra, .is-3d.portrait .lastra.l-s, .is-3d.portrait .lastra.l-m,
.is-3d.portrait .lastra.l-l, .is-3d.portrait .lastra.l-xl { width: 380px; padding: 26px 26px 30px; font-size: 16px; }
.is-3d.portrait .lastra h2 { font-size: 32px; }
.is-3d.portrait .lastra .cifra { font-size: 68px; }
/* sul telefono le tabelle larghe si stringono invece di uscire dalla lastra */
.is-3d.portrait .tabella { font-size: 11.5px; }
.is-3d.portrait .tabella th { font-size: 9px; letter-spacing: .08em; padding-right: 6px; }
.is-3d.portrait .tabella td { padding: 9px 6px 9px 0; white-space: normal !important; }
.is-3d.portrait .tabella td.c { font-size: 1.25em; }
.is-3d.portrait .lastra.finestra { width: 400px; padding: 0 10px 10px; }
.is-3d.portrait .finestra-cielo { padding: 56px 24px; }
.is-3d.portrait .finestra-cielo h2 { font-size: 40px; }
.k-off { visibility: hidden; }
.k-off, .k-off * { animation-play-state: paused !important; }

/* Livello leggero: niente sfocature dietro barra e testi, che su GPU deboli si ricalcolano a ogni fotogramma */
[data-livello="leggero"] .nav-pill, [data-livello="leggero"] .nav-panel, [data-livello="leggero"] .hero-copy { backdrop-filter: none; background: rgba(255,255,255,.94); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .nuvola, .scroll-hint::after { animation: none; }
}
