/* ============================================================
   Simone Pitta — ICT Consulting · style.css
   Tema chiaro/scuro (auto + toggle) · WCAG 2.1 AA · Responsive
   Nessun font o risorsa esterna: zero richieste di terze parti.
   ============================================================ */

/* ---------- Reset essenziale ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img, svg { max-width: 100%; display: block; }
h1, h2, h3, h4, p, dl, dd, ul { margin: 0; }
ul[role="list"], .nav-menu { list-style: none; padding: 0; }

/* ---------- Design tokens ---------- */
:root {
	--font-sans: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--radius: 14px;
	--radius-sm: 9px;
	--container: 1120px;
	--shadow: 0 10px 30px rgba(2, 12, 27, .12);

	/* Tema chiaro (default senza preferenza esplicita gestita sotto) */
	--bg: #f5f8fc;
	--bg-alt: #eaf1f8;
	--surface: #ffffff;
	--text: #0e1f38;
	--text-muted: #40536e;
	--accent: #0b6aa8;        /* testo/link accent su chiaro — AA su --bg */
	--accent-strong: #075985; /* riempimenti bottoni */
	--accent-contrast: #ffffff;
	--border: #cfdcea;
	--hero-glow: #38bdf8;
	--focus-ring: #0b6aa8;
	--wa: #0e7a43;            /* verde WhatsApp scurito per contrasto AA */
}

/* Tema scuro via preferenza di sistema… */
@media (prefers-color-scheme: dark) {
	html[data-theme="auto"] {
		--bg: #0b1220;
		--bg-alt: #0e1729;
		--surface: #121d33;
		--text: #e8eef7;
		--text-muted: #a9b7cc;
		--accent: #67d1ff;
		--accent-strong: #43b6ec;
		--accent-contrast: #06121f;
		--border: #24344f;
		--hero-glow: #22d3ee;
		--focus-ring: #67d1ff;
		--wa: #4cd989;
		--shadow: 0 10px 30px rgba(0, 0, 0, .45);
	}
}
/* …e via toggle manuale */
html[data-theme="dark"] {
	--bg: #0b1220;
	--bg-alt: #0e1729;
	--surface: #121d33;
	--text: #e8eef7;
	--text-muted: #a9b7cc;
	--accent: #67d1ff;
	--accent-strong: #43b6ec;
	--accent-contrast: #06121f;
	--border: #24344f;
	--hero-glow: #22d3ee;
	--focus-ring: #67d1ff;
	--wa: #4cd989;
	--shadow: 0 10px 30px rgba(0, 0, 0, .45);
}
html[data-theme="light"] { /* i valori chiari sono già in :root */ }

/* Icone del toggle: mostra quella pertinente allo stato corrente */
html[data-theme="dark"] .icon-moon { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="light"] .icon-sun { display: none; }
html[data-theme="light"] .icon-moon { display: block; }
html[data-theme="auto"] .icon-sun { display: none; }
@media (prefers-color-scheme: dark) {
	html[data-theme="auto"] .icon-sun { display: block; }
	html[data-theme="auto"] .icon-moon { display: none; }
}

/* ---------- Base ---------- */
body {
	font-family: var(--font-sans);
	font-size: 1.05rem;
	line-height: 1.65;
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
.container { max-width: var(--container); margin-inline: auto; padding-inline: clamp(1.1rem, 4vw, 2rem); }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
strong { color: inherit; }

:where(a, button, input, [tabindex]):focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 3px;
	border-radius: 4px;
}

.sr-only {
	position: absolute; width: 1px; height: 1px; margin: -1px;
	padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	background: var(--accent-strong); color: var(--accent-contrast);
	padding: .7rem 1.2rem; border-radius: 0 0 var(--radius-sm) var(--radius-sm);
	transition: top .2s ease; text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 0; }

