/* Ohmera · sito pubblico. Kit del marchio v1 (docs/marchio/kit-v1.html): colori, caratteri, curve, voce.
   Due temi: Notte (predefinito, come il display di un analizzatore) e Carta (chiaro, i colori «su chiaro» del kit).
   Senza una scelta salvata si segue il sistema; la scelta del pulsante vince (data-theme sulla radice).
   Niente stili in linea: la CSP (style-src 'self') li blocca. JavaScript cambia solo classi, attributi SVG e testo.
   Con «riduci movimento» nessuna animazione: tutto allo stato finale. I caratteri stanno su questo server. */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(/caratteri/archivo-latin-wdth-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(/caratteri/source-sans-3-latin-400-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-display: swap;
  font-weight: 600;
  src: url(/caratteri/source-sans-3-latin-600-normal.woff2) format('woff2');
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-display: swap;
  font-weight: 500;
  src: url(/caratteri/ibm-plex-mono-latin-500-normal.woff2) format('woff2');
}

/* ---------- Colori ---------- */

/* Notte: fondo Notte #0E1718, strumento Display #061011, lettura #4FD1BE, puntale #F2B544, testo Nebbia #E4EFED.
   Le variabili --sc-* sono la scena dell'apertura, come nell'app (apps/mobile/src/ui/globals.css, --intro-*). */
:root {
  color-scheme: dark;
  --fondo: #0e1718;
  --display: #061011;
  --display-filo: #16302f;
  --superficie: #142022;
  --superficie-velo: rgba(20, 32, 34, 0.8);
  --inchiostro: #e4efed;
  --inchiostro-2: #9db4b1;
  --inchiostro-3: #7d9693;
  --linea: #263a3c;
  --linea-forte: #3d5759;
  --griglia: #132a2c;
  --alone: rgba(79, 209, 190, 0.11);
  --accento: #4fd1be;
  --accento-ink: #03201c;
  --puntale: #f2b544;
  --bagliore: rgba(79, 209, 190, 0.55);
  --alone-bottone: 0 0 0 1px rgba(79, 209, 190, 0.3), 0 0 24px -4px rgba(79, 209, 190, 0.55);
  --bagliore-lettura: 0 0 18px rgba(111, 240, 218, 0.34);
  --vetro: rgba(255, 255, 255, 0.04);
  --vignetta: rgba(0, 0, 0, 0.3);
  --scansione: rgba(79, 209, 190, 0.035);
  --scansione-filo: rgba(79, 209, 190, 0.22);
  --scala-spenta: #12292a;
  --ombra-pannello: 0 40px 90px -50px rgba(0, 0, 0, 0.85);

  --sc-griglia: #0f2426;
  --sc-cornice: #2b4547;
  --sc-scatola: #0b1a1b;
  --sc-scatola-filo: #33494b;
  --sc-schermo: #061011;
  --sc-schermo-filo: #16302f;
  --sc-lettura: #6ff0da;
  --sc-etichetta: #5b7a76;
  --sc-presa-fondo: #1e2527;
  --sc-presa: #9db4b1;
  --sc-esito-fondo: #10301f;
  --sc-esito-filo: #5bd69a;
  --sc-esito: #72f0a8;
  --sc-traccia: #4fd1be;
  --sc-punto: #f2b544;
  --sc-testo: #e4efed;
  --sc-testo-2: #9db4b1;

  /* Interruttori del tema: logo QVAD® bianco o nero, manopola del pulsante */
  --mostra-notte: block;
  --mostra-carta: none;
  --giro-tema: 0deg;

  /* Curve del kit: molla, uscita morbida, entrata-uscita (quella dell'anello e della firma nell'apertura) */
  --molla: cubic-bezier(0.34, 1.56, 0.64, 1);
  --morbida: cubic-bezier(0.16, 1, 0.3, 1);
  --entrata-uscita: cubic-bezier(0.65, 0, 0.35, 1);

  --f-display: 'Archivo', 'Arial Narrow', system-ui, sans-serif;
  --f-body: 'Source Sans 3', system-ui, sans-serif;
  --f-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

/* Carta: i colori «su chiaro» del kit (Lettura scura #0B7C72, puntale #A86B06). Due blocchi uguali: uno per il
   sistema in chiaro senza scelta salvata, uno per la scelta «Carta» del pulsante. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='notte']) {
    color-scheme: light;
    --fondo: #edf3f2;
    --display: #f4f8f7;
    --display-filo: #cbdad7;
    --superficie: #ffffff;
    --superficie-velo: rgba(255, 255, 255, 0.84);
    --inchiostro: #0d1c1b;
    --inchiostro-2: #45605c;
    --inchiostro-3: #557069;
    --linea: #cbdad7;
    --linea-forte: #7a918e;
    --griglia: #d9e5e3;
    --alone: rgba(11, 124, 114, 0.08);
    --accento: #0b7c72;
    --accento-ink: #ffffff;
    --puntale: #a86b06;
    --bagliore: rgba(11, 124, 114, 0.3);
    --alone-bottone: 0 0 0 1px rgba(11, 124, 114, 0.22), 0 6px 18px -8px rgba(11, 124, 114, 0.5);
    --bagliore-lettura: 0 0 0 transparent;
    --vetro: rgba(255, 255, 255, 0);
    --vignetta: rgba(13, 28, 27, 0.05);
    --scansione: rgba(11, 124, 114, 0.035);
    --scansione-filo: rgba(11, 124, 114, 0.18);
    --scala-spenta: #dce7e5;
    --ombra-pannello: 0 30px 70px -45px rgba(13, 28, 27, 0.35);
    --sc-griglia: #dce7e5;
    --sc-cornice: #b5c8c5;
    --sc-scatola: #ffffff;
    --sc-scatola-filo: #cbdad7;
    --sc-schermo: #e3ecea;
    --sc-schermo-filo: #cbdad7;
    --sc-lettura: #0b7c72;
    --sc-etichetta: #557069;
    --sc-presa-fondo: #ffffff;
    --sc-presa: #45605c;
    --sc-esito-fondo: #ddf0e5;
    --sc-esito-filo: #1b7f4e;
    --sc-esito: #1b7f4e;
    --sc-traccia: #0b7c72;
    --sc-punto: #a86b06;
    --sc-testo: #0d1c1b;
    --sc-testo-2: #45605c;
    --mostra-notte: none;
    --mostra-carta: block;
    --giro-tema: 180deg;
  }
}
:root[data-theme='carta'] {
  color-scheme: light;
  --fondo: #edf3f2;
  --display: #f4f8f7;
  --display-filo: #cbdad7;
  --superficie: #ffffff;
  --superficie-velo: rgba(255, 255, 255, 0.84);
  --inchiostro: #0d1c1b;
  --inchiostro-2: #45605c;
  --inchiostro-3: #557069;
  --linea: #cbdad7;
  --linea-forte: #7a918e;
  --griglia: #d9e5e3;
  --alone: rgba(11, 124, 114, 0.08);
  --accento: #0b7c72;
  --accento-ink: #ffffff;
  --puntale: #a86b06;
  --bagliore: rgba(11, 124, 114, 0.3);
  --alone-bottone: 0 0 0 1px rgba(11, 124, 114, 0.22), 0 6px 18px -8px rgba(11, 124, 114, 0.5);
  --bagliore-lettura: 0 0 0 transparent;
  --vetro: rgba(255, 255, 255, 0);
  --vignetta: rgba(13, 28, 27, 0.05);
  --scansione: rgba(11, 124, 114, 0.035);
  --scansione-filo: rgba(11, 124, 114, 0.18);
  --scala-spenta: #dce7e5;
  --ombra-pannello: 0 30px 70px -45px rgba(13, 28, 27, 0.35);
  --sc-griglia: #dce7e5;
  --sc-cornice: #b5c8c5;
  --sc-scatola: #ffffff;
  --sc-scatola-filo: #cbdad7;
  --sc-schermo: #e3ecea;
  --sc-schermo-filo: #cbdad7;
  --sc-lettura: #0b7c72;
  --sc-etichetta: #557069;
  --sc-presa-fondo: #ffffff;
  --sc-presa: #45605c;
  --sc-esito-fondo: #ddf0e5;
  --sc-esito-filo: #1b7f4e;
  --sc-esito: #1b7f4e;
  --sc-traccia: #0b7c72;
  --sc-punto: #a86b06;
  --sc-testo: #0d1c1b;
  --sc-testo-2: #45605c;
  --mostra-notte: none;
  --mostra-carta: block;
  --giro-tema: 180deg;
}

/* ---------- Base ---------- */

*,
*::before,
*::after { box-sizing: border-box; }
/* Anche con display impostato altrove: un elemento hidden resta nascosto (pulsanti mostrati solo con JavaScript) */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--fondo); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--fondo);
  color: var(--inchiostro);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accento); color: var(--accento-ink); }

