/* ═══════════════════════════════════════════════════════════════════════
   VECTOOR — sito commerciale
   Editorial italiana · carta calda · serif espressivo · rosso italia
   Riferimenti: Domus, Casabella, Pirelli Magazine, Olivetti, Vignelli, Munari

   Token semantici: --paper è SEMPRE lo sfondo, --ink è SEMPRE il testo.
   Il tema dark inverte i valori, non i nomi → nessuna regola duplicata.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─── Tema chiaro (default) ──────────────────────────────────────────── */
:root {
  --paper:      #FAF7F0;
  --cream:      #F5EEDC;
  --cream-2:    #EFE6D1;
  --ink:        #1A1612;
  --ink-soft:   #4A413A;
  --ink-faint:  #8B8378;
  --rosso:      #BE2A2A;
  --rosso-dark: #8B1A1A;
  --navy:       #1F2E4D;
  --giallo:     #E8B339;

  --rule:       #1A1612;
  --rule-soft:  rgba(26, 22, 18, 0.12);
  --nav-bg:     rgba(250, 247, 240, 0.78);
  --grain:      0.4;
  --shadow:     0 24px 60px -20px rgba(26, 22, 18, 0.15);

  /* Inverse: blocchi che ribaltano il contrasto (feature scure, footer) */
  --inverse-bg:   #1A1612;
  --inverse-fg:   #F5EEDC;

  --serif: 'Fraunces', 'GT Sectra', 'Tiempos Headline', Georgia, serif;
  --sans:  'Hanken Grotesk', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  --tx-snap: cubic-bezier(0.83, 0, 0.17, 1);
  --tx-soft: cubic-bezier(0.22, 1, 0.36, 1);

  --gutter: 80px;
  color-scheme: light;
}

/* ─── Tema scuro ─────────────────────────────────────────────────────── */
:root[data-theme='dark'] {
  --paper:      #14120F;
  --cream:      #1C1915;
  --cream-2:    #24201A;
  --ink:        #F0E9DA;
  --ink-soft:   #BAB0A0;
  --ink-faint:  #7C7466;
  --rosso:      #E2564F;
  --rosso-dark: #B33A34;
  --navy:       #8FA8D4;
  --giallo:     #F0C462;

  --rule:       #F0E9DA;
  --rule-soft:  rgba(240, 233, 218, 0.14);
  --nav-bg:     rgba(20, 18, 15, 0.8);
  --grain:      0.22;
  --shadow:     0 24px 60px -20px rgba(0, 0, 0, 0.6);

  --inverse-bg: #F5EEDC;
  --inverse-fg: #14120F;
  color-scheme: dark;
}

/* ─── Reset + base ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-padding-top: 90px;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'kern' 1, 'liga' 1, 'calt' 1;
  transition: background 0.5s var(--tx-soft), color 0.5s var(--tx-soft);
}

/* Grana carta — la texture che fa leggere "stampato" invece di "renderizzato" */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: var(--grain);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.95' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.10  0 0 0 0 0.09  0 0 0 0 0.07  0 0 0 0.045 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
:root[data-theme='dark'] body::before { mix-blend-mode: screen; }

::selection { background: var(--rosso); color: var(--paper); }

a { color: inherit; text-decoration: none; transition: opacity 0.2s var(--tx-soft); }
a:hover { opacity: 0.6; }
button { font-family: inherit; cursor: pointer; background: none; border: none; color: inherit; }
img, svg { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--rosso);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: absolute; top: 8px; left: 8px; z-index: 1000;
  padding: 10px 18px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.15em;
  transform: translateY(-200%);
  transition: transform 0.2s var(--tx-soft);
}
.skip-link:focus { transform: translateY(0); opacity: 1; }

/* ─── Cursore custom (dot che segue, si gonfia sugli interattivi) ────── */
@media (hover: hover) and (pointer: fine) {
  body { cursor: none; }
  #cursor {
    position: fixed; z-index: 9998;
    top: 0; left: 0;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--ink);
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.18s var(--tx-soft), height 0.18s var(--tx-soft), background 0.18s var(--tx-soft);
    mix-blend-mode: difference;
  }
  #cursor.hover { width: 56px; height: 56px; background: var(--rosso); }
  /* Sopra le demo il cursore torna quello del sistema: serve precisione */
  .demo-stage, .demo-stage * { cursor: auto !important; }
  .demo-stage:hover ~ #cursor, body.in-demo #cursor { opacity: 0; }
}
@media (hover: none), (pointer: coarse) { #cursor { display: none; } }

/* ─── Griglia editoriale 12 col + margini ────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: var(--gutter) repeat(12, 1fr) var(--gutter);
  column-gap: 24px;
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
}
@media (max-width: 980px) {
  :root { --gutter: 24px; }
  .grid { grid-template-columns: var(--gutter) repeat(6, 1fr) var(--gutter); column-gap: 12px; }
}

/* ─── Helper tipografici ─────────────────────────────────────────────── */
.mono { font-family: var(--mono); font-feature-settings: 'ss01' 1; letter-spacing: 0.01em; }
.uc { text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; font-size: 11px; }
.rosso { color: var(--rosso); }
.serif-it {
  font-family: var(--serif); font-style: italic; font-weight: 300;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
}

/* ═══ NAV ══════════════════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 20px 0;
  background: var(--nav-bg);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--tx-soft), padding 0.3s var(--tx-soft);
}
.nav.scrolled { border-color: var(--rule-soft); padding: 14px 0; }
.nav-inner {
  grid-column: 2 / -2;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.nav-brand {
  display: flex; align-items: center;
}
.nav-brand .logo {
  height: 22px; width: auto; display: block;
}
/* Logo commutato per tema: black su chiaro, white su scuro. Segue sia il
   toggle manuale (data-theme) sia la preferenza di sistema iniziale. */
.nav-brand .logo-white { display: none; }
[data-theme="dark"] .nav-brand .logo-black { display: none; }
[data-theme="dark"] .nav-brand .logo-white { display: block; }
.nav-right { display: flex; align-items: center; gap: 34px; }
.nav-links {
  display: flex; gap: 32px;
  font-family: var(--mono); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-soft);
}
.nav-links a { position: relative; padding-bottom: 3px; }
.nav-links a::after {
  content: '';
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--rosso);
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--tx-soft);
}
.nav-links a:hover { opacity: 1; }
.nav-links a:hover::after { transform: scaleX(1); transform-origin: left; }
@media (max-width: 900px) { .nav-links { display: none; } }

