/**
 * lucalevi.com — foglio di stile del sito principale.
 *
 * Stesso sistema visivo di lucalevi's way (siti/way/app/src/index.css):
 * gli stessi token HSL a saturazione 0%, la stessa scala tipografica,
 * gli stessi ritmi verticali. La differenza e' che qui non c'e' Tailwind:
 * il sito e' HTML statico, quindi le utilita' che servivano sono scritte
 * per esteso. Se un giorno questo sito diventa un'app Vite come way,
 * i token si copiano da qui senza toccare niente.
 */

/* ------------------------------------------------------------------ token */
:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 8%;
  --muted: 0 0% 96%;
  --muted-foreground: 0 0% 42%;
  --border: 0 0% 88%;
  --hairline: 0 0% 80%;
  --ink: 0 0% 6%;
  --ink-foreground: 0 0% 96%;
  --ink-muted: 0 0% 62%;
  --accent-surface: 0 0% 93%;
  --ring: 0 0% 20%;
  --radius: 2px;

  --font-display: "EB Garamond", "EB Garamond Riserva", "EB Garamond Riserva Android", Georgia, "Times New Roman", serif;
  --font-sans: Inter, "Inter Riserva", "Inter Riserva Android", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------- base */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* La testata resta ferma in cima: senza questo spazio, l'elemento raggiunto
     col tasto Tab puo' finirci sotto (WCAG 2.4.11). */
  scroll-padding-top: 6rem;
  scroll-padding-bottom: 1.5rem;
}

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  overflow-x: clip; /* clip, non hidden: hidden romperebbe l'header sticky */
  font-feature-settings: "ss01" 1, "cv11" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}


h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
}

h1 { font-size: clamp(2.5rem, 8vw, 5.5rem); line-height: 0.92; letter-spacing: -0.038em; }
h2 { font-size: clamp(1.9rem, 5vw, 3.25rem); line-height: 1.05; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); line-height: 1.25; letter-spacing: -0.01em; }

p { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: inherit; }

:where(a, button, [tabindex]):focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: var(--radius);
}
.section-ink :where(a, button, [tabindex]):focus-visible {
  outline-color: hsl(var(--ink-foreground));
}

::selection { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.section-ink ::selection { background: hsl(var(--ink-foreground)); color: hsl(var(--ink)); }

/* ------------------------------------------------------------- primitive */
.container-editorial {
  margin-inline: auto;
  width: 100%;
  max-width: 72rem;
  padding-inline: 1.25rem;
}
@media (min-width: 640px) { .container-editorial { padding-inline: 2rem; } }
@media (min-width: 1024px) { .container-editorial { padding-inline: 3rem; } }

/* Il ritmo verticale e' meta' di quello di lucalevi's way, ed e' voluto: la'
   le sezioni sono lunghe e il respiro serve, qui sono corte e dense, e lo
   stesso respiro diventava un buco bianco fra una sezione e l'altra. */
.section-rhythm { padding-block: 3.5rem; }
@media (min-width: 640px) { .section-rhythm { padding-block: 4.25rem; } }
@media (min-width: 1024px) { .section-rhythm { padding-block: 5rem; } }
@media (min-width: 1280px) { .section-rhythm { padding-block: 5.5rem; } }

.section-ink { background: hsl(var(--ink)); color: hsl(var(--ink-foreground)); position: relative; }

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  line-height: 1;
}
.eyebrow.muted { color: hsl(var(--muted-foreground)); }
.eyebrow.ink-muted { color: hsl(var(--ink-muted)); }

.numeral { font-family: var(--font-display); line-height: 1; font-variant-numeric: tabular-nums; }

.link-underline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: hsl(var(--hairline));
  transition: text-decoration-color 180ms var(--ease-editorial);
}
.link-underline:hover { text-decoration-color: currentColor; }

