/* Jacopo Damiani: design ripreso dal sito originale (Astro), riportato in CSS semplice. */

@font-face {
  font-family: "Archivo Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo.woff2) format("woff2-variations");
}
@font-face {
  font-family: "IBM Plex Mono";
  font-style: normal;
  font-display: swap;
  font-weight: 400;
  src: url(fonts/plex-mono.woff2) format("woff2");
}

@font-face {
  font-family: "Archivo Variable";
  font-style: italic;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url(fonts/archivo-italic.woff2) format("woff2-variations");
}

:root {
  /* Palette: gli unici colori scritti a mano del sito. Mappa dei ruoli in ../../COLORI.md.
     Per provare una palette si cambiano solo questi token (vedi palette-lab.js). */
  --bg: oklch(0.075 0 0);
  --surface: oklch(0.13 0 0);
  --raised: oklch(0.16 0.003 60);
  --line: oklch(0.26 0 0);
  --line-strong: oklch(0.36 0 0);
  --ink: oklch(0.97 0 0);
  --ink-2: oklch(0.8 0 0);
  --ink-3: oklch(0.68 0 0);
  --accent: oklch(0.72 0.17 48);
  --accent-hover: oklch(0.78 0.15 52);
  --on-accent: oklch(0.08 0 0);
  --signal: oklch(0.72 0.17 48);
  /* Effetti di luce e ombra: uguali per ogni palette. */
  --sheen: oklch(1 0 0);
  --shadow: oklch(0 0 0);
  /* Loghi clienti: bianchi sui fondi scuri, la palette chiara li porta a nero. */
  --logo-filter: brightness(0) invert(1);

  /* Derivati: si aggiornano da soli quando cambia la palette. */
  --accent-soft: color-mix(in oklab, var(--accent) 10%, transparent);
  --accent-glow: color-mix(in oklab, var(--accent) 55%, transparent);
  --accent-edge: color-mix(in oklab, var(--accent) 80%, var(--shadow));
  --signal-soft: color-mix(in oklab, var(--signal) 12%, transparent);
  --code-ink: color-mix(in oklab, var(--ink) 7.5%, transparent);
  --code-ink-hi: color-mix(in oklab, var(--ink) 70%, transparent);
  --bg-glass: color-mix(in oklab, var(--bg) 86%, transparent);
  --hover-fill: color-mix(in oklab, var(--ink) 7%, var(--bg));
  --ui-mute: color-mix(in oklab, var(--ink) 18%, var(--surface));
  --ui-dim: color-mix(in oklab, var(--ink) 40%, var(--surface));

  /* Alias dei nomi precedenti, usati dalle pagine in bozze/. */
  --bg-2: var(--surface);
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --line-2: var(--line-strong);
  --accent-h: var(--accent-hover);

  --sans: "Archivo Variable", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --pad: clamp(20px, 3.5vw, 48px);
  --max: 1440px;
}

:root { color-scheme: dark; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body { font-family: var(--sans); font-size: 18px; line-height: 1.55; font-variation-settings: "wdth" 100; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--ink); color: var(--bg); }
/* Grassetto di contenuto: la frase che regge il paragrafo. Si stacca dal grigio per peso e colore insieme. */
strong { font-weight: 600; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
[id] { scroll-margin-top: 80px; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: .05em; text-transform: uppercase; }


.skip { position: absolute; left: var(--pad); top: -100px; z-index: 20; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: 15px; }
.skip:focus { top: 16px; }

/* Header */
.top { position: fixed; inset: 0 0 auto; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 16px var(--pad); }
.top::before { content: ""; position: absolute; inset: 0 0 -24px; z-index: -1; pointer-events: none; background: linear-gradient(color-mix(in oklab, var(--bg) 88%, transparent), color-mix(in oklab, var(--bg) 60%, transparent) 55%, transparent); }
.top .name { font-weight: 600; font-variation-settings: "wdth" 125; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; }
.top nav { display: flex; align-items: center; gap: 32px; font-size: 15px; }
.top nav a { color: var(--ink-2); transition: color .2s; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); }
.top nav a.cta { display: inline-flex; align-items: center; height: 40px; padding: 0 18px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 500; transition: background .25s var(--ease); }
.top nav a.cta:hover { background: var(--accent-hover); }

