/* ============================================================
   MFX // FLOW — BASE
   Reset, tipografia di sistema, primitive di layout.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + var(--s-5));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 300;
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }   /* menu mobile aperto */

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

/* --- TIPOGRAFIA --------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: var(--lh-title);
  margin: 0;
  letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); font-family: var(--font-body); font-weight: 400; letter-spacing: 0; }

p { margin: 0; max-width: var(--measure); }

a { color: inherit; text-decoration: none; }

/* Selezione testo in tinta brand */
::selection { background: var(--accent-soft); color: var(--text); }

/* Focus visibile: requisito minimo di qualità, non un extra */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* --- ELEMENTI RICORRENTI ------------------------------------ */

/* Eyebrow: etichetta di sezione in maiuscoletto */
.eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 500;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.eyebrow--accent { color: var(--accent); }

/* Testo secondario */
.lead  { font-size: var(--fs-lead); color: var(--muted); line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }

/* Corsivo Cormorant: usato solo su parole-chiave, mai su blocchi */
.italic { font-style: italic; }

/* --- LAYOUT -------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--tight { padding-block: var(--s-8); }

.section-head { margin-bottom: var(--s-7); }
.section-head h2 { margin-top: var(--s-4); }
.section-head p  { margin-top: var(--s-4); }

/* Divisore hairline a piena larghezza */
.rule { height: 1px; background: var(--hairline); border: 0; margin: 0; }

/* Stack verticale generico */
.stack > * + * { margin-top: var(--s-4); }

/* --- REVEAL AL SCROLL ---------------------------------------
   Attivato via IntersectionObserver in main.js.
   Senza JS il contenuto resta visibile (nessun contenuto nascosto).
------------------------------------------------------------- */
.js .reveal {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity var(--t-reveal) var(--ease),
    transform var(--t-reveal) var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* --- MOTION RIDOTTO ------------------------------------------ */
@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;
  }
  .js .reveal { opacity: 1 !important; transform: none !important; }
}

/* Solo per screen reader */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Salto al contenuto */
.skip-link {
  position: absolute; top: var(--s-3); left: var(--s-3);
  transform: translateY(-200%);
  background: var(--surface); color: var(--text);
  padding: var(--s-3) var(--s-4);
  border: 1px solid var(--hairline-hi);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  z-index: 100;
  transition: transform var(--t-state) var(--ease);
}
.skip-link:focus { transform: none; }
