/* ==========================================================================
   SimuData — landing page
   Design system: ledger grid + branching scenario diagram as recurring motif.
   Type: Fraunces (display, research/editorial register) + IBM Plex Sans (body)
         + IBM Plex Mono (data, identifiers, tabular figures — the "ledger" voice).
   ========================================================================== */

/* --- Self-hosted fonts (GDPR: nessuna chiamata a Google Fonts) --- */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/fraunces-500-latin-ext.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;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/fraunces-500-latin.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: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/fraunces-600-latin-ext.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;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/fraunces-600-latin.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: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/fraunces-700-latin-ext.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;
}
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('assets/fonts/fraunces-700-latin.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/plexsans-400-latin-ext.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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/plexsans-400-latin.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/plexsans-500-latin-ext.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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/plexsans-500-latin.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: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/plexsans-600-latin-ext.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;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/plexsans-600-latin.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/plexmono-400-latin-ext.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;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/plexmono-400-latin.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: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/plexmono-500-latin-ext.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;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('assets/fonts/plexmono-500-latin.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;
}


:root {
  /* --- Brand tokens (light) --- */
  --ink: #0b1f33;       /* navy — primary text, headline */
  --signal: #00a6a6;    /* teal — accent, links, CTA, "balanced" mark */
  --slate: #2e3a46;     /* graphite — secondary text */
  --paper: #f6f9fb;     /* light ground */
  --rule: #cbd5df;      /* hairlines, ledger grid lines */
  --surface: #ffffff;   /* card / raised surface on paper */
  --surface-2: #eef3f6; /* subtle recessed surface (form, code) */

  /* Semantic posture colors — used only inside the scenario diagram and
     small posture tags, never as UI chrome or the page accent. */
  --posture-stable: var(--ink);
  --posture-growth: var(--signal);
  --posture-risk: #b54834;

  --focus-ring: 0 0 0 3px rgba(0, 166, 166, 0.35);

  /* --- Type --- */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --step-caption: clamp(0.75rem, 0.72rem + 0.15vw, 0.8125rem);
  --step-body: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-lead: clamp(1.15rem, 1.05rem + 0.5vw, 1.375rem);
  --step-h3: clamp(1.35rem, 1.2rem + 0.75vw, 1.75rem);
  --step-h2: clamp(1.9rem, 1.6rem + 1.5vw, 2.75rem);
  --step-h1: clamp(2.6rem, 2.05rem + 2.75vw, 4.25rem);

  --container: 1180px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 3px;

  color-scheme: light;
}

/* Registrazione tipata dei token colore: senza @property i browser trattano
   le custom property come non interpolabili, e le transition su background/
   color che referenziano var(--paper) ecc. restano bloccate al primo valore
   invece di seguire il cambio tema (bug osservato su body al toggle). */
@property --ink {
  syntax: '<color>';
  inherits: true;
  initial-value: #0b1f33;
}
@property --signal {
  syntax: '<color>';
  inherits: true;
  initial-value: #00a6a6;
}
@property --slate {
  syntax: '<color>';
  inherits: true;
  initial-value: #2e3a46;
}
@property --paper {
  syntax: '<color>';
  inherits: true;
  initial-value: #f6f9fb;
}
@property --rule {
  syntax: '<color>';
  inherits: true;
  initial-value: #cbd5df;
}
@property --surface {
  syntax: '<color>';
  inherits: true;
  initial-value: #ffffff;
}
@property --surface-2 {
  syntax: '<color>';
  inherits: true;
  initial-value: #eef3f6;
}
@property --posture-stable {
  syntax: '<color>';
  inherits: true;
  initial-value: #0b1f33;
}
@property --posture-growth {
  syntax: '<color>';
  inherits: true;
  initial-value: #00a6a6;
}
@property --posture-risk {
  syntax: '<color>';
  inherits: true;
  initial-value: #b54834;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #eef3f7;
    --signal: #2fd0cd;
    --slate: #aab8c4;
    --paper: #081119;
    --rule: #24384a;
    --surface: #0e1c2b;
    --surface-2: #0b1622;
    --posture-stable: #eef3f7;
    --posture-growth: #2fd0cd;
    --posture-risk: #d97a5f;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --ink: #eef3f7;
  --signal: #2fd0cd;
  --slate: #aab8c4;
  --paper: #081119;
  --rule: #24384a;
  --surface: #0e1c2b;
  --surface-2: #0b1622;
  --posture-stable: #eef3f7;
  --posture-growth: #2fd0cd;
  --posture-risk: #d97a5f;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --ink: #0b1f33;
  --signal: #00a6a6;
  --slate: #2e3a46;
  --paper: #f6f9fb;
  --rule: #cbd5df;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --posture-stable: var(--ink);
  --posture-growth: var(--signal);
  --posture-risk: #b54834;
  color-scheme: light;
}

