/* andreaquaresima.it — lo stile del sito.
   Andrea Quaresima - AQSolutions

   «Scuro e tecnico» (Andrea, 26/11/2026): fondo scuro, un colore d'accento,
   un po' da sviluppatore. Sempre scuro, senza interruttore del tema.
   I caratteri stanno sul sito, come per aqsolutions.it (da li' vengono i file):
   Inter, Inter Tight e JetBrains Mono, licenza SIL Open Font License 1.1.
   Niente Google Fonts: ogni visita a un font esterno porta l'IP del visitatore
   fuori dall'Europa. */

@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../font/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../font/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../font/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 600; font-style: normal; font-display: swap; src: url("../font/inter-tight-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-weight: 700; font-style: normal; font-display: swap; src: url("../font/inter-tight-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../font/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../font/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

/* ---------- Token ---------- */
:root {
  --bg: #0b0d10;
  --bg-2: #0f1216;
  --surface: #13171c;
  --surface-2: #1a1f26;
  --line: #242b34;
  --line-2: #323b47;
  --text: #e8ecf1;
  --text-2: #b4bdc8;
  --muted: #8893a0;
  /* Il verde di una traccia d'oscilloscopio: l'elettronica da cui parte tutto. */
  --accent: #3ddc97;
  --accent-2: #2bb47a;
  --accent-soft: rgba(61, 220, 151, 0.12);
  --accent-ink: #04140c;
  --errore: #ff7a7a;
  --grid: rgba(255, 255, 255, 0.035);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-titoli: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --larghezza: 1120px;
  --gutter: 16px;
  --raggio: 14px;
  --raggio-piccolo: 10px;
  --barra-h: 60px;

  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--barra-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-titoli); line-height: 1.15; margin: 0; letter-spacing: -0.02em; }
p { margin: 0; }
::selection { background: var(--accent); color: var(--accent-ink); }

.salta {
  position: absolute; left: var(--gutter); top: -100px; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
}
.salta:focus { top: 12px; }

.etichetta {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}

