/* =========================================================================
   Touch_me — design system + layout
   Stile: pagina prodotto Apple. Tipografia grande, molto respiro,
   sezioni alternate chiaro/scuro, un solo canvas 3D persistente.
   ========================================================================= */

/* ---------- 0. Font ------------------------------------------------------
   Inter è ospitato qui dentro, non caricato da Google Fonts: su un sito che
   parla di salute una richiesta a fonts.gstatic.com trasmetterebbe l'IP del
   visitatore a un terzo, in un contesto in cui il dato è particolarmente
   sensibile. Due sottoinsiemi con unicode-range: il browser scarica solo
   quello che serve (48 KB per il latino di base).
   Inter — SIL Open Font License 1.1 — https://github.com/rsms/inter
   ------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Inter Variable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 1. Token ---------------------------------------------------- */

:root {
  /* Brand — derivato dal logo (#28398e). Su fondo scuro il blu di marca
     serve come superficie e come pallino sul prodotto; per il testo si
     usano i gradini chiari della scala. */
  --brand-50:  #f1f4fd;
  --brand-100: #dde4f9;
  --brand-200: #bcc7ef;
  --brand-300: #8d9ce0;
  --brand-400: #5c6fcb;
  --brand-500: #3b4cae;
  --brand-600: #28398e;
  --brand-700: #1f2c6f;
  --brand-800: #172154;
  --brand-900: #101739;
  --brand-950: #080c1f;

  /* Superfici: una scala di blu-nero sulla stessa tonalità del marchio.
     La differenza fra un gradino e l'altro è volutamente minima — su fondo
     scuro bastano pochi punti di luminanza, e ciò che separa davvero i
     piani sono le linee sottili e le ombre. */
  --surface-deep:   #05070d;   /* il più profondo: app, riconoscimenti, footer */
  --surface-base:   #0b0f1a;   /* fondo pagina, hero e anatomia */
  --surface-raised: #101623;   /* sezioni alternate */
  --surface-card:   #151d2e;   /* schede e riquadri */

  /* Testo. Rapporti misurati sul fondo base #0b0f1a. */
  --fg:        #f4f6fb;        /* 17,7:1  AAA */
  --fg-muted:  #aab3c9;        /*  9,1:1  AAA */
  --fg-subtle: #8189a0;        /*  5,5:1  AA (4,8:1 sulle schede) */

  --line:        rgba(255, 255, 255, .10);

  /* Ruoli */
  --bg: var(--surface-base);
  --accent: var(--brand-300);   /* occhielli e dettagli: 7,3:1 sul fondo base */

  /* Tipografia */
  --font-sans: "Inter Variable", -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;

  --fs-display-1: clamp(2.6rem, 7.4vw, 6.25rem);
  --fs-display-2: clamp(2.15rem, 5vw, 4.1rem);
  --fs-h2:        clamp(1.9rem, 3.6vw, 3.1rem);
  --fs-h3:        clamp(1.25rem, 1.9vw, 1.75rem);
  --fs-lead:      clamp(1.1rem, 1.55vw, 1.5rem);
  --fs-body:      1.0625rem;
  --fs-small:     0.9375rem;
  --fs-caption:   0.8125rem;

  /* Spazi */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 3rem;     --s-8: 4rem;
  --s-9: 6rem;     --s-10: 8rem;    --s-11: 11rem;

  --radius-s: 10px;
  --radius-m: 16px;
  --radius-l: 24px;
  --radius-xl: 34px;
  --radius-pill: 999px;

  --shadow-s: 0 1px 2px rgba(0, 0, 0, .3), 0 2px 8px rgba(0, 0, 0, .22);
  --shadow-m: 0 4px 14px rgba(0, 0, 0, .34), 0 20px 44px -18px rgba(0, 0, 0, .6);
  --shadow-l: 0 10px 34px rgba(0, 0, 0, .4), 0 44px 96px -40px rgba(0, 0, 0, .75);

  /* Movimento */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --t-fast: 180ms;
  --t-mid: 380ms;
  --t-slow: 720ms;

  /* Layout */
  --page-max: 1240px;
  --gutter: clamp(1.25rem, 5vw, 4.5rem);
  --header-h: 88px;

  /* Livelli */
  --z-stage: 1;
  --z-overlay: 2;
  --z-content: 3;
  --z-header: 20;
  --z-modal: 40;
}