/* --- Reset --- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s ease, color 0.3s ease;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--signal);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  font-weight: 600;
  text-wrap: balance;
  letter-spacing: -0.01em;
}

p {
  margin: 0;
  max-width: 62ch;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--step-caption);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--signal);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}

.eyebrow::before {
  content: "";
  width: 1.4em;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 0.9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand__icon {
  width: 28px;
  height: 28px;
}

.brand__word {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
}

.brand__word em {
  font-style: normal;
  color: var(--signal);
}

.site-header nav {
  display: flex;
  flex-wrap: wrap;
  row-gap: 0.5rem;
  align-items: center;
  gap: clamp(1rem, 3vw, 2rem);
}

.nav-link {
  font-size: 0.9375rem;
  color: var(--slate);
  text-decoration: none;
}

.nav-link:hover {
  color: var(--ink);
}

/* --- Menu mobile --- */

.mobile-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.mobile-nav-toggle svg {
  width: 20px;
  height: 20px;
}

.mobile-nav-toggle:hover {
  border-color: var(--signal);
  color: var(--signal);
}

@media (max-width: 719px) {
  .mobile-nav-toggle {
    display: inline-flex;
  }

  .site-header nav.site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  }

  .site-header nav.site-nav.site-nav--open {
    display: flex;
  }

  .site-nav .nav-link {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--rule);
  }

  .site-nav .btn,
  .site-nav .theme-toggle {
    width: 100%;
    justify-content: center;
  }
}

.theme-toggle {
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.theme-toggle svg {
  width: 16px;
  height: 16px;
}

/* ==========================================================================
   Buttons + form controls — sharp, ledger-flat, no pill shapes
   ========================================================================== */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  padding: 0.8rem 1.5rem;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--ink);
  color: var(--paper);
}

.btn--primary:hover {
  background: var(--signal);
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  border-color: var(--rule);
  color: var(--ink);
}

.btn--ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
}

.btn--small {
  padding: 0.6rem 1.1rem;
  font-size: 0.85rem;
}

.btn--danger {
  color: var(--posture-risk);
}

.btn--danger:hover {
  border-color: var(--posture-risk);
  color: var(--posture-risk);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}

.hero__ledger {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--rule) 1px, transparent 1px),
    linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.35;
  mask-image: linear-gradient(to bottom, black, transparent 85%);
  pointer-events: none;
}

.hero .container {
  position: relative;
  padding-block: clamp(3rem, 8vw, 6.5rem) clamp(2.5rem, 6vw, 4.5rem);
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 980px) {
  .hero .container {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
  }
}

/* Variante senza diagramma (login.php): una sola colonna, più compatta —
   descrizione breve, niente meccanismo esposto. */
.hero--solo .container {
  padding-block: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 5vw, 3rem);
}

@media (min-width: 980px) {
  .hero--solo .container {
    grid-template-columns: 1fr;
    max-width: 62ch;
  }
}