/* Toggle tema — due semicerchi, non un'icona sole/luna */
.theme-toggle {
  width: 34px; height: 34px;
  border: 1px solid var(--rule-soft);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color 0.25s var(--tx-soft), transform 0.4s var(--tx-snap);
  flex: none;
}
.theme-toggle:hover { border-color: var(--rosso); transform: rotate(180deg); }
.theme-toggle svg { width: 15px; height: 15px; }
.theme-toggle .half { fill: var(--ink); }
.theme-toggle .ring { fill: none; stroke: var(--ink); stroke-width: 1.5; }

/* ═══ HERO ═════════════════════════════════════════════════════════════ */
.hero {
  min-height: 100svh;
  /* Padding quasi simmetrico: con `align-items: center` il blocco si centra
     davvero nella viewport invece di restare appeso al margine alto. Il valore
     minimo tiene il titolo appena sotto la nav fissa sugli schermi bassi. */
  padding: clamp(96px, 13vh, 168px) 0 clamp(80px, 11vh, 132px);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--rule-soft);
  display: flex; align-items: center;
}
.hero > .grid { width: 100%; }
.hero-inner {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: inherit;
  /* `inherit`, non 24px fisso: sotto i 980px il .grid padre passa a 6 colonne
     con gap 12px, e un gap piu' largo qui schiacciava le 1fr ereditate a 9px. */
  column-gap: inherit;
}
/* .hero-art è posizionato, quindi dipingerebbe sopra i fratelli statici:
   alziamo esplicitamente il testo perché resti sempre leggibile. */
.hero-inner > *:not(.hero-art) { position: relative; z-index: 1; }


.hero-title {
  /* Testata a tutta la larghezza del boxed: sta SOPRA lo split, non dentro la
     colonna sinistra. Lo split (copy a sinistra, palco a destra) inizia dopo. */
  grid-column: 2 / -2;
  grid-row: 1 / 3;
  /* Scala legata alla larghezza reale: le due righe devono arrivare quasi al
     margine, altrimenti la testata a tutta larghezza resta mezza vuota. */
  font-size: clamp(40px, 12.1vw, 172px);
  /* Stacco netto dal contenuto sotto: il titolone deve respirare, non sembrare
     attaccato al testo di servizio. */
  margin-bottom: clamp(64px, 8.5vw, 132px);
  line-height: 0.86;
  letter-spacing: -0.05em;
}
.hero-title .l1, .hero-title .l2 { display: block; }
.hero-title .l1 {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: 'opsz' 144, 'SOFT' 20;
}
.hero-title .l2 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  color: var(--rosso);
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
  /* Allineata a destra: le due righe chiudono il blocco sui due margini. */
  text-align: right;
}

.hero-copy {
  grid-column: 2 / 9;
  grid-row: 3;
}
.hero-lede {
  font-size: clamp(18px, 1.9vw, 23px);
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 44ch;
}
.hero-lede em {
  font-family: var(--serif); font-style: italic;
  color: var(--ink); font-weight: 400;
}
.hero-sub {
  margin-top: 20px;
  font-size: clamp(14px, 1.25vw, 16px);
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 50ch;
}

.hero-meta {
  grid-column: 2 / 9;
  grid-row: 4;
  margin-top: 26px;
  align-self: start;
  text-align: left;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ink-soft);
  line-height: 1.9;
}
.hero-meta .l { color: var(--ink-faint); }
@media (max-width: 980px) {
  /* La griglia qui ha 6 colonne: ogni riferimento oltre la 13esima linea
     creerebbe colonne implicite da 0px e spingerebbe il testo fuori margine. */
  .hero-copy, .hero-meta, .hero-ctas { grid-column: 2 / -2; }
  .hero-copy, .hero-meta { text-align: left; }
  .hero-meta { grid-row: 4; margin-top: 32px; align-self: start; }
}

/* Sotto i 620px "infinite applicazioni." non ci sta: niente rientro e scala
   legata alla larghezza reale, altrimenti la riga esce dal margine destro. */
@media (max-width: 620px) {
  .hero-title { font-size: clamp(30px, 13.5vw, 74px); }

  /* Su mobile la hero non si centra (min-height: 0): il titolo sale sotto la
     nav, così lo schermo corto non spreca mezza pagina di vuoto. */
  .hero { padding-top: 88px; }
}

.hero-ctas {
  grid-column: 2 / 9;
  grid-row: 5;
  margin-top: 40px;
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
}

/* Composizione vettoriale ambient — si disegna da sola all'ingresso */
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ═══ PALCO EROE ══════════════════════════════════════════════════════════
   Un artboard che diventa sei strumenti diversi. Ogni scena vive nello stesso
   SVG; la regia in hero.js accende una `.scene` per volta con `.on`, e le
   animazioni ripartono da capo perché la classe viene tolta e rimessa. */