/* Fondo da strumento: la griglia del kit (24 px) con un alone di lettura in alto, fissa dietro la pagina */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 45% at 50% -8%, var(--alone), transparent 70%),
    linear-gradient(var(--griglia) 1px, transparent 1px) 50% 0 / 24px 24px,
    linear-gradient(90deg, var(--griglia) 1px, transparent 1px) 50% 0 / 24px 24px;
  -webkit-mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 25%, transparent 85%);
  mask-image: radial-gradient(ellipse 120% 90% at 50% 0%, #000 25%, transparent 85%);
}
/* Pagine da leggere (informativa, supporto, 404): la griglia solo in alto, il testo su fondo pulito */
.lettura::before {
  -webkit-mask-image: radial-gradient(ellipse 110% 45% at 50% 0%, #000 15%, transparent 80%);
  mask-image: radial-gradient(ellipse 110% 45% at 50% 0%, #000 15%, transparent 80%);
}
/* Linea di scansione: una fascia tenue che scende lenta, come sul display. Quattro passaggi, poi si ferma
   (un movimento decorativo senza fine distrae e non si può fermare). Solo sulle pagine «vive»: iniziale e «in arrivo». */
.vivo::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 22vh;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--scansione) calc(100% - 1px), var(--scansione-filo) calc(100% - 1px));
  transform: translate3d(0, -24vh, 0);
}

