/* Sito di Sara — stile comune. Identità «Segnale» (scelta di Giorgio, 27/9):
   nero profondo, luce elettrica chartreuse, Geist e Geist Mono, logo con il LED. */

@font-face {
  font-family: "Geist";
  src: url("../font/geist-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Geist Mono";
  src: url("../font/geist-mono-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --notte: #07090b;
  --luce: #c8f53c;
  --su-luce: #0b0d05;

  --carta: #f1f2ee;
  --superficie: #ffffff;
  --superficie-2: #e6e8e2;
  --inchiostro: #0c0e0c;
  --tenue: #5a605b;
  --linea: #d9dcd4;
  --accento: #c8f53c;
  --accento-forte: #b6e62a;
  --accento-tenue: #eef8d2;
  --su-accento: #0b0d05;
  --evidenza: #c8f53c;
  --avviso: #f6f1dc;
  --su-avviso: #5a4a0c;

  --titoli: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --testo: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --raggio: 22px;
  --ombra: 0 1px 2px rgb(0 0 0 / 0.04), 0 18px 40px -18px rgb(0 0 0 / 0.22);
  --margine: clamp(16px, 5vw, 40px);
  --largo: 1200px;
  --sezione: clamp(88px, 13vw, 168px);
  --curva: cubic-bezier(0.2, 0.7, 0.2, 1);
  --lenta: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --carta: #0b0e10;
    --superficie: #12161a;
    --superficie-2: #1a1f24;
    --inchiostro: #eef0ea;
    --tenue: #939a95;
    --linea: rgb(255 255 255 / 0.1);
    --accento-tenue: rgb(200 245 60 / 0.12);
    --avviso: rgb(200 245 60 / 0.08);
    --su-avviso: #e4f5b4;
    --ombra: 0 1px 2px rgb(0 0 0 / 0.3), 0 18px 40px -18px rgb(0 0 0 / 0.7);
  }
}
/* Zone di notte: sempre scure, con gli stessi nomi di colore. */
.notte {
  --carta: #07090b;
  --superficie: #0f1215;
  --superficie-2: #171b1f;
  --inchiostro: #eef0ea;
  --tenue: #8b928d;
  --linea: rgb(255 255 255 / 0.09);
  --accento-tenue: rgb(200 245 60 / 0.12);
  --avviso: rgb(200 245 60 / 0.08);
  --su-avviso: #e4f5b4;
  background: var(--carta);
  color: var(--inchiostro);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--carta);
  color: var(--inchiostro);
  font-family: var(--testo);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: 0.22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--luce); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--luce); color: var(--su-luce); }

h1, h2, h3 { font-family: var(--titoli); font-weight: 600; letter-spacing: -0.045em; line-height: 0.98; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(2.7rem, 1.2rem + 6.6vw, 6.4rem); }
h2 { font-size: clamp(2.2rem, 1.2rem + 4.4vw, 4.8rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + 0.7vw, 1.6rem); letter-spacing: -0.025em; line-height: 1.15; }
p { margin: 0; text-wrap: pretty; }
/* La parola chiave: luce elettrica sul nero, evidenziatore sul chiaro */
.notte h1 em, .notte h2 em { font-style: normal; color: var(--luce); }
h1 em, h2 em { font-style: normal; background: linear-gradient(transparent 60%, var(--evidenza) 60%, var(--evidenza) 92%, transparent 92%); padding-inline: 0.04em; }
@media (prefers-color-scheme: dark) { h1 em, h2 em { background: none; color: var(--luce); } }
.notte h1 em, .notte h2 em { background: none; }

.contenitore { width: min(100% - 2 * var(--margine), var(--largo)); margin-inline: auto; }
.solo-lettori { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.salta { position: absolute; left: 12px; top: -100px; z-index: 100; background: var(--luce); color: var(--su-luce); padding: 10px 16px; border-radius: 10px; }
.salta:focus { top: 12px; }

/* Etichetta tecnica, in Geist Mono */
.occhiello {
  display: inline-flex; align-items: center; gap: 10px;
  margin-bottom: 22px;
  font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--tenue);
}
.occhiello::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--luce); box-shadow: 0 0 10px rgb(200 245 60 / 0.8); }

/* Segnaposto per ciò che non è ancora deciso: si vede, e non va in produzione. */
.da-chiedere {
  display: inline-block; padding: 0.1em 0.6em;
  border: 1.5px dashed currentColor; border-radius: 8px;
  background: var(--avviso); color: var(--su-avviso);
  font-family: var(--mono); font-size: 0.75rem; font-weight: 600; line-height: 1.6; letter-spacing: 0;
}
.da-chiedere::before { content: "da chiedere · "; font-weight: 700; }