.hero-stage {
  grid-column: 9 / 15;
  grid-row: 3 / 6;
  align-self: center;
  min-width: 0;
}
.stage-frame {
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* Barra titolo: basta a dire "questo è un editor" senza spiegarlo */
.stage-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.stage-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--rosso); flex: none;
}
.stage-spacer { flex: 1; }
.stage-file { color: var(--ink-soft); transition: opacity 0.3s var(--tx-soft); }
.stage-file.swap { opacity: 0; }

.stage-body { display: flex; align-items: stretch; }

.stage-rail {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 8px;
  border-right: 1px solid var(--rule-soft);
  background: var(--cream);
  flex: none;
}
.stage-rail .tool {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  color: var(--ink-faint);
}
.stage-rail .tool svg { width: 15px; height: 15px; fill: currentColor; stroke: none; }
.stage-rail .tool:nth-child(4) svg,
.stage-rail .tool:nth-child(5) svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.stage-rail .tool.on { background: var(--ink); color: var(--paper); }

.stage-svg { flex: 1; min-width: 0; aspect-ratio: 13 / 10; display: block; }

/* griglia di fondo */
.stage-grid path { stroke: var(--rule-soft); stroke-width: 1; fill: none; }

/* ─── Scene: una sola accesa per volta ─── */
.scene { opacity: 0; visibility: hidden; }
.scene.on { opacity: 1; visibility: visible; }

/* Elementi comuni alle scene */
.scene .sh { stroke: var(--ink); stroke-width: 1.4; }
.fill-rosso    { fill: var(--rosso); }
.fill-navy     { fill: var(--navy); }
.fill-giallo   { fill: var(--giallo); }
.fill-paper    { fill: var(--paper); }
.fill-cream2   { fill: var(--cream-2); }
.fill-rosso-t  { fill: var(--rosso);  fill-opacity: 0.18; }
.fill-navy-t   { fill: var(--navy);   fill-opacity: 0.18; }
.fill-giallo-t { fill: var(--giallo); fill-opacity: 0.22; }

.scene .draw {
  fill: none;
  stroke-dasharray: var(--len, 900);
  stroke-dashoffset: var(--len, 900);
}
.scene .pop  { transform: scale(0.55); transform-origin: center; opacity: 0; }
.scene .fade { opacity: 0; }

.scene.on .draw { animation: draw 1.15s var(--tx-soft) forwards; }
.scene.on .pop  { animation: stage-pop 0.5s var(--tx-snap) forwards; }
.scene.on .fade { animation: fadein 0.5s var(--tx-soft) forwards; }
@keyframes stage-pop { to { transform: scale(1); opacity: 1; } }

.scene .d3 { animation-delay: 0.16s; }
.scene .d4 { animation-delay: 0.26s; }
.scene .d5 { animation-delay: 0.36s; }
.scene .d6 { animation-delay: 0.46s; }
.scene .d7 { animation-delay: 0.58s; }
.scene .d8 { animation-delay: 0.70s; }

/* maniglie di selezione */
.handles rect {
  fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.2;
}
.rot-handle path   { stroke: var(--rosso); stroke-width: 1.4; fill: none; }
.rot-handle circle { fill: var(--rosso); }

/* quote */
.quote path { stroke: var(--ink-soft); stroke-width: 1; fill: none; }
.quote text {
  font-family: var(--mono); font-size: 11px; fill: var(--ink-soft);
  text-anchor: middle;
}
.quote .q-bg { fill: var(--paper); }

/* scena stampa */
.print-area {
  fill: none; stroke: var(--rosso); stroke-width: 1.4; stroke-dasharray: 5 4;
}
.tee-art { transform-origin: 260px 200px; }

/* scena planimetria: tramezzi leggeri, muro perimetrale pesante */
.room { stroke: var(--ink); stroke-width: 1.6; }
.wall { fill: none; stroke: var(--ink); stroke-width: 4; }
.room-tag text {
  font-family: var(--mono); font-size: 12px; fill: var(--ink); text-anchor: middle;
}
.room-tag .sm { font-size: 10px; fill: var(--ink-faint); }
/* la quota totale è più chiara delle parziali: gerarchia da tavola tecnica */
.quote.tot path { stroke: var(--ink-faint); }
.quote.tot text { fill: var(--ink-faint); }
.snap-guide path { stroke: var(--rosso); stroke-width: 1; stroke-dasharray: 4 4; fill: none; }

/* scena workflow */
.link path { stroke: var(--ink-faint); stroke-width: 1.5; fill: none; }
.node rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.4; }
.node .bar { fill: var(--ink); stroke: none; opacity: 0.35; }
.node .bar.sm { opacity: 0.16; }
.node.sel rect { fill: var(--cream-2); stroke: var(--rosso); stroke-width: 1.8; }
.node .plus { stroke: var(--rosso); stroke-width: 1.6; fill: none; }

