/* =========================================================
   Fin-X Lab — Veste grafica 2026
   Struttura e contenuti invariati: cambia solo la presentazione.

   Linguaggio visivo: il disegno tecnico. Fin-X Lab nasce dai
   progetti di ricerca e sviluppo, quindi la pagina è impaginata
   come una tavola di progetto — griglia costruttiva a vista,
   filetti sottili, quote in oro, tipografia misurata.
   ========================================================= */

:root {
  /* Base */
  --ink:      #0a1724;
  --ink-2:    #0e2033;
  --ink-3:    #143048;
  --line-d:   #1d3a55;
  --line-d2:  #2a5075;

  /* Carta */
  --paper:    #efebe3;
  --paper-2:  #f8f6f1;
  --paper-3:  #e5dfd4;
  --line-l:   #d5cec0;

  /* Accenti */
  --gold:     #d49f62;
  --gold-hi:  #e8bd8c;
  --gold-dk:  #a2743c;
  --steel:    #7fa8ca;

  /* Testo */
  --on-dark:      #eaf1f7;
  --on-dark-mid:  #a3b8ca;
  --on-dark-dim:  #7690a6;
  --on-light:     #101d29;
  --on-light-mid: #46545f;
  --on-light-dim: #6f7c88;

  --maxw:   1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --nav-h:  76px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--ink);
  color: var(--on-dark);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-weight: 300;
  font-size: 16.5px;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

h1, h2, h3 {
  font-family: "Archivo", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: -0.028em;
  line-height: 1.06;
}

::selection { background: var(--gold); color: var(--ink); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Le ancore non devono finire sotto la navbar fissa */
section[id] { scroll-margin-top: calc(var(--nav-h) + 16px); }

/* =========================================================
   NAVBAR
   ========================================================= */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--nav-h);
  background: rgba(10, 23, 36, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s;
}
.site-nav.scrolled {
  background: rgba(10, 23, 36, 0.97);
  border-bottom-color: var(--line-d);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--nav-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 22px;
}

.nav-logo { display: inline-flex; align-items: center; gap: 11px; }
.nav-logo .logo-mark { height: 42px; width: auto; }
.nav-logo .logo-text { height: 18px; width: auto; }

.nav-toggle {
  margin-left: auto;
  width: 44px; height: 44px;
  border: 1px solid var(--line-d2);
  background: none;
  color: var(--on-dark);
  border-radius: 3px;
  font-size: 1.25rem;
  line-height: 1;
}

.nav-menu {
  list-style: none;
  position: absolute;
  top: var(--nav-h); left: 0; right: 0;
  background: var(--ink-2);
  border-bottom: 1px solid var(--line-d);
  flex-direction: column;
  padding: 6px var(--gutter) 20px;
  display: none;
}
.site-nav.open .nav-menu { display: flex; }
.nav-menu li { border-bottom: 1px solid rgba(29, 58, 85, 0.6); }
.nav-menu li:last-child { border-bottom: 0; }
.nav-menu a {
  display: block;
  padding: 13px 0;
  font-size: 0.95rem;
  color: var(--on-dark-mid);
  transition: color 0.2s;
}
.nav-menu a:hover { color: var(--on-dark); }

.nav-cta { color: var(--gold) !important; font-weight: 500; }

.nav-lang {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--on-dark-dim);
  border: 1px solid var(--line-d2);
  padding: 6px 11px;
  border-radius: 3px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-lang:hover { color: var(--gold); border-color: var(--gold); }

/* =========================================================
   ELEMENTI RICORRENTI
   ========================================================= */
.section { padding: clamp(72px, 9vw, 116px) var(--gutter); }
.section-inner { max-width: var(--maxw); margin: 0 auto; }

/* Occhiello: non più maiuscoletto spaziato, ma una quota di disegno */
.eyebrow,
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 0.83rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  background: none;
  color: var(--gold);
  margin-bottom: 18px;
}
.eyebrow::before,
.hero-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
  opacity: 0.65;
}

