/* Zendarm - foglio di stile locale (nessuna dipendenza esterna, niente Tailwind CDN). */

:root {
  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --border: #1e293b;
  --border-soft: rgba(30, 41, 59, 0.6);
  --text: #f1f5f9;
  --muted: #bfbfbf;
  --muted-2: #94a3b8;

  --brand-50: #eff6ff;
  --brand-400: #60a5fa;
  --brand-500: #3b82f6;
  --brand-600: #2563eb;
  --brand-900: #1e3a8a;

  --cyan-400: #22d3ee;
  --amber-400: #fbbf24;
  --red-400: #f87171;
  --red-500: #ef4444;
  --emerald-400: #34d399;

  --radius: 0.75rem;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
code, pre, .mono { font-family: var(--font-mono); }
a { color: inherit; text-decoration: none; }
::selection { background: var(--brand-500); color: #020617; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

section { padding: 3rem 0; }
.section-tight { padding: 2rem 0; }

.section-title { text-align: center; max-width: 640px; margin: 0 auto 3rem; }
.section-title h2 { font-size: 1.875rem; font-weight: 700; color: #fff; margin: 0 0 0.75rem; }
.section-title p { color: var(--muted); margin: 0; }

/* Navbar */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: 4rem;
  background: rgba(2, 6, 23, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-soft);
}
.navbar .container { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 0.75rem; }
.brand-mark {
  width: 2rem; height: 2rem; border-radius: 0.5rem;
  background: var(--brand-500);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 20px -8px rgba(59, 130, 246, 0.5);
}
.brand-mark svg { width: 1.25rem; height: 1.25rem; color: #020617; }
.brand-name { font-weight: 700; font-size: 1.125rem; letter-spacing: -0.01em; }
.brand-name span { color: var(--brand-400); }

.nav-links { display: none; align-items: center; gap: 2rem; font-size: 0.875rem; font-weight: 500; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
@media (min-width: 768px) { .nav-links { display: flex; } }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.9rem 1.5rem;
  border-radius: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .05s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand-500); color: #020617; box-shadow: 0 10px 25px -10px rgba(59,130,246,.5); }
.btn-primary:hover { background: var(--brand-600); }
.btn-ghost { background: var(--surface); color: #e2e8f0; border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.75rem; border-radius: 0.4rem; }
.btn-block { width: 100%; }
@media (min-width: 640px) { .btn-block { width: auto; } }

/* Hero */
.hero { padding: 8.5rem 0 3rem; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  border: 1px solid rgba(59,130,246,.35);
  background: rgba(59,130,246,.1);
  color: var(--brand-400);
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 2rem;
}
.eyebrow-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--brand-500); animation: pulse 2s infinite; }
.hero h1 { font-size: 2.5rem; font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.15; max-width: 820px; margin: 0 auto; }
@media (min-width: 640px) { .hero h1 { font-size: 3.5rem; } }
.hero h1 .accent {
  background: linear-gradient(90deg, var(--brand-500), var(--amber-400));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 1.5rem auto 0; max-width: 620px; color: var(--muted); font-size: 1.05rem; }
.hero-actions { margin-top: 2.5rem; display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; }
@media (min-width: 640px) { .hero-actions { flex-direction: row; } }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* Stat cards */
.stats-grid { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .stats-grid { grid-template-columns: repeat(3, 1fr); } }

.card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 20px 40px -25px rgba(0,0,0,.6);
}
.stat-card { display: flex; flex-direction: column; justify-content: space-between; min-height: 168px; }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.stat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat-value { font-size: 4.0rem; font-weight: 800; color: #05f6c9; font-family: var(--font-mono); letter-spacing: -0.01em; text-align: center; }
.stat-value.accent-cyan { color: var(--cyan-400); }
.stat-value.accent-amber { color: var(--amber-400); }
.stat-foot { font-size: 0.75rem; color: var(--muted-2); margin: 1rem 0 0; }
.stat-value.is-loading { color: var(--muted-2); }

.live-dot { width: 0.5rem; height: 0.5rem; border-radius: 999px; background: var(--emerald-400); animation: ping 1.6s cubic-bezier(0,0,.2,1) infinite; }
@keyframes ping { 75%,100% { transform: scale(2.2); opacity: 0; } }

.country-row + .country-row { margin-top: 0.65rem; }
.country-row-top { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 0.3rem; }
.country-row-top .name { color: #cbd5e1; font-weight: 500; }
.country-row-top .pct { color: var(--muted); font-family: var(--font-mono); }
.bar-track { width: 100%; height: 0.35rem; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--brand-500); transition: width .6s ease; }

.stats-updated { text-align: center; font-size: 0.7rem; color: var(--muted-2); margin-top: 1rem; }

/* Terminal */
.terminal { max-width: 760px; margin: 0 auto; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 25px 60px -30px rgba(59,130,246,.15); }
.terminal-head { display: flex; align-items: center; justify-content: space-between; padding: 0.75rem 1rem; background: var(--bg); border-bottom: 1px solid var(--border); }
.terminal-dots { display: flex; gap: 0.4rem; }
.terminal-dots span { width: 0.7rem; height: 0.7rem; border-radius: 999px; }
.terminal-dots span:nth-child(1) { background: rgba(239,68,68,.8); }
.terminal-dots span:nth-child(2) { background: rgba(245,158,11,.8); }
.terminal-dots span:nth-child(3) { background: rgba(34,197,94,.8); }
.terminal-title { font-size: 0.7rem; color: var(--muted-2); font-family: var(--font-mono); }
.terminal-body { padding: 1.25rem; font-family: var(--font-mono); font-size: 0.85rem; }
.terminal-body p { margin: 0 0 0.5rem; }
.terminal-body p:last-child { margin-bottom: 0; }
.t-muted { color: var(--muted-2); }
.t-warn { color: var(--amber-400); }
.t-info { color: #38bdf8; }
.t-action { color: var(--red-400); font-weight: 600; }
.t-hub { color: var(--brand-400); }
.t-ok { color: var(--emerald-400); }

/* Architecture / features */
.panel-band { background: rgba(15, 23, 42, 0.5); border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); }
.step-grid, .feature-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 768px) { .step-grid { grid-template-columns: repeat(3, 1fr); } .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }

.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.step-number { color: var(--brand-500); font-family: var(--font-mono); font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.step-card h3 { color: #fff; font-size: 1.15rem; margin: 0 0 0.5rem; }
.step-card p { color: var(--muted); font-size: 0.9rem; margin: 0; line-height: 1.6; }

.feature-card { background: rgba(15,23,42,.4); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 1.5rem; }
.feature-icon { width: 2.5rem; height: 2.5rem; border-radius: 0.5rem; background: rgba(59,130,246,.1); color: var(--brand-500); display: flex; align-items: center; justify-content: center; margin-bottom: 1rem; }
.feature-icon svg { width: 1.4rem; height: 1.4rem; }
.feature-card h3 { color: #fff; font-size: 1.05rem; margin: 0 0 0.5rem; }
.feature-card p { color: var(--muted); font-size: 0.875rem; margin: 0; }

/* Contact form */
.contact-wrap { max-width: 640px; margin: 0 auto; }
.contact-form { display: grid; gap: 1.1rem; text-align: left; margin-top: 2rem; }
.form-row { display: grid; gap: 1.1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-row { grid-template-columns: 1fr 1fr; } }
.field label { display: block; font-size: 0.8rem; font-weight: 600; color: #cbd5e1; margin-bottom: 0.4rem; }
.field input, .field textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 0.5rem;
  padding: 0.75rem 0.9rem; color: var(--text); font-family: var(--font-sans); font-size: 0.9rem;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.field textarea { resize: vertical; min-height: 120px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alert { padding: 0.85rem 1rem; border-radius: 0.5rem; font-size: 0.875rem; margin-bottom: 1rem; text-align: left; }
.form-alert.success { background: rgba(52,211,153,.1); border: 1px solid rgba(52,211,153,.35); color: #6ee7b7; }
.form-alert.error { background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.35); color: #fca5a5; }

.contact-note { font-size: 0.75rem; color: var(--muted-2); margin-top: 1rem; text-align: center; }

/* Footer */
footer { border-top: 1px solid var(--border-soft); padding: 2rem 0; text-align: center; font-size: 0.75rem; color: var(--muted-2); }

/* Utility */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