/* Bottoni */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 24px; border-radius: 999px; font-size: 16px; font-weight: 500; border: 1px solid var(--ink); transition: background .3s var(--ease), border-color .3s var(--ease); }
.btn-p { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-p:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Hero */
.hero { position: relative; height: 100svh; min-height: 680px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 1fr auto; padding: 0 var(--pad) 32px; overflow: hidden; }
#field { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-c { position: relative; align-self: center; pointer-events: none; max-width: var(--max); width: 100%; margin-inline: auto; }
.hero h1 { font-weight: 300; font-variation-settings: "wdth" 125; font-size: clamp(2.5rem, 7.6vw, 8.6rem); line-height: .95; letter-spacing: -.045em; }
.hero h1 b { font-weight: 650; }
.hero h1 .ln { display: block; white-space: nowrap; }
.w { display: inline-block; animation: up 1s var(--ease) both; }
@keyframes up { from { opacity: .01; transform: translateY(.25em); } to { opacity: 1; transform: none; } }
.hero-b { position: relative; display: grid; grid-template-columns: 1fr 1.3fr auto; gap: 24px 40px; align-items: end; border-top: 1px solid var(--line); padding-top: 24px; max-width: var(--max); width: 100%; margin-inline: auto; animation: up 1s .8s var(--ease) both; }
.hero-b p { color: var(--ink-2); max-width: 44ch; }
.hero-b .state { color: var(--ink-3); line-height: 1.8; }
.act { justify-self: end; display: grid; gap: 12px; justify-items: end; }
.hint { color: var(--ink-3); }

/* Testata delle pagine interne */
.page-head { padding: clamp(140px, 16vw, 220px) var(--pad) clamp(56px, 6vw, 96px); }
.page-head > * { max-width: var(--max); margin-inline: auto; }
.page-head h1 { font-weight: 300; font-variation-settings: "wdth" 125; font-size: clamp(2.8rem, 8vw, 8rem); line-height: .95; letter-spacing: -.045em; max-width: 14ch; text-wrap: balance; }
.page-head h1 b { font-weight: 650; }
.page-head .lede { margin-top: clamp(32px, 4vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 4fr 8fr; gap: 24px 48px; }
.page-head .lede p { color: var(--ink-2); font-size: clamp(18px, 1.5vw, 22px); line-height: 1.5; max-width: 52ch; grid-column: 2; }

/* Sezioni */
.sec { padding: clamp(80px, 9vw, 152px) var(--pad); border-top: 1px solid var(--line); }
.sec > * { max-width: var(--max); margin-inline: auto; }
.sec.alt { background: var(--surface); border-top-color: transparent; }
.sec.alt + .sec { border-top-color: transparent; }
.lab { display: flex; justify-content: space-between; gap: 24px; color: var(--ink-3); padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: clamp(40px, 4vw, 64px); }
.lab .no { color: var(--ink); margin-right: 14px; }
.dot { position: relative; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: 1px; }
.dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--accent); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(3); opacity: 0; } }
h2 { font-weight: 300; font-variation-settings: "wdth" 125; font-size: clamp(2.25rem, 5.6vw, 5.75rem); line-height: 1; letter-spacing: -.04em; max-width: 16ch; text-wrap: balance; }
h2 b { font-weight: 650; color: var(--accent); }
h3 { font-weight: 500; font-variation-settings: "wdth" 112; font-size: clamp(20px, 1.7vw, 24px); line-height: 1.3; letter-spacing: -.01em; }
.prose p { color: var(--ink-2); max-width: 60ch; text-wrap: pretty; }
.prose p + p { margin-top: 1em; }
.prose .lead { color: var(--ink); font-size: clamp(20px, 1.8vw, 26px); line-height: 1.4; letter-spacing: -.01em; }
.prose a, .link { color: var(--ink); border-bottom: 1px solid var(--line-strong); transition: border-color .2s; }
.prose a:hover, .link:hover { border-color: var(--ink); }