.sec-title {
  text-wrap: balance;
  font-size: clamp(1.95rem, 3.7vw, 2.95rem);
  color: var(--on-light);
  margin-bottom: 18px;
  max-width: 20ch;
}
.sec-title.light { color: var(--on-dark); }
.sec-title em { font-style: normal; color: var(--gold); }

.sec-lead {
  font-size: 1.06rem;
  color: var(--on-light-mid);
  max-width: 62ch;
}
.sec-lead.light { color: var(--on-dark-mid); }

.gold-bar { width: 46px; height: 2px; background: var(--gold); margin: 0 0 26px; }

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.on { opacity: 1; transform: none; }

/* Bottoni */
.btn-primary,
.btn-outline {
  display: inline-block;
  padding: 14px 26px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-hi); }
.btn-outline { border-color: var(--line-d2); color: var(--on-dark-mid); background: none; }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* =========================================================
   HERO
   ========================================================= */
#hero {
  position: relative;
  padding: calc(var(--nav-h) + 54px) var(--gutter) 74px;
  overflow: hidden;
  display: block;
  background-color: var(--ink);
  /* Il tracciato: dal die di silicio al grafo di inferenza.
     SVG vettoriale, 13 KB, nessuna fotografia. */
  background-image:
    linear-gradient(94deg,
      rgba(10, 23, 36, 0.96) 0%,
      rgba(10, 23, 36, 0.9) 30%,
      rgba(10, 23, 36, 0.42) 56%,
      rgba(10, 23, 36, 0.3) 82%,
      rgba(10, 23, 36, 0.5) 100%),
    url('../assets/hero-ai.png');
  background-size: cover, 880px auto;
  background-position: center, 100% 46%;
  background-repeat: no-repeat, no-repeat;
}
#hero {
  background-image:
    linear-gradient(94deg,
      rgba(10, 23, 36, 0.96) 0%,
      rgba(10, 23, 36, 0.9) 30%,
      rgba(10, 23, 36, 0.42) 56%,
      rgba(10, 23, 36, 0.3) 82%,
      rgba(10, 23, 36, 0.5) 100%),
    image-set(url('../assets/hero-ai.webp') type('image/webp'),
              url('../assets/hero-ai.png') type('image/png'));
  background-size: cover, 880px auto;
  background-position: center, 100% 46%;
}

/* La griglia costruttiva: firma visiva della nuova veste */
.hero-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 1;
  background-image:
    repeating-linear-gradient(90deg, rgba(127, 168, 202, 0.05) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(0deg,  rgba(127, 168, 202, 0.05) 0 1px, transparent 1px 96px),
    repeating-linear-gradient(90deg, rgba(212, 159, 98, 0.09) 0 1px, transparent 1px 480px);
  -webkit-mask-image: radial-gradient(125% 100% at 50% 0%, #000 32%, transparent 88%);
  mask-image: radial-gradient(125% 100% at 50% 0%, #000 32%, transparent 88%);
}

.hero-glow {
  position: absolute;
  top: -22%; right: -20%;
  width: min(880px, 94vw);
  aspect-ratio: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(31, 86, 130, 0.34) 0, transparent 64%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: 52px;
}

.hero-title {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-wrap: balance;
  font-size: clamp(2.15rem, 4.4vw, 3.45rem);
  max-width: 17ch;
  margin-bottom: 22px;
}
.hero-title em { font-style: normal; color: var(--gold); }

.hero-sub {
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  color: var(--on-dark-mid);
  max-width: 54ch;
  margin-bottom: 32px;
}

.hero-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Numeri: impaginati come quote di disegno */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(136px, 1fr));
  gap: 22px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line-d);
}
.hero-stat { display: flex; flex-direction: column; gap: 3px; }
.stat-number {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 2.05rem;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 0.83rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--on-dark-dim);
}