.mt-tight { margin-top: 1rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  z-index: 100;
}
.skip-link:focus {
  left: 1rem;
  top: 1rem;
  background: hsl(var(--ink));
  color: hsl(var(--ink-foreground));
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.04;
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ----------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  height: 4rem;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: height 180ms var(--ease-editorial), border-color 180ms var(--ease-editorial);
}
@media (min-width: 1024px) { .site-header { height: 76px; } }
.site-header[data-bordered="true"] { border-bottom-color: hsl(var(--hairline)); }
.site-header[data-compact="true"] { height: 3.5rem; }
@media (min-width: 640px) { .site-header[data-compact="true"] { height: 4rem; } }
@media (min-width: 1024px) { .site-header[data-compact="true"] { height: 76px; } }

.header-row {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.wordmark-link { display: flex; align-items: center; min-height: 44px; text-decoration: none; }
.wordmark {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
  font-size: 1.25rem;
  transition: font-size 180ms var(--ease-editorial);
}
.site-header[data-compact="true"] .wordmark { font-size: 1.0625rem; }
@media (min-width: 1024px) { .site-header[data-compact="true"] .wordmark { font-size: 1.25rem; } }

.header-nav { display: none; gap: 1.75rem; }
@media (min-width: 640px) { .header-nav { display: flex; } }
.header-nav a {
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  transition: color 180ms var(--ease-editorial);
}
.header-nav a:hover { color: hsl(var(--foreground)); }

.header-side { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }

.progress-bar {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: 2px;
  transform-origin: left;
  transform: scaleX(0);
  background: hsl(var(--foreground));
}

/* ---------------------------------------------------------- lang switch */
.lang-switch { display: flex; align-items: center; }
.lang-switch button,
.lang-switch a {
  appearance: none;
  border: 0;
  background: none;
  cursor: pointer;
  min-height: 44px;
  padding-inline: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  letter-spacing: 0.14em;
  color: hsl(var(--muted-foreground));
  transition: color 180ms var(--ease-editorial);
}
.lang-switch button:hover,
.lang-switch a:hover { color: hsl(var(--foreground)); }
.lang-switch button[aria-pressed="true"],
.lang-switch a[aria-current="true"] {
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}
/* I due collegamenti dell'interruttore sono <a>, non <button>: da settembre
   2026 IT ed EN sono indirizzi veri (/ e /en/), cosi' si possono condividere e
   i motori di ricerca li seguono. Restano i selettori sui bottoni perche' la
   404, che non va indicizzata, cambia lingua sul posto. */
.lang-switch a { text-decoration: none; display: inline-flex; align-items: center; }
.lang-sep { display: block; width: 1px; height: 0.875rem; margin-inline: 0.25rem; background: hsl(var(--hairline)); }

.lang-switch-dark button,
.lang-switch-dark a { color: hsl(var(--ink-muted)); }
.lang-switch-dark button:hover,
.lang-switch-dark a:hover { color: hsl(var(--ink-foreground)); }
.lang-switch-dark button[aria-pressed="true"],
.lang-switch-dark a[aria-current="true"] { color: hsl(var(--ink-foreground)); }
.lang-switch-dark .lang-sep { background: hsl(var(--ink-muted) / 0.5); }

/* ------------------------------------------------------------------- hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 92svh;
  overflow: hidden;
}
@media (min-width: 1024px) { .hero { min-height: 100svh; } }

/* Il segno di lucalevi.com e' la greca, in colonna lungo il bordo destro
   dell'hero: la disegna assets/main.js. I cerchi concentrici restano il segno
   di lucalevi's way. */
.hero-meandro {
  position: absolute;
  top: 0;
  bottom: 0;
  right: -18%;
  width: 62vw;
  max-width: 300px;
  pointer-events: none;
}
.hero-meandro svg { width: 100%; height: 100%; }
@media (min-width: 640px) { .hero-meandro { right: -4%; width: 32vw; } }
@media (min-width: 1024px) { .hero-meandro { right: 4%; width: 24vw; max-width: 340px; } }

.hero-inner { position: relative; padding-block: 6rem; }
@media (min-width: 1024px) { .hero-inner { padding-block: 7rem; } }

.hero-eyebrow { color: hsl(var(--ink-muted)); margin-bottom: 1.75rem; }
.hero h1 { max-width: 30ch; color: hsl(var(--ink-foreground)); }
.hero h1 em { font-style: italic; font-weight: 400; }

.hero-sub {
  margin-top: 2rem;
  max-width: 52ch;
  color: hsl(var(--ink-foreground) / 0.72);
  font-size: clamp(0.95rem, 1vw, 1.0625rem);
  line-height: 1.6;
}

.hero-actions { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 0.75rem; }
@media (min-width: 640px) { .hero-actions { flex-direction: row; align-items: center; } }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
  transition: background-color 180ms var(--ease-editorial), border-color 180ms var(--ease-editorial), color 180ms var(--ease-editorial);
}
.btn-primary { background: hsl(var(--ink-foreground)); color: hsl(var(--ink)); }
.btn-primary:hover { background: hsl(var(--background)); }
.btn-secondary {
  border: 1px solid hsl(var(--ink-foreground) / 0.35);
  color: hsl(var(--ink-foreground));
  font-weight: 400;
}
.btn-secondary:hover { border-color: hsl(var(--ink-foreground)); }