/* Colonne: titolo a sinistra, testo a destra */
.split { display: grid; grid-template-columns: 6fr 6fr; gap: 40px 48px; align-items: start; }
.split > .prose { padding-top: .4em; }
.two-p { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px; margin-top: clamp(40px, 4vw, 64px); }
.two-p p { color: var(--ink-2); max-width: 52ch; }
.more { display: inline-block; margin-top: clamp(32px, 3vw, 48px); }

/* Geosnap */
.geo-name { font-size: clamp(3.5rem, 12vw, 12rem); max-width: none; line-height: .9; }
.geo-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; margin-top: clamp(40px, 4vw, 64px); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 14px 24px; align-content: start; padding-top: 6px; }
.facts dt { color: var(--ink-3); }
.facts dd { font-size: 17px; }
.flow { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); margin-top: clamp(48px, 5vw, 80px); border-top: 1px solid var(--line-strong); counter-reset: f; }
.flow li { padding: 18px 20px 0 0; color: var(--ink-2); font-size: 16px; line-height: 1.4; counter-increment: f; }
.flow li::before { content: counter(f, decimal-leading-zero); display: block; font-family: var(--mono); font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.flow li + li { border-left: 1px solid var(--line); padding-left: 20px; }

/* Metodo */
.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(40px, 4vw, 64px); border-top: 1px solid var(--line-strong); }
.steps li { padding: 24px 28px 0 0; }
.steps li + li { border-left: 1px solid var(--line); padding-left: 24px; }
.steps .n { display: block; color: var(--ink-3); margin-bottom: 40px; }
.steps h3 { margin-bottom: 12px; }
.steps p { color: var(--ink-2); font-size: 17px; }

/* Metodo esteso (pagina Come lavoro) */
.phase { display: grid; grid-template-columns: 2fr 4fr 6fr; gap: 24px 48px; padding: clamp(32px, 3vw, 48px) 0; border-top: 1px solid var(--line); }
.phase:first-child { border-top: 0; padding-top: 0; }
.phase .n { color: var(--ink-3); padding-top: .5em; }
.phase h2 { font-size: clamp(2rem, 3.6vw, 3.4rem); }
.phase p { color: var(--ink-2); max-width: 60ch; padding-top: .4em; }

/* FAQ */
.faq { border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px 0; font-size: clamp(20px, 1.8vw, 26px); font-variation-settings: "wdth" 112; letter-spacing: -.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: var(--mono); font-size: 20px; color: var(--ink-3); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--ink-2); max-width: 64ch; padding: 0 0 28px; }