/* Le cinque aree: schede tecniche, non riquadri generici */
.hero-cards {
  display: grid;
  gap: 1px;
  background: rgba(29, 58, 85, 0.55);
  border: 1px solid var(--line-d);
  border-radius: 5px;
  overflow: hidden;
}
.hero-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  align-items: start;
  padding: 19px 21px;
  background: rgba(11, 25, 40, 0.44);
  backdrop-filter: blur(9px);
  transition: background 0.24s;
}
.hero-card:hover { background: rgba(20, 48, 72, 0.95); }
.card-icon {
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(212, 159, 98, 0.28);
  border-radius: 3px;
  background: rgba(212, 159, 98, 0.06);
}
.card-label {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.96rem;
  letter-spacing: -0.012em;
  text-transform: none;
  color: var(--on-dark);
  margin-bottom: 3px;
}
.card-text { font-size: 0.89rem; color: var(--on-dark-mid); }

/* =========================================================
   CERTIFICAZIONI  (fascia di raccordo fra hero e contenuti)
   ========================================================= */
.certs {
  background: var(--ink-2);
  border-top: 1px solid var(--line-d);
  border-bottom: 1px solid var(--line-d);
  padding: 34px var(--gutter);
}
.certs-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  gap: 24px;
}
.certs-intro {
  font-size: 0.88rem;
  color: var(--on-dark-dim);
  max-width: 26ch;
  align-self: center;
}
.certs-list {
  list-style: none;
  display: grid;
  gap: 1px;
  background: var(--line-d);
  border: 1px solid var(--line-d);
  border-radius: 4px;
  overflow: hidden;
}
.cert {
  background: var(--ink);
  padding: 17px 18px;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto auto auto;
  column-gap: 15px;
  row-gap: 3px;
  align-content: start;
}

/* Emblema: grafica nostra, non un marchio di certificazione.
   I marchi ufficiali (organismo + ACCREDIA) si potranno esporre
   soltanto a certificazione ottenuta. */
.cert-ico {
  grid-row: 1 / span 3;
  padding: 2px;
  align-self: start;
  width: 46px;
  height: 46px;
  color: var(--gold);
  opacity: 0.9;
}
.cert-code {
  grid-column: 2;
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--gold);
}
.cert-name { grid-column: 2; font-size: 0.85rem; color: var(--on-dark-mid); }
.cert-state {
  grid-column: 2;
  justify-self: start;
  margin-top: 8px;
  font-size: 0.73rem;
  padding: 3px 8px;
  border-radius: 2px;
  border: 1px solid var(--line-d2);
  color: var(--on-dark-dim);
}
.cert-state.wip {
  color: var(--gold);
  border-color: rgba(212, 159, 98, 0.4);
  background: rgba(212, 159, 98, 0.07);
}
.cert-state.done {
  color: #6fc79b;
  border-color: rgba(111, 199, 155, 0.4);
  background: rgba(111, 199, 155, 0.08);
}

/* =========================================================
   IDENTITÀ  (fondo carta)
   ========================================================= */
#identita { background: var(--paper); color: var(--on-light); }
#identita, #metodo, #team, #blog { border-top: 1px solid rgba(0,0,0,0.06); }
.id-grid { display: grid; gap: 50px; }

.id-quote {
  font-family: "Archivo", sans-serif;
  font-weight: 500;
  font-style: normal;
  font-size: clamp(1.12rem, 1.85vw, 1.4rem);
  line-height: 1.42;
  letter-spacing: -0.018em;
  color: var(--on-light);
  border-left: 2px solid var(--gold);
  padding-left: 22px;
  margin-bottom: 30px;
  max-width: 46ch;
}

.id-text { color: var(--on-light-mid); margin-bottom: 17px; max-width: 62ch; }