.hero__copy {
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.hero h1 {
  font-size: var(--step-h1);
  line-height: 1.05;
}

.hero h1 .accent {
  color: var(--signal);
}

.hero__lead {
  font-family: var(--font-body);
  font-size: var(--step-lead);
  color: var(--slate);
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.hero__spec {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.6rem;
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.hero__spec div {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
}

.hero__spec strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 600;
}

/* --- Scenario diagram --- */

.diagram {
  position: relative;
}

.diagram__frame {
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 2rem);
}

.diagram__caption {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--slate);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.diagram svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.diagram .path-line {
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-dasharray: 300;
  stroke-dashoffset: 300;
}

.diagram.is-drawn .path-line {
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.diagram.is-drawn .path-stable {
  stroke-dashoffset: 0;
  transition-delay: 0.15s;
}

.diagram.is-drawn .path-growth {
  stroke-dashoffset: 0;
  transition-delay: 0.35s;
}

.diagram.is-drawn .path-risk {
  stroke-dashoffset: 0;
  transition-delay: 0.55s;
}

.diagram .node-root {
  opacity: 0;
  transform: scale(0.6);
  transform-origin: center;
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.diagram.is-drawn .node-root {
  opacity: 1;
  transform: scale(1);
}

.diagram .tag {
  opacity: 0;
  transition: opacity 0.4s ease;
}

.diagram.is-drawn .tag-stable {
  opacity: 1;
  transition-delay: 1.1s;
}

.diagram.is-drawn .tag-growth {
  opacity: 1;
  transition-delay: 1.25s;
}

.diagram.is-drawn .tag-risk {
  opacity: 1;
  transition-delay: 1.4s;
}

.diagram text {
  font-family: var(--font-mono);
}

.diagram__legend {
  list-style: none;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 1rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px dashed var(--rule);
}

.diagram__legend li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--slate);
}

.diagram__legend strong {
  color: var(--ink);
}

.diagram__legend i {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  margin-top: 0.35em;
  border-radius: 1px;
  display: inline-block;
}

/* ==========================================================================
   Section rhythm
   ========================================================================== */

section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
  border-bottom: 1px solid var(--rule);
}

section:last-of-type {
  border-bottom: none;
}

.section-head {
  max-width: 58ch;
  margin-bottom: clamp(2rem, 5vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.section-head h2 {
  font-size: var(--step-h2);
  line-height: 1.1;
}

.section-head p {
  color: var(--slate);
  font-size: var(--step-lead);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Problem section --- */

.problem-grid {
  display: grid;
  gap: 1px;
  background: var(--rule);
  border: 1px solid var(--rule);
}

@media (min-width: 780px) {
  .problem-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.problem-grid__item {
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.problem-grid__item .glyph {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--signal);
  letter-spacing: 0.08em;
}

.problem-grid__item h3 {
  font-size: var(--step-h3);
}

.problem-grid__item p {
  color: var(--slate);
}

/* --- Audience cards --- */

.audience-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 780px) {
  .audience-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.audience-card {
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  border-radius: var(--radius);
}

.audience-card__stage {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  border: 1px solid var(--rule);
  align-self: flex-start;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.audience-card h3 {
  font-size: var(--step-h3);
}

.audience-card p {
  color: var(--slate);
  font-size: 0.95rem;
}

/* --- Rigor / audit section --- */

.rigor {
  background: var(--surface-2);
}

.trust-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.trust-tags li {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink);
  border: 1px solid var(--rule);
  background: var(--surface);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
}

.quality-card {
  margin-top: 2rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.quality-card th,
.quality-card td {
  text-align: left;
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--rule);
}

.quality-card th {
  font-weight: 500;
  color: var(--slate);
}

.quality-card td {
  font-family: var(--font-mono);
  color: var(--ink);
  white-space: nowrap;
}

/* --- Process (Come funziona) --- */

.process-flow {
  list-style: none;
  margin: 0 0 2.5rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
}

.process-flow li {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.5rem 0.9rem;
}

.process-flow li:not(:last-child)::after {
  content: "↓";
  display: block;
  margin: 0.3rem 0 -0.1rem;
  color: var(--slate);
  font-family: var(--font-mono);
}

.process-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 780px) {
  .process-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.process-card {
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.process-card .glyph {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--signal);
  letter-spacing: 0.08em;
}

.process-card h3 {
  font-size: 1.1rem;
}

.process-card p {
  color: var(--slate);
  font-size: 0.9rem;
}

/* --- Output ("Cosa ricevi") --- */

.output-grid__list {
  margin: 0;
  max-width: 62ch;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.output-grid__list dt {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
}

.output-grid__list dd {
  margin: 0;
  color: var(--slate);
  font-size: 0.92rem;
}

/* --- Limiti ("cosa è / cosa non è") --- */

.limits-grid {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 780px) {
  .limits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.limits-grid__col {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.5rem, 3vw, 2rem);
}

.limits-grid__col h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.limits-grid__col ul {
  margin: 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.limits-grid__col li {
  color: var(--slate);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* --- CTA finale --- */

.final-cta {
  background: var(--surface-2);
}

.final-cta__checklist {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.final-cta__inner {
  max-width: 62ch;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.final-cta__inner h2 {
  font-size: var(--step-h2);
}

.final-cta__inner p {
  color: var(--slate);
  font-size: var(--step-lead);
}

.final-cta__actions {
  margin-top: 0.5rem;
}

.final-cta__note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
}

/* --- Waitlist --- */

.waitlist {
  position: relative;
}

.waitlist-layout {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 980px) {
  .waitlist-layout {
    grid-template-columns: 0.9fr 1.1fr;
  }
}

.waitlist-copy h2 {
  font-size: var(--step-h2);
  margin-bottom: 1rem;
}

.waitlist-copy p {
  color: var(--slate);
  font-size: var(--step-lead);
}

.waitlist-copy .eyebrow {
  margin-bottom: 1rem;
}

form.ledger-form {
  border: 1px solid var(--rule);
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
}

.ledger-form fieldset {
  border: none;
  margin: 0;
  padding: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr;
  border-bottom: 1px solid var(--rule);
}

@media (min-width: 620px) {
  .field-row--split {
    grid-template-columns: 1fr 1fr;
  }
  .field-row--split .field:first-child {
    border-right: 1px solid var(--rule);
  }
}

.field {
  display: flex;
  flex-direction: column;
  padding: 1rem 1.35rem;
}

.field label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 0.4rem;
}

.field input,
.field select,
.field textarea {
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.15rem 0;
}

.field textarea {
  resize: vertical;
  min-height: 4.5em;
}

.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--slate) 65%, transparent);
}

.field select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M4 6l4 4 4-4' stroke='%232E3A46' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 0 center;
  padding-right: 1.4rem;
  cursor: pointer;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
}

.field:focus-within {
  background: var(--surface-2);
}

.consent-row {
  padding: 1rem 1.35rem;
}

.consent-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--slate);
  line-height: 1.5;
}

.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 0.2rem;
  width: 1rem;
  height: 1rem;
  accent-color: var(--signal);
}