/* ---------- 2. Reset ---------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* L'header è fisso: senza questo, ogni ancora finisce sotto di lui. */
  scroll-padding-block-start: calc(var(--header-h) + 1.5rem);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-synthesis-weight: none;
}

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

/* Sulle superfici chiare — l'unica è il bottone primario — l'anello bianco
   sparirebbe: lì torna blu. */
.btn--primary:focus-visible {
  outline-color: var(--brand-600);
}

/* ---------- 3. Utilità tipografiche ------------------------------------- */

.display-1 {
  font-size: var(--fs-display-1);
  line-height: .95;
  letter-spacing: -.042em;
  font-weight: 700;
  text-wrap: balance;
}

.display-2 {
  font-size: var(--fs-display-2);
  line-height: 1.02;
  letter-spacing: -.035em;
  font-weight: 680;
  text-wrap: balance;
}

.h2 {
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -.028em;
  font-weight: 660;
  text-wrap: balance;
}

.h3 {
  font-size: var(--fs-h3);
  line-height: 1.25;
  letter-spacing: -.018em;
  font-weight: 620;
}

.lead {
  font-size: var(--fs-lead);
  line-height: 1.45;
  letter-spacing: -.012em;
  color: var(--fg-muted);
  text-wrap: pretty;
}

.eyebrow {
  font-size: var(--fs-caption);
  font-weight: 620;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.small { font-size: var(--fs-small); color: var(--fg-muted); }
.caption { font-size: var(--fs-caption); color: var(--fg-subtle); }
.measure { max-width: 56ch; }
.measure-tight { max-width: 44ch; }

/* Testo solo per le tecnologie assistive */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Il nome del prodotto: l'underscore fa parte del marchio */
.wordmark { white-space: nowrap; }

/* ---------- 4. Struttura di pagina -------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  /* Con viewport-fit=cover in orizzontale su iPhone la tacca invade il
     margine: la safe area si somma al gutter. */
  padding-inline: max(var(--gutter), env(safe-area-inset-left))
                  max(var(--gutter), env(safe-area-inset-right));
}

section { position: relative; }

.section-pad { padding-block: clamp(5rem, 12vh, 9rem); }

/* Il ritmo verticale della pagina: tre gradini di scuro. Il testo è chiaro
   ovunque, quindi non servono eccezioni per sezione. */
.section--base   { background: var(--surface-base); }
.section--raised { background: var(--surface-raised); }
.section--deep   { background: var(--surface-deep); }


/* Le sezioni che devono coprire il canvas 3D */
.section--opaque { z-index: var(--z-content); }

/* Fixed e non absolute: con absolute il link, una volta a fuoco, comparirebbe
   in cima al documento — cioè fuori schermo se la pagina è già scorsa. */
.skip-link {
  position: fixed;
  left: -9999px;
  top: 0;
  background: var(--fg);
  color: var(--surface-base);
  padding: .75rem 1.25rem;
  z-index: var(--z-modal);
  border-radius: 0 0 var(--radius-s) 0;
}
.skip-link:focus { left: 0; }

/* ---------- 5. Header --------------------------------------------------- */

.site-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: var(--header-h);
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  transition: background var(--t-mid) var(--ease-out),
              backdrop-filter var(--t-mid) var(--ease-out),
              border-color var(--t-mid) var(--ease-out);
  border-block-end: 1px solid transparent;
}

.site-header[data-scrolled="true"] {
  background: rgba(8, 11, 19, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-block-end-color: rgba(255, 255, 255, .09);
}

.site-header .shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  font-weight: 640;
  letter-spacing: -.024em;
  font-size: 1.6rem;
  color: var(--fg);
}
.brand svg { width: 50px; height: 50px; color: var(--brand-300); }

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.2vw, 2rem);
  font-size: var(--fs-small);
  color: var(--fg-muted);
}
.nav a { transition: color var(--t-fast) var(--ease-out); }
.nav a:hover { color: var(--fg); }