/* scena nesting */
.sheet { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.nest path, .nest circle { fill: var(--cream-2); stroke: var(--ink-faint); stroke-width: 1.2; }
/* fill-opacity, non opacity: l'animazione .fade anima `opacity` fino a 1
   e cancellerebbe la trasparenza, rendendo lo scarto un blocco rosso pieno. */
.waste { fill: var(--rosso); fill-opacity: 0.14; stroke: none; }
.cut {
  fill: none; stroke: var(--rosso); stroke-width: 1.6; stroke-dasharray: 6 6;
  animation: ants 0.7s linear infinite;
}
@keyframes ants { to { stroke-dashoffset: -24; } }
.badge rect { fill: var(--paper); stroke: var(--rosso); stroke-width: 1.2; }
.badge text {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  fill: var(--rosso); text-anchor: middle;
}

/* scena curva */
.curve { fill: none; stroke: var(--ink); stroke-width: 2.6; stroke-linecap: round; }
.ctrl path   { stroke: var(--rosso); stroke-width: 1; fill: none; }
.ctrl circle { fill: var(--paper); stroke: var(--rosso); stroke-width: 1.4; }
.node-pt rect { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.node-pt rect.on { fill: var(--rosso); stroke: var(--rosso); }

/* cursore che si sposta e afferra */
.stage-cursor {
  fill: var(--ink);
  transition: transform 1.05s var(--tx-soft);
  transform: translate(260px, 200px);
}
.stage-cursor.grab { animation: grab 0.45s var(--tx-snap); }
@keyframes grab {
  50% { opacity: 0.35; }
}

/* piede: il nome dello strumento si scrive da solo */
.stage-foot {
  display: flex; align-items: center; gap: 2px;
  padding: 14px 16px;
  border-top: 1px solid var(--rule-soft);
  background: var(--cream);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink);
  min-height: 46px;
}
.stage-label::before { content: '↳ '; color: var(--rosso); }
.stage-caret {
  width: 8px; height: 15px;
  background: var(--rosso);
  animation: blink 1.05s steps(2) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Sotto i 1180px il palco passa sotto al testo, a tutta larghezza */
@media (max-width: 1180px) {
  .hero-stage { grid-column: 2 / -2; grid-row: 6; margin-top: 54px; }
  .hero-title { font-size: clamp(40px, 13vw, 150px); }
}
@media (max-width: 980px) {
  .hero { min-height: 0; }
  .hero-stage { grid-column: 2 / -2; }
  .stage-rail { display: none; }
}

/* Reveal scaglionato dell'hero */
.hero-copy, .hero-meta, .hero-ctas, .hero-stage {
  opacity: 0;
  transform: translateY(20px);
  animation: rise 1s var(--tx-soft) forwards;
}
.hero-stage { animation-delay: 0.45s; animation-duration: 1.2s; }
.hero-title .l1 { display: inline-block; opacity: 0; transform: translateY(64px); animation: rise 1.1s var(--tx-snap) 0.22s forwards; }
.hero-title .l2 { display: block; opacity: 0; transform: translateY(64px); animation: rise 1.1s var(--tx-snap) 0.38s forwards; }
.hero-copy     { animation-delay: 0.60s; }
.hero-meta     { animation-delay: 0.72s; }
.hero-ctas     { animation-delay: 0.82s; }
.hero-art      { animation-delay: 0.30s; }
@keyframes rise { to { opacity: 1; transform: translateY(0); } }

/* ─── Bottoni ────────────────────────────────────────────────────────── */
.btn-fill, .btn-line {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 18px 32px;
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em;
  border: 1px solid var(--ink);
  transition: background 0.3s var(--tx-soft), color 0.3s var(--tx-soft),
              transform 0.3s var(--tx-soft), box-shadow 0.3s var(--tx-soft),
              border-color 0.3s var(--tx-soft);
}
.btn-fill { background: var(--ink); color: var(--paper); }
.btn-fill:hover {
  background: var(--rosso); border-color: var(--rosso); color: #FAF7F0; opacity: 1;
  transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink);
}
.btn-line { background: transparent; color: var(--ink); }
.btn-line:hover {
  background: var(--ink); color: var(--paper); opacity: 1;
  transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--rosso);
}
.btn-fill .arrow, .btn-line .arrow { transition: transform 0.3s var(--tx-soft); }
.btn-fill:hover .arrow, .btn-line:hover .arrow { transform: translateX(5px); }

/* ═══ TICKER ═══════════════════════════════════════════════════════════ */
.ticker {
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  overflow: hidden;
  padding: 20px 0;
}
.ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
  animation: ticker 46s linear infinite;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(32px, 5vw, 64px);
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
}
.ticker-track span { display: inline-flex; align-items: center; gap: 40px; padding-right: 40px; }
.ticker-track .dot {
  width: 12px; height: 12px;
  background: var(--rosso);
  border-radius: 50%;
  flex: none;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ═══ SEZIONI ══════════════════════════════════════════════════════════ */
.section { padding: 130px 0; position: relative; }
/* Una sola colonna: la numerazione di sezione è stata tolta e resta solo
   sui dieci esempi, dove serve a scandire la sequenza. */
.section-head {
  grid-column: 2 / -2;
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 90px;
  border-top: 1px solid var(--rule);
  padding-top: 30px;
}
.section-title {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(34px, 4.6vw, 60px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  font-variation-settings: 'opsz' 144, 'SOFT' 50;
  max-width: 20ch;
}
.section-title strong {
  font-weight: 600; font-style: normal;
  font-variation-settings: 'opsz' 144, 'SOFT' 20;
}
.section-head .lede {
  grid-column: 1;
  margin-top: 22px;
  font-size: 18px;
  color: var(--ink-soft);
  max-width: 54ch;
}
@media (max-width: 760px) {
  .section { padding: 90px 0; }
  .section-head { grid-template-columns: 1fr; gap: 14px; margin-bottom: 60px; }
  .section-num { font-size: 60px; }
}

/* ═══ PUNTI DI FORZA — 4 blocchi, griglia asimmetrica ═════════════════ */
.pillars {
  grid-column: 2 / -2;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  border-top: 1px solid var(--rule-soft);
}
.pillar {
  padding: 52px 44px 56px;
  border-bottom: 1px solid var(--rule-soft);
  border-left: 1px solid var(--rule-soft);
  position: relative;
  transition: background 0.45s var(--tx-soft);
}
.pillar:hover { background: var(--cream); }
.pillar:nth-child(1) { grid-column: 1 / 7;  border-left: none; }
.pillar:nth-child(2) { grid-column: 7 / 13; }
.pillar:nth-child(3) { grid-column: 1 / 6;  border-left: none; }
.pillar:nth-child(4) { grid-column: 6 / 13; background: var(--inverse-bg); color: var(--inverse-fg); }
.pillar:nth-child(4):hover { background: var(--rosso); }
.pillar:nth-child(4) .pillar-num { color: var(--rosso); }
.pillar:nth-child(4):hover .pillar-num { color: var(--inverse-fg); opacity: 0.65; }
.pillar:nth-child(4) .pillar-body { opacity: 0.8; }

.pillar-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--rosso);
  margin-bottom: 26px;
  transition: color 0.45s var(--tx-soft);
}
.pillar-title {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  font-variation-settings: 'opsz' 72, 'SOFT' 30;
  max-width: 18ch;
}
.pillar-body { color: var(--ink-soft); line-height: 1.6; max-width: 48ch; }
.pillar:nth-child(4) .pillar-body { color: var(--inverse-fg); }
.pillar-body + .pillar-body { margin-top: 14px; }
@media (max-width: 860px) {
  .pillar, .pillar:nth-child(n) {
    grid-column: 1 / -1 !important;
    border-left: none;
    padding: 40px 0 44px;
  }
  .pillar:nth-child(4) { padding: 40px 28px 44px; }
  .pillar:hover { background: transparent; }
  .pillar:nth-child(4):hover { background: var(--inverse-bg); }
}