.consent-label a {
  color: var(--ink);
}

.ledger-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.1rem 1.35rem;
  background: var(--surface-2);
}

.ledger-form__hint {
  font-size: 0.8rem;
  color: var(--slate);
  max-width: 34ch;
}

.form-status {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: none;
}

.form-status.is-success {
  display: block;
  color: var(--signal);
}

.form-status.is-error {
  display: block;
  color: var(--posture-risk);
}

.ledger-form.is-sent fieldset {
  display: none;
}

.ledger-form__success {
  display: none;
  padding: 2.25rem 1.5rem;
  text-align: center;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.ledger-form.is-sent .ledger-form__success {
  display: flex;
}

.ledger-form__success strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.ledger-form__success span {
  color: var(--slate);
  font-size: 0.9rem;
  max-width: 40ch;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  padding-block: 2.5rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer .brand {
  opacity: 0.9;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--slate);
}

.footer-meta a {
  color: var(--slate);
  text-decoration: none;
}

.footer-meta a:hover {
  color: var(--signal);
}

/* ==========================================================================
   Utility
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden-focusable:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* Honeypot anti-spam: nascosto ai visitatori reali e agli screen reader
   (a differenza di .sr-only, che li mantiene annunciati e navigabili). */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ==========================================================================
   Legal / long-form text pages (privacy, ecc.)
   ========================================================================== */

.legal-page {
  padding-block: 3rem 5rem;
  max-width: 72ch;
  margin-inline: auto;
}

.legal-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  text-decoration: none;
  margin-bottom: 2rem;
}

.legal-page .back-link:hover {
  color: var(--signal);
}

.legal-page h1 {
  font-size: var(--step-h2);
  margin-bottom: 0.5rem;
}

.legal-page .legal-updated {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--slate);
  margin-bottom: 2.5rem;
  display: block;
}