.nascosto {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.salta {
  position: absolute;
  left: 16px;
  top: 12px;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--superficie);
  color: var(--inchiostro);
  border: 1px solid var(--accento);
  transform: translateY(-160%);
}
.salta:focus { transform: none; }

/* ---------- Pagina e testata ---------- */

.pagina {
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 16px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Sul telefono: logo e tema sulla prima riga, pagine sotto. Da 560 px tutto su una riga. */
.testata {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: 'logo tema' 'nav nav';
  align-items: center;
  gap: 2px 12px;
}
.logo { grid-area: logo; justify-self: start; display: inline-flex; align-items: center; gap: 11px; min-height: 44px; color: var(--inchiostro); text-decoration: none; }
.logo .segno { width: 43px; height: 40px; color: var(--accento); flex: none; overflow: visible; }
.logo .punto { fill: var(--puntale); transform-box: fill-box; transform-origin: center; }
.logo .nome { font: 800 30px/1 var(--f-display); font-stretch: 118%; letter-spacing: -0.01em; }
.logo:hover { text-shadow: none; }

.testata nav { grid-area: nav; display: flex; gap: 8px; margin-inline: -10px; }
.testata nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  color: var(--inchiostro-2);
  text-decoration: none;
  /* Sottolineatura che si traccia da sinistra, come una lettura che sale */
  background: linear-gradient(var(--accento), var(--accento)) 10px calc(100% - 8px) / 0 1px no-repeat;
}
.testata nav a:hover,
.testata nav a[aria-current='page'] { color: var(--inchiostro); background-size: calc(100% - 20px) 1px; }

/* Pulsante del tema: una manopola da strumento, metà piena; gira di mezzo giro passando a Carta */
.tema {
  grid-area: tema;
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--linea-forte);
  background: var(--superficie);
  color: var(--inchiostro);
  cursor: pointer;
}
.tema:hover { border-color: var(--accento); color: var(--accento); box-shadow: var(--alone-bottone); }
.tema svg { width: 22px; height: 22px; overflow: visible; }
.tema .tacche { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; opacity: 0.5; }
.tema circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.tema .manopola { transform-box: view-box; transform-origin: 50% 50%; transform: rotate(var(--giro-tema)); }
.tema .manopola path { fill: currentColor; }

@media (min-width: 560px) {
  .testata { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: 'logo nav tema'; gap: 16px; }
  .testata nav { margin-inline: 0; gap: 4px; }
}
@media (min-width: 720px) {
  .pagina { padding: 24px 32px 48px; gap: 56px; }
}

/* ---------- Collegamenti, pulsanti, fuoco ---------- */