/* ═══ APPLICAZIONI — 10 casi, impaginati come portfolio ═══════════════ */
.cases { grid-column: 2 / -2; }

.case {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: 24px;
  align-items: start;
  padding: 90px 0;
  border-top: 1px solid var(--rule-soft);
}
.case:first-child { border-top: 1px solid var(--rule); }

.case-meta { grid-column: 1 / 5; position: sticky; top: 120px; }
.case-art  { grid-column: 6 / 13; }
/* Righe alternate: il contenuto scambia lato — ritmo da impaginato */
.case:nth-child(even) .case-meta { grid-column: 9 / 13; order: 2; }
.case:nth-child(even) .case-art  { grid-column: 1 / 8;  order: 1; }

.case-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 72px;
  line-height: 0.9;
  letter-spacing: -0.04em;
  color: var(--rosso);
  margin-bottom: 20px;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
}
.case-title {
  font-family: var(--serif);
  font-size: clamp(26px, 3vw, 40px);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  font-variation-settings: 'opsz' 96, 'SOFT' 20;
}
.case-body { color: var(--ink-soft); line-height: 1.62; max-width: 42ch; }
.case-body + .case-body { margin-top: 14px; }

.case-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 26px;
}

.case-cta {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 26px;
  padding: 13px 22px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.16em;
  border: 1px solid var(--ink);
  transition: background 0.3s var(--tx-soft), color 0.3s var(--tx-soft),
              transform 0.3s var(--tx-soft), box-shadow 0.3s var(--tx-soft),
              border-color 0.3s var(--tx-soft);
}
.case-cta:hover {
  background: var(--rosso); border-color: var(--rosso); color: #FAF7F0; opacity: 1;
  transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink);
}
.case-cta .arrow { transition: transform 0.3s var(--tx-soft); }
.case-cta:hover .arrow { transform: translate(3px, -3px); }
.case-tag {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  border: 1px solid var(--rule-soft);
  padding: 6px 11px;
}

@media (max-width: 980px) {
  .case { grid-template-columns: 1fr; padding: 60px 0; row-gap: 34px; }
  .case-meta, .case-art,
  .case:nth-child(even) .case-meta, .case:nth-child(even) .case-art {
    grid-column: 1 / -1; position: static; order: unset;
  }
  .case:nth-child(even) .case-art { order: 2; }
  .case:nth-child(even) .case-meta { order: 1; }
  .case-num { font-size: 52px; }
}

/* ─── Illustrazioni SVG animate (i 7 casi statici) ───────────────────── */
.illo {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--cream);
  border: 1px solid var(--rule-soft);
  overflow: hidden;
  position: relative;
}
.illo svg { width: 100%; height: 100%; display: block; }
.illo .draw {
  stroke-dasharray: var(--len, 800);
  stroke-dashoffset: var(--len, 800);
}
.illo .fade { opacity: 0; }
.illo .pop  { transform: scale(0.4); transform-origin: center; opacity: 0; }
.illo .slide { transform: translateX(-18px); opacity: 0; }

/* Le animazioni partono solo quando l'illustrazione entra in viewport */
.illo.visible .draw  { animation: draw 1.5s var(--tx-soft) forwards; }
.illo.visible .fade  { animation: fadein 0.7s var(--tx-soft) forwards; }
.illo.visible .pop   { animation: popin 0.6s var(--tx-snap) forwards; }
.illo.visible .slide { animation: slidein 0.7s var(--tx-soft) forwards; }
.illo.visible .loop  { animation-play-state: running; }
@keyframes fadein  { to { opacity: 1; } }
@keyframes popin   { to { transform: scale(1); opacity: 1; } }
@keyframes slidein { to { transform: translateX(0); opacity: 1; } }

.illo .d1 { animation-delay: 0.05s; }
.illo .d2 { animation-delay: 0.15s; }
.illo .d3 { animation-delay: 0.25s; }
.illo .d4 { animation-delay: 0.35s; }
.illo .d5 { animation-delay: 0.45s; }
.illo .d6 { animation-delay: 0.55s; }
.illo .d7 { animation-delay: 0.65s; }
.illo .d8 { animation-delay: 0.75s; }

/* ─── Animazioni dimostrative ────────────────────────────────────────────
   Non sono decorazione: ognuna mostra il gesto del caso d'uso. Partono solo
   con `.illo.visible` (fuori viewport non gira niente) e sono tutte CSS,
   così `prefers-reduced-motion` le spegne insieme al resto. */