/* Percorso */
.years { list-style: none; margin-top: clamp(40px, 4vw, 64px); border-top: 1px solid var(--line-strong); }
.years li { display: grid; grid-template-columns: 2fr 4fr 6fr; gap: 8px 48px; padding: 22px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.years .y { color: var(--ink-3); }
.years .c { font-size: clamp(22px, 2.2vw, 32px); font-variation-settings: "wdth" 118; font-weight: 500; letter-spacing: -.02em; line-height: 1.3; }
.years .c small { display: block; font-size: 15px; font-variation-settings: "wdth" 100; font-weight: 400; color: var(--ink-3); letter-spacing: 0; margin-top: 4px; }
.years .d { color: var(--ink-2); max-width: 60ch; }
.years .d p + p { margin-top: .8em; }
.note { display: grid; grid-template-columns: 6fr 6fr; gap: 48px; margin-top: clamp(40px, 4vw, 64px); }
.note p { color: var(--ink-2); max-width: 56ch; grid-column: 2; }

/* Elenco interventi (pagina agenzie) */
.list { list-style: none; border-top: 1px solid var(--line-strong); margin-top: clamp(40px, 4vw, 64px); }
.list li { display: grid; grid-template-columns: 6fr 6fr; gap: 8px 48px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.list b { font-weight: 500; font-variation-settings: "wdth" 112; font-size: clamp(20px, 1.7vw, 24px); letter-spacing: -.01em; }
.list span { color: var(--ink-2); }

/* Chiusura con CTA */
.closing h2 { font-size: clamp(2.6rem, 7vw, 7rem); max-width: 14ch; }
.closing .cols { display: grid; grid-template-columns: 6fr 6fr; gap: 40px 48px; margin-top: clamp(48px, 5vw, 80px); padding-top: 24px; border-top: 1px solid var(--line); }
.closing h3 { margin-bottom: 12px; }
.closing p { color: var(--ink-2); max-width: 52ch; }
.closing .act { justify-self: start; justify-items: start; margin-top: 32px; }

/* Footer */
footer { padding: clamp(48px, 5vw, 72px) var(--pad) 28px; border-top: 1px solid var(--line); font-size: 15px; color: var(--ink-3); }
footer > * { max-width: var(--max); margin-inline: auto; }
footer a { color: var(--ink-2); transition: color .2s; }
footer a:hover { color: var(--ink); }
.f-top { display: grid; grid-template-columns: 6fr 2fr 2fr 2fr; gap: 32px 24px; padding-bottom: clamp(40px, 4vw, 64px); }
.f-id { display: flex; flex-direction: column; gap: 6px; max-width: 40ch; }
.f-id span:first-child { color: var(--ink); font-size: clamp(20px, 1.8vw, 26px); font-variation-settings: "wdth" 112; letter-spacing: -.02em; }
.f-col { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.f-col .mono { color: var(--ink-3); margin-bottom: 4px; }
.f-col a { font-size: 17px; min-height: 28px; }
.f-bot { display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); }

/* Pagina privacy */
.legal { max-width: 760px; margin-inline: auto; padding: clamp(140px, 14vw, 200px) var(--pad) 120px; }
.legal h1 { font-weight: 300; font-variation-settings: "wdth" 125; font-size: clamp(2.5rem, 6vw, 4.5rem); letter-spacing: -.04em; line-height: 1; margin-bottom: 40px; }
.legal h2 { font-size: 22px; font-weight: 500; font-variation-settings: "wdth" 112; letter-spacing: -.01em; margin: 40px 0 12px; max-width: none; line-height: 1.3; }
.legal p { color: var(--ink-2); }
.legal p + p { margin-top: 12px; }

/* Comparsa allo scroll */
.js .rv { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .rv.in { opacity: 1; transform: none; }

@media (max-width: 1100px) {
  .flow { grid-template-columns: repeat(3, 1fr); row-gap: 28px; }
  .flow li:nth-child(4) { border-left: 0; padding-left: 0; }
  .steps { grid-template-columns: 1fr 1fr; row-gap: 40px; }
  .steps li:nth-child(3) { border-left: 0; padding-left: 0; }
}
@media (max-width: 960px) {
  .top nav a:not(.cta) { display: none; }
  .sec { padding-block: 72px; }
  .hero-b { grid-template-columns: 1fr 1fr; }
  .hero-b .state { grid-column: span 2; order: -1; }
  .hero-b .act { grid-column: span 2; justify-self: start; justify-items: start; }
  .split, .two-p, .geo-grid, .closing .cols, .note, .page-head .lede { grid-template-columns: 1fr; }
  .note p, .page-head .lede p { grid-column: 1; }
  .phase { grid-template-columns: 1fr; gap: 12px; }
  .years li, .list li { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .f-top { grid-template-columns: 1fr 1fr; }
  .f-id { grid-column: 1 / -1; }
  .f-bot { flex-direction: column; }
  .f-col a, .f-bot a { min-height: 44px; display: inline-flex; align-items: center; }
}
@media (max-width: 600px) {
  .hero { min-height: 640px; }
  .hero h1 .ln { white-space: normal; }
  .hero-b { grid-template-columns: 1fr; }
  .hero-b .state, .hero-b .act { grid-column: auto; }
  .hero-b p { font-size: 17px; }
  .flow, .steps { grid-template-columns: 1fr; }
  .flow li + li, .steps li + li { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 20px; }
  .steps .n { margin-bottom: 16px; }
  .lab { flex-direction: column; gap: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .rv { opacity: 1; transform: none; }
}
@media print {
  html, body, .sec, .sec.alt { background: #fff !important; color: #000 !important; }
  .top, .skip, canvas { display: none !important; }
  .js .rv { opacity: 1 !important; transform: none !important; }
  * { color: #000 !important; }
}
/* "prodotti digitali": italic emphasis inside the hero headline. */
.hero h1 em, .fill em { font-style: italic; font-weight: 650; padding-right: .05em; color: var(--accent); }