/* ---------- Barra in alto ---------- */
.barra {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.barra-dentro {
  max-width: var(--larghezza); margin: 0 auto; padding: 0 var(--gutter);
  height: var(--barra-h); display: flex; align-items: center; gap: 24px;
}
.marchio { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 600; }
.marchio-sigla {
  font-family: var(--font-mono); font-weight: 500; font-size: 0.8125rem;
  color: var(--accent-ink); background: var(--accent);
  border-radius: 7px; padding: 4px 6px; line-height: 1;
}
.marchio-nome { white-space: nowrap; }
.menu { display: none; margin-left: auto; gap: 26px; }
.menu a { color: var(--text-2); text-decoration: none; font-size: 0.9375rem; }
.menu a:hover { color: var(--text); }
.lingue { margin-left: auto; display: inline-flex; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px; }
.lingue a {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.04em;
  color: var(--muted); text-decoration: none; padding: 4px 10px; border-radius: 999px;
}
.lingue a[aria-current="true"] { background: var(--surface-2); color: var(--text); }
.lingue a:hover { color: var(--text); }
/* Il menu c'e' solo da 860px in su: sotto, il selettore delle lingue va a destra
   da solo (margin-left: auto), sopra lo spinge il menu. */
@media (min-width: 860px) { .menu { display: flex; } .menu + .lingue { margin-left: 0; } }
@media (max-width: 380px) { .marchio-nome { display: none; } }

/* ---------- Apertura ---------- */
.apertura {
  position: relative;
  padding: 72px var(--gutter) 56px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
/* La griglia di un foglio a quadretti, che sfuma verso i bordi. */
.apertura::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 30%, transparent 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 30% 30%, #000 30%, transparent 75%);
}
.apertura::after {
  content: ""; position: absolute; z-index: -1;
  width: 520px; height: 520px; right: -160px; top: -200px;
  background: radial-gradient(circle, rgba(61, 220, 151, 0.16), transparent 65%);
}
/* Larga quanto il contenuto delle sezioni e della barra (che hanno il margine
   dentro): cosi' tutto parte dalla stessa riga verticale. */
.apertura-dentro {
  max-width: calc(var(--larghezza) - 2 * var(--gutter)); margin: 0 auto;
  display: grid; gap: 40px; align-items: center;
}
.apertura h1 { font-size: clamp(2.6rem, 8vw, 4.75rem); font-weight: 700; letter-spacing: -0.035em; }
.apertura-riga {
  font-family: var(--font-titoli); font-weight: 600;
  font-size: clamp(1.35rem, 3.6vw, 2rem); letter-spacing: -0.02em;
  color: var(--accent); margin-top: 10px;
}
.apertura-intro { color: var(--text-2); font-size: 1.125rem; max-width: 36em; margin-top: 18px; }
.bottoni { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.bottone {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 22px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--text); background: transparent;
  font: 600 0.9375rem/1 var(--font); text-decoration: none; cursor: pointer;
  transition: border-color .2s, background-color .2s, color .2s;
}
.bottone:hover { border-color: var(--accent); color: var(--text); }
.bottone-pieno { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.bottone-pieno:hover { background: #5ee8ab; border-color: #5ee8ab; color: var(--accent-ink); }
.bottone[disabled] { opacity: .6; cursor: progress; }

/* Il posto della foto: per ora le iniziali (Andrea, 26/11/2026: «la
   pubblichiamo dopo»). */
.ritratto {
  justify-self: start;
  width: 132px; aspect-ratio: 1; border-radius: 28px;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--surface-2), var(--bg-2));
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 6px var(--bg), 0 0 0 7px var(--line), 0 30px 60px -30px rgba(61, 220, 151, 0.35);
  font-family: var(--font-mono); font-weight: 500; font-size: 2.6rem; color: var(--accent);
  order: -1;
}
.numeri {
  list-style: none; padding: 0; margin: 56px auto 0; max-width: calc(var(--larghezza) - 2 * var(--gutter));
  display: grid; gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--raggio); overflow: hidden;
}
.numeri li { background: var(--bg-2); padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.numeri strong { font-family: var(--font-mono); font-weight: 500; font-size: 1.75rem; color: var(--text); line-height: 1.1; }
.numeri span { color: var(--muted); font-size: 0.9375rem; }
@media (min-width: 720px) {
  .apertura { padding-top: 110px; padding-bottom: 80px; }
  .apertura-dentro { grid-template-columns: 1fr auto; }
  .ritratto { order: 0; width: 220px; border-radius: 40px; font-size: 4rem; justify-self: end; }
  .numeri { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Sezioni ---------- */
.sezione {
  max-width: var(--larghezza); margin: 0 auto;
  padding: 80px var(--gutter);
  border-bottom: 1px solid var(--line);
}
.sezione:last-child { border-bottom: 0; }
.sezione > h2 { font-size: clamp(1.9rem, 5vw, 2.75rem); font-weight: 700; margin-bottom: 36px; }
.sezione-sola { min-height: 60vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.sezione-sola h1 { font-size: clamp(2rem, 6vw, 3rem); }
.sezione-sola p { color: var(--text-2); }
@media (min-width: 720px) { .sezione { padding-top: 110px; padding-bottom: 110px; } }

/* ---------- La storia ---------- */
.citazione {
  margin: 0 0 56px; padding: 24px 26px;
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 80%);
  border-radius: 0 var(--raggio) var(--raggio) 0;
  max-width: 46em;
}
.citazione blockquote { margin: 0; }
.citazione blockquote p {
  font-family: var(--font-titoli); font-weight: 600;
  font-size: clamp(1.2rem, 3vw, 1.6rem); line-height: 1.35; letter-spacing: -0.015em;
}
.citazione blockquote p::before { content: "«"; color: var(--accent); }
.citazione blockquote p::after { content: "»"; color: var(--accent); }
.citazione blockquote:lang(en) p::before { content: "“"; }
.citazione blockquote:lang(en) p::after { content: "”"; }
.citazione figcaption { margin-top: 12px; color: var(--muted); font-size: 0.9375rem; }
.citazione cite { font-style: normal; }

/* La timeline: una linea verticale con le tappe. La linea si accende mentre
   si scende (--avanzamento lo scrive sito.js); senza JavaScript e' accesa
   tutta, e le tappe si vedono tutte. */
.timeline {
  --avanzamento: 1;
  list-style: none; margin: 0; padding: 0 0 0 30px;
  position: relative; max-width: 46em;
}
.timeline::before, .timeline::after {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
}
.timeline::before { background: var(--line-2); }
.timeline::after {
  background: linear-gradient(var(--accent), var(--accent-2));
  transform-origin: top; transform: scaleY(var(--avanzamento));
  box-shadow: 0 0 12px rgba(61, 220, 151, 0.45);
}
.tappa { position: relative; padding-bottom: 40px; }
.tappa:last-child { padding-bottom: 0; }
.tappa::before {
  content: ""; position: absolute; left: -30px; top: 6px; z-index: 1;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  transition: background-color .4s, box-shadow .4s;
}
.tappa.accesa::before { background: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 14px rgba(61, 220, 151, 0.7); }
.tappa-anno { font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent); margin-bottom: 6px; }
.tappa h3 { font-size: 1.3rem; font-weight: 600; margin-bottom: 8px; }
.tappa p:last-child { color: var(--text-2); }
.tappa-futuro::before { border-style: dashed; background: var(--bg); }
.tappa-futuro.accesa::before { background: var(--bg); box-shadow: 0 0 0 4px var(--bg); }
.tappa-futuro { border: 1px dashed var(--line-2); border-radius: var(--raggio); padding: 20px 22px; margin-left: -8px; }
.tappa-futuro::before { left: -22px; top: 26px; }

/* Le tappe che arrivano mentre si scende. La classe la mette sito.js solo
   sulle tappe ancora fuori dallo schermo: quelle gia' visibili non spariscono
   e riappaiono. */
.tappa.spenta { opacity: 0; transform: translateY(18px); }
.tappa { transition: opacity .6s ease, transform .6s ease; }

/* ---------- Schede (cosa faccio, progetti) ---------- */
.schede { display: grid; gap: 16px; }
.scheda {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--raggio);
  padding: 24px; transition: border-color .2s, transform .2s;
}
.scheda:hover { border-color: var(--line-2); }
.scheda h3, .scheda h4 { font-size: 1.2rem; font-weight: 600; margin-bottom: 10px; }
.scheda p { color: var(--text-2); font-size: 1rem; }
.scheda-numero { font-family: var(--font-mono); color: var(--accent); font-size: 0.875rem; margin-bottom: 16px; }
.scheda-link { margin-top: 14px; font-family: var(--font-mono); font-size: 0.875rem; }
.scheda-link a::after { content: " ↗"; }
@media (min-width: 720px) {
  .schede { grid-template-columns: repeat(2, 1fr); }
  .schede-tre { grid-template-columns: repeat(3, 1fr); }
  .schede-piccole { grid-template-columns: repeat(3, 1fr); }
}
.schede-piccole .scheda { padding: 18px 20px; }
.schede-piccole .scheda h4 { font-family: var(--font-mono); font-weight: 500; font-size: 1rem; margin-bottom: 6px; }
.schede-piccole .scheda p { font-size: 0.9375rem; }

.fuori {
  margin-top: 24px; padding: 24px; border-radius: var(--raggio);
  border: 1px solid var(--line); background: var(--bg-2);
  display: grid; gap: 4px;
}
.fuori .etichetta { margin-bottom: 4px; }
.fuori p:last-child { color: var(--text-2); }

.gruppo + .gruppo { margin-top: 56px; }
.gruppo-titolo { font-size: 1.05rem; font-family: var(--font-mono); font-weight: 500; letter-spacing: 0; color: var(--text); margin-bottom: 6px; }
.gruppo-titolo::before { content: "// "; color: var(--accent); }
.gruppo-nota { color: var(--muted); font-size: 0.9375rem; margin-bottom: 18px; }
.gruppo-titolo + .schede { margin-top: 18px; }

/* ---------- Contatti ---------- */
.contatti { display: grid; gap: 40px; }
.contatti-testo > p { color: var(--text-2); font-size: 1.125rem; max-width: 30em; }
.social { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.social a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1px solid var(--line-2); border-radius: 999px;
  color: var(--text); text-decoration: none; font-size: 0.9375rem;
}
.social a::after { content: "↗"; margin-left: 8px; color: var(--accent); }
.social a:hover { border-color: var(--accent); }
@media (min-width: 860px) { .contatti { grid-template-columns: 5fr 7fr; align-items: start; } }

/* Il modulo */
.modulo {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--raggio);
  padding: 24px; display: grid; gap: 18px;
}
.campo { display: grid; gap: 6px; }
.campo label { font-size: 0.875rem; font-weight: 500; color: var(--text-2); }
.campo input, .campo textarea {
  width: 100%; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--raggio-piccolo);
  padding: 12px 14px; transition: border-color .2s, box-shadow .2s;
}
.campo textarea { resize: vertical; min-height: 140px; line-height: 1.5; }
.campo input::placeholder, .campo textarea::placeholder { color: var(--muted); }
.campo input:focus, .campo textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.campo-msg { font-size: 0.875rem; color: var(--errore); min-height: 0; }
.campo-msg:empty { display: none; }
.campo-errore input, .campo-errore textarea { border-color: var(--errore); }
/* Il campo per i robot: fuori dallo schermo, non nascosto con display:none,
   che molti robot riconoscono e saltano. */