/* 03 · HMI — lancette, livello, allarme, nastro, spie */
.illo .hmi-needle { transform-box: view-box; }
.illo.visible .hmi-needle.n1 { transform-origin: 86px 96px;  animation: needle-a 4.2s ease-in-out infinite; }
.illo.visible .hmi-needle.n2 { transform-origin: 168px 96px; animation: needle-b 5.6s ease-in-out infinite; }
@keyframes needle-a { 0%,100% { transform: rotate(-62deg); } 50% { transform: rotate(48deg); } }
@keyframes needle-b { 0%,100% { transform: rotate(-40deg); } 50% { transform: rotate(66deg); } }

.illo .hmi-level { transform-box: view-box; transform-origin: 226px 134px; }
.illo.visible .hmi-level { animation: level 5s ease-in-out infinite; }
@keyframes level { 0%,100% { transform: scaleY(0.32); } 50% { transform: scaleY(0.92); } }

.illo.visible .hmi-alarm { animation: blink-hard 1.4s steps(2) infinite; }
@keyframes blink-hard { 50% { opacity: 0.15; } }

.illo .hmi-belt { transform-box: view-box; }
.illo.visible .hmi-belt { animation: belt 3.4s linear infinite; }
@keyframes belt { to { transform: translateX(96px); } }

.illo.visible .hmi-lamp { animation: lamp 2.4s ease-in-out infinite; }
.illo .hmi-lamp.l2 { animation-delay: 0.35s; }
.illo .hmi-lamp.l3 { animation-delay: 0.7s; }
@keyframes lamp { 0%,70%,100% { opacity: 0.2; } 20%,50% { opacity: 1; } }

/* 05 · Viewer — la lente scorre sul disegno e l'elemento selezionato pulsa */
.illo .vw-lens { transform-box: view-box; }
.illo.visible .vw-lens { animation: lens 7s ease-in-out infinite; }
@keyframes lens {
  0%, 100% { transform: translate(0, 0); }
  35%      { transform: translate(-150px, 46px); }
  70%      { transform: translate(-46px, -34px); }
}
.illo.visible .vw-sel { animation: sel-pulse 2.8s ease-in-out infinite; }
@keyframes sel-pulse { 0%,100% { opacity: 0.1; } 50% { opacity: 0.3; } }

/* 07 · Workflow — impulsi di dati che percorrono le connessioni */
.illo .wf-pulse { offset-rotate: 0deg; }
.illo.visible .wf-pulse { animation: pulse-run 2.6s linear infinite; }
.illo .wf-pulse.p2 { animation-delay: 0.55s; }
.illo .wf-pulse.p3 { animation-delay: 1.3s; }
.illo .wf-pulse.p4 { animation-delay: 1.75s; }
@keyframes pulse-run {
  0%   { offset-distance: 0%;   opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { offset-distance: 100%; opacity: 0; }
}

/* 09 · Cropper — l'immagine si riposiziona e zooma dentro il ritaglio fermo.
   Animare il riquadro sarebbe sbagliato: la maschera scura non lo segue e
   ritaglio e oscuramento vanno fuori sincrono. Qui si muove il soggetto. */
.illo .cr-photo { transform-box: view-box; transform-origin: 186px 150px; }
.illo.visible .cr-photo { animation: crop-pan 8s ease-in-out infinite; }
@keyframes crop-pan {
  0%, 100% { transform: scale(1)    translate(0, 0); }
  32%      { transform: scale(1.22) translate(-16px, 6px); }
  66%      { transform: scale(1.1)  translate(14px, -8px); }
}

/* 10 · Disegno — il tracciato si ridisegna in ciclo e i nodi respirano */
.illo.visible .dr-curve {
  stroke-dasharray: 520;
  animation: redraw 6s ease-in-out infinite;
}
@keyframes redraw {
  0%   { stroke-dashoffset: 520; }
  45%  { stroke-dashoffset: 0; }
  85%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 520; }
}
.illo.visible .dr-node { animation: node-breathe 3.2s ease-in-out infinite; }
.illo .dr-node.b2 { animation-delay: 0.4s; }
.illo .dr-node.b3 { animation-delay: 0.8s; }
@keyframes node-breathe { 0%,100% { opacity: 0.45; } 50% { opacity: 1; } }

/* Palette illustrazioni — legata ai token, cambia col tema */
.illo .s-ink    { stroke: var(--ink); }
.illo .s-faint  { stroke: var(--ink-faint); }
.illo .s-rosso  { stroke: var(--rosso); }
.illo .s-navy   { stroke: var(--navy); }
.illo .f-ink    { fill: var(--ink); }
.illo .f-paper  { fill: var(--paper); }
.illo .f-rosso  { fill: var(--rosso); }
.illo .f-navy   { fill: var(--navy); }
.illo .f-giallo { fill: var(--giallo); }
.illo .f-none   { fill: none; }
.illo .f-cream2 { fill: var(--cream-2); }

/* ─── Demo interattive (i 3 casi live) ───────────────────────────────── */
.demo {
  border: 1px solid var(--rule);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.demo-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule-soft);
  background: var(--cream);
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}
.demo-bar .live {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--rosso); font-weight: 600;
}
.demo-bar .live::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--rosso);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.25; } }

.demo-stage {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 260px;
  position: relative;
  background: var(--paper);
}
.demo-stage > .vectoor { width: 100%; height: 100%; }

.demo-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  padding: 14px 16px;
  border-top: 1px solid var(--rule-soft);
  background: var(--cream);
}
.demo-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.demo-readout {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
  font-feature-settings: 'tnum' 1;
  white-space: nowrap;
}
.demo-readout b { color: var(--ink); font-weight: 600; }