a { color: var(--accento); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-shadow: 0 0 14px var(--bagliore); }
/* Fuoco ambra, come nel kit: si vede su tutti e due i temi */
a:focus-visible,
button:focus-visible { outline: 2px solid var(--puntale); outline-offset: 3px; border-radius: 6px; }
.tema:focus-visible { border-radius: 50%; }
.rivedi:focus-visible,
.pulsante:focus-visible { border-radius: 999px; }

.pulsante {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--accento);
  color: var(--accento);
  font: 600 16px/1 var(--f-body);
  text-decoration: none;
}
.pulsante:hover { background: var(--accento); color: var(--accento-ink); box-shadow: var(--alone-bottone); text-shadow: none; }

/* ---------- Testo ---------- */

main { flex: 1; display: flex; flex-direction: column; gap: 40px; }
section { display: flex; flex-direction: column; gap: 12px; }
h1,
h2 { margin: 0; font-family: var(--f-display); text-wrap: balance; }
h1 { font-size: clamp(34px, 7vw, 54px); font-weight: 800; font-stretch: 112%; letter-spacing: -0.02em; line-height: 1.05; }
h2 { font-size: 22px; font-weight: 700; font-stretch: 108%; line-height: 1.2; }
p,
ul { margin: 0; max-width: 64ch; }
ul { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
strong { font-weight: 600; }

.etichetta { font: 500 12px/1.4 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--inchiostro-2); }
.motto { font: 700 clamp(24px, 3.4vw, 34px)/1.15 var(--f-display); font-stretch: 112%; letter-spacing: -0.01em; color: var(--accento); }
.introduzione { font-size: 19px; line-height: 1.55; color: var(--inchiostro-2); }
.avviso { border-left: 3px solid var(--puntale); padding: 4px 0 4px 14px; color: var(--inchiostro-2); }
.hud { margin: 0; font: 500 11px/1.4 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--inchiostro-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (min-width: 720px) {
  main { gap: 56px; }
}

/* ---------- Pagina iniziale: il pannello con l'apertura ---------- */

.eroe { gap: 28px; }

/* Il pannello è lo strumento: barra di stato, display (il palco), avanzamento e comandi.
   Sul telefono va da bordo a bordo, sul computer è una cornice con gli angoli arrotondati. */
.pannello {
  container-type: inline-size;
  position: relative;
  margin-inline: -16px;
  background: var(--superficie);
  border-block: 1px solid var(--linea);
  box-shadow: var(--ombra-pannello);
}
.barra { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 0 16px; }
.barra .hud:last-child { margin-left: auto; }
.stato { display: inline-flex; align-items: center; gap: 9px; }
.led { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--puntale); box-shadow: 0 0 10px var(--puntale); }

/* Il palco mostra la scena del kit (360 × 640 unità) tagliata da y 150 a 490: 340 unità di altezza, larghezza fino a
   720 unità, la scena sempre al centro. --u è un'unità della scena in pixel: 1/360 della larghezza, al massimo 1,45 px
   (sul computer il palco si allarga ai lati invece di crescere in altezza). L'SVG ha lo stesso taglio (viewBox
   -180 150 720 340, «slice»), quindi testo HTML e disegno SVG restano allineati. Senza unità del contenitore (cqw)
   vale la stessa misura presa dalla finestra: sul telefono il palco è largo quanto la finestra, sul computer vale il tetto. */