/* Le tre leve: elenco quotato */
.levers { display: grid; gap: 0; align-content: start; }
.lever {
  display: grid;
  grid-template-columns: 50px 1fr;
  gap: 18px;
  padding: 23px 0;
  border-top: 1px solid var(--line-l);
}
.lever:last-child { border-bottom: 1px solid var(--line-l); }
.lever-n {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--gold-dk);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.lever-t {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 1.06rem;
  letter-spacing: -0.018em;
  text-transform: none;
  color: var(--on-light);
  margin-bottom: 5px;
}
.lever-d { font-size: 0.94rem; color: var(--on-light-mid); }

/* =========================================================
   SERVIZI  (fondo scuro)
   ========================================================= */
#servizi { background: var(--ink); }

.srv-grid {
  display: grid;
  gap: 1px;
  background: var(--line-d);
  border: 1px solid var(--line-d);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 44px;
}
.srv {
  position: relative;
  background: var(--ink-2);
  padding: 29px 26px 26px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  transition: background 0.24s;
}
.srv:hover { background: var(--ink-3); }

.srv-num {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.84rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.srv-title { text-wrap: balance; font-size: 1.14rem; letter-spacing: -0.022em; color: var(--on-dark); }
.srv-desc { font-size: 0.93rem; color: var(--on-dark-mid); }

.srv-desc { margin-bottom: 4px; }
.srv-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 10px; }
.srv-tag {
  font-size: 0.75rem;
  color: var(--on-dark-mid);
  border: 1px solid var(--line-d2);
  border-radius: 2px;
  padding: 4px 9px;
}

/* La freccia compare solo all'interazione */
.srv-arrow {
  position: absolute;
  right: 22px;
  top: 25px;
  color: var(--gold);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.24s, transform 0.24s;
}
.srv:hover .srv-arrow { opacity: 1; transform: none; }

/* =========================================================
   METODO  (fondo carta, sequenza reale)
   ========================================================= */
#metodo { background: var(--paper-2); color: var(--on-light); }
.met-layout { display: grid; gap: 46px; }
.met-sticky p { color: var(--on-light-mid); margin-bottom: 16px; max-width: 46ch; }

.met-step {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 22px;
  padding: 25px 0;
  border-top: 1px solid var(--line-l);
}
.met-step:last-child { border-bottom: 1px solid var(--line-l); }
.met-n {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 1.42rem;
  color: var(--gold-dk);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.met-t { font-size: 1.12rem; letter-spacing: -0.02em; color: var(--on-light); margin-bottom: 7px; }
.met-d { font-size: 0.95rem; color: var(--on-light-mid); max-width: 70ch; }

/* =========================================================
   TEAM  (fondo carta più caldo)
   ========================================================= */
#team { background: var(--paper-3); color: var(--on-light); }
.team-grid { display: grid; gap: 20px; margin-top: 44px; }
.team-card {
  background: var(--paper-2);
  border: 1px solid var(--line-l);
  border-radius: 5px;
  padding: 29px 26px;
  display: flex;
  flex-direction: column;
}
.team-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gold-dk);
  border: 1px solid rgba(162, 116, 60, 0.4);
  border-radius: 2px;
  padding: 3px 9px;
  margin-bottom: 18px;
}
.team-name { font-size: 1.26rem; letter-spacing: -0.024em; color: var(--on-light); margin-bottom: 3px; }
.team-role { font-size: 0.92rem; color: var(--gold-dk); }
.team-div { height: 1px; background: var(--line-l); margin: 17px 0; }
.team-desc { font-size: 0.93rem; color: var(--on-light-mid); margin-bottom: 20px; }
.team-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.team-tag {
  font-size: 0.75rem;
  color: var(--on-light-mid);
  border: 1px solid var(--line-l);
  border-radius: 2px;
  padding: 4px 9px;
  background: #fff;
}

/* =========================================================
   PORTFOLIO  (fondo scuro: i progetti sono il core business)
   ========================================================= */
#portfolio { background: var(--ink); }
#portfolio .sec-title { color: var(--on-dark); }
#portfolio .sec-lead { color: var(--on-dark-mid); }