@media (max-width: 860px) {
  .nav { display: none; }
}

/* Sotto i 640 px il marchio a piena taglia occuperebbe mezza barra. */
@media (max-width: 640px) {
  :root { --header-h: 72px; }
  .brand { font-size: 1.3rem; }
  .brand svg { width: 40px; height: 40px; }
}

/* ---------- 6. Bottoni -------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .8rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: var(--fs-small);
  font-weight: 580;
  letter-spacing: -.005em;
  cursor: pointer;
  transition: transform var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Il blu di marca su fondo quasi nero arriva a 2,6:1 contro la pagina: non
   basta a delimitare un bottone. Il primario diventa quindi chiaro con testo
   scuro (17,5:1 in entrambe le direzioni), che è anche la soluzione più
   leggibile a distanza. */
.btn--primary { background: var(--fg); color: var(--surface-base); }
.btn--primary:hover { background: #fff; }

.btn--ghost {
  background: transparent;
  color: var(--fg);
  border-color: rgba(255, 255, 255, .4);   /* 3,4:1 sul fondo base */
}
.btn--ghost:hover {
  border-color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .07);
}

.btn--sm { padding: .55rem 1.1rem; font-size: var(--fs-caption); }

/* ---------- 7. Il palco 3D ---------------------------------------------- */

/* Un unico canvas accompagna hero + anatomia. È uno sticky pin alto una
   schermata: il margine inferiore negativo toglie la sua altezza dal flusso,
   così hero e anatomia gli scorrono sopra. Sticky e non fixed perché su iOS
   lo scroll inerziale viaggia sul compositor e un fixed resta indietro. */
/* Una velatura appena percettibile dietro al modello: solleva il pezzo
   bianco dal fondo bianco senza introdurre un colore nuovo. */
#stage-range {
  position: relative;
  /* Un pozzo di luce dietro al pezzo: è quello che fa sembrare il sensore
     illuminato in una stanza buia invece che ritagliato su un fondo nero. */
  background:
    radial-gradient(46% 36% at 46% 46%, rgba(88, 112, 200, .3) 0%, rgba(11, 15, 26, 0) 72%),
    linear-gradient(to bottom, var(--surface-base) 0%, #0d1220 52%, var(--surface-base) 100%);
}

.stage {
  position: sticky;
  inset-block-start: 0;
  /* La riga in vh viene prima ed è il ripiego: Chrome ed Edge fra la 89 e la
     107 capiscono le import map (quindi il 3D parte) ma non ancora le unità
     svh, e senza questa cascata il pin collasserebbe ad altezza automatica,
     portandosi dietro tutta la coreografia dello scroll. */
  height: 100vh;
  height: 100svh;
  margin-block-end: -100vh;
  margin-block-end: -100svh;
  z-index: var(--z-stage);
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--t-slow) var(--ease-out);
}
.stage[data-visible="true"] { opacity: 1; }
.stage canvas { width: 100%; height: 100%; }

.stage__fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: var(--gutter);
  text-align: center;
}
.stage[data-fallback] .stage__fallback { display: grid; }
.stage[data-fallback] canvas,
.stage[data-fallback] .stage__loader { display: none; }

/* Senza WebGL il palco esce dal flusso sticky e diventa una figura normale
   in cima alla pagina; le sezioni-passo si accorciano a contenuto. */
.stage[data-fallback] {
  position: static;
  height: auto;
  margin-block-end: 0;
  padding-block: var(--s-9) var(--s-7);
  opacity: 1;
}
.stage[data-fallback] .stage__fallback { position: static; }

[data-stage="fallback"] .hero { min-height: auto; padding-block: var(--s-7) var(--s-8); }
[data-stage="fallback"] .anatomy__intro { min-height: auto; }
[data-stage="fallback"] .step { min-height: auto; padding-block: var(--s-6); }
[data-stage="fallback"] .step__card { margin-inline: 0; max-width: 46rem; opacity: 1; transform: none; }