/* --------------------------------------------------------------- progetti */
/* Titolo a sinistra, occhiello sopra, sommario a destra: su schermo largo il
   titolo da solo lasciava vuota meta' pagina e l'intestazione era alta il
   doppio del necessario. Sotto i 900px torna una colonna sola. */
.sezione-testata { display: grid; gap: 1.25rem; }
@media (min-width: 900px) {
  .sezione-testata {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: end;
  }
  .sezione-testata > .section-lede { margin-top: 0; padding-bottom: 0.4rem; }
}

.section-lede {
  margin-top: 1.5rem;
  max-width: 52ch;
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.65;
  color: hsl(var(--ink-muted));
}

.cards {
  margin-top: 3.5rem;
  display: grid;
  gap: 1px;
  background: hsl(var(--hairline));
  border-block: 1px solid hsl(var(--hairline));
}
@media (min-width: 900px) { .cards { grid-template-columns: 1fr 1fr; } }

.card {
  background: hsl(var(--background));
  padding: 2.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
@media (min-width: 900px) {
  .card { padding: 3rem 2.5rem 3rem 0; }
  .card + .card { padding-left: 2.5rem; padding-right: 0; }
}

.card-index { font-size: 0.875rem; color: hsl(var(--hairline)); letter-spacing: 0.05em; }
.card h3 { margin-top: 1rem; }
.card-body {
  margin-top: 1rem;
  font-size: clamp(1rem, 1.1vw, 1.0625rem);
  line-height: 1.65;
  max-width: 46ch;
  color: hsl(var(--muted-foreground));
}
.card-meta {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--foreground)); }
.dot-soon { background: none; border: 1px solid hsl(var(--hairline)); }
.card-link { margin-top: 1rem; display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; }

/* ------------------------------------------------------------------ libri */
.books {
  margin-top: 2.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2.5rem 1.5rem;
}
@media (min-width: 1100px) { .books { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3rem 2rem; } }

.book { display: flex; flex-direction: column; }

/* Il riquadro tiene le proporzioni di un tascabile (1:1.6), cosi' la fila
   resta allineata anche se le copertine hanno formati leggermente diversi. */
.book-cover {
  position: relative;
  aspect-ratio: 1 / 1.6;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid hsl(var(--ink-foreground) / 0.15);
  border-radius: var(--radius);
  background: hsl(var(--ink-foreground) / 0.04);
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }

.book-cover-fallback {
  padding: 1.25rem;
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.6vw, 1.15rem);
  line-height: 1.25;
  color: hsl(var(--ink-muted));
  text-wrap: balance;
}

.book-text { margin-top: 1rem; display: flex; flex-direction: column; flex: 1 1 auto; }

