/* Stile "Vetta": grafite e bianco, un solo colore (il rosso del logo),
   titoli Archivo molto pesanti. Riferimento e motivazioni: docs/12-sito.md,
   docs/appendici/G-sito-stile-riferimento.md. Tema unico: niente chiaro/scuro
   automatico, sono le sezioni ad alternare scuro (.ink) e chiaro. */

/* Archivo, variabile in peso e larghezza, servito dal sito stesso: nessuna
   richiesta a Google Fonts (licenza OFL in assets/fonts/OFL.txt). */
@font-face {
  font-family: "Archivo";
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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: "Archivo";
  src: url("assets/fonts/archivo-latin-ext.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono Regular, servito dal sito (licenza OFL in
   assets/fonts/OFL-JetBrainsMono.txt): e' il font dei dati dell'app. */
@font-face {
  font-family: "JetBrains Mono";
  src: url("assets/fonts/jetbrains-mono-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

:root {
  --ink: #0e0e10;
  --paper: #ffffff;
  /* Il velo dell'app (fg al 7% sul fondo), gia' composto: un grigio pieno,
     cosi' non si somma al fondo di una sezione alterna. */
  --paper-2: #eeeeef;
  /* Rosso del logo (#F50C07) scurito quanto basta per il testo bianco sopra
     (contrasto 5:1); il chiaro e' lo stop alto del gradiente del logo, per
     gli accenti sul fondo scuro. */
  --red: #d90a05;
  --red-deep: #a70805;
  --red-light: #f8504c;

  --text: var(--ink);
  --text-dim: rgba(14, 14, 16, 0.64);
  --line: rgba(14, 14, 16, 0.12);
  --accent-text: var(--red);
  --focus: var(--red);

  --radius: 8px;
  --radius-sm: 6px;
  --max-width: 1280px;
  --gutter: clamp(16px, 5vw, 64px);
  --ease: cubic-bezier(0.42, 0, 0, 1);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "DejaVu Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: light;
}

/* Sezioni scure: ridefiniscono i colori, i componenti dentro non cambiano. */
.ink {
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.64);
  --line: rgba(255, 255, 255, 0.12);
  --accent-text: var(--red-light);
  --focus: var(--red-light);
  background: var(--ink);
  color: var(--text);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: inherit; }

h1, h2, h3 {
  font-weight: 900;
  font-stretch: 112%;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

code {
  font-family: var(--mono);
  background: var(--paper-2);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.88em;
}

kbd {
  font-family: var(--mono);
  font-size: 0.85em;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--paper);
  color: var(--text);
}

/* Bottoni: alti 44 px, raggio 6 come quelli dell'app, bordo di 1 px. Un solo
   rosso per schermata, gli altri sono contorni. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 6px;
  border: 1px solid transparent;
  font: 700 14px/1 var(--font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease), color 300ms var(--ease);
}

.btn-sm { height: 36px; padding: 0 18px; }

.btn-block { width: 100%; }

.btn-primary {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-deep);
  border-color: var(--red-deep);
}

.btn-outline-light {
  border-color: #fff;
  color: #fff;
}

.btn-outline-light:hover { background: rgba(255, 255, 255, 0.12); }

/* Un pacchetto non ancora pubblicato: il bottone resta (script.js ne blocca
   il clic) ma si legge come "in attesa", non come un'azione. */
.btn[data-pending="true"] {
  background: transparent;
  border: 1px dashed rgba(14, 14, 16, 0.32);
  color: rgba(14, 14, 16, 0.56);
  cursor: not-allowed;
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}

.tag-light {
  background: #fff;
  color: var(--ink);
}

.badge-soon {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-dim);
  border: 1px dashed var(--text-dim);
  padding: 1px 8px;
  border-radius: 999px;
  vertical-align: 2px;
}

/* Nav */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(14, 14, 16, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  --focus: var(--red-light);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
  font-stretch: 112%;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.brand-mark { display: block; width: 28px; height: 28px; }

.nav-links {
  display: flex;
  gap: 28px;
  margin-left: auto;
  margin-right: 12px;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.nav-links a:hover,
.nav-links a[aria-current] { color: #fff; }

/* Indicatore della sezione in vista (script.js): una sola linea che scorre
   sotto la voce attiva, e la barra di avanzamento sul bordo dell'header. */
.nav-links { position: relative; }

.nav-indicator {
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 1px;
  height: 2px;
  background: var(--red-light);
  border-radius: 1px;
  transform-origin: 0 0;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.2s;
}

.nav-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--red);
  transform: scaleX(0);
  transform-origin: 0 0;
  pointer-events: none;
}

.nav .btn[aria-current] {
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px var(--red-light);
}

@media (prefers-reduced-motion: reduce) {
  .nav-indicator { transition: none; }
}

/* Testate e titoli di sezione */

.eyebrow {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dim);
}

.section {
  padding: clamp(72px, 10vw, 120px) 0;
}

.section-alt { background: var(--paper-2); }

.section h2 {
  margin: 0 0 16px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.035em;
  max-width: 20ch;
}

.section-head { margin-bottom: 48px; }

.section-head.center {
  max-width: 760px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-head.center h2 { max-width: none; }

.section-lede {
  color: var(--text-dim);
  font-size: 18px;
  max-width: 60ch;
  margin: 0 0 40px;
}

.section-head .section-lede { margin-bottom: 0; }

.section-head + .section-lede { margin-top: -24px; }

.section-head.center .section-lede { margin: 0 auto; max-width: 52ch; }

.section h2.sub-head {
  margin: clamp(72px, 9vw, 112px) 0 32px;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: -0.03em;
}

/* Hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 112px 0 96px;
}

/* Il motivo: la montagna del logo ripetuta come curve di livello. */
.ridges {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 420px;
  display: block;
}

.ridges polyline {
  fill: none;
  stroke: #fff;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.ridges polyline:nth-child(1) { stroke-opacity: 0.14; }
.ridges polyline:nth-child(2) { stroke-opacity: 0.11; }
.ridges polyline:nth-child(3) { stroke-opacity: 0.08; }
.ridges polyline:nth-child(4) { stroke-opacity: 0.06; }
.ridges .ridge-accent { stroke: var(--red-light); stroke-opacity: 0.35; }

/* La montagna in ASCII animata (mountain.js): sostituisce .ridges quando
   lo script parte; senza JavaScript restano le curve di livello. */
.mountain-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.hero.has-mountain .ridges { display: none; }

.hero-inner { position: relative; }

.hero-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-end;
  justify-content: space-between;
}

.hero-copy { flex: 1 1 560px; min-width: 0; }

.hero h1 {
  margin: 0 0 32px;
  font-size: clamp(40px, 11vw, 136px);
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.lede {
  margin: 0 0 32px;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.4;
  max-width: 34ch;
  color: rgba(255, 255, 255, 0.82);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.hero-badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red-light);
  flex: none;
}

/* Scheda di download della testata, su vetro. */
.hero-card {
  flex: 0 1 380px;
  padding: 24px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-card p { margin: 0; }

.hero-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-card-head > div { flex: 1; }

.hero-card-head img { display: block; }

.hero-card-title {
  font-size: 20px;
  font-weight: 900;
  font-stretch: 112%;
  letter-spacing: -0.02em;
}

.hero-card-sub,
.hero-card-note {
  font-size: 14px;
  color: var(--text-dim);
}

.hero-card-note { font-size: 13px; }

.hero-card-text {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
}

.hero-card-ctas {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.hero-card-ctas .btn { flex: 1 1 0; padding: 0 18px; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin: 80px 0 0;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}

.stats > div { margin: 0; }

.stats dt {
  font-size: 48px;
  font-weight: 900;
  font-stretch: 112%;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 8px;
}

.stats dd {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  max-width: 24ch;
}

/* Screenshot grande a cavallo tra testata scura e pagina chiara: il fondo
   e' diviso a meta', la cornice di vetro ci sta sopra. */
.hero-shot {
  background: linear-gradient(var(--ink) 50%, var(--paper) 50%);
  padding: 0 var(--gutter);
}

.hero-shot .glass { max-width: 1080px; margin: 0 auto; }

/* Cornice di vetro: 8 px di margine traslucido, ombra corta come quella
   che l'app da' a una scheda che galleggia (.note-popup). */
.glass {
  margin: 0;
  padding: 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.glass-dark {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.glass img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  background: #fff;
}

.hero-shot .glass img {
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}

/* Ogni a.shot-link apre il popup di script.js (senza JavaScript, il file). */
.shot-link {
  display: block;
  cursor: zoom-in;
  border-radius: 6px;
}

/* Griglia delle funzioni: card grandi a coppie, poi tre piccole, poi una
   larga col video. Flex con basi diverse: su schermi stretti si impilano. */

.bento {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.tile {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-2);
  text-align: center;
}

.tile-lg { flex-basis: 520px; }

/* .tile e .ink hanno la stessa specificita': senza questa riga vincerebbe
   il grigio della card, col testo bianco sopra. */
.tile.ink { background: var(--ink); }

.tile-text { padding: 40px 28px 28px; }

.tile-lg .tile-text { padding: 48px 32px 32px; }

.tile-kicker {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-text);
}

.tile h3 {
  margin: 0 0 10px;
  font-size: 22px;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.tile-lg h3 {
  font-size: clamp(24px, 2.4vw, 32px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}

.tile p {
  margin: 0 auto;
  max-width: 40ch;
  font-size: 15px;
  color: var(--text-dim);
}

.tile-lg p { font-size: 16px; }

.tile-media {
  margin: auto 24px 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tile-media img,
.tile-media video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: top center;
}

.tile-lg .tile-media img,
.tile-lg .tile-media video { aspect-ratio: 16 / 10; }

/* Le tre barre degli strumenti: ritaglio largo della barra, non una pagina intera. */
.bars .tile { flex-basis: 360px; }
.bars .tile-media img { aspect-ratio: 3 / 1; object-position: top left; }
.bar-tools {
  margin: 18px 0 0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-dim);
}

.tile.ink .tile-media img,
.tile.ink .tile-media video { object-position: center; background: #fff; }

.media-top-left img { object-position: top left; }

/* Il modulo che si calcola da solo, disegnato in HTML (decorativo). */
.form-demo {
  padding: 24px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
  font-size: 14px;
}

.field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
}

.field-box {
  flex: 0 0 140px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: right;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.field-total { color: var(--text); font-weight: 800; }

.field-total .field-box { border: 2px solid var(--red); }

/* Card larga col video 3D: il video riempie la card, il testo sta in basso
   su un velo scuro. Sul telefono il video torna nelle sue proporzioni e il
   testo va sotto. */
.tile-wide {
  flex-basis: 100%;
  position: relative;
  min-height: 480px;
  justify-content: flex-end;
  text-align: left;
}

.tile-wide video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tile-wide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.72) 85%);
  pointer-events: none;
}

.tile-wide-text {
  position: relative;
  z-index: 1;
  padding: 40px;
  max-width: 640px;
}

.tile-wide h3 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.tile-wide p { margin: 0; color: rgba(255, 255, 255, 0.82); font-size: 16px; }

.tile-wide .tile-kicker { color: rgba(255, 255, 255, 0.72); }

/* Visore 3D: elenco a fisarmonica a sinistra, immagine a destra. */

.viewer {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  align-items: flex-start;
}

.viewer-list {
  flex: 1 1 400px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.viewer-media {
  flex: 1 1 520px;
  min-width: 0;
  position: relative;
  aspect-ratio: 16 / 10;
}

/* Un elemento per voce dell'elenco, uno alla volta: senza :has resta il
   primo. Riempiono la cornice; immagini molto larghe o fitte (render mode,
   modelli rotti) stanno intere su fondo scuro invece di essere ritagliate. */
.viewer-media .vm {
  position: absolute;
  inset: 8px;
  display: none;
  overflow: hidden;
  border-radius: 6px;
  background: #fff;
}

.viewer-media .vm-1 { display: block; }

.vm img,
.vm video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
  background: transparent;
}

.vm-contain { background: var(--ink) !important; }

.vm-contain img { object-fit: contain; }

@supports selector(:has(*)) {
  /* Specificita' piu' bassa delle regole sotto, che devono vincere. */
  .viewer:has(details[open]) .vm { display: none; }
  .viewer:has(.vl-1[open]) .vm-1,
  .viewer:has(.vl-2[open]) .vm-2,
  .viewer:has(.vl-3[open]) .vm-3,
  .viewer:has(.vl-4[open]) .vm-4,
  .viewer:has(.vl-5[open]) .vm-5 { display: block; }
}

.viewer-list details {
  border-radius: var(--radius-sm);
  opacity: 0.56;
  transition: background-color 300ms var(--ease), opacity 300ms var(--ease);
}

.viewer-list details:hover { opacity: 0.8; }

.viewer-list details[open] {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
}

.viewer-list summary {
  list-style: none;
  cursor: pointer;
  padding: 20px;
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 800;
  font-stretch: 108%;
  letter-spacing: -0.02em;
  line-height: 1.15;
  border-radius: var(--radius-sm);
}

.viewer-list summary::-webkit-details-marker { display: none; }

.viewer-list details p {
  margin: -8px 0 0;
  padding: 0 20px 20px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.72);
}

/* Filosofia */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--paper-2);
  border-radius: var(--radius);
  padding: 32px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
}