.stage__loader {
  position: absolute;
  inset-block-end: clamp(2rem, 8vh, 5rem);
  inset-inline: 0;
  display: grid;
  justify-items: center;
  gap: .75rem;
  transition: opacity var(--t-mid) var(--ease-out);
}
.stage[data-loaded="true"] .stage__loader { opacity: 0; }

.stage__loader-track {
  width: 132px;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 255, 255, .14);
  overflow: hidden;
}
.stage__loader-bar {
  height: 100%;
  width: 0%;
  background: var(--brand-300);
  transition: width 240ms var(--ease-out);
}

/* Strato degli hotspot: SVG per le linee, DOM per le etichette */
.hotspot-layer {
  position: absolute;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
}
.hotspot-layer[hidden] { display: none; }

.hotspot-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.hotspot-lines path {
  fill: none;
  stroke: rgba(255, 255, 255, .8);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease-out);
}
.hotspot-lines path[data-on="true"] { opacity: .62; }
/* Il punto sta girando dietro al pezzo: la linea si assottiglia e tratteggia
   invece di sparire di colpo. */
.hotspot-lines path[data-ghost="true"] {
  stroke-dasharray: 2 4;
  opacity: .3;
}
@media (max-width: 1100px) {
  .hotspot-lines path { stroke-width: 1; }
}

/* Il pallino sul modello.
   La posizione viene riscritta ogni frame da JS: per questo il contenitore
   non ha transizioni, mentre l'animazione di entrata sta nel nucleo interno. */
.hotspot-dot {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  width: 0;
  height: 0;
  will-change: transform;
}

.hotspot-dot__core {
  position: absolute;
  inset-block-start: -7px;
  inset-inline-start: -7px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  /* Il pallino sta sopra il prodotto, che ora è blu: un pallino blu ci
     sparirebbe dentro. Nucleo quasi nero (6:1 sul silicone) e anello bianco,
     che lo tiene visibile anche quando finisce sul fondo scuro. */
  background: var(--surface-base);
  border: 2px solid rgba(255, 255, 255, .95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .55);
  font-style: normal;   /* il contenitore è un <i>: il numero non va corsivo */
  opacity: 0;
  transform: scale(.35);
  transition: opacity var(--t-mid) var(--ease-out),
              transform var(--t-mid) var(--ease-out),
              background var(--t-fast) var(--ease-out);
}
.hotspot-dot[data-on="true"] .hotspot-dot__core { opacity: 1; transform: scale(1); }
.hotspot-dot[data-active="true"] .hotspot-dot__core {
  background: #000;
  transform: scale(1.32);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}

/* Il punto è quasi dietro al pezzo: resta come contorno, senza riempimento. */
.hotspot-dot[data-ghost="true"] .hotspot-dot__core {
  background: transparent;
  border-color: rgba(255, 255, 255, .55);
  box-shadow: none;
}
.hotspot-dot[data-ghost="true"] .hotspot-dot__core::after { animation: none; }

/* Il numero si vede solo dove non ci sono etichette, cioè su schermi
   stretti: è il ponte fra il pallino e l'indice della scheda di testo. */
.hotspot-dot__core b {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* Anello pulsante solo sul punto attivo */
.hotspot-dot__core::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .8);
  opacity: 0;
}
.hotspot-dot[data-on="true"][data-active="true"] .hotspot-dot__core::after {
  animation: hotspot-pulse 2.4s var(--ease-out) 3;
}

@keyframes hotspot-pulse {
  0%   { opacity: .7; transform: scale(.75); }
  70%  { opacity: 0;  transform: scale(1.75); }
  100% { opacity: 0;  transform: scale(1.75); }
}

@media (max-width: 860px) {
  .hotspot-dot__core {
    inset-block-start: -10px;
    inset-inline-start: -10px;
    width: 20px;
    height: 20px;
  }
  .hotspot-dot__core b { display: flex; }
  .hotspot-dot[data-ghost="true"] .hotspot-dot__core b { color: rgba(255, 255, 255, .85); }
}

