/* ==========================================================
   MONOM — Base: font, reset, tipografia, griglia
   ========================================================== */

/* --- Font locali (nessuna chiamata a servizi esterni) ---
   Archivo variabile: larghezza 62–125%, peso 100–900.
   Titoli = Archivo espanso (125%), testi = Archivo normale.
   [DA CONFERMARE i font definitivi del marchio] */
@font-face {
  font-family: "Archivo";
  src: url("../assets/fonts/archivo-var.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("../assets/fonts/jetbrains-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* --- Misure comuni --- */
:root {
  --font-testo: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --larghezza-max: 1440px;
  --margine: 16px;            /* margine laterale (mobile) */
  --spazio-sezione: 64px;     /* respiro tra le sezioni */
  --altezza-header: 60px;
  --raggio: 6px;              /* "morbido, non tondo" */
  --filetto: 1px solid var(--colore-filetto);
}

@media (min-width: 768px) {
  :root {
    --margine: 32px;
    --spazio-sezione: 96px;
    --altezza-header: 68px;
  }
}

@media (min-width: 1200px) {
  :root {
    --margine: 48px;
    --spazio-sezione: 128px;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--altezza-header) + 8px);
}

body {
  margin: 0;
  background-color: var(--colore-fondo);
  color: var(--colore-testo);
  font-family: var(--font-testo);
  font-size: 1rem;
  line-height: 1.5;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  height: auto;
}

h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

/* --- Tipografia --- */

/* Titoli: grotesk espanso, maiuscolo */
.titolo {
  font-family: var(--font-testo);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 0.95;
  letter-spacing: -0.01em;
}

/* Dati ed etichette: monospace */
.mono {
  font-family: var(--font-mono);
  font-size: 0.6875rem; /* 11px */
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.testo-grande {
  font-size: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.tenue {
  color: var(--colore-testo-tenue);
}

/* --- Contenitore --- */
.contenitore {
  width: 100%;
  max-width: var(--larghezza-max);
  margin-inline: auto;
  padding-inline: var(--margine);
}

/* --- Accessibilità --- */
.solo-lettori {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.salta-al-contenuto {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--nero);
  color: var(--bianco);
  text-decoration: none;
  transform: translateY(-200%);
}

.salta-al-contenuto:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid var(--colore-accento);
  outline-offset: 3px;
}

/* Sopra il rosso il focus diventa nero, per restare visibile */
.su-rosso :focus-visible {
  outline-color: var(--nero);
}

::selection {
  background: var(--rosso);
  color: var(--nero);
}

/* --- Movimento ridotto --- */
@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;
  }
}