.book-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: hsl(var(--ink-foreground));
  text-wrap: balance;
}
.book-subtitle {
  margin-top: 0.25rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 0.9375rem;
  line-height: 1.3;
  color: hsl(var(--ink-muted));
}
.book-note {
  margin-top: 0.6rem;
  font-size: 0.875rem;
  line-height: 1.55;
  color: hsl(var(--ink-muted));
}
.book-action { margin-top: auto; padding-top: 0.75rem; font-size: 0.8125rem; letter-spacing: 0.04em; }
.book-action a { color: hsl(var(--ink-foreground)); }
.book-soon { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.8125rem; color: hsl(var(--ink-muted)); }

/* --------------------------------------------------------------- chi sono */
.about-grid { display: grid; gap: 2.5rem; }
@media (min-width: 1024px) { .about-grid { grid-template-columns: 4fr 8fr; gap: 3rem; } }

.about-left img {
  margin-top: 2rem;
  width: 10rem;
  border-radius: var(--radius);
  object-fit: cover;
}
@media (min-width: 640px) { .about-left img { width: 12rem; } }
@media (min-width: 1024px) { .about-left img { margin-top: 2.5rem; width: 100%; max-width: 280px; } }
.about-left h2 { max-width: 14ch; }

.about-lede {
  border-left: 1px solid hsl(var(--foreground));
  padding-left: 1.25rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  line-height: 1.3;
}
@media (min-width: 640px) { .about-lede { padding-left: 1.5rem; } }
@media (min-width: 1024px) { .about-lede { padding-left: 2rem; } }

.about-body { margin-top: 2.25rem; display: grid; gap: 1.5rem; }
.about-body p {
  font-size: clamp(1rem, 1.1vw, 1.125rem);
  line-height: 1.65;
  max-width: 68ch;
  color: hsl(var(--muted-foreground));
}

.about-cta { margin-top: 2.25rem; }

.meander-wrap { margin-top: 4rem; overflow: hidden; }
@media (min-width: 640px) { .meander-wrap { margin-top: 5rem; } }
.meander { height: 1.25rem; width: 100%; opacity: 0.35; }

/* ----------------------------------------------------------------- footer */
.site-footer { border-top: 1px solid hsl(var(--ink-foreground) / 0.15); }
.footer-inner {
  padding-block: 3rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}
@media (min-width: 1024px) {
  .footer-inner { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 3rem; padding-block: 4rem; }
}
.footer-wordmark { font-family: var(--font-display); font-size: 1.25rem; }
.footer-link { margin-top: 0.75rem; display: inline-flex; align-items: center; min-height: 44px; font-size: 0.875rem; color: hsl(var(--ink-foreground)); }
/* Una colonna del piede con piu' di un collegamento: uno sotto l'altro.
   Affiancati, i due .footer-link sono inline-flex e i loro sottolineati si
   toccano — a 360 px si leggeva «lucalevi's wayInsurek», una parola sola. */
.footer-elenco { display: flex; flex-direction: column; align-items: flex-start; }
.footer-elenco .footer-link { margin-top: 0.5rem; }
.footer-elenco .footer-link:first-child { margin-top: 0.75rem; }

.footer-end { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; }
@media (min-width: 1024px) { .footer-end { align-items: flex-end; } }
.footer-fine { font-size: 0.8125rem; color: hsl(var(--ink-muted)); }

/* -------------------------------------------------------------- movimento */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity 600ms var(--ease-editorial), transform 600ms var(--ease-editorial); }

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


/* =================================================================== 2026-09
   Sezioni aggiunte con la riscrittura: navigazione, «way», libri con PDF,
   codice su GitHub, altrove, teaser della galleria.
   ======================================================================= */