/* Pulsanti */
.pulsante {
  --bg: var(--luce); --fg: var(--su-luce);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  min-height: 54px; padding: 0 1.5em;
  border: 0; border-radius: 999px;
  background: var(--bg); color: var(--fg);
  font: 600 1rem/1 var(--testo); letter-spacing: -0.01em;
  text-decoration: none; cursor: pointer;
  transition: transform 0.25s var(--curva), background-color 0.2s, box-shadow 0.3s;
  -webkit-tap-highlight-color: transparent;
}
.pulsante:hover { --bg: #d6ff55; text-decoration: none; box-shadow: 0 10px 34px -10px rgb(200 245 60 / 0.6); }
.pulsante:active { transform: scale(0.97); }
.pulsante svg { width: 1.1em; height: 1.1em; transition: transform 0.25s var(--curva); }
.pulsante:hover svg { transform: translateX(3px); }
.pulsante-secondario { --bg: transparent; --fg: var(--inchiostro); box-shadow: inset 0 0 0 1.5px var(--linea); }
.pulsante-secondario:hover { --bg: transparent; box-shadow: inset 0 0 0 1.5px var(--inchiostro); }
.pulsante-scuro { --bg: var(--inchiostro); --fg: var(--carta); }
.pulsante-scuro:hover { --bg: var(--inchiostro); box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.5); }
.pulsante[disabled] { opacity: 0.45; cursor: not-allowed; transform: none; }
.azioni { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
@media (max-width: 480px) { .azioni .pulsante { flex: 1 1 100%; } }

/* Marchio: «sara» e il LED di segnale */
.marchio { display: inline-flex; align-items: center; gap: 10px; font-family: var(--titoli); font-size: 1.4rem; font-weight: 600; letter-spacing: -0.05em; text-decoration: none; }
.led { position: relative; width: 11px; height: 11px; flex: none; border-radius: 50%; background: var(--luce); box-shadow: 0 0 0 4px rgb(200 245 60 / 0.16), 0 0 16px rgb(200 245 60 / 0.9); }
.led::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid rgb(200 245 60 / 0.6); animation: led 2.8s var(--lenta) infinite; }
@keyframes led { from { transform: scale(0.6); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

/* Testata */
.testata {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--carta) 80%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(16px); backdrop-filter: saturate(1.4) blur(16px);
  border-bottom: 1px solid transparent;
  transition: background-color 0.5s, color 0.5s, border-color 0.3s;
}
.testata.staccata { border-bottom-color: var(--linea); }
.testata .contenitore { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
.testata nav { display: flex; align-items: center; gap: 30px; }
.testata nav a:not(.pulsante) { font-size: 0.9375rem; font-weight: 500; text-decoration: none; color: var(--tenue); transition: color 0.2s; }
.testata nav a:not(.pulsante):hover { color: var(--inchiostro); }
.testata .pulsante { min-height: 42px; padding: 0 1.15em; font-size: 0.9375rem; }
@media (max-width: 820px) { .testata nav a:not(.pulsante) { display: none; } }

/* Sezioni */
.sezione { padding-block: var(--sezione); }
.intro { max-width: 46rem; }
.intro p { margin-top: 22px; font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.3rem); color: var(--tenue); }

/* Elenchi con segno */
.elenco { display: grid; gap: 16px; margin: 0; padding: 0; list-style: none; }
.elenco li { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start; }
.elenco li::before { content: ""; width: 26px; height: 26px; margin-top: 1px; border-radius: 8px; background: var(--accento-tenue); }
.elenco li::after {
  content: ""; position: absolute; left: 6px; top: 7px; width: 14px; height: 14px; background: var(--inchiostro);
  -webkit-mask: var(--icona) center / contain no-repeat; mask: var(--icona) center / contain no-repeat;
}
.notte .elenco li::after { background: var(--luce); }
.elenco.si li { --icona: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.elenco.no li { --icona: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 12h12'/%3E%3C/svg%3E"); }
.elenco.no li::before { background: var(--superficie-2); }
.elenco.no li::after { background: var(--tenue); }
.elenco small { display: block; margin-top: 3px; color: var(--tenue); font-size: 0.9375rem; line-height: 1.5; }

/* Domande */
.domande { margin-top: 48px; border-top: 1px solid var(--linea); }
.domande details { border-bottom: 1px solid var(--linea); }
.domande summary {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding: 24px 0; cursor: pointer; list-style: none;
  font-family: var(--titoli); font-size: clamp(1.125rem, 1rem + 0.6vw, 1.45rem); font-weight: 600; letter-spacing: -0.025em; line-height: 1.25;
}
.domande summary::-webkit-details-marker { display: none; }
.domande summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--superficie-2); font-family: var(--mono); font-weight: 400; font-size: 1.1rem;
  transition: transform 0.35s var(--lenta), background-color 0.2s;
}
.domande details[open] summary::after { transform: rotate(45deg); background: var(--luce); color: var(--su-luce); }
.domande .risposta { padding: 0 0 28px; max-width: 48rem; color: var(--tenue); }
.domande .risposta p + p, .domande .risposta ul { margin-top: 10px; }
.domande .risposta ul { padding-left: 1.2em; }
.domande .risposta li + li { margin-top: 4px; }

/* Modulo */
.modulo-griglia { display: grid; gap: 40px; }
@media (min-width: 960px) { .modulo-griglia { grid-template-columns: 0.9fr 1.1fr; gap: 80px; align-items: start; } }
.modulo { padding: clamp(24px, 4vw, 40px); border-radius: 28px; background: var(--superficie); box-shadow: var(--ombra), 0 0 0 1px var(--linea); }
.campo + .campo { margin-top: 18px; }
.campo label { display: block; margin-bottom: 8px; font-size: 0.9375rem; font-weight: 600; }
.campo .aiuto { display: block; margin-top: 6px; font-size: 0.8125rem; color: var(--tenue); }
.campo input {
  width: 100%; min-height: 56px; padding: 0 16px;
  border: 1.5px solid var(--linea); border-radius: 14px;
  background: var(--carta); color: var(--inchiostro);
  font: 400 1.0625rem var(--testo);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.campo input:focus { outline: none; border-color: var(--inchiostro); box-shadow: 0 0 0 4px var(--accento-tenue); }
.campo input[aria-invalid="true"] { border-color: #c4452f; }
.consenso { display: grid; grid-template-columns: 24px 1fr; gap: 12px; margin-top: 24px; font-size: 0.9375rem; line-height: 1.5; cursor: pointer; }
.consenso input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: #0c0e0c; cursor: pointer; }
.trappola { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.modulo .pulsante { width: 100%; margin-top: 28px; }
.esito { margin-top: 16px; padding: 14px 16px; border-radius: 14px; font-size: 0.9375rem; }
.esito:empty { display: none; }
.esito.ok { background: var(--accento-tenue); }
.esito.errore { background: #fbe3dc; color: #6b1f10; }

/* Piè di pagina */
.piede { padding-block: 72px 40px; font-size: 0.9375rem; color: var(--tenue); }
.piede .contenitore { display: grid; gap: 32px; }
@media (min-width: 860px) { .piede .contenitore { grid-template-columns: 1.4fr 1fr 1fr; } }
.piede .marchio { color: var(--inchiostro); }
.piede-descrizione { margin-top: 16px; max-width: 22rem; }
.piede h2 { margin-bottom: 12px; font-family: var(--mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--inchiostro); line-height: 1.4; }
.piede ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.piede p + p { margin-top: 8px; }
.piede .fondo { grid-column: 1 / -1; padding-top: 24px; border-top: 1px solid var(--linea); font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.02em; }

/* Pagine di testo (privacy, 404) */
.pagina-testo { padding-block: clamp(48px, 8vw, 96px) var(--sezione); }
.pagina-testo .contenitore { max-width: 48rem; }
.pagina-testo h1 { font-size: clamp(2.4rem, 1.5rem + 4vw, 4.4rem); }
.pagina-testo .aggiornata { margin-top: 16px; color: var(--tenue); font-size: 0.9375rem; }
.pagina-testo h2 { margin: 60px 0 16px; font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.2rem); }
.pagina-testo h3 { margin: 28px 0 8px; font-size: 1.1875rem; }
.pagina-testo p, .pagina-testo ul { margin-top: 12px; }
.pagina-testo ul { padding-left: 1.25em; }
.pagina-testo li + li { margin-top: 6px; }
.pagina-testo .riquadro-nota { margin-top: 32px; padding: 18px 20px; border-radius: 16px; background: var(--avviso); color: var(--su-avviso); font-size: 0.9375rem; }
.pagina-404 { min-height: 100vh; min-height: 100dvh; display: grid; align-items: center; }

/* Comparsa morbida allo scorrimento (privacy): sito.js nasconde solo ciò che è sotto lo schermo */
.appare { transition: opacity 0.9s var(--lenta), transform 0.9s var(--lenta); }
.appare.nascosto { opacity: 0; transform: translateY(20px); }

/* Transizione morbida fra le pagine (home ↔ demo), niente flash bianco */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.45s; animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .appare.nascosto { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