.port-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 28px; }
.filt-btn {
  background: none;
  border: 1px solid var(--line-d2);
  color: var(--on-dark-mid);
  padding: 8px 15px;
  border-radius: 2px;
  font-size: 0.86rem;
  letter-spacing: 0;
  text-transform: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.filt-btn:hover { border-color: var(--gold); color: var(--gold); }
.filt-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 600;
}

.port-grid { display: grid; gap: 17px; }
.port-card {
  background: var(--ink-2);
  border: 1px solid var(--line-d);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  padding: 25px 23px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: background 0.24s, transform 0.24s;
}
.port-card:hover { background: var(--ink-3); transform: translateY(-2px); }
.port-area { font-size: 0.78rem; letter-spacing: 0; text-transform: none; color: var(--on-dark-dim); }
.port-title { text-wrap: balance; font-size: 1.08rem; letter-spacing: -0.02em; color: var(--on-dark); }
.port-desc { font-size: 0.91rem; color: var(--on-dark-mid); }
.port-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 8px; }
.port-tag {
  font-size: 0.74rem;
  color: var(--on-dark-mid);
  border: 1px solid var(--line-d2);
  border-radius: 2px;
  padding: 3px 8px;
}
.port-add { display: flex; align-items: center; justify-content: center; padding: 24px 0; }

/* =========================================================
   BLOG  (fondo carta)
   ========================================================= */
#blog { background: var(--paper-2); color: var(--on-light); }
.blog-grid { display: grid; gap: 18px; margin-top: 44px; }
.blog-card {
  background: #fff;
  border: 1px solid var(--line-l);
  border-radius: 5px;
  padding: 27px 25px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.24s;
}
.blog-card:hover { border-color: var(--gold); }
.blog-card.feat { border-top: 3px solid var(--gold); }
.blog-cat { font-size: 0.78rem; letter-spacing: 0; text-transform: none; color: var(--gold-dk); }
.blog-title { text-wrap: balance; font-size: 1.13rem; letter-spacing: -0.022em; color: var(--on-light); }
.blog-exc { font-size: 0.92rem; color: var(--on-light-mid); }
.blog-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line-l);
}
.blog-date { font-size: 0.8rem; color: var(--on-light-dim); }

.blog-coming {
  margin-top: 32px;
  padding: 25px 27px;
  border: 1px dashed var(--line-l);
  border-radius: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.blog-coming p { color: var(--on-light-mid); max-width: 52ch; }

/* =========================================================
   CONTATTI  (fondo scuro)
   ========================================================= */
#contatti { background: var(--ink); }
.cont-layout { display: grid; gap: 46px; }
.cont-info p { color: var(--on-dark-mid); max-width: 52ch; }

.cont-items { display: grid; gap: 0; margin-top: 30px; }
.cont-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 0;
  border-top: 1px solid var(--line-d);
  font-size: 0.93rem;
  color: var(--on-dark-mid);
}
.cont-item:last-child { border-bottom: 1px solid var(--line-d); }
.cont-icon {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: var(--gold);
  border: 1px solid rgba(212, 159, 98, 0.25);
  border-radius: 3px;
}

.cont-form {
  background: var(--ink-2);
  border: 1px solid var(--line-d);
  border-radius: 5px;
  padding: 31px 29px;
}
.cont-form h3 { font-size: 1.3rem; letter-spacing: -0.024em; margin-bottom: 5px; }
.cont-form .sub { font-size: 0.89rem; color: var(--on-dark-dim); margin-bottom: 25px; }

.fg { margin-bottom: 16px; }
.fg label {
  display: block;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--on-dark-mid);
  margin-bottom: 7px;
}
.fg input, .fg select, .fg textarea {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line-d2);
  color: var(--on-dark);
  padding: 12px 14px;
  border-radius: 3px;
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.fg input::placeholder, .fg textarea::placeholder { color: var(--on-dark-dim); }
.fg input:focus, .fg select:focus, .fg textarea:focus { border-color: var(--gold); outline: none; }
.fg select option { background: var(--ink-2); color: var(--on-dark); }
.fg textarea { min-height: 116px; resize: vertical; }
.fg-row { display: grid; gap: 16px; }