/* ---------- Header / nav ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
}
.nav { display: flex; align-items: center; gap: 1rem; min-height: 4.4rem; }
.brand {
	display: inline-flex; align-items: center; gap: .6rem;
	text-decoration: none; color: var(--text); font-weight: 700; margin-right: auto;
}
.brand-mark { color: var(--accent); display: inline-flex; }
.brand-text { line-height: 1.15; font-size: 1.06rem; }
.brand-text small { display: block; font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); }

.nav-menu { display: flex; align-items: center; gap: .2rem; margin: 0; }
.nav-menu > li > a:not(.button) {
	display: inline-block; padding: .55rem .8rem; border-radius: var(--radius-sm);
	color: var(--text); text-decoration: none; font-weight: 550;
}
.nav-menu > li > a:not(.button):hover { background: var(--bg-alt); color: var(--accent-strong); }
.nav-cta { margin-left: .4rem; }

.theme-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 2.6rem; height: 2.6rem; margin-left: .2rem;
	border: 1px solid var(--border); border-radius: 50%;
	background: var(--surface); color: var(--text); cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-toggle {
	display: none; position: relative; width: 2.8rem; height: 2.8rem;
	border: 1px solid var(--border); border-radius: var(--radius-sm);
	background: var(--surface); cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
	content: ""; position: absolute; left: 50%; translate: -50% 0;
	width: 1.25rem; height: 2px; border-radius: 2px; background: var(--text);
	transition: .2s ease;
}
.nav-toggle-bar { top: calc(50% - 1px); }
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; rotate: 45deg; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; rotate: -45deg; }

@media (max-width: 880px) {
	.nav-toggle { display: block; }
	.nav-menu {
		position: absolute; inset: 100% 0 auto 0;
		flex-direction: column; align-items: stretch; gap: .15rem;
		background: var(--bg); border-bottom: 1px solid var(--border);
		padding: .8rem clamp(1.1rem, 4vw, 2rem) 1.2rem;
		box-shadow: var(--shadow);
		display: none;
	}
	.nav-menu.open { display: flex; }
	.nav-menu > li > a:not(.button) { display: block; padding: .8rem .9rem; }
	.nav-cta { margin: .4rem 0 0; }
}

/* ---------- Bottoni ---------- */
.button {
	display: inline-flex; align-items: center; gap: .55rem;
	padding: .8rem 1.5rem; border-radius: 999px;
	font-weight: 650; text-decoration: none; cursor: pointer;
	border: 2px solid transparent; font-size: 1rem;
}
.button-small { padding: .45rem 1.05rem; font-size: .92rem; }
.button-primary, .nav-cta .button {
	background: var(--accent-strong); color: var(--accent-contrast);
}
.button-primary:hover, .nav-cta .button:hover { filter: brightness(1.12); color: var(--accent-contrast); }
.button-ghost {
	border-color: var(--border); color: var(--text); background: transparent;
}
.button-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--bg-alt); }
.hero-bg { position: absolute; inset: 0; color: var(--accent); pointer-events: none; }
.hero-bg svg { width: 100%; height: 100%; }
.hero-net { opacity: .35; }
.hero-nodes { opacity: .55; }
.hero-inner { position: relative; padding-block: clamp(4rem, 10vw, 7.5rem) clamp(3rem, 8vw, 6rem); max-width: 780px; margin-inline: 0; }
.hero .container.hero-inner { margin-inline: auto; }

.eyebrow {
	font-size: .8rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
	color: var(--accent); margin-bottom: .9rem;
}
.hero h1 {
	font-size: clamp(2.3rem, 6vw, 3.9rem); line-height: 1.06;
	letter-spacing: -.02em; font-weight: 800; margin-bottom: 1.2rem;
}
.hero .accent { color: var(--accent); }
.lead { font-size: clamp(1.08rem, 2vw, 1.24rem); color: var(--text-muted); max-width: 40rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }

.hero-stats {
	display: flex; flex-wrap: wrap; gap: clamp(1.2rem, 4vw, 3rem);
	margin-top: clamp(2rem, 5vw, 3.2rem); padding-top: 1.6rem;
	border-top: 1px solid var(--border);
}
.hero-stats dt { font-size: 1.5rem; font-weight: 800; color: var(--text); }
.hero-stats dd { color: var(--text-muted); font-size: .92rem; }

/* ---------- Sezioni ---------- */
.section { padding-block: clamp(3.2rem, 8vw, 5.5rem); }
.section-alt { background: var(--bg-alt); }
.section-head { max-width: 46rem; margin-bottom: clamp(1.8rem, 4vw, 2.8rem); }
.section-head h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); letter-spacing: -.015em; line-height: 1.15; }
.section-sub { color: var(--text-muted); margin-top: .7rem; }

/* ---------- Profilo ---------- */
.profile-grid { display: grid; gap: clamp(1.6rem, 4vw, 3rem); grid-template-columns: 1.15fr .85fr; align-items: start; }
.profile-text p + p { margin-top: 1rem; }
.profile-points { display: grid; gap: 1rem; }
.profile-points li {
	display: flex; gap: .95rem; align-items: flex-start;
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 1.1rem 1.2rem;
}
.point-icon {
	flex: 0 0 auto; width: 2.6rem; height: 2.6rem; border-radius: var(--radius-sm);
	display: inline-flex; align-items: center; justify-content: center;
	background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent);
}
.profile-points h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.profile-points p { color: var(--text-muted); font-size: .95rem; }
@media (max-width: 820px) { .profile-grid { grid-template-columns: 1fr; } }