/* L'etichetta breve in fondo alla linea guida.
   Anche qui il transform è pilotato da JS: transiziona solo l'opacità. */
.hotspot-label {
  position: absolute;
  inset-block-start: 0;
  inset-inline-start: 0;
  padding: .3rem .75rem .35rem;
  border-radius: var(--radius-pill);
  /* Niente backdrop-filter qui: sono fino a cinque elementi sopra un canvas
     che ridipinge a ogni frame, e con will-change verrebbe comunque
     annullato. Un fondo quasi pieno costa zero e si legge meglio. */
  background: rgba(15, 21, 35, .82);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  color: var(--fg);
  font-size: var(--fs-caption);
  font-weight: 580;
  letter-spacing: -.005em;
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
  will-change: transform, opacity;
}
.hotspot-label[data-on="true"] { opacity: 1; }
.hotspot-label[data-active="true"] {
  background: var(--fg);
  border-color: var(--fg);
  color: var(--surface-base);
}

/* ---------- 8. Hero ----------------------------------------------------- */

.hero {
  position: relative;
  z-index: var(--z-content);
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding-block: calc(var(--header-h) + 2rem) 5rem;
  pointer-events: none;
}
.hero .shell > * { pointer-events: auto; }

.hero__inner { max-width: 46rem; }

.hero__title { margin-block: .5rem .85rem; }

.hero__title em {
  font-style: normal;
  color: var(--brand-600);
}

.hero__lead { max-width: 30rem; }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-block-start: var(--s-6);
}

}

/* Su desktop il modello sta a destra: il testo hero resta a sinistra.
   Su mobile il modello è centrato e il testo scende sotto. */
@media (max-width: 860px) {
  .hero { align-content: end; min-height: 100vh; min-height: 100svh; padding-block-end: 4rem; }
  .hero__inner { max-width: none; }

  /* Su schermo stretto il modello sta sopra e il testo sotto: una velatura
     verso il colore di fondo garantisce che il titolo resti leggibile
     anche quando il pezzo scende. */
  .hero::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    inset-block-end: 0;
    height: 68%;
    background: linear-gradient(to bottom,
      rgba(11, 15, 26, 0) 0%,
      rgba(11, 15, 26, .72) 18%,
      rgba(11, 15, 26, .94) 40%,
      var(--surface-base) 100%);
    pointer-events: none;
    z-index: -1;
  }
}

/* ---------- 9. Sezione anatomia (scrollytelling) ------------------------ */

.anatomy {
  position: relative;
  z-index: var(--z-content);
  pointer-events: none;
}
.anatomy__intro {
  pointer-events: auto;
  min-height: 70vh;
  min-height: 70svh;
  display: grid;
  align-content: center;
  padding-block: var(--s-9);
}
.anatomy__intro .shell { max-width: 62rem; }
.anatomy__intro-inner { max-width: 34rem; }

/* Ogni "step" occupa una schermata: mentre scorre, il modello ruota. */
.anatomy__steps { position: relative; }

.step {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  align-content: center;
  padding-block: var(--s-8);
}

.step__card {
  pointer-events: auto;
  max-width: 27rem;
  margin-inline-start: auto;
  padding: clamp(1.5rem, 2.6vw, 2.25rem);
  background: rgba(16, 22, 35, .78);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, .11);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
.js-anim .step__card { opacity: 0; transform: translateY(26px); }
.step[data-inview="true"] .step__card { opacity: 1; transform: none; }

/* Su dispositivi touch la sfocatura dello sfondo sopra un canvas che
   ridipinge a ogni frame costa più di quanto renda: un fondo quasi pieno
   si legge uguale e non fa ricomporre l'intero strato. */
@media (pointer: coarse) {
  .step__card,
  .site-header[data-scrolled="true"] {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .step__card { background: rgba(16, 22, 35, .96); }
  .site-header[data-scrolled="true"] { background: rgba(8, 11, 19, .96); }
}

.step__index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--brand-500);
  color: #fff;
  font-size: var(--fs-caption);
  font-weight: 620;
  font-variant-numeric: tabular-nums;
  margin-block-end: var(--s-4);
}