.fg-consent { display: flex; align-items: flex-start; gap: 11px; margin: 21px 0; }
.fg-consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 3px;
  accent-color: var(--gold);
  cursor: pointer;
}
.fg-consent label { font-size: 0.83rem; line-height: 1.55; color: var(--on-dark-mid); cursor: pointer; }
.fg-consent a { color: var(--gold); text-decoration: underline; }
.fg-consent .req { color: var(--gold); }

.btn-submit {
  width: 100%;
  background: var(--gold);
  color: var(--ink);
  border: 0;
  padding: 14px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  transition: background 0.2s;
}
.btn-submit:hover { background: var(--gold-hi); }
.btn-submit:disabled { opacity: 0.6; cursor: default; }

#form-msg { display: none; margin-top: 13px; font-size: 0.88rem; text-align: center; }

.form-note { font-size: 0.76rem; line-height: 1.6; color: var(--on-dark-dim); margin-top: 16px; }

/* Honeypot: invisibile agli utenti, visibile ai bot */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--ink);
  border-top: 1px solid var(--line-d);
  padding: 42px var(--gutter) 32px;
}
.foot-inner { max-width: var(--maxw); margin: 0 auto; display: grid; gap: 20px; }
.foot-logo {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 1.08rem;
  letter-spacing: -0.02em;
}
.foot-logo span { color: var(--gold); }
.foot-links { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 0.88rem; }
.foot-links a { color: var(--on-dark-dim); transition: color 0.2s; }
.foot-links a:hover { color: var(--gold); }
.foot-copy {
  font-size: 0.81rem;
  color: var(--on-dark-dim);
  padding-top: 18px;
  border-top: 1px solid var(--line-d);
}

/* =========================================================
   BANNER COOKIE
   ========================================================= */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 400;
  background: var(--ink-2);
  border-top: 1px solid var(--line-d2);
  padding: 16px var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-height: 44vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s ease;
  box-shadow: 0 -6px 30px rgba(0, 0, 0, 0.45);
}
#cookie-banner.show { transform: translateY(0); }
.cookie-text { font-size: 0.82rem; line-height: 1.55; color: var(--on-dark-mid); max-width: 74ch; }
.cookie-text a { color: var(--gold); text-decoration: underline; }
.cookie-btns { display: flex; flex-wrap: wrap; gap: 9px; }
.btn-ck {
  padding: 9px 17px;
  border-radius: 3px;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  border: 1px solid var(--line-d2);
  background: none;
  color: var(--on-dark-mid);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn-ck-accept { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 600; }
.btn-ck-accept:hover { background: var(--gold-hi); }
.btn-ck-reject:hover, .btn-ck-detail:hover { border-color: var(--gold); color: var(--gold); }

/* =========================================================
   PAGINE LEGALI (privacy policy, cookie policy)
   ========================================================= */
.legal-main {
  padding-top: var(--nav-h);
  background: var(--ink);
}
.legal-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: clamp(52px, 7vw, 84px) var(--gutter) clamp(64px, 8vw, 96px);
}

.page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font-size: 0.83rem;
  color: var(--gold);
  margin-bottom: 16px;
}
.page-eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--gold);
  opacity: 0.65;
}

.legal-inner h1 {
  font-size: clamp(2rem, 4vw, 2.85rem);
  color: var(--on-dark);
  margin-bottom: 12px;
  text-wrap: balance;
}
.legal-inner h2 {
  font-size: 1.24rem;
  color: var(--on-dark);
  margin: 46px 0 14px;
  padding-top: 22px;
  border-top: 1px solid var(--line-d);
}
/* Due titoli consecutivi ("2." seguito da "2.1") non devono avere due filetti */
.legal-inner h2 + h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 10px;
  font-size: 1.08rem;
}

.legal-inner h3 {
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.018em;
  color: var(--on-dark);
  margin: 28px 0 10px;
}