/* ---------- Card (Servizi / Portfolio) ---------- */
.card-grid {
	display: grid; gap: 1.4rem;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); overflow: hidden;
	display: flex; flex-direction: column;
	transition: translate .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { translate: 0 -4px; box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.card-img { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; background: var(--bg-alt); }
.card-body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .5rem; }
.card-body h3 { font-size: 1.14rem; line-height: 1.3; }
.card-body p { color: var(--text-muted); font-size: .97rem; }

/* ---------- Galleria ---------- */
.gallery-grid {
	display: grid; gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.gallery-item { margin: 0; position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); }
.gallery-item img { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; }
.gallery-item figcaption {
	padding: .65rem .9rem; font-size: .9rem; color: var(--text-muted);
	border-top: 1px solid var(--border);
}

/* ---------- Dati societari ---------- */
.facts-grid {
	display: grid; gap: 1px; overflow: hidden;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	background: var(--border); border: 1px solid var(--border); border-radius: var(--radius);
}
.facts-grid > div { background: var(--surface); padding: 1.05rem 1.25rem; }
.facts-grid dt { font-size: .74rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .2rem; }
.facts-grid dd { font-weight: 600; overflow-wrap: anywhere; }

/* ---------- Supporto ---------- */
.support-grid {
	display: grid; gap: clamp(1.6rem, 4vw, 3rem);
	grid-template-columns: 1.15fr .85fr; align-items: start;
}
.steps {
	margin: 0; padding: 0; list-style: none;
	counter-reset: step; display: grid; gap: 1rem;
}
.steps li {
	counter-increment: step; position: relative;
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 1.15rem 1.3rem 1.15rem 4rem;
	color: var(--text-muted);
}
.steps li strong { color: var(--text); }
.steps li::before {
	content: counter(step);
	position: absolute; left: 1.15rem; top: 1.05rem;
	width: 2rem; height: 2rem; border-radius: 50%;
	display: grid; place-items: center;
	background: color-mix(in srgb, var(--accent) 16%, transparent);
	color: var(--accent); font-weight: 800; font-size: 1rem;
}
.support-downloads {
	background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius); padding: 1.5rem 1.6rem;
	display: flex; flex-direction: column; gap: .9rem; align-items: flex-start;
}
.support-downloads .button { width: 100%; justify-content: center; }
.support-note { color: var(--text-muted); font-size: .9rem; }
@media (max-width: 820px) { .support-grid { grid-template-columns: 1fr; } }

/* ---------- Contatti ---------- */
.section-contact { background: var(--bg-alt); }
.contact-grid {
	display: grid; gap: 1.2rem;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.contact-card {
	display: flex; flex-direction: column; gap: .2rem;
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 1.4rem 1.5rem; text-decoration: none; color: var(--text);
	transition: translate .18s ease, box-shadow .18s ease, border-color .18s ease;
}
a.contact-card:hover { translate: 0 -4px; box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
.contact-icon { color: var(--accent); margin-bottom: .55rem; }
.contact-wa .contact-icon { color: var(--wa); }
.contact-label { font-size: .78rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--text-muted); }
.contact-value { font-weight: 700; font-size: 1.08rem; overflow-wrap: anywhere; }
.contact-hint { color: var(--text-muted); font-size: .9rem; overflow-wrap: anywhere; }
.contact-support { margin-top: 1.8rem; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg); }
.footer-inner { padding-block: 2.2rem; display: grid; gap: .9rem; font-size: .93rem; color: var(--text-muted); }
.footer-links { display: flex; gap: .7rem; align-items: center; }
.footer-copy { font-size: .85rem; }

/* ---------- Pagina Privacy ---------- */
.page-doc { max-width: 820px; padding-block: clamp(2.5rem, 6vw, 4rem); }
.page-doc h1 { font-size: clamp(1.9rem, 4.5vw, 2.6rem); letter-spacing: -.02em; line-height: 1.12; margin-bottom: .4rem; }
.page-doc h2 { font-size: 1.35rem; margin: 2.2rem 0 .6rem; }
.page-doc h3 { font-size: 1.08rem; margin: 1.4rem 0 .4rem; }
.page-doc p + p { margin-top: .8rem; }
.page-doc .doc-updated { color: var(--text-muted); font-size: .92rem; margin-bottom: 1.6rem; }
.page-doc ul { padding-left: 1.2rem; }
.page-doc li { margin-block: .3rem; }

/* ---------- Motion & preferenze utente ---------- */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Stampa ---------- */
@media print {
	.site-header, .hero-bg, .theme-toggle, .nav-toggle, .skip-link { display: none !important; }
	body { background: #fff; color: #000; }
}