.demo-hint {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-top: 12px;
  display: flex; align-items: center; gap: 8px;
}
.demo-hint::before { content: '↖'; color: var(--rosso); font-size: 13px; }

/* Fallback se il modulo demo non carica: l'illustrazione resta visibile */
.demo[hidden] { display: none; }

/* ═══ OLTRE IL 2D — banda scura con il planner incorporato ════════════════
   La banda resta scura in ENTRAMBI i temi: l'app incorporata è sempre chiara
   e calda, e la chrome scura attorno al foglio chiaro è esattamente il segnale
   che fa leggere planner-3d come strumento. Qui i token non si invertono. */
.beyond {
  background: #14120F;
  color: #F0E9DA;
  border-top: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  padding: 130px 0 140px;
}
.beyond .section-head { border-top-color: rgba(240, 233, 218, 0.22); }
.beyond .lede         { color: rgba(240, 233, 218, 0.66); }
.beyond .section-head::before { background: var(--rosso); }

/* Da bordo a bordo: il planner è un'applicazione da scrivania e ogni pixel
   guadagnato è area di lavoro leggibile. Esce dalla griglia e dai margini,
   unico blocco della pagina a farlo. */
.beyond-stage {
  grid-column: 1 / -1;
  padding: 0;
}
.beyond .grid { max-width: none; }
.demo3d { border-left: 0; border-right: 0; }

.demo3d {
  border: 1px solid rgba(240, 233, 218, 0.18);
  background: #0E0D0B;
  overflow: hidden;
}
.demo3d .demo-bar,
.demo3d .demo-foot {
  background: rgba(240, 233, 218, 0.05);
  border-color: rgba(240, 233, 218, 0.14);
  color: rgba(240, 233, 218, 0.5);
}
.demo3d .demo-bar .live { color: var(--rosso); }

.demo3d-frame {
  position: relative;
  width: 100%;
  /* Altezza legata alla finestra, non alla larghezza: con `aspect-ratio: 16/10`
     a tutta pagina un monitor largo generava un riquadro più alto della
     viewport e il planner non si vedeva mai per intero. `svh` e non `vh`
     perché su mobile la barra del browser falsa il 100vh. */
  /* Il `min()` toglie i ~90px di barra e piede: così l'intero blocco resta
     sotto il 100svh anche su finestre basse, dove il solo 75% non basterebbe. */
  height: min(75svh, calc(100svh - 96px));
  min-height: 300px;
  background: #0E0D0B;
}
.demo3d-frame iframe {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border: 0; display: block;
}

.demo3d-loading {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(240, 233, 218, 0.42);
}
.demo3d-loading .spin {
  width: 13px; height: 13px;
  border: 1.5px solid rgba(240, 233, 218, 0.2);
  border-top-color: var(--rosso);
  border-radius: 50%;
  animation: spin3d 0.85s linear infinite;
}
@keyframes spin3d { to { transform: rotate(360deg); } }
.demo3d-frame.loaded .demo3d-loading { display: none; }

/* Suggerimento sullo zoom: compare solo quando serve, sopra l'iframe. */
.demo3d-hint {
  position: absolute; inset: 0; z-index: 2;
  /* flex, non grid: con `place-items` ogni parola diventerebbe una riga */
  display: flex; align-items: center; justify-content: center;
  background: rgba(14, 13, 11, 0.62);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #F0E9DA;
  opacity: 0; visibility: hidden;
  transition: opacity 0.25s var(--tx-soft), visibility 0.25s;
  pointer-events: none;
}
.demo3d-hint.on { opacity: 1; visibility: visible; }
.demo3d-hint span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 14px 22px;
  border: 1px solid rgba(240, 233, 218, 0.22);
  background: rgba(14, 13, 11, 0.72);
  white-space: nowrap;
}
.demo3d-hint kbd {
  font-family: var(--mono); font-size: 12px;
  padding: 3px 8px; margin: 0 2px;
  border: 1px solid rgba(240, 233, 218, 0.4);
  border-radius: 3px;
}

.demo-hint3d {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(240, 233, 218, 0.42);
}
.demo3d-open {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #F0E9DA;
  border-bottom: 1px solid rgba(240, 233, 218, 0.28);
  padding-bottom: 3px;
}
.demo3d-open:hover { color: var(--rosso); border-color: var(--rosso); opacity: 1; }
.demo3d-open .arrow { transition: transform 0.3s var(--tx-soft); }
.demo3d-open:hover .arrow { transform: translate(3px, -3px); }

/* Sotto i 900px l'iframe sparisce: un editor da scrivania in 390px non si usa */
.demo3d-mobile { display: none; }
@media (max-width: 900px) {
  .beyond { padding: 90px 0 100px; }
  .demo3d { display: none; }
  .demo3d-mobile {
    display: block;
    border: 1px solid rgba(240, 233, 218, 0.18);
  }
  .demo3d-gif {
    display: block;
    width: 100%; height: auto;
    border-bottom: 1px solid rgba(240, 233, 218, 0.18);
  }
  /* Nessun pulsante verso il planner da telefono: mandarci qualcuno che poi
     non riesce a usarlo è peggio che non offrirlo. La GIF mostra cosa fa,
     il resto si prova da computer. */
  .demo3d-mobile p {
    margin: 28px;
    color: rgba(240, 233, 218, 0.66);
    max-width: 40ch;
  }
}