.step__title { margin-block-end: .55rem; }
.step__text { color: var(--fg-muted); }

.step__facts {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-block-start: var(--s-5);
}
.step__facts li {
  font-size: var(--fs-caption);
  padding: .28rem .65rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .07);
  color: var(--fg-muted);
}

/* L'ultimo step mostra tutti i callout insieme: la card si fa più discreta */
.step--overview .step__card { max-width: 24rem; }

@media (max-width: 860px) {
  .step { min-height: 92vh; min-height: 92svh; align-content: end; padding-block-end: var(--s-7); }
  .step__card { margin-inline: 0; max-width: none; }
}

/* ---------- 10. Griglie di contenuto ------------------------------------ */

.section-head { max-width: 44rem; margin-block-end: var(--s-8); }
.section-head .eyebrow { display: block; margin-block-end: .75rem; }
.section-head .lead { margin-block-start: var(--s-4); }

.grid {
  display: grid;
  gap: clamp(1.25rem, 2.4vw, 2rem);
}
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .grid--3, .grid--4, .grid--2 { grid-template-columns: minmax(0, 1fr); }
}

.card {
  padding: clamp(1.5rem, 2.4vw, 2rem);
  background: var(--surface-card);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
}
/* Sulla superficie più profonda la scheda va alzata di un gradino in più,
   altrimenti sparisce nel fondo. */
.section--deep .card { background: #12182a; }

.card__num {
  font-size: clamp(2.25rem, 4vw, 3.25rem);
  font-weight: 660;
  letter-spacing: -.04em;
  line-height: 1;
  color: var(--brand-300);
  font-variant-numeric: tabular-nums;
}

.card__title { margin-block: .9rem .5rem; }
.card__text { color: var(--fg-muted); font-size: var(--fs-small); }

/* Passi "come funziona" */
.steps-row { counter-reset: howto; }
.howto {
  position: relative;
  padding-block-start: var(--s-6);
  border-block-start: 1px solid var(--line);
}

.howto::before {
  counter-increment: howto;
  content: counter(howto, decimal-leading-zero);
  display: block;
  font-size: var(--fs-caption);
  font-weight: 620;
  letter-spacing: .1em;
  color: var(--accent);
  margin-block-end: var(--s-4);
  font-variant-numeric: tabular-nums;
}

/* Specifiche */
.specs { border-block-start: 1px solid var(--line); }


/* Tredici righe: se ognuna respira come un paragrafo, la scheda diventa una
   maratona. Interlinea stretta, valori a corpo di testo e non da titolo. */
.spec {
  display: grid;
  grid-template-columns: minmax(0, 13rem) minmax(0, 1fr);
  gap: .35rem var(--s-5);
  padding-block: .85rem;
  border-block-end: 1px solid var(--line);
  align-items: baseline;
  line-height: 1.4;
}

.spec__k { color: var(--fg-subtle); font-size: var(--fs-small); }

.spec__v { font-size: 1.125rem; letter-spacing: -.012em; }
.spec__note { display: block; margin-block-start: .15rem; line-height: 1.35; }

.spec__v[data-pending="true"] {
  color: var(--fg-muted);
  font-style: italic;
  font-size: var(--fs-body);
}


@media (max-width: 620px) {
  .spec { grid-template-columns: minmax(0, 1fr); gap: .35rem; }
}

/* FAQ */
.faq { border-block-start: 1px solid var(--line); }
.faq details {
  border-block-end: 1px solid var(--line);
}
.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding-block: var(--s-5);
  cursor: pointer;
  list-style: none;
  font-size: var(--fs-h3);
  font-weight: 600;
  letter-spacing: -.018em;
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 13px; height: 13px;
  border-inline-end: 1.75px solid var(--brand-300);
  border-block-end: 1.75px solid var(--brand-300);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform var(--t-mid) var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq .faq__a { padding-block-end: var(--s-6); color: var(--fg-muted); max-width: 60ch; }

/* App / IA */
.app-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
}
@media (max-width: 900px) { .app-split { grid-template-columns: minmax(0, 1fr); } }

