/* ===========================================================
   Tetha Solutions — Single page · Tech grid
   Dark-first, responsive, JetBrains/Inter Tight/Inter.
   =========================================================== */

:root {
  --bg: #0A0E1A;
  --bg-alt: #060914;
  --panel: #11172A;
  --panel-hi: #151C33;
  --ink: #F4F6FB;
  --text: #D0D5E3;
  --muted: #B4BACB;
  --dim: #8891A8;
  --blue: #4F7FFF;
  --blue-soft: #93B4F5;
  --blue-deep: #1E3A8A;
  --blue-glow: rgba(79, 127, 255, 0.25);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --grid-line: rgba(255, 255, 255, 0.035);

  --font-display: 'Inter Tight', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container: 1360px;
  --pad-x: clamp(20px, 4vw, 40px);
  --radius: 8px;
  --radius-lg: 12px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ─── Tipografia ─── */
.mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.mono-blue { color: var(--blue); }

h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 500; color: var(--ink); letter-spacing: -0.03em; }
h1 { font-size: clamp(44px, 7vw, 88px); line-height: 0.98; letter-spacing: -0.035em; }
h2 { font-size: clamp(32px, 5vw, 52px); line-height: 1.02; letter-spacing: -0.028em; }
h3 { font-size: clamp(20px, 2.2vw, 24px); line-height: 1.2; letter-spacing: -0.02em; }
p { margin: 0; }
em { font-style: italic; font-weight: 400; }

/* ─── Background grid ─── */
.grid-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 18px rgba(79, 127, 255, 0.25);
}
.btn-primary:hover {
  background: #3F6FEF;
  box-shadow: 0 10px 28px rgba(79, 127, 255, 0.4);
  transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  transform: translateY(-1px);
}
.btn-sm { padding: 10px 18px; font-size: 14px; }