/* ═══ MANIFESTO ════════════════════════════════════════════════════════ */
.manifesto {
  background: var(--cream);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 140px 0;
}
.manifesto-inner { grid-column: 3 / 13; text-align: center; }
.manifesto-quote {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(30px, 4.4vw, 62px);
  line-height: 1.14;
  letter-spacing: -0.03em;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
}
.manifesto-quote .roman {
  font-style: normal; font-weight: 600;
  font-variation-settings: 'opsz' 144, 'SOFT' 20;
}
.manifesto-attrib {
  margin-top: 40px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
}
@media (max-width: 860px) { .manifesto { padding: 90px 0; } .manifesto-inner { grid-column: 2 / -2; } }

/* ═══ CTA FINALE — l'unico momento in cui il sito chiede qualcosa ═════ */
.cta-final {
  padding: 150px 0 140px;
  position: relative;
  overflow: hidden;
}
.cta-inner { grid-column: 2 / -2; }
.cta-final h2 {
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(42px, 8vw, 130px);
  line-height: 0.94;
  letter-spacing: -0.045em;
  font-variation-settings: 'opsz' 144, 'SOFT' 60;
  margin-bottom: 40px;
}
.cta-final h2 strong {
  display: block;
  font-style: normal; font-weight: 600;
  color: var(--rosso);
  font-variation-settings: 'opsz' 144, 'SOFT' 20;
  padding-left: 6%;
}
.cta-body {
  max-width: 56ch;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  color: var(--ink-soft);
  margin-bottom: 48px;
}
.cta-body + .cta-body { margin-top: -32px; }
.cta-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cta-aside {
  margin-top: 34px;
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.cta-aside a { color: var(--ink); border-bottom: 1px solid var(--rule-soft); padding-bottom: 2px; }
.cta-aside a:hover { border-color: var(--rosso); color: var(--rosso); opacity: 1; }

/* ═══ FOOTER ═══════════════════════════════════════════════════════════ */
footer {
  background: var(--inverse-bg);
  color: var(--inverse-fg);
  padding: 90px 0 40px;
}
.ft-inner {
  grid-column: 2 / -2;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(128, 128, 128, 0.28);
}
.ft-logo {
  height: 48px; width: auto; display: block;
  margin-bottom: 20px;
}
/* Il footer inverte il contrasto: sfondo scuro su tema chiaro → logo bianco,
   sfondo chiaro su tema scuro → logo nero. È l'opposto della nav. */
.ft-logo-black { display: none; }
[data-theme="dark"] .ft-logo-white { display: none; }
[data-theme="dark"] .ft-logo-black { display: block; }
.ft-col h3 {
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-weight: 600;
  opacity: 0.5;
  margin-bottom: 20px;
}
.ft-col a, .ft-col p {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 2.1;
  opacity: 0.78;
}
.ft-col a:hover { opacity: 1; color: var(--rosso); }
.ft-note {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.9;
  opacity: 0.55;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  max-width: 30ch;
}
.ft-bottom {
  grid-column: 2 / -2;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  padding-top: 30px;
  font-family: var(--mono);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.5;
}
/* Crediti: obbligatori per licenza ma non sono contenuto. Tenuti al minimo
   leggibile — visibili a chi li cerca, invisibili a chi legge la pagina. */
.ft-credits {
  grid-column: 2 / -2;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
  letter-spacing: 0.08em;
  opacity: 0.3;
  transition: opacity 0.3s var(--tx-soft);
}
.ft-credits:hover { opacity: 0.6; }
.ft-credits a { text-decoration: underline; text-underline-offset: 2px; }
.ft-credits a:hover { color: var(--rosso); opacity: 1; }

@media (max-width: 860px) {
  .ft-inner { grid-template-columns: 1fr 1fr; gap: 40px; }
  .ft-logo { height: 40px; }
}

/* ═══ REVEAL AL SCROLL ═════════════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s var(--tx-soft), transform 0.9s var(--tx-soft);
}
.reveal.visible { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: 0.08s; }
.reveal.d2 { transition-delay: 0.16s; }
.reveal.d3 { transition-delay: 0.24s; }

/* Rules che si disegnano da sinistra quando la sezione entra.
   Il rosso è un lampo: traccia la riga e poi si spegne, lasciando il filo
   grigio del bordo. Dieci righe rosse accese insieme sarebbero rumore. */
.section-head, .case, .pillars { position: relative; }
.section-head::before, .case::before {
  content: '';
  position: absolute; top: -1px; left: 0;
  width: 100%; height: 1px;
  background: var(--rosso);
  transform: scaleX(0); transform-origin: left;
}
.section-head.visible::before, .case.visible::before {
  animation: rule-sweep 2.1s var(--tx-soft) forwards;
}
@keyframes rule-sweep {
  0%   { transform: scaleX(0); opacity: 1; }
  55%  { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

/* ═══ ACCESSIBILITÀ — nessun movimento se non lo si vuole ═════════════ */
@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;
  }
  .hero-copy, .hero-meta, .hero-ctas, .hero-stage,
  .hero-title .l1, .hero-title .l2 { opacity: 1; transform: none; }
  /* Il palco resta, ma fermo sulla prima scena: niente ciclo, niente cursore. */
  .scene .draw { stroke-dashoffset: 0; }
  .scene .pop, .scene .fade { opacity: 1; transform: none; }
  .cut, .stage-caret { animation: none; }
  .stage-cursor { display: none; }
  .reveal { opacity: 1; transform: none; }
  .illo .draw { stroke-dashoffset: 0; }
  .illo .fade, .illo .pop, .illo .slide { opacity: 1; transform: none; }
  .ticker-track { animation: none; }
  #cursor { display: none; }
  body { cursor: auto; }
}

/* ═══ STAMPA ═══════════════════════════════════════════════════════════ */
@media print {
  .nav, #cursor, .ticker, .demo-foot { display: none; }
  body::before { display: none; }
  .reveal, .illo .fade, .illo .pop, .illo .slide { opacity: 1; transform: none; }
  .case { break-inside: avoid; }
}
