/* ============================================================
   BASE — reset, tipografia, focus, accessibilita'
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;   /* header sticky */
}

body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: 400 var(--text-body)/1.7 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-synthesis-weight: none;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }

/* ============================================================
   TITOLI — Fraunces, asse ottico variabile.
   `opsz` alto sui corpi grandi (grazie piu' marcate, piu' carattere),
   basso sui corpi piccoli (aste piu' robuste, si leggono).
   ============================================================ */
h1, h2, h3, h4 {
  margin: 0;
  text-wrap: balance;
  font-family: var(--font-display);
}
h1 {
  font-size: var(--text-h1); line-height: 1.08; letter-spacing: -0.022em;
  font-weight: 600; font-variation-settings: "opsz" 120;
}
h2 {
  font-size: var(--text-h2); line-height: 1.14; letter-spacing: -0.018em;
  font-weight: 600; font-variation-settings: "opsz" 90;
}
h3 {
  font-size: var(--text-h3); line-height: 1.22; letter-spacing: -0.012em;
  font-weight: 600; font-variation-settings: "opsz" 40;
}
h4 {
  font-size: var(--text-h4); line-height: 1.32; letter-spacing: -0.008em;
  font-weight: 600; font-variation-settings: "opsz" 24;
}

.display {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--text-display); line-height: 1.02; letter-spacing: -0.028em;
  font-variation-settings: "opsz" 144;
  margin: 0; text-wrap: balance;
}

p { margin: 0; text-wrap: pretty; }
/* Riga di lettura 60-72 caratteri: vale per il testo corrente, non per
   le liste che formano la struttura (elenchi, navigazione, footer). */
p, li { max-width: var(--container-text); }
.elenco > li, .contatti-lista li, .site-footer li,
.nav__list li, .breadcrumb li, .prove li { max-width: none; }

.lead    { font-size: var(--text-lg); line-height: 1.6; color: var(--c-text-muted); }
.small   { font-size: var(--text-small); line-height: 1.55; }
.caption { font-size: var(--text-caption); line-height: 1.5; letter-spacing: .01em;
           color: var(--c-text-muted); }

/* Occhiello: piccolo, spaziato, sempre sopra il titolo */
.eyebrow {
  font-family: var(--font-body); font-weight: 700;
  font-size: var(--text-caption);
  line-height: 1.2; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--c-accent);
  margin: 0 0 var(--space-3);
}

/* ============================================================
   RITMO VERTICALE
   Un solo insieme di regole. Niente margini inventati sul posto.
   ============================================================ */
.stack        > * + *  { margin-top: var(--space-4); }
.stack-tight  > * + *  { margin-top: var(--space-2); }
.stack-loose  > * + *  { margin-top: var(--space-6); }
.stack h1 + p, .stack h2 + p, .stack h3 + p { margin-top: var(--space-3); }
.stack .actions        { margin-top: var(--space-6); }

/* Distanza fissa fra un'immagine e il testo che la riguarda */
.media + *, * + .media { margin-top: var(--gap-media); }

/* ---------- LINK ---------- */
a { color: var(--c-accent); }
.prose a, a.inline {
  color: var(--c-accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-fast) var(--ease),
              text-decoration-thickness var(--dur-fast) var(--ease);
}
.prose a:hover, a.inline:hover { color: var(--c-accent-hover); text-decoration-thickness: 2px; }
.prose a:active, a.inline:active { color: var(--c-primary-active); }

/* ---------- FOCUS — sempre visibile, mai rimosso ---------- */
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---------- UTILITY ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--space-4); top: -100px; z-index: var(--z-modal);
  background: var(--c-primary); color: var(--c-on-primary);
  padding: 12px var(--space-5); border-radius: var(--r-md);
  font-weight: 700; text-decoration: none;
  transition: top var(--dur-base) var(--ease-out);
}
.skip-link:focus { top: var(--space-4); }

/* Dati non ancora confermati dal cliente: restano dichiarati a schermo,
   cosi' nessuno li scambia per verificati. */
.da-confermare {
  border-bottom: 1px dashed var(--c-accent);
  padding-bottom: 1px;
}

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