.legal-page h2 {
  font-size: var(--step-h3);
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.legal-page p,
.legal-page li {
  max-width: none;
  color: var(--slate);
  font-size: var(--step-body);
  line-height: 1.65;
}

.legal-page p {
  margin-bottom: 1rem;
}

.legal-page ul {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.legal-page li {
  margin-bottom: 0.4rem;
}

.legal-page strong {
  color: var(--ink);
}

.legal-page .legal-todo {
  color: var(--posture-risk);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

/* ==========================================================================
   Admin panel
   ========================================================================== */

.admin-page {
  padding-block: 3rem 5rem;
}

.admin-page h1 {
  font-size: var(--step-h2);
  margin-top: 0.5rem;
}

.admin-page__lead {
  color: var(--slate);
  max-width: 60ch;
  margin-top: 0.75rem;
}

.admin-empty {
  color: var(--slate);
  margin-top: 2rem;
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

.admin-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rule);
}

.admin-section h2 {
  font-size: var(--step-h3);
  margin-top: 0.4rem;
}

.admin-section .admin-page__lead {
  margin-top: 0.5rem;
}

.admin-section-table-wrap {
  overflow-x: auto;
}

.admin-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.35rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
}

.admin-card--accepted,
.admin-card--rejected {
  opacity: 0.7;
}

.admin-card__actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-card__email-opt {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  color: var(--slate);
  cursor: pointer;
}

.admin-card__email-opt input[type="checkbox"] {
  accent-color: var(--signal);
}

.admin-card__main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-card__main strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}

.admin-card__email {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--signal);
}

.admin-card__meta {
  font-size: 0.82rem;
  color: var(--slate);
}

.admin-card__meta--faint {
  opacity: 0.7;
}

.admin-card__use-case {
  margin: 0.4rem 0 0;
  padding: 0.5rem 0.65rem;
  max-width: 52ch;
  font-family: var(--font-body);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--slate);
  background: var(--surface-2);
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-break: break-word;
}

.admin-card__action {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-status {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
}

.admin-status--rejected {
  color: var(--posture-risk);
}

.admin-code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  color: var(--ink);
}

.admin-code--big {
  display: inline-block;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  padding: 0.5rem 0.9rem;
  margin: 0.4rem 0;
}

/* Banner "codice generato": mostrato una sola volta dopo l'emissione. */
.admin-issued {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.1rem 1.35rem;
  margin: 1.5rem 0;
  border: 1px solid var(--signal);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--signal) 8%, var(--surface));
}

.admin-issued strong {
  font-family: var(--font-display);
  color: var(--ink);
}

.admin-issued span {
  font-size: 0.85rem;
  color: var(--slate);
}

/* Form di generazione codice manuale. */
.admin-manual {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin: 1.5rem 0 2rem;
}

.admin-manual input {
  flex: 1 1 260px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.admin-manual input:focus {
  outline: none;
  border-color: var(--signal);
}

/* ==========================================================================
   Login gate
   ========================================================================== */

.login-error {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--posture-risk);
  margin: 0 0 1rem;
}

.admin-notice {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--signal);
  margin: 0 0 1rem;
}

/* ==========================================================================
   Sezione 2 di login.php: "Accedi" (codice già posseduto)
   ========================================================================== */

.access-layout {
  display: grid;
  gap: clamp(2.5rem, 6vw, 4rem);
}

@media (min-width: 980px) {
  .access-layout {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: center;
  }
}

.access-copy h2 {
  font-size: var(--step-h2);
  margin-bottom: 1rem;
}

.access-copy p {
  color: var(--slate);
  font-size: var(--step-lead);
}

.access-copy .eyebrow {
  margin-bottom: 1rem;
}

/* ==========================================================================
   Sezione 4 di login.php: FAQ
   ========================================================================== */

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 72ch;
}

.faq-item {
  /* Bordo piu' marcato del semplice hairline (var(--rule)): sulle card FAQ
     deve restare ben visibile anche in tema scuro, dove var(--rule) ha poco
     contrasto contro var(--surface). */
  border: 1px solid color-mix(in srgb, var(--slate) 35%, transparent);
  border-radius: var(--radius);
  background: var(--surface);
}

.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1rem 1.35rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--signal);
  flex-shrink: 0;
}

.faq-item[open] summary::after {
  content: "\2212";
}

.faq-item summary:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: -2px;
}

.faq-item p {
  margin: 0;
  padding: 0 1.35rem 1.1rem;
  color: var(--slate);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ==========================================================================
   Cookie banner — solo cookie tecnici, nessun opt-out necessario ma
   comunque presentato e dismissibile in modo persistente (localStorage).
   ========================================================================== */

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 640px;
  margin-inline: auto;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.cookie-banner p {
  margin: 0;
  max-width: none;
  flex: 1 1 320px;
  font-size: 0.82rem;
  color: var(--slate);
}

.cookie-banner a {
  color: var(--ink);
}

.cookie-banner button {
  flex-shrink: 0;
}