.card-num {
  font-size: 64px;
  font-weight: 900;
  font-stretch: 112%;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--red);
}

.card h3 {
  margin: 0 0 10px;
  font-size: 24px;
  letter-spacing: -0.02em;
}

.card p {
  margin: 0;
  color: var(--text-dim);
  font-size: 16px;
}

/* Tutto il resto: elenco a griglia separato da filetti. */

.features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  column-gap: 32px;
}

.feature {
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
}

.feature h4 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.feature p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
}

/* Download: le tre varianti, la tabella e i pacchetti.
   Fondo grigio, card bianche. */

.hardening-banner {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 16px;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

.hardening-banner strong { color: var(--text); }

.variant-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.variant-card {
  background: var(--paper);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 28px;
}

/* La "safe" e' quella che si sceglie per una ragione, non per default:
   il bordo pieno la distingue a colpo d'occhio senza un badge in piu'. */
.variant-card-safe { border-color: var(--ink); }

.variant-logo {
  display: block;
  margin-bottom: 16px;
}

.variant-card h3 {
  margin: 0;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.variant-card-sub {
  margin: 2px 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--red);
}

.variant-card p:last-child {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

.variant-matrix-wrap {
  overflow-x: auto;
  background: var(--paper);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.variant-matrix {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.variant-matrix caption {
  text-align: left;
  padding: 20px 20px 4px;
  font-size: 16px;
  font-weight: 800;
}

.variant-matrix th,
.variant-matrix td {
  padding: 12px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.variant-matrix thead th {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-dim);
}

.variant-matrix tbody th { font-weight: 600; }

.variant-matrix tbody tr:last-child th,
.variant-matrix tbody tr:last-child td { border-bottom: none; }

.variant-matrix .yes { color: var(--text); }

.variant-matrix .no { color: var(--text-dim); }

.variant-note {
  color: var(--text-dim);
  font-size: 15px;
  max-width: 70ch;
  margin: 0 0 40px;
  line-height: 1.65;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.download-card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.download-os {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}

.download-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.download-card p {
  margin: 0 0 18px;
  color: var(--text-dim);
  font-size: 15px;
  flex-grow: 1;
}

/* Ogni scheda (un tipo di installazione) elenca le tre varianti: nome e peso,
   bottone, checksum in un <details> chiuso perche' sei hash per scheda
   aperti sarebbero un muro di esadecimale. Nessun JavaScript. */
.download-variants {
  list-style: none;
  margin: 0;
  padding: 0;
}

.download-variant {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.download-variant:last-child { padding-bottom: 0; }

.download-variant-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.download-variant-name {
  font-weight: 800;
  font-size: 15px;
}

.download-variant-meta {
  font-size: 13px;
  color: var(--text-dim);
}

.download-sums summary {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  cursor: pointer;
}

.download-sums .checksums {
  margin-top: 8px;
  padding-top: 0;
  border-top: 0;
}

.download-pending {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-dim);
}

.download-card .download-pending { flex-grow: 0; margin-bottom: 0; }

.download-pending code {
  display: inline-block;
  margin-top: 4px;
  word-break: break-all;
}

.checksums {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.checksums > div {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 11.5px;
  line-height: 1.6;
}

.checksums dt {
  flex: none;
  width: 48px;
  color: var(--text-dim);
  font-weight: 700;
}

.checksums dd {
  margin: 0;
  font-family: var(--mono);
  color: var(--text-dim);
  word-break: break-all;
  user-select: all;
}

/* Riga "verifica il download" sotto le schede dei pacchetti. I due file
   SHA256SUMS/MD5SUMS stanno su R2 accanto ai pacchetti: senza questo link
   sarebbero caricati e invisibili, e l'unico modo di verificare un download
   resterebbe copiare l'hex a mano dalla pagina. */
.verify-note {
  margin: 24px 0 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
  max-width: 70ch;
}

.verify-note a { color: var(--red); }

.verify-note code {
  background: var(--paper);
  word-break: break-all;
}

/* FAQ: <details> nativi, separati da filetti. */

.faq {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
}

.faq h2 { flex: 1 1 300px; margin: 0; }

.faq-list { flex: 2 1 560px; min-width: 0; }

.faq-list details { border-bottom: 1px solid var(--line); }

.faq-list summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 0 20px;
  font-size: clamp(18px, 1.6vw, 22px);
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.faq-list summary::-webkit-details-marker { display: none; }

.faq-list summary::after {
  content: "+";
  flex: none;
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
  transition: transform 300ms var(--ease);
}

.faq-list details[open] summary::after { transform: rotate(45deg); }

.faq-list details p {
  margin: 0;
  padding: 0 48px 28px 0;
  font-size: 17px;
  color: var(--text-dim);
}

/* Footer */

.footer { padding: 56px 0 48px; }

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-weight: 900;
  font-stretch: 112%;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.footer-brand img { display: block; }

.footer-text {
  margin: 12px 0 0;
  max-width: 44ch;
  font-size: 15px;
  color: var(--text-dim);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-links a {
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover { color: var(--text); }

/* Comparsa allo scroll, solo CSS (animazioni legate alla vista): dove il
   browser non le supporta o si chiede meno movimento, tutto e' gia' fermo
   e visibile. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .section-head,
    .tile,
    .card,
    .feature,
    .viewer,
    .variant-card,
    .faq-list details {
      animation: reveal linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 35%;
    }
  }
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: none; }
}

/* Popup degli screenshot (script.js crea il <dialog>). Sfondo scuro e
   sfocato, immagine il piu' grande possibile dentro lo schermo, didascalia
   sotto; frecce ai lati su desktop, in basso accanto alla didascalia sul
   telefono, dove il pollice ci arriva. */
.lb-open { overflow: hidden; }

.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
  font-family: var(--font);
  --focus: var(--red-light);
}

.lightbox::backdrop {
  background: rgba(14, 14, 16, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.lb-frame {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 56px 88px 24px;
}

.lb-figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
  max-height: 100%;
}

.lb-img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 160px);
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  background: #fff;
}

.lb-cap {
  max-width: 680px;
  margin-top: 16px;
  text-align: center;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.72);
}

.lb-count {
  display: block;
  margin-bottom: 2px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.56);
  font-variant-numeric: tabular-nums;
}

.lb-title {
  color: #fff;
  font-weight: 800;
  margin-right: 6px;
}

.lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(14, 14, 16, 0.7);
  color: #fff;
  font: 400 30px/1 system-ui, sans-serif;
  cursor: pointer;
  transition: background-color 300ms var(--ease), border-color 300ms var(--ease);
}

.lb-btn:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }

.lb-close { top: 12px; right: 12px; width: 44px; height: 44px; font-size: 28px; }

.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }

.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }

.lightbox[open] .lb-figure { animation: lb-in 0.22s ease-out; }

.lightbox[open]::backdrop { animation: lb-fade 0.22s ease-out; }

@keyframes lb-in {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: none; }
}

@keyframes lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox[open] .lb-figure,
  .lightbox[open]::backdrop { animation: none; }
}

/* Responsive */

@media (max-width: 760px) {
  .nav-links { display: none; }
  .hero { padding: 72px 0 64px; }
  .hero-card { flex-basis: 100%; }
  .stats { margin-top: 56px; grid-template-columns: repeat(2, 1fr); }
  .stats dt { font-size: 36px; }
  .tile-wide { min-height: 0; }
  .tile-wide video { position: static; height: auto; }
  .tile-wide::after { display: none; }
  .tile-wide-text { padding: 24px 24px 32px; }
  .faq-list details p { padding-right: 0; }
  .lb-frame { padding: 56px 12px 88px; }
  .lb-img { max-height: calc(100dvh - 230px); }
  .lb-cap { font-size: 14px; padding: 0 4px; }
  .lb-prev,
  .lb-next { top: auto; bottom: 20px; transform: none; }
  .lb-prev { left: calc(50% - 64px); }
  .lb-next { right: calc(50% - 64px); }
}

@media (max-width: 420px) {
  .hero h1 { font-stretch: 100%; letter-spacing: -0.04em; }
  .hero-card-ctas .btn { flex-basis: 100%; }
  .tile-text,
  .tile-lg .tile-text { padding: 32px 20px 24px; }
  .tile-media { margin: auto 16px 0; }
  .variant-card,
  .download-card { padding: 20px; }
}

/* Font incorporati: elenco degli alfabeti in un <details> sotto la griglia. */

.fonts-lede {
  margin: -16px 0 24px;
  max-width: 68ch;
  font-size: 17px;
  color: var(--text-dim);
}

.font-scripts {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.font-scripts summary {
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
}

.font-scripts ul {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  columns: 200px auto;
  column-gap: 32px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-dim);
}

/* Sezione firme digitali (#signatures) e FAQ sui certificati incorporati. */

.feature a { color: var(--accent-text); font-weight: 600; }

.faq-list .faq-certs {
  margin: -12px 0 20px;
  padding: 0 48px 0 20px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-dim);
}

.faq-certs li + li { margin-top: 10px; }

.faq-certs strong { color: var(--text); }

.faq-certs code {
  display: inline-block;
  margin-top: 2px;
  font-size: 12px;
  word-break: break-all;
}

@media (max-width: 760px) {
  .faq-list .faq-certs { padding-right: 0; }
}