.campo-robot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.modulo-fondo { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.modulo-esito { font-size: 0.9375rem; color: var(--text-2); flex: 1 1 220px; }
.modulo-esito:empty { display: none; }
.esito-ok { color: var(--accent); }
.esito-errore { color: var(--errore); }
@media (min-width: 720px) { .modulo { padding: 32px; } }
.modulo-nota { font-size: 0.875rem; color: var(--muted); }

/* ---------- La privacy ---------- */
.legale { max-width: calc(46em + 2 * var(--gutter)); }
.legale h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin-bottom: 10px; }
.legale-data { color: var(--muted); font-size: 0.9375rem; margin-bottom: 36px; }
.legale h2 { font-size: 1.25rem; font-weight: 600; margin: 36px 0 12px; }
.legale p, .legale li { color: var(--text-2); }
.legale p + p { margin-top: 12px; }
.legale ul { padding-left: 1.2em; margin: 0; display: grid; gap: 8px; }
.legale-torna { margin-top: 48px; font-family: var(--font-mono); font-size: 0.875rem; }

/* ---------- Piede ---------- */
.piede { border-top: 1px solid var(--line); background: var(--bg-2); color: var(--muted); font-size: 0.875rem; }
.piede-dentro {
  max-width: var(--larghezza); margin: 0 auto; padding: 28px var(--gutter);
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
}
.piede a { color: var(--text-2); }
.piede a:hover { color: var(--text); }

/* La firma AQSolutions (pezzo firma-aqs del REPO). Il piede e' sempre scuro:
   si vede solo il logo per il fondo scuro. */
.firma-aqs { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0.35em 0.5em; color: inherit; vertical-align: middle; }
.firma-aqs-link { display: inline-flex; align-items: center; gap: 0.4em; color: inherit; text-decoration: none; }
.firma-aqs-link:hover > span, .firma-aqs-link:focus-visible > span { text-decoration: underline; }
.firma-aqs img { display: block; height: 1.4em; width: auto; }
.firma-aqs .aqs-chiaro { display: none; }

/* ---------- Chi ha chiesto meno movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .tappa.spenta { opacity: 1; transform: none; }
}