/* ------------------------------------------------------- navigazione */
/* Prima la navigazione spariva sotto i 640px e sul telefono non c'era modo
   di raggiungere le sezioni. Adesso resta, e scorre di lato se non ci sta.
   Provata davvero a 390 px, il 12 settembre 2026: il contenuto misura 517 px
   in una finestra da 205, e quel che resta fuori in pratica non esiste —
   nessuno trascina di lato una barra che non sembra trascinabile. Due
   correzioni, per questo:
   1. la sfumatura sfumava gli ultimi 8% della barra, cioe' 16 px, e il taglio
      cadeva quasi sempre dentro uno spazio vuoto fra due voci: una sfumatura
      sul nulla non si vede. Ora ne sfuma il 20%, abbastanza da mordere sempre
      una parola e far capire che la riga continua;
   2. sul telefono vengono prima i due siti vicini. Sono gli unici
      collegamenti che lo scorrimento della pagina non regala: le ancore
      interne (Libri, Chi sono, Tesi e CV, Codice) si raggiungono scorrendo, e
      finivano davanti proprio quelle. Da 640 px in su, dove ci sta tutto,
      l'ordine torna quello dell'HTML.
   La sfumatura e' in pixel e non in percentuale, e lo spazio fra le voci
   scende a 0,875rem, perche' i due numeri devono andare d'accordo: a 390 px
   «Insurek» finisce prima che la sfumatura cominci — resta netto — e quel che
   sfuma e' la prima lettera della voce dopo, che cosi' si intravede. Con 20 px
   di spazio e una sfumatura in percentuale il taglio cadeva nel vuoto fra due
   voci: una sfumatura sul nulla non si vede, e sbiadiva «Insurek». */
.header-nav {
  display: flex;
  gap: 0.875rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(to right, #000 0 calc(100% - 18px), transparent);
}
.header-nav::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .header-nav { gap: 1.5rem; overflow: visible; mask-image: none; } }
@media (min-width: 1024px) { .header-nav { gap: 1.75rem; } }
.header-nav a { white-space: nowrap; }
.nav-esterno { color: hsl(var(--foreground)); order: -1; }
@media (min-width: 640px) { .nav-esterno { order: 0; } }
.nav-freccia { margin-left: 0.25rem; font-size: 0.9375em; opacity: 0.7; }

/* Sotto i 640 px la navigazione va su una seconda riga, larga quanto lo
   schermo. Prima stava stretta fra il nome e le lingue: a 390 px se ne vedeva
   una voce e mezza (sulle pagine a quattro lingue una sola), e a 320 px meno
   ancora. Adesso si vedono tre o quattro voci, e la sfumatura a destra dice
   che la riga continua. */
@media (max-width: 639.98px) {
  .site-header,
  .site-header[data-compact="true"] { height: auto; }
  .header-row { flex-wrap: wrap; column-gap: 0.75rem; row-gap: 0; }
  .wordmark-link { min-height: 48px; }
  .site-header[data-compact="true"] .wordmark-link { min-height: 44px; }
  .header-nav {
    order: 3;
    flex: 1 0 100%;
    margin-inline: -1.25rem;
    padding-inline: 1.25rem;
    gap: 1.25rem;
    border-top: 1px solid hsl(var(--border));
  }
  .header-nav a { min-height: 40px; }
  /* La galleria ha margini di 1rem, non 1.25rem: la riga deve seguirli. */
  .container-largo .header-nav { margin-inline: -1rem; padding-inline: 1rem; }
  html { scroll-padding-top: 6.5rem; }
}

/* --------------------------------------------------------------- «way» */
/* Banda grigia, non bianca: e' il collegamento piu' importante della pagina e
   deve leggersi come un blocco, non come del testo perso in mezzo al bianco. */
.feature { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .feature { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 4rem; } }

.feature-testo h2 { font-size: clamp(2rem, 4.4vw, 3rem); }
.feature-body {
  margin-top: 1.25rem;
  font-size: clamp(1rem, 1.15vw, 1.125rem);
  line-height: 1.65;
  max-width: 54ch;
  color: hsl(var(--muted-foreground));
}
.feature-meta {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: hsl(var(--muted-foreground));
}
.feature-testo .btn { margin-top: 1.75rem; }