/* ─── Nav ─── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 16px var(--pad-x);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.nav-left { display: flex; align-items: center; gap: 40px; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo img { height: 32px; object-fit: contain; filter: brightness(1.4); }
.logo-text {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.logo-text .accent { color: var(--blue); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s var(--ease);
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 1.5px;
  background: var(--blue);
  transition: width 0.25s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 14px; }

.badge-partner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim);
}
.badge-partner .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 8px #34D399;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

/* Burger button */
.burger {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  padding: 0;
  position: relative;
}
.burger span {
  position: absolute;
  left: 10px;
  right: 10px;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease), top 0.3s var(--ease);
}
.burger span:nth-child(1) { top: 14px; }
.burger span:nth-child(2) { top: 19px; }
.burger span:nth-child(3) { top: 24px; }
.burger.is-open span:nth-child(1) { top: 19px; transform: rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { top: 19px; transform: rotate(-45deg); }

/* Mobile menu overlay */
.mobile-menu {
  position: fixed;
  inset: 64px 0 0 0;
  background: var(--bg);
  z-index: 49;
  padding: 24px var(--pad-x) 40px;
  transform: translateY(-100%);
  transition: transform 0.4s var(--ease);
  overflow-y: auto;
}
.mobile-menu.is-open { transform: translateY(0); }
.mobile-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.mobile-menu ul a {
  display: block;
  padding: 20px 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.mobile-menu ul a:hover { color: var(--blue); }
.mobile-menu .mobile-cta {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mobile-menu .badge-partner { align-self: flex-start; }

/* ─── HERO ─── */
.hero {
  position: relative;
  padding: clamp(60px, 10vw, 100px) 0 clamp(80px, 12vw, 120px);
  overflow: hidden;
}
.hero-glow {
  position: absolute;
  top: -200px;
  right: -200px;
  width: 800px;
  height: 800px;
  background: radial-gradient(closest-side, rgba(79, 127, 255, 0.25), transparent);
  pointer-events: none;
  animation: float 12s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, 30px); }
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.hero-tag {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--blue);
}
.hero-tag .line { width: 24px; height: 1px; background: var(--blue); }

.hero h1 .blue { color: var(--blue); }
.hero h1 .ital { font-style: italic; font-weight: 400; }

.hero-lead {
  max-width: 500px;
  margin-top: 28px;
  font-size: clamp(16px, 1.5vw, 18px);
  color: var(--muted);
}
.hero-cta {
  margin-top: 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-kpis {
  margin-top: clamp(48px, 8vw, 72px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  padding-top: 24px;
}
.hero-kpis .kpi {
  padding-right: 16px;
  border-right: 1px solid var(--border);
}
.hero-kpis .kpi:last-child { border-right: none; }
.hero-kpis .num {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-kpis .lbl {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  margin-top: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Geometric visual */
.hero-visual {
  position: relative;
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-visual svg { width: 100%; height: 100%; max-width: 600px; }
.hero-visual .orbit-outer,
.hero-visual .orbit-mid,
.hero-visual .orbit-inner {
  transform-origin: 280px 280px;
}
.hero-visual .orbit-outer { animation: spin 60s linear infinite; }
.hero-visual .orbit-mid { animation: spin 45s linear infinite reverse; }
.hero-visual .orbit-inner { animation: spin 30s linear infinite; }
@keyframes spin {
  to { transform: rotate(360deg); }
}
.hero-visual .node-glow {
  animation: nodePulse 3s ease-in-out infinite;
  transform-origin: center;
}
.hero-visual .node-glow:nth-of-type(2) { animation-delay: 0.7s; }
.hero-visual .node-glow:nth-of-type(3) { animation-delay: 1.4s; }
.hero-visual .node-glow:nth-of-type(4) { animation-delay: 2.1s; }
@keyframes nodePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ─── Sections ─── */
.section {
  padding: clamp(80px, 12vw, 120px) 0;
  position: relative;
  border-top: 1px solid var(--border);
}
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.section-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: clamp(32px, 5vw, 64px);
  margin-bottom: clamp(40px, 6vw, 64px);
  align-items: start;
}
.section-head h2 .blue { color: var(--blue); }
.section-head .sub {
  max-width: 560px;
  margin-top: 20px;
  font-size: clamp(15px, 1.3vw, 17px);
}
.section-head .row-end {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head .row-end a {
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
}

/* ─── Servizi grid ─── */
.grid-services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.service {
  background: var(--panel);
  padding: clamp(24px, 3vw, 36px);
  transition: background 0.3s var(--ease);
}
.service:hover { background: var(--panel-hi); }
.service-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.service-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: rgba(79, 127, 255, 0.12);
  border: 1px solid rgba(79, 127, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  transition: transform 0.3s var(--ease);
}
.service:hover .service-icon { transform: rotate(-6deg) scale(1.06); }
.service h3 { margin-bottom: 10px; }
.service p { margin: 0 0 20px; color: var(--muted); }
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ─── Settori ─── */
.grid-sectors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sector {
  background: var(--panel);
  padding: clamp(20px, 2.5vw, 28px);
  transition: background 0.3s var(--ease);
}
.sector:hover { background: var(--panel-hi); }
.sector .mono { margin-bottom: 20px; color: var(--blue); }
.sector h3 { font-size: clamp(18px, 2vw, 22px); margin-bottom: 10px; }
.sector p { font-size: 14px; color: var(--muted); }

/* ─── Casi di studio ─── */
.grid-cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.case {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}
.case:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 127, 255, 0.4);
}
.case-visual {
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--panel-hi), var(--panel));
  position: relative;
  border-bottom: 1px solid var(--border);
}
.case-tag {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 4px 10px;
  background: rgba(10, 14, 26, 0.9);
  color: var(--blue);
  border-radius: 4px;
  border: 1px solid rgba(79, 127, 255, 0.3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.case-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.case-client {
  font-size: 13px;
  color: var(--blue);
  font-weight: 500;
  margin-bottom: 8px;
}
.case h3 { font-size: 20px; line-height: 1.25; margin-bottom: 20px; }
.case-metric {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-top: 20px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.case-metric .val {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.case-metric .lbl { font-size: 12px; color: var(--dim); }

/* ─── Metodo ─── */
.grid-method {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.step {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.5vw, 28px);
  transition: border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.step:hover { border-color: rgba(79, 127, 255, 0.35); transform: translateY(-3px); }
.step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}
.step-num { font-family: var(--font-mono); font-size: 11px; color: var(--blue); letter-spacing: 0.1em; }
.step-arrow {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}
.step:hover .step-arrow { color: var(--blue); transform: translateX(4px); }
.step h3 { font-size: 22px; margin-bottom: 12px; }
.step p { font-size: 14px; color: var(--muted); }

/* ─── Stack ─── */
.grid-stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.stack-col {
  background: var(--panel);
  padding: clamp(20px, 2.5vw, 28px);
}
.stack-col .mono {
  font-size: 11px;
  color: var(--blue);
  margin-bottom: 20px;
}
.stack-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.stack-col li {
  font-size: 15px;
  color: var(--ink);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stack-col li::before {
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blue);
}

/* ─── CTA Terminal ─── */
.cta-terminal {
  background: linear-gradient(180deg, var(--bg) 0%, #070A12 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.cta-terminal::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 300px at 85% 50%, rgba(79,127,255,0.10), transparent 70%),
    radial-gradient(400px 200px at 15% 80%, rgba(79,127,255,0.06), transparent 70%);
  pointer-events: none;
}
.cta-terminal > .container { position: relative; z-index: 1; }
.cta-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.cta-copy h2 { margin-top: 20px; }
.cta-copy h2 .blue { color: var(--blue); }
.cta-copy .sub { margin-top: 20px; max-width: 440px; }

.terminal {
  background: #05080F;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(79,127,255,0.08);
  font-family: var(--font-mono);
}
.terminal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--dim);
}
.terminal-head .dot-r,
.terminal-head .dot-y,
.terminal-head .dot-g {
  width: 11px; height: 11px; border-radius: 50%;
}
.terminal-head .dot-r { background: #FF5F57; }
.terminal-head .dot-y { background: #FEBC2E; }
.terminal-head .dot-g { background: #28C840; }
.terminal-title { margin-left: 12px; letter-spacing: 0.05em; }
.terminal-live { margin-left: auto; color: #34D399; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

.terminal-body {
  margin: 0;
  padding: 24px 22px;
  font-size: clamp(12px, 1.1vw, 13px);
  line-height: 1.75;
  color: #D0D5E3;
  min-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
  position: relative;
}
.terminal-body code { font-family: inherit; white-space: pre-wrap; }
.terminal-body .tk-cmt { color: #5B6B8A; }
.terminal-body .tk-key { color: #C792EA; }
.terminal-body .tk-fn { color: #82AAFF; }
.terminal-body .tk-str { color: #C3E88D; }
.terminal-body .tk-num { color: #F78C6C; }
.terminal-body .tk-op { color: #89DDFF; }
.terminal-body .tk-id { color: #F4F6FB; }
.terminal-body .tk-prompt { color: var(--blue); }
.terminal-body .tk-ok { color: #34D399; }

.caret {
  display: inline-block;
  width: 8px;
  height: 1em;
  background: var(--blue);
  vertical-align: -2px;
  margin-left: 2px;
  animation: caret-blink 1s steps(2, start) infinite;
}
@keyframes caret-blink { 50% { opacity: 0; } }

.terminal.done .caret { display: none; }

@media (max-width: 1024px) {
  .cta-wrap { grid-template-columns: 1fr; }
}

/* ─── Contatti ─── */
.contact {
  position: relative;
}
.contact .bg-glow {
  position: absolute;
  top: 20%;
  left: 25%;
  width: 600px;
  height: 600px;
  background: radial-gradient(closest-side, rgba(79, 127, 255, 0.15), transparent);
  pointer-events: none;
}
.contact-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(40px, 6vw, 80px);
}
.contact h2 .blue { color: var(--blue); }
.contact-lead {
  margin-top: 24px;
  max-width: 440px;
  font-size: clamp(15px, 1.4vw, 17px);
}
.contact-info {
  margin-top: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}
.contact-info .row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.contact-info .row:last-child { border-bottom: none; }
.contact-info .k {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  width: 70px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.contact-info .v { font-size: 15px; font-weight: 500; color: var(--ink); word-break: break-word; }

.form-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 3vw, 36px);
}
.form-card .label-line {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--blue);
  margin-bottom: 24px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(79, 127, 255, 0.15);
}
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  transition: all 0.2s var(--ease);
}
.chip:hover { color: var(--ink); border-color: var(--border-strong); }
.chip.is-active {
  background: rgba(79, 127, 255, 0.14);
  border-color: rgba(79, 127, 255, 0.4);
  color: var(--blue);
}
.form-card .btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ─── Footer ─── */
.footer {
  background: var(--bg-alt);
  padding: 72px 0 32px;
  border-top: 1px solid var(--border);
  position: relative;
}
.footer-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 56px;
}
.footer-brand img { height: 50px; margin-bottom: 20px; }
.footer-brand p {
  color: var(--dim);
  font-size: 14px;
  max-width: 320px;
  line-height: 1.55;
}
.footer-partner {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}
.ms-logo { width: 16px; height: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.ms-logo span { display: block; }
.ms-logo span:nth-child(1) { background: #F25022; }
.ms-logo span:nth-child(2) { background: #7FBA00; }
.ms-logo span:nth-child(3) { background: #00A4EF; }
.ms-logo span:nth-child(4) { background: #FFB900; }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--dim);
  margin: 0 0 20px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-col li { font-size: 14px; color: var(--text); }
.footer-col a:hover { color: var(--blue); }

.footer-map {
  height: 220px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}
.footer-map .pulse-dot {
  animation: mapPulse 2.5s ease-out infinite;
  transform-origin: center;
}
.footer-map .pulse-dot.p2 { animation-delay: 0.8s; }
@keyframes mapPulse {
  0% { opacity: 0.7; r: 5; }
  100% { opacity: 0; r: 40; }
}

.footer-legal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--dim);
  gap: 24px;
  flex-wrap: wrap;
}
.footer-legal .legal-text { flex: 1 1 480px; line-height: 1.6; }
.footer-legal .links { display: flex; gap: 24px; flex-shrink: 0; }

@media (max-width: 768px) {
  .footer-legal .legal-text { flex: 1 1 180px; }
}

/* ─── Accessibility ─── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  z-index: 9999;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 16px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.p-margin
{
  margin-block-start: 1em;
  margin-block-end: 1em;
}

/* ─── Form consent ─── */
.form-consent { margin-top: 4px; }
/* Override: la label "consent" non deve ereditare gli stili delle label-input */
.form-card .form-consent label.consent {
  display: flex;
  margin-bottom: 0;
  padding: 0;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--dim);
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  user-select: none;
}
.consent input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.consent .consent-box {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background: rgba(255,255,255,0.02);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all 0.2s var(--ease);
  margin-top: 1px;
}
.consent input:checked + .consent-box {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.consent input:focus-visible + .consent-box {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.consent-text a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.consent-text a:hover { color: var(--blue); }
.consent-text .req { color: var(--blue); }

.form-consent.shake { animation: shake 0.45s var(--ease); }

.form-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px;
  text-align: center;
  min-height: 280px;
}
.form-success h3 { font-size: 22px; color: var(--ink); margin: 0; }
.form-success p { color: var(--muted); font-size: 15px; margin: 0; }

.form-error {
  margin-bottom: 16px;
  padding: 12px 14px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.3);
  border-radius: 6px;
  color: #FF6B6B;
  font-size: 14px;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ─── Animazioni reveal ─── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: 0.08s; }
.reveal[data-delay="2"] { transition-delay: 0.16s; }
.reveal[data-delay="3"] { transition-delay: 0.24s; }
.reveal[data-delay="4"] { transition-delay: 0.32s; }
.reveal[data-delay="5"] { transition-delay: 0.40s; }

/* Hero animazioni entrata */
.hero-enter > * { opacity: 0; transform: translateY(20px); }
.hero-loaded .hero-tag { animation: heroIn 0.8s var(--ease) 0.1s forwards; }
.hero-loaded h1 { animation: heroIn 0.9s var(--ease) 0.25s forwards; }
.hero-loaded .hero-lead { animation: heroIn 0.8s var(--ease) 0.4s forwards; }
.hero-loaded .hero-cta { animation: heroIn 0.8s var(--ease) 0.55s forwards; }
.hero-loaded .hero-kpis { animation: heroIn 0.8s var(--ease) 0.7s forwards; }
.hero-loaded .hero-visual { animation: heroInRight 1.2s var(--ease) 0.2s forwards; }
@keyframes heroIn {
  to { opacity: 1; transform: translateY(0); }
}
@keyframes heroInRight {
  from { opacity: 0; transform: scale(0.9) rotate(-5deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

/* KPI counter animation */
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── Responsive ─── */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 480px; margin: 16px auto 0; order: -1; }
  .grid-sectors { grid-template-columns: repeat(2, 1fr); }
  .grid-cases { grid-template-columns: repeat(2, 1fr); }
  .grid-method { grid-template-columns: repeat(2, 1fr); }
  .grid-stack { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-right .badge-partner,
  .nav-right .btn { display: none; }
  .burger { display: block; }

  .hero-kpis {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 24px;
  }
  .hero-kpis .kpi:nth-child(2) { border-right: none; }
  .hero-kpis .kpi:nth-child(3) {
    border-right: 1px solid var(--border);
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }
  .hero-kpis .kpi:nth-child(4) {
    padding-top: 24px;
    border-top: 1px solid var(--border);
  }

  .grid-services { grid-template-columns: 1fr; }
  .grid-sectors { grid-template-columns: 1fr; }
  .grid-cases { grid-template-columns: 1fr; }
  .grid-method { grid-template-columns: 1fr; }
  .grid-stack { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-legal { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .hero { padding: 40px 0 60px; }
  .hero-cta .btn { flex: 1; justify-content: center; }
  .btn { padding: 12px 18px; font-size: 14px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-visual .orbit-outer,
  .hero-visual .orbit-mid,
  .hero-visual .orbit-inner { animation: none; }
  .hero-loaded .hero-tag,
  .hero-loaded h1,
  .hero-loaded .hero-lead,
  .hero-loaded .hero-cta,
  .hero-loaded .hero-kpis,
  .hero-loaded .hero-visual { opacity: 1 !important; transform: none !important; }
}