/* --------- L'app: telefono fermo, schermo che cambia ---------------------
   Stesso meccanismo del sensore che ruota: il telefono resta agganciato
   mentre i passaggi scorrono a fianco, e lo schermo dentro passa da uno
   all'altro in dissolvenza. Le schermate sono quelle vere dell'app
   pubblicata, servite da questo dominio e non da Google. */

.appshow {
  --phone-w: clamp(220px, 24vw, 300px);
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
  /* La coppia telefono + testo sta al centro della colonna: senza questo, a
     schermo largo il testo resta appeso a sinistra con un vuoto a destra. */
  max-width: 62rem;
  margin: var(--s-8) auto 0;
}

.appshow__stage {
  position: sticky;
  inset-block-start: calc(var(--header-h) + 8vh);
  justify-self: center;
}

/* La scocca: nessuna tacca finta, solo una cornice pulita con il bordo
   illuminato in alto, che è ciò che fa leggere l'oggetto come un telefono. */
.phone {
  width: var(--phone-w);
  padding: 3px;
  border-radius: 32px;
  background: linear-gradient(160deg, #39415a 0%, #171d31 45%, #0b0f1c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .3),
    var(--shadow-l);
}

.phone__screen {
  position: relative;
  aspect-ratio: 720 / 1460;
  border-radius: 29px;
  overflow: hidden;
  background: #05060c;
}

.phone__shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 520ms var(--ease-out), transform 520ms var(--ease-out);
}
.phone__shot[data-active="true"] { opacity: 1; transform: none; }

.appshow__steps { counter-reset: appstep; }

.appstep {
  min-height: 58svh;
  display: grid;
  align-content: center;
  max-width: 38rem;
  padding-block: var(--s-6);
  transition: opacity var(--t-slow) var(--ease-out);
}
/* Lo sbiadito vale solo dove il JavaScript è partito: senza, i quattro
   passaggi resterebbero al 38% di opacità e nessuno potrebbe accenderli. */
.js-anim .appstep { opacity: .38; }
.appstep[data-active="true"] { opacity: 1; }

.appstep__n {
  font-size: var(--fs-caption);
  font-weight: 620;
  letter-spacing: .12em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  margin-block-end: var(--s-4);
}
.appstep h3 { margin-block-end: .6rem; }
.appstep__text { color: var(--fg-muted); }

.appshow__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4) var(--s-6);
  margin-block-start: var(--s-8);
  padding-block-start: var(--s-6);
  border-block-start: 1px solid var(--line);
}
.appshow__foot .caption { max-width: 44ch; }

/* I badge sono l'artwork ufficiale di Google e di Apple: non vanno
   ridisegnati né ricolorati, solo scalati.

   Le due immagini hanno però proporzioni diverse: quella di Google include
   nel file lo spazio di rispetto (il badge occupa il 76% dell'altezza),
   quella di Apple no. A parità di altezza CSS il badge Apple sembrerebbe più
   grande, quindi lo si tiene a 52 px contro i 68 di Google: così i due
   rettangoli neri risultano alti uguale. */
.storebadges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-4);
  flex: none;
}

.playbadge {
  display: inline-block;
  border-radius: 8px;
}
.playbadge img {
  height: 68px;
  width: auto;
  display: block;
}
.playbadge:focus-visible { outline-offset: 0; }

.storebadge {
  height: 52px;
  width: auto;
  display: block;
}

@media (max-width: 900px) {
  .appshow {
    --phone-w: clamp(150px, 42vw, 210px);
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
  }
  .appshow__stage {
    inset-block-start: calc(var(--header-h) + 12px);
    z-index: 2;
  }
  /* In colonna unica il testo che esce passerebbe dietro al telefono e si
     intravederebbe ai lati: questa fascia lo copre e sfuma verso il basso. */
  .appshow__stage::before {
    content: "";
    position: absolute;
    inset: -16px calc(-1 * var(--gutter)) -32px;
    background: linear-gradient(to bottom,
      var(--surface-deep) 0%,
      var(--surface-deep) 78%,
      rgba(5, 7, 13, 0) 100%);
    z-index: -1;
  }
  .appstep { min-height: 54svh; max-width: none; }
  .appshow__foot { flex-direction: column; align-items: flex-start; }
}