.legal-inner p {
  color: var(--on-dark-mid);
  margin-bottom: 15px;
  font-size: 0.97rem;
}
.legal-inner strong { color: var(--on-dark); font-weight: 600; }

.legal-inner ul, .legal-inner ol {
  margin: 0 0 20px;
  padding-left: 4px;
  list-style: none;
}
.legal-inner li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 9px;
  color: var(--on-dark-mid);
  font-size: 0.97rem;
}
.legal-inner li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 7px;
  height: 1px;
  background: var(--gold);
}

.legal-inner a {
  color: var(--gold);
  border-bottom: 1px solid rgba(212, 159, 98, 0.35);
  transition: border-color 0.2s;
}
.legal-inner a:hover { border-bottom-color: var(--gold); }

.last-update {
  font-size: 0.85rem !important;
  color: var(--on-dark-dim) !important;
  margin-bottom: 30px !important;
}

/* Riquadro introduttivo */
.box {
  border: 1px solid var(--line-d);
  border-left: 2px solid var(--gold);
  border-radius: 4px;
  background: var(--ink-2);
  padding: 20px 22px;
  margin: 0 0 34px;
}
.box p:last-child { margin-bottom: 0; }

/* Tabella dei cookie */
.cookie-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 28px;
  font-size: 0.9rem;
  border: 1px solid var(--line-d);
  border-radius: 4px;
  overflow: hidden;
}
.cookie-table thead th {
  background: var(--ink-2);
  color: var(--on-dark);
  font-family: "Archivo", sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-d);
}
.cookie-table th:nth-child(1), .cookie-table td:nth-child(1) { width: 27%; }
.cookie-table th:nth-child(2), .cookie-table td:nth-child(2) { width: 14%; }
.cookie-table th:nth-child(3), .cookie-table td:nth-child(3) { width: 13%; white-space: nowrap; }

.cookie-table td {
  padding: 13px 14px;
  color: var(--on-dark-mid);
  border-bottom: 1px solid rgba(29, 58, 85, 0.6);
  vertical-align: top;
}
.cookie-table tbody tr:last-child td { border-bottom: 0; }

.badge {
  display: inline-block;
  font-size: 0.74rem;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 2px;
  white-space: nowrap;
}
.badge-tech {
  color: var(--gold);
  border: 1px solid rgba(212, 159, 98, 0.38);
  background: rgba(212, 159, 98, 0.07);
}

/* Pannello preferenze cookie */
.consent-panel {
  border: 1px solid var(--line-d);
  border-radius: 5px;
  background: var(--ink-2);
  padding: 26px 24px;
  margin: 26px 0 34px;
}
.consent-panel h3 { margin: 0 0 18px; font-size: 1.08rem; }

.consent-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--line-d);
}
.consent-info { display: grid; gap: 3px; flex: 1 1 260px; }
.consent-info strong { font-size: 0.96rem; color: var(--on-dark); }
.consent-info span { font-size: 0.86rem; color: var(--on-dark-mid); }

.toggle-wrap { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.toggle-label { font-size: 0.83rem; color: var(--on-dark-dim); white-space: nowrap; }

/* Interruttore: l'input nativo resta accessibile ma invisibile */
.toggle { position: relative; display: inline-block; width: 46px; height: 25px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--ink);
  border: 1px solid var(--line-d2);
  border-radius: 25px;
  transition: background 0.22s, border-color 0.22s;
  pointer-events: none;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--on-dark-dim);
  transition: transform 0.22s, background 0.22s;
}
.toggle input:checked + .toggle-slider {
  background: rgba(212, 159, 98, 0.2);
  border-color: var(--gold);
}
.toggle input:checked + .toggle-slider::before {
  transform: translate(21px, -50%);
  background: var(--gold);
}
.toggle input:disabled + .toggle-slider { opacity: 0.55; }
.toggle input:disabled { cursor: default; }
.toggle input:focus-visible + .toggle-slider { outline: 2px solid var(--gold); outline-offset: 3px; }