.palco {
  --u: min(calc(100vw / 360), 1.45px);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: calc(720 * var(--u));
  height: calc(340 * var(--u));
  margin-inline: auto;
  background: var(--display);
  color: var(--sc-testo);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
@supports (width: 1cqw) {
  .palco { --u: min(calc(100cqw / 360), 1.45px); }
}
.griglia {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--sc-griglia) 1px, transparent 1px), linear-gradient(90deg, var(--sc-griglia) 1px, transparent 1px);
  background-size: calc(24 * var(--u)) calc(24 * var(--u));
  background-position: 50% 50%;
  -webkit-mask-image: radial-gradient(ellipse 62% 80% at 50% 46%, #000 0, transparent 100%);
  mask-image: radial-gradient(ellipse 62% 80% at 50% 46%, #000 0, transparent 100%);
}
.scena { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.scena text { font-family: var(--f-mono); font-weight: 500; }
.sc-scatola { fill: var(--sc-scatola); stroke: var(--sc-scatola-filo); stroke-width: 1.5; }
.sc-schermo { fill: var(--sc-schermo); stroke: var(--sc-schermo-filo); }
.sc-lettura { fill: var(--sc-lettura); }
.sc-etichetta { fill: var(--sc-etichetta); }
/* Rosso e blu dei cavi: solo nella scena, uguali nei due temi (kit) */
.sc-sonda { fill: #d6453a; }
.sc-parte { fill: #2f6fd6; }
.sc-presa-nera { fill: var(--sc-presa-fondo); stroke: var(--sc-etichetta); }
.sc-presa { fill: none; stroke: var(--sc-presa); stroke-width: 1.5; }
.sc-cavo { fill: none; stroke-width: 3; stroke-linecap: round; }
.sc-cavo-sonda { stroke: #d6453a; }
.sc-cavo-parte { stroke: #2f6fd6; }
.sc-esito-fondo { fill: var(--sc-esito-fondo); stroke: var(--sc-esito-filo); }
.sc-esito { fill: var(--sc-esito); }
/* Spessore, tratteggio e forma del tracciato li scrive apertura.js negli attributi: qui solo il colore */
.sc-traccia { fill: none; stroke: var(--sc-traccia); stroke-linecap: round; stroke-linejoin: round; }
.sc-eco { fill: none; stroke: var(--sc-punto); stroke-width: 2; }
.sc-punto { fill: var(--sc-punto); }

/* «Collega. Misura. Verifica.» durante l'apertura; nell'ultimo fotogramma sono già sfumate */
.didascalie {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(302 * var(--u));
  display: flex;
  justify-content: center;
  gap: calc(14 * var(--u));
  font: 700 calc(21 * var(--u)) / 1 var(--f-display);
  font-stretch: 108%;
  opacity: 0;
  pointer-events: none;
}
.didascalie span { opacity: 0.18; }

/* La firma: il posto della «o» lascia spazio al simbolo, appoggiato sulla linea delle lettere (kit, «Firma») */
.marchio { position: absolute; left: 0; right: 0; top: calc(146 * var(--u)); display: flex; justify-content: center; }
.marchio h1 { display: flex; flex-direction: column; align-items: center; margin: 0; font: inherit; letter-spacing: normal; }
.firma { display: flex; align-items: baseline; font: 800 calc(46 * var(--u)) / 1 var(--f-display); font-stretch: 118%; letter-spacing: -0.01em; }
.firma b { display: inline-block; font-weight: 800; }
.posto { position: relative; display: block; flex: none; width: calc(52 * var(--u)); height: 0; }
/* Il simbolo fermo dell'ultimo fotogramma: stessa scala (0,39) e stesso punto d'arrivo del simbolo animato */
.posto svg { position: absolute; left: 0; bottom: 0; width: 100%; height: calc(46 * var(--u)); overflow: visible; }
.posto path { fill: none; stroke: var(--sc-traccia); stroke-width: 16; stroke-linecap: round; stroke-linejoin: round; }
.posto .punto { fill: var(--sc-punto); }
.posto .eco { fill: none; stroke: var(--sc-punto); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.sottotitolo {
  margin-top: calc(12 * var(--u));
  font: 500 max(11px, calc(12 * var(--u))) / 1.2 var(--f-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: var(--sc-testo-2);
}

/* Angoli del display e righello in basso, come la cornice di uno schermo da strumento */
.cornice {
  --c: var(--sc-cornice);
  --l: 14px;
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left top / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) right top / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right top / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) left bottom / 1px var(--l) no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / var(--l) 1px no-repeat,
    linear-gradient(var(--c), var(--c)) right bottom / 1px var(--l) no-repeat;
}
.cornice::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--c) 0 1px, transparent 1px calc(24 * var(--u)));
  opacity: 0.8;
}
/* Riflesso del vetro (solo sul tema scuro) */
.palco::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(165deg, var(--vetro), transparent 38%);
}

.avanzamento { display: block; width: 100%; height: 2px; }
.avanzamento line { stroke-width: 2; }
.avanzamento .binario { stroke: var(--linea); }
.avanzamento .corsa { stroke: var(--accento); }

.rivedi {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px 0 13px;
  border-radius: 999px;
  border: 1px solid var(--linea-forte);
  background: transparent;
  color: var(--inchiostro);
  font: 500 12px/1 var(--f-mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.rivedi:hover { border-color: var(--accento); color: var(--accento); box-shadow: var(--alone-bottone); }
.rivedi svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rivedi .icona-salta,
.rivedi.in-corso .icona-rivedi { display: none; }
.rivedi.in-corso .icona-salta { display: block; }

.presentazione { display: grid; gap: 14px; }

@media (min-width: 720px) {
  .pannello { margin-inline: 0; padding: 0 12px; border: 1px solid var(--linea); border-radius: 20px; }
  .barra { padding: 0 4px; }
  .palco { border-radius: 12px; }
  .palco::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    box-shadow: inset 0 0 0 1px var(--display-filo), inset 0 0 70px var(--vignetta);
  }
  .avanzamento { margin-top: 10px; }
}
@media (min-width: 900px) {
  .presentazione { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; }
}

/* ---------- Tracciati fra le sezioni ---------- */

/* Il tracciato del kit (lo stesso dell'apertura) che si disegna quando arriva sullo schermo; il punto ambra sul picco */
.separatore { height: 48px; }
.separatore svg { display: block; width: 100%; height: 48px; }
.separatore path { fill: none; stroke: var(--accento); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; opacity: 0.75; }
.separatore .sonda { fill: var(--puntale); transform-box: fill-box; transform-origin: center; }

/* ---------- Letture d'esempio ---------- */

.letture { display: grid; gap: 12px; }
.strumento {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 18px 18px;
  background: var(--display);
  border: 1px solid var(--linea);
  border-radius: 14px;
  overflow: hidden;
}
.strumento::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(160deg, var(--vetro), transparent 45%);
}
.grandezza { margin: 0; font: 500 11.5px/1.35 var(--f-mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--inchiostro-2); }
.valore { margin: 0; display: flex; align-items: baseline; gap: 10px; font-family: var(--f-mono); font-weight: 500; color: var(--sc-lettura); }
.cifre { font-size: clamp(38px, 4.6vw, 50px); line-height: 1; letter-spacing: -0.02em; white-space: pre; font-variant-numeric: tabular-nums; text-shadow: var(--bagliore-lettura); }
.unita { font-size: 20px; color: var(--inchiostro-2); }
/* Barra a segmenti, come sui display degli analizzatori: la parte accesa sale con la lettura */
.scala { position: relative; display: block; height: 6px; background: repeating-linear-gradient(90deg, var(--scala-spenta) 0 5px, transparent 5px 8px); }
.luce { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, var(--sc-lettura) 0 5px, transparent 5px 8px); clip-path: inset(0 var(--resto) 0 0); }
.strumento:nth-child(1) { --resto: 64%; }
.strumento:nth-child(2) { --resto: 42%; }
.strumento:nth-child(3) { --resto: 17%; }
.didascalia { grid-column: 1 / -1; margin: 0; max-width: none; font-size: 14px; color: var(--inchiostro-3); }
@media (min-width: 760px) {
  .letture { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}

/* ---------- Canali: per chi è, a che punto è, cosa non fa ---------- */

.canali { display: grid; gap: 16px; }
.canale {
  position: relative;
  gap: 12px;
  padding: 22px 22px 24px;
  border: 1px solid var(--linea);
  border-radius: 16px;
  background: var(--superficie-velo);
}
/* Angolo acceso in alto a sinistra: verde lettura, ambra per «Cosa non fa» */
.canale::before {
  content: '';
  position: absolute;
  left: -1px;
  top: -1px;
  width: 30px;
  height: 30px;
  border-left: 2px solid var(--accento);
  border-top: 2px solid var(--accento);
  border-top-left-radius: 16px;
  transform-origin: 0 0;
  pointer-events: none;
}
.canale.attenzione::before { border-color: var(--puntale); }
.indice { display: flex; align-items: center; gap: 9px; margin: 0; font: 500 11.5px/1 var(--f-mono); letter-spacing: 0.1em; color: var(--inchiostro-3); }
.indice .led { width: 6px; height: 6px; background: var(--accento); box-shadow: 0 0 8px var(--bagliore); transform-origin: center; }
.attenzione .indice .led { background: var(--puntale); box-shadow: 0 0 8px var(--puntale); }
@media (min-width: 760px) {
  .canali { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .canale.attenzione { grid-column: 1 / -1; }
}

/* ---------- Pagine da leggere ---------- */

.leggibile { max-width: 760px; gap: 36px; }
.leggibile h2 { display: flex; align-items: center; gap: 12px; }
.leggibile h2::before { content: ''; flex: none; width: 14px; height: 2px; border-radius: 1px; background: var(--accento); box-shadow: 0 0 8px var(--bagliore); }

/* ---------- «In arrivo» (app.ohmera.it) ---------- */

.arrivo-pannello { align-items: flex-start; gap: 16px; }
.segnale {
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin-bottom: 12px;
  border-radius: 20px;
  border: 1px solid var(--linea);
  background:
    linear-gradient(var(--sc-griglia) 1px, transparent 1px) 50% 50% / 24px 24px,
    linear-gradient(90deg, var(--sc-griglia) 1px, transparent 1px) 50% 50% / 24px 24px,
    var(--display);
  box-shadow: var(--ombra-pannello);
}
.segnale svg { width: 112px; height: 105px; overflow: visible; }
.segnale .tratto { fill: none; stroke: var(--sc-traccia); stroke-width: 11; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.segnale .punto { fill: var(--sc-punto); transform-box: fill-box; transform-origin: center; }
.segnale .eco { fill: none; stroke: var(--sc-punto); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }

/* ---------- Piede ---------- */

footer { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid var(--linea); color: var(--inchiostro-2); }
/* QVAD® bianco sul tema scuro, nero sul chiaro: piccolo e da solo */
.qvad { display: var(--mostra-notte); width: auto; height: 18px; }
.qvad.su-carta { display: var(--mostra-carta); }
.legale { font-size: 13px; }

/* ---------- Movimento (solo se il sistema non chiede di ridurlo) ---------- */

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .vivo::after { animation: scansione 9s var(--entrata-uscita) 1.2s 4; }

  /* Cambio di tema (sito.js, transizione di vista): il nuovo tema scende dall'alto come una scansione */
  ::view-transition-old(root),
  ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
  ::view-transition-new(root) { animation: tendina 0.75s var(--morbida); }

  .salta { transition: transform 0.25s var(--morbida); }
  a { transition: color 0.25s var(--morbida), text-shadow 0.3s var(--morbida); }
  .testata nav a { transition: color 0.25s var(--morbida), background-size 0.45s var(--morbida); }
  .tema,
  .rivedi { transition: border-color 0.25s var(--morbida), color 0.25s var(--morbida), box-shadow 0.3s var(--morbida); }
  .pulsante { transition: background-color 0.25s var(--morbida), color 0.25s var(--morbida), box-shadow 0.3s var(--morbida); }
  .tema .manopola { transition: transform 0.7s var(--molla); }
  .logo:hover .punto { animation: rimbalzo 0.6s var(--molla); }
  .stato .led { animation: respiro 2.4s var(--entrata-uscita) 0.6s 6; }

  /* Apertura: con JavaScript la scena resta coperta finché apertura.js non la prende in mano. Se lo script non
     arriva, dopo 2,5 s compare l'ultimo fotogramma scritto nell'HTML. */
  .js .palco:not(.pronto) .strato { visibility: hidden; animation: rete-palco 0s linear 2.5s forwards; }

  /* Le parti HTML dell'apertura: stessi tempi del kit, partono con la classe «gira» (apertura.js) */
  .palco.gira .didascalie { animation: sfuma-via 0.4s linear 2.3s both; }
  .palco.gira .didascalie span { animation: accendi 0.3s var(--morbida) both; }
  .palco.gira .didascalie span:nth-child(1) { animation-delay: 0.2s; }
  .palco.gira .didascalie span:nth-child(2) { animation-delay: 1s; }
  .palco.gira .didascalie span:nth-child(3) { animation-delay: 1.6s; }
  .palco.gira .firma b { animation: lettera 0.6s var(--morbida) both; }
  .palco.gira .firma b:nth-of-type(1) { animation-delay: 5.6s; }
  .palco.gira .firma b:nth-of-type(2) { animation-delay: 5.66s; }
  .palco.gira .firma b:nth-of-type(3) { animation-delay: 5.72s; }
  .palco.gira .firma b:nth-of-type(4) { animation-delay: 5.78s; }
  .palco.gira .firma b:nth-of-type(5) { animation-delay: 5.84s; }
  .palco.gira .sottotitolo { animation: compari 0.5s var(--morbida) 6.3s both; }
  /* Durante l'apertura il simbolo è quello animato dell'SVG; alla fine torna quello fermo, identico */
  .palco.gira .posto svg { visibility: hidden; }
  .palco.finito .posto .eco { animation: eco 2.4s var(--morbida) 0.5s 2; }

  /* Sezioni che entrano allo scorrimento: con JavaScript partono un po' più in basso e trasparenti, sito.js aggiunge
     «dentro» quando arrivano sullo schermo. Se sito.js non arriva, dopo 3 s si vedono comunque. */
  [data-entra]:not(.separatore) > * { transition: opacity 0.7s var(--morbida), transform 0.9s var(--morbida); }
  [data-entra] > :nth-child(2) { transition-delay: 0.08s; }
  [data-entra] > :nth-child(3) { transition-delay: 0.16s; }
  [data-entra] > :nth-child(4) { transition-delay: 0.24s; }
  .js [data-entra]:not(.dentro):not(.separatore) > * { opacity: 0; transform: translate3d(0, 22px, 0); }
  .js:not(.osserva) [data-entra]:not(.separatore) > * { animation: rete 0s linear 3s forwards; }

  .separatore path { transition: stroke-dashoffset 1.8s var(--morbida); }
  .separatore .sonda { transition: transform 0.6s var(--molla) 0.7s; }
  .js .separatore:not(.dentro) path { stroke-dashoffset: 1; }
  .js .separatore:not(.dentro) .sonda { transform: scale(0); }
  .js:not(.osserva) .separatore path { animation: rete-traccia 0s linear 3s forwards; }
  .js:not(.osserva) .separatore .sonda { animation: rete 0s linear 3s forwards; }
  .separatore.dentro .sonda { animation: rimbalzo 0.8s var(--molla) 1.4s; }

  .luce { transition: clip-path 1.3s var(--morbida) 0.15s; }
  .js [data-entra]:not(.dentro) .luce { clip-path: inset(0 100% 0 0); }
  .js:not(.osserva) .luce { animation: rete-luce 0s linear 3s forwards; }
  .cifre.fissa { animation: fissa 0.9s var(--morbida); }

  .canale::before { transition: transform 0.7s var(--molla) 0.25s; }
  .js .canale:not(.dentro)::before { transform: scale(0); }
  .js:not(.osserva) .canale::before { animation: rete 0s linear 3s forwards; }
  .canale .led { transition: transform 0.5s var(--molla) 0.45s; }
  .js .canale:not(.dentro) .led { transform: scale(0); }

  /* «In arrivo»: il simbolo Ω si disegna, il punto ambra compare con la molla e pulsa (otto volte, poi resta) */
  .segnale .tratto { animation: disegna 1.8s var(--morbida) 0.3s both; }
  .segnale .punto { animation: spunta 0.6s var(--molla) 1.7s both; }
  .segnale .eco { animation: eco 2.4s var(--morbida) 2.1s 8; }
}

@keyframes tendina {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}
@keyframes scansione {
  from { transform: translate3d(0, -24vh, 0); }
  to { transform: translate3d(0, 104vh, 0); }
}
@keyframes rete { to { opacity: 1; transform: none; } }
@keyframes rete-palco { to { visibility: visible; } }
@keyframes rete-traccia { to { stroke-dashoffset: 0; } }
@keyframes rete-luce { to { clip-path: inset(0 var(--resto) 0 0); } }
@keyframes sfuma-via {
  from { opacity: 1; }
  to { opacity: 0; }
}
@keyframes accendi {
  from { opacity: 0.18; }
  to { opacity: 1; }
}
@keyframes lettera {
  from { opacity: 0; transform: translateY(0.6em); }
  to { opacity: 1; transform: none; }
}
@keyframes compari {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes disegna {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes spunta {
  from { transform: scale(0); }
  to { transform: scale(1); }
}
@keyframes eco {
  from { opacity: 0.9; transform: scale(1); stroke-width: 2; }
  to { opacity: 0; transform: scale(5); stroke-width: 0.4; }
}
@keyframes rimbalzo {
  0% { transform: scale(1); }
  40% { transform: scale(1.5); }
  100% { transform: scale(1); }
}
@keyframes respiro {
  0%,
  100% { opacity: 1; }
  50% { opacity: 0.35; }
}
@keyframes fissa {
  from { text-shadow: 0 0 26px var(--sc-lettura); }
  to { text-shadow: var(--bagliore-lettura); }
}

/* «Riduci movimento»: niente animazioni né transizioni, ogni cosa al suo stato finale */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after { animation: none !important; transition: none !important; }
}