.feature-segno { display: none; }
@media (min-width: 900px) {
  .feature-segno { display: block; justify-self: center; width: 100%; max-width: 260px; }
  .feature-segno svg { width: 100%; height: auto; }
}

/* Bottone scuro su fondo chiaro: il rovescio di .btn-primary. */
.btn-scuro { background: hsl(var(--ink)); color: hsl(var(--ink-foreground)); }
.btn-scuro:hover { background: hsl(var(--foreground)); }

.section-grigia { background: hsl(var(--muted)); }
.lede-chiara { color: hsl(var(--muted-foreground)); }
.sezione-link { margin-top: 2rem; display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; }

/* --------------------------------------------------- libri: due azioni */
.book-actions {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
}
/* Il PDF gratuito e' l'azione principale della scheda: bottone pieno, non un
   contorno che si perdeva sul nero. Amazon resta il collegamento secondario. */
.book-pdf {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  background: hsl(var(--ink-foreground));
  color: hsl(var(--ink));
  font-weight: 500;
  text-decoration: none;
  transition: background-color 180ms var(--ease-editorial);
}
.book-pdf:hover { background: hsl(var(--background)); }
.book-amazon { color: hsl(var(--ink-muted)); }
/* Col dito, un collegamento da solo deve essere alto 44 px, non 16: su
   telefono «Su Amazon» e i collegamenti del piede erano difficili da prendere. */
@media (pointer: coarse) {
  .book-amazon,
  .footer-fine-link,
  .prosa-fine a { display: inline-flex; align-items: center; min-height: 44px; }
  .footer-end { gap: 0.25rem; }
}
.book-amazon:hover { color: hsl(var(--ink-foreground)); }

/* ------------------------------------------------------- studi e lavoro */
/* Due schede sole, sul fondo scuro come i libri: sono documenti da scaricare,
   e il bottone chiaro pieno e' lo stesso di li'. */