/* Con movimento ridotto cade tutta la coreografia: niente aggancio, niente
   dissolvenze, niente scocca. Le quattro schermate diventano una griglia e i
   passaggi sono tutti leggibili insieme. */
@media (prefers-reduced-motion: reduce) {
  .appshow {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-6);
    max-width: none;
  }
  .appshow__stage { position: static; justify-self: stretch; }
  .phone { width: auto; padding: 0; background: none; border: 0; box-shadow: none; }
  .phone__screen {
    aspect-ratio: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
    gap: var(--s-4);
    border-radius: 0;
    background: none;
    overflow: visible;
  }
  .phone__shot {
    position: static;
    opacity: 1;
    transform: none;
    height: auto;
    transition: none;
    border-radius: var(--radius-m);
    border: 1px solid var(--line);
  }
  .js-anim .appstep,
  .appstep { opacity: 1; min-height: auto; padding-block: var(--s-5); }
  .appshow__stage::before { display: none; }
}

/* Riconoscimenti */
.award {
  display: grid;
  gap: var(--s-4);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  border-radius: var(--radius-l);
  background: #12182a;
  border: 1px solid var(--line);
}
.award__year {
  font-size: var(--fs-caption);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-200);
}

/* CTA finale */

/* Footer */
.site-footer {
  position: relative;
  z-index: var(--z-content);
  background: var(--surface-deep);
  color: var(--fg-muted);
  padding-block: var(--s-8) var(--s-6);
  font-size: var(--fs-small);
}
.site-footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 1fr));
  gap: var(--s-7);
  padding-block-end: var(--s-7);
  border-block-end: 1px solid var(--line);
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: minmax(0, 1fr); } }
.footer-grid h3 { font-size: var(--fs-caption); text-transform: uppercase; letter-spacing: .12em; color: rgba(255, 255, 255, .55); margin-block-end: var(--s-4); }
.footer-grid li + li { margin-block-start: .5rem; }
.footer-grid a { overflow-wrap: anywhere; }
.footer-brand svg { width: 30px; height: 30px; color: #fff; margin-block-end: var(--s-4); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4) var(--s-6);
  justify-content: space-between;
  padding-block-start: var(--s-5);
  font-size: var(--fs-caption);
  color: rgba(255, 255, 255, .55);
}

.disclaimer {
  margin-block-start: var(--s-5);
  padding: var(--s-4) var(--s-5);
  border-inline-start: 2px solid rgba(255, 255, 255, .2);
  font-size: var(--fs-caption);
  color: rgba(255, 255, 255, .5);
  max-width: 62ch;
}

/* ---------- 11. Rivelazione allo scroll --------------------------------- */

.js-anim .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--t-slow) var(--ease-out),
              transform var(--t-slow) var(--ease-out);
}
.reveal { transition: opacity var(--t-slow) var(--ease-out),
                       transform var(--t-slow) var(--ease-out); }
.reveal[data-inview="true"] { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 80ms; }
.reveal[data-delay="2"] { transition-delay: 160ms; }
.reveal[data-delay="3"] { transition-delay: 240ms; }

/* ---------- 12. Preferenze di movimento ridotto ------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  /* Specificità allineata a `.js-anim .reveal`, altrimenti queste due
     righe non vincono e il contenuto resta appeso all'observer. */
  .js-anim .reveal,
  .reveal { opacity: 1; transform: none; }
  .js-anim .step__card,
  .step__card { opacity: 1; transform: none; }
}

/* ---------- 13. Stampa -------------------------------------------------- */

@media print {
  .stage, .hotspot-layer, .site-header { display: none !important; }
  body { background: #fff; color: #000; }
}
