/* =============================================================================
   Neon Modena — basi del design system
   Una cosa che si ripete ha una fonte sola: i valori stanno qui, i pezzi in componenti.css.
   Decisioni e perché: hq/siti/neonmodena/revisione-ux-ui.md (capitoli 9 e 10).
   ============================================================================= */

/* ---------- Font (ospitati da noi) ---------- */
@font-face {
	font-family: "Clash Display";
	src: url("../font/ClashDisplay-Bold.woff2") format("woff2");
	font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
	font-family: "Clash Display";
	src: url("../font/ClashDisplay-Semibold.woff2") format("woff2");
	font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
	font-family: "Manrope";
	src: url("../font/Manrope-variabile-latin.woff2") format("woff2");
	font-weight: 400 800; font-style: normal; font-display: swap;
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Manrope";
	src: url("../font/Manrope-variabile-latin-ext.woff2") format("woff2");
	font-weight: 400 800; font-style: normal; font-display: swap;
	unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Valori ---------- */
:root {
	/* Colori: un rosso, un nero, un grigio di fondo */
	--rosso: #7A1816;
	--rosso-premuto: #5F1210;
	--nero: #1F1F1F;
	--grigio: #EFEFEF;
	--bianco: #FFFFFF;
	--testo: #1F1F1F;
	--testo-2: #3A3A3A;            /* testo secondario */
	--testo-3: #6B6B6B;            /* attenuato e segnaposto: 4,6 a 1 su --grigio */
	--su-scuro-2: #C9C9C9;         /* testo secondario su fondo scuro */
	--linea: #D6D6D6;
	--linea-su-scuro: rgba(255, 255, 255, .2);

	/* Font */
	--titoli: "Clash Display", "Arial Black", "Helvetica Neue", Arial, sans-serif;
	--testi: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

	/* Scala dei testi: cresce in modo continuo da 402 px (mobile) a 1512 px (desktop) */
	--t-display: clamp(4.5rem, 2.961rem + 6.126vw, 8.75rem);   /* 72 → 140 */
	--t-h1: clamp(1.875rem, 1.196rem + 2.703vw, 3.75rem);      /* 30 → 60 */
	--t-h2: clamp(1.5625rem, 1.223rem + 1.351vw, 2.5rem);      /* 25 → 40 */
	--t-h3: clamp(1.25rem, 1.024rem + .901vw, 1.875rem);       /* 20 → 30 */
	--t-h4: clamp(1.125rem, 1.08rem + .18vw, 1.25rem);         /* 18 → 20 */
	--t-etichetta: 1rem;                                        /* menu e bottoni */
	--t-testo: 1rem;
	--t-piccolo: .875rem;
	--t-legale: .75rem;

	/* Spazi: scala 4, 8, 12, 16, 20, 24, 32, 48, 64, 96 */
	--s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px;
	--s-6: 24px; --s-8: 32px; --s-12: 48px; --s-16: 64px; --s-24: 96px;
	--margine: clamp(16px, calc(16px + 51 * ((100vw - 402px) / 1110)), 67px);  /* 16 → 67 */
	--contenitore: 1378px;
	--sezione: clamp(64px, calc(64px + 32 * ((100vw - 402px) / 1110)), 96px);  /* 64 → 96 */

	/* Forme */
	--r-campo: 14px;
	--r-card: 20px;
	--r-pannello: 32px;
	--r-pieno: 999px;
	--ombra: 0 12px 32px rgba(0, 0, 0, .06);

	/* Vetro: due ricette, solo sopra foto o fondi colorati */
	--vetro-testata: rgba(255, 255, 255, .72);
	--sfoca-testata: 12px;
	--vetro-foto: rgba(255, 255, 255, .16);
	--sfoca-foto: 16px;
	--bordo-vetro: rgba(255, 255, 255, .35);

	/* Movimento: tre durate, una curva */
	--veloce: 150ms;
	--medio: 250ms;
	--lento: 450ms;
	--curva: cubic-bezier(.2, .7, .2, 1);

	--testata-alta: 64px;
	--testata-su: clamp(12px, 2.2vw, 33px);
}

/* ---------- Azzeramento 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(--testata-alta) + var(--testata-su) + 16px); }
body {
	margin: 0;
	background: var(--bianco);
	color: var(--testo);
	font-family: var(--testi);
	font-size: var(--t-testo);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { margin: 0; padding: 0; list-style: none; }
img, picture, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
table { border-collapse: collapse; }
[hidden] { display: none !important; }

/* ---------- Testi ---------- */
.nm-display, .nm-h1, .nm-h2, .nm-h3, .nm-h4 {
	font-family: var(--titoli);
	font-weight: 700;
	text-transform: uppercase;      /* il testo si scrive normale: il maiuscolo lo dà lo stile */
	letter-spacing: 0;
	text-wrap: balance;
}
.nm-display { font-size: var(--t-display); line-height: .95; }
.nm-h1 { font-size: var(--t-h1); line-height: 1; }
.nm-h2 { font-size: var(--t-h2); line-height: 1.1; }
.nm-h3 { font-size: var(--t-h3); line-height: 1.1; }
.nm-h4 { font-size: var(--t-h4); line-height: 1.15; }
.nm-h4--normale { text-transform: none; }     /* titoli piccoli che restano in minuscolo */
.nm-testo { font-size: var(--t-testo); line-height: 1.5; color: var(--testo-2); max-width: 62ch; text-wrap: pretty; }
.nm-testo--grande { font-size: clamp(1.125rem, 1.035rem + .36vw, 1.375rem); line-height: 1.4; color: var(--testo); }
.nm-piccolo { font-size: var(--t-piccolo); line-height: 1.45; color: var(--testo-3); }
.nm-legale { font-size: var(--t-legale); line-height: 1.5; }
.nm-su-scuro { color: var(--bianco); }
.nm-su-scuro .nm-testo { color: var(--su-scuro-2); }
.nm-rosso { color: var(--rosso); }

/* ---------- Impaginazione ---------- */
.nm-contenitore {
	width: 100%;
	max-width: calc(var(--contenitore) + 2 * var(--margine));
	margin-inline: auto;
	padding-inline: var(--margine);
}
.nm-sezione { padding-block: var(--sezione); }
.nm-sezione--grigia { background: var(--grigio); }
.nm-sezione--scura { background: var(--nero); color: var(--bianco); }
.nm-sezione--rossa { background: var(--rosso); color: var(--bianco); }
.nm-pila > * + * { margin-top: var(--pila, var(--s-4)); }

/* ---------- Accessibilità ---------- */
.nm-salta {
	position: absolute; left: var(--margine); top: -100px; z-index: 100;
	background: var(--nero); color: var(--bianco); padding: 12px 18px; border-radius: var(--r-campo);
	font-weight: 600;
}
.nm-salta:focus { top: 12px; }
.nm-solo-lettori {
	position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Fuoco da tastiera: sempre visibile, mai al clic del mouse */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--rosso); outline-offset: 3px; border-radius: 4px; }
.nm-sezione--scura :focus-visible, .nm-sezione--rossa :focus-visible, .nm-su-foto :focus-visible { outline-color: var(--bianco); }

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