.documenti {
  margin-top: 2.75rem;
  display: grid;
  gap: 1px;
  background: hsl(var(--ink-foreground) / 0.15);
  border: 1px solid hsl(var(--ink-foreground) / 0.15);
}
@media (min-width: 900px) { .documenti { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }

.documento {
  background: hsl(var(--ink));
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
@media (min-width: 900px) { .documento { padding: 2.5rem 2rem; } }

.documento-titolo {
  margin-top: 1rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2.1vw, 1.5rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: hsl(var(--ink-foreground));
  text-wrap: balance;
}
.documento-sottotitolo {
  margin-top: 0.35rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: hsl(var(--ink-muted));
}
.documento-meta {
  margin-top: 1.1rem;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  line-height: 1.7;
  color: hsl(var(--ink-muted));
}
.documento-body {
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  max-width: 52ch;
  color: hsl(var(--ink-foreground) / 0.72);
}
.documento-fine {
  margin-top: 1rem;
  font-size: 0.8125rem;
  line-height: 1.6;
  max-width: 52ch;
  color: hsl(var(--ink-muted));
}
/* `display: flex` batte la regola del browser per [hidden]: senza questa riga
   i bottoni resterebbero visibili anche quando il file non c'e'. */
.documento-azioni[hidden] { display: none; }

.documento-azioni {
  margin-top: auto;
  padding-top: 1.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.documento-attesa {
  margin-top: auto;
  padding-top: 1.75rem;
  max-width: 46ch;
  font-size: 0.875rem;
  line-height: 1.6;
  color: hsl(var(--ink-muted));
}

/* -------------------------------------------------------------- codice */
.repos {
  margin-top: 2.75rem;
  display: grid;
  gap: 1px;
  background: hsl(var(--hairline));
  border: 1px solid hsl(var(--hairline));
}
@media (min-width: 700px) { .repos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .repos { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.repo {
  background: hsl(var(--muted));
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
}
@media (min-width: 700px) { .repo { padding: 2rem 1.75rem 1.75rem; } }

.repo-alto { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.repo-indice { font-size: 0.875rem; color: hsl(var(--hairline)); letter-spacing: 0.05em; }
.repo-linguaggio {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: hsl(var(--muted-foreground));
}
.repo-nome {
  margin-top: 1rem;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  word-break: break-word;
}
.repo-body {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: hsl(var(--muted-foreground));
}
.repo-link { margin-top: 1.25rem; padding-top: 0.5rem; align-self: flex-start; display: inline-flex; align-items: center; min-height: 40px; font-size: 0.875rem; }
.repo-body + .repo-link { margin-top: auto; }
/* La riga dei collegamenti di una scheda: GitHub e, se c'e', il sito che gira.
   Sta in fondo alla scheda (margin-top: auto) come faceva prima il solo
   collegamento a GitHub, e a schermo stretto i due vanno a capo. */
.repo-link-riga { margin-top: auto; display: flex; flex-wrap: wrap; column-gap: 1.5rem; }
.repo-link-riga .repo-link { margin-top: 1.25rem; }

/* ------------------------------------------------------------- altrove */
.canali {
  margin-top: 2.75rem;
  display: grid;
  gap: 2.25rem;
  border-top: 1px solid hsl(var(--hairline));
  padding-top: 2.25rem;
}
@media (min-width: 800px) { .canali { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem; } }

.canale-nome {
  font-family: var(--font-display);
  line-height: 1.2;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  letter-spacing: -0.01em;
}
.canale-body {
  margin-top: 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.6;
  max-width: 40ch;
  color: hsl(var(--muted-foreground));
}
.canale a { margin-top: 1rem; display: inline-flex; align-items: center; min-height: 44px; font-size: 0.9375rem; }

/* ------------------------------------------------- teaser della galleria */
/* Niente spazio in fondo: la striscia arriva fino al bordo del footer e fa da
   chiusura. Prima restavano cento pixel di nero fra due sezioni nere, e le
   due si leggevano come un blocco solo. */
.teaser { padding-block: 3.5rem 0; overflow: hidden; }
@media (min-width: 640px) { .teaser { padding-block: 4.25rem 0; } }
@media (min-width: 1024px) { .teaser { padding-block: 5rem 0; } }

.teaser-cta { margin-top: 2rem; }

.teaser-striscia {
  margin-top: 3rem;
  display: flex;
  gap: 0.75rem;
  height: 9rem;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent, #000 6% 88%, transparent);
}
@media (min-width: 1024px) { .teaser-striscia { height: 13rem; gap: 1rem; margin-top: 3.5rem; } }

.striscia-voce {
  flex: 0 0 auto;
  height: 100%;
  aspect-ratio: var(--rapporto, 1.5);
  overflow: hidden;
  filter: grayscale(0.72) contrast(1.04);
  opacity: 0.62;
  transition: opacity 400ms var(--ease-editorial), filter 400ms var(--ease-editorial);
}
.teaser:hover .striscia-voce { opacity: 0.85; }
.striscia-voce:hover { filter: none; opacity: 1; }
.striscia-voce img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------- footer */
.footer-fine-link { font-size: 0.8125rem; color: hsl(var(--ink-muted)); }
.footer-fine-link:hover { color: hsl(var(--ink-foreground)); }

/* ------------------------------------------------------------ alto contrasto */
/* Con i colori forzati (Windows, «Contrasto elevato») sfondi e ombre spariscono
   e il sistema ridisegna testo e bordi con i suoi colori. I bottoni pieni
   diventerebbero testo nudo: gli si da' un bordo, che resta. */
@media (forced-colors: active) {
  .btn, .skip-link:focus, .lightbox button { border: 1px solid ButtonText; }
  :where(a, button, summary, [tabindex]):focus-visible { outline-color: Highlight; }
}

/* Testo che sta nella pagina solo per chi la ascolta. */
.solo-voce {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
