/* ============================================================
   BASE — reset, tipografia, fondo pagina, accessibilità
   ============================================================ */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--scala-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--testo);
  background-color: var(--carta);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }

/* --- Titoli: stessa famiglia del testo, distinti da peso e
       spaziatura anziché da un secondo carattere -------------- */
h1, h2, h3 {
  font-family: var(--font);
  margin: 0 0 var(--sp-2);
  text-wrap: balance;
}

h1 {
  font-family: var(--font-titoli);
  font-size: var(--scala-1);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h2 {
  font-family: var(--font-titoli);
  font-size: var(--scala-2);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.016em;
}

h3 {
  font-size: var(--scala-3);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.012em;
}

/* Enfasi nei titoli: colore, non corsivo di un altro font */
h1 em, h2 em {
  font-style: italic;
  font-weight: 400;
  color: var(--blu);
}

p { margin: 0 0 var(--sp-2); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration-color: var(--blu); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

ul, ol { margin: 0; padding: 0; list-style: none; }
strong { font-weight: 600; }

/* --- Etichetta di sezione ----------------------------------
   Stessa famiglia, resa riconoscibile da maiuscoletto,
   spaziatura ampia e un trattino che la ancora al margine.
   ----------------------------------------------------------- */
.mono-label,
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font);
  font-size: var(--scala-micro);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--testo-tenue);
  margin: 0 0 var(--sp-2);
}
.mono-label::before,
.eyebrow::before {
  content: "";
  flex: none;
  width: 18px;
  height: 1.5px;
  background: var(--acqua);
}
.eyebrow { color: var(--blu); margin-bottom: var(--sp-3); }
.eyebrow::before { background: var(--blu); }

/* Nelle liste chiave-valore l'etichetta resta in linea */
.credenziali .mono-label,
.contatti-lista .mono-label { display: inline-flex; }

.lede, .section-lede {
  font-size: var(--scala-lede);
  line-height: 1.6;
  color: var(--testo-tenue);
  max-width: 58ch;
}

/* --- Accessibilità ------------------------------------------ */
.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; left: var(--sp-2); top: -100px; z-index: 100;
  background: var(--inchiostro); color: var(--carta);
  padding: var(--sp-1) var(--sp-2); border-radius: var(--raggio);
  transition: top var(--transizione);
}
.skip-link:focus { top: var(--sp-2); }

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

/* --- Comparsa in scroll: breve, per non rallentare la lettura */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 450ms ease, transform 450ms cubic-bezier(0.2, 0.6, 0.3, 1);
}
.reveal.is-visible { opacity: 1; transform: none; }

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