.btn-save-prefs {
  margin-top: 20px;
  background: var(--gold);
  color: var(--ink);
  border: 0;
  padding: 12px 24px;
  border-radius: 3px;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s;
}
.btn-save-prefs:hover { background: var(--gold-hi); }

/* Su schermi stretti la tabella diventa un elenco di schede:
   quattro colonne non stanno in 390 pixel senza tagliare il testo. */
@media (max-width: 640px) {
  .cookie-table, .cookie-table tbody, .cookie-table tr, .cookie-table td { display: block; width: 100%; }
  .cookie-table thead { position: absolute; left: -9999px; }
  .cookie-table { border: 0; }
  .cookie-table tr {
    border: 1px solid var(--line-d);
    border-left: 2px solid var(--gold);
    border-radius: 4px;
    background: var(--ink-2);
    padding: 14px 16px;
    margin-bottom: 12px;
  }
  .cookie-table td { border: 0; padding: 4px 0; }
  .cookie-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.74rem;
    color: var(--on-dark-dim);
    margin-bottom: 2px;
  }
  .cookie-table th:nth-child(n), .cookie-table td:nth-child(n) { width: auto; }
}

#pref-msg {
  display: none;
  margin: 14px 0 0 !important;
  font-size: 0.88rem !important;
  color: var(--gold) !important;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (min-width: 700px) {
  .certs-list { grid-template-columns: repeat(3, 1fr); }
  .fg-row { grid-template-columns: 1fr 1fr; }
  .team-grid { grid-template-columns: repeat(2, 1fr); }
  .port-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  #cookie-banner { flex-direction: row; align-items: center; justify-content: space-between; }
  .foot-inner { grid-template-columns: auto 1fr; align-items: center; }
  .foot-links { justify-content: flex-end; }
  .foot-copy { grid-column: 1 / -1; }
}

@media (min-width: 900px) {
  .certs-inner { grid-template-columns: auto 1fr; gap: 36px; }
  .certs-list { grid-template-columns: repeat(3, 1fr); }
  .nav-toggle { display: none; }
  .nav-menu {
    display: flex;
    flex-direction: row;
    position: static;
    background: none;
    border: 0;
    padding: 0;
    margin-left: auto;
    gap: 24px;
  }
  .nav-menu li { border: 0; }
  .nav-menu a { padding: 0; font-size: 0.92rem; }

  .hero-inner { grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 54px; }
  .id-grid { grid-template-columns: 1.08fr 0.92fr; gap: 60px; }
  .met-layout { grid-template-columns: 0.85fr 1.15fr; gap: 60px; align-items: start; }
  .met-sticky { position: sticky; top: calc(var(--nav-h) + 30px); }
  .cont-layout { grid-template-columns: 0.92fr 1.08fr; gap: 56px; }
  .srv-grid { grid-template-columns: repeat(2, 1fr); }
  .team-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-grid { grid-template-columns: repeat(3, 1fr); }
  .blog-card.feat { grid-column: span 3; }
}

@media (min-width: 1120px) {
  .srv-grid { grid-template-columns: repeat(3, 1fr); }
  .port-grid { grid-template-columns: repeat(3, 1fr); }
  #hero { background-size: cover, 1000px auto; background-position: center, 100% 46%; }
}


@media (max-width: 699px) {
  #hero {
    background-image:
      linear-gradient(172deg, rgba(10,23,36,0.9) 0%, rgba(10,23,36,0.84) 40%, rgba(10,23,36,0.72) 100%),
      url('../assets/hero-ai.png');
    background-size: cover, cover;
    background-position: center, 60% 22%;
  }
  .hero-stats { grid-template-columns: repeat(3, 1fr); gap: 13px; }
  .stat-number { font-size: 1.55rem; }
  .stat-label { font-size: 0.74rem; }
  .btn-primary, .btn-outline { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .port-card:hover { transform: none; }
}
