/* ============================================================
   SKAB — Design System
   Devdata Automation SRL
   Zero dipendenze esterne (font di sistema, nessun CDN)
   ============================================================ */

:root {
  /* Colori del marchio SKAB
     #0b2343 blu notte · #2659aa blu · #5e9eea azzurro */
  --bg:          #060e1a;
  --bg-alt:      #0a1626;
  --surface:     #0e1e33;
  --surface-2:   #14293f;
  --border:      #1e3a56;
  --border-soft: #16293d;

  --text:        #e6eef7;
  --text-muted:  #93a9c2;
  --text-dim:    #627892;

  --accent:      #5e9eea;
  --accent-dim:  #2659aa;
  --accent-glow: rgba(94, 158, 234, .15);

  --amber:       #f0a132;
  --orange:      #e8743b;
  --red:         #e05252;
  --green:       #3fbf8f;

  /* Tipografia */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  /* Layout */
  --wrap: 1180px;
  --wrap-narrow: 760px;
  --radius: 10px;
  --radius-lg: 16px;

  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;   /* su iOS il solo overflow sul body non basta */
  max-width: 100%;
}
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; font-weight: 650; letter-spacing: -.02em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.35rem); }
h4 { font-size: 1.02rem; }
p  { margin: 0 0 1.1em; }
ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin-bottom: .45em; }
strong { color: #fff; font-weight: 620; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .15em .42em; border-radius: 4px; color: var(--accent); }

/* ---------- Utility ---------- */
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 24px; }
.wrap-narrow { max-width: var(--wrap-narrow); margin-inline: auto; padding-inline: 24px; }
.section { padding: clamp(56px, 8vw, 104px) 0; }
.section--alt { background: var(--bg-alt); border-block: 1px solid var(--border-soft); }
.center { text-align: center; }
.lead { font-size: clamp(1.05rem, 2vw, 1.24rem); color: var(--text-muted); line-height: 1.6; }
.muted { color: var(--text-muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); }
.mb0 { margin-bottom: 0; }
.mt2 { margin-top: 2rem; }
.mt3 { margin-top: 3.25rem; }

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1rem;
}

.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 60px); }
.section-head.center { margin-inline: auto; }

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-size: .96rem;
  font-weight: 600;
  padding: .78em 1.5em;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .18s ease;
  text-decoration: none !important;
  font-family: inherit;
}
.btn--primary { background: var(--accent); color: #061426; }
.btn--primary:hover { background: #7db4f2; transform: translateY(-1px); }
.btn--ghost { border-color: var(--border); color: var(--text); background: transparent; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-glow); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(6, 14, 26, .9);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.nav { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none !important; margin-right: auto; }
.brand__logo { height: 34px; width: auto; flex: none; }
.brand__by {
  font-size: .66rem; color: var(--text-dim); letter-spacing: .07em;
  line-height: 1.25; max-width: 9.5em; border-left: 1px solid var(--border);
  padding-left: 12px;
}
@media (max-width: 620px) { .brand__by { display: none; } }

/* Logo completo (footer) */
.footer__logo { height: 52px; width: auto; margin-bottom: 14px; }

/* Header della pagina 404 / grazie senza navigazione */
.page-head .brand__logo { height: 40px; }

.nav__links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav__links a { color: var(--text-muted); font-size: .93rem; font-weight: 500; text-decoration: none !important; }
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--text); }

.lang { display: flex; gap: 4px; font-family: var(--mono); font-size: .78rem; }
.lang a { color: var(--text-dim); padding: 2px 6px; border-radius: 4px; text-decoration: none !important; }
.lang a[aria-current] { color: var(--accent); background: var(--accent-glow); }

.nav__toggle {
  display: none; background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; color: var(--text);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(72px, 11vw, 140px) 0 clamp(56px, 8vw, 100px);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 22% 0%, rgba(94,158,234,.16), transparent 62%),
    radial-gradient(ellipse 60% 50% at 88% 18%, rgba(38,89,170,.14), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; }
.hero h1 { max-width: 15ch; }
.hero .lead { max-width: 60ch; }
.hero__grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero__grid > * { min-width: 0; }

.badge {
  display: inline-flex; align-items: center; gap: .5em;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em;
  padding: .42em .9em; border-radius: 100px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-muted); margin-bottom: 1.5rem;
}
.badge__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; }

/* ---------- Card ---------- */
/* minmax(0, 1fr) e non 1fr: con 1fr la colonna ha min-width auto e
   un contenuto largo (immagine, tabella) allarga tutta la griglia,
   facendo sforare la pagina e rimpicciolire il testo su mobile. */
.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > *, .gallery > *, .split > * { min-width: 0; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.card--hover { transition: border-color .2s, transform .2s; }
.card--hover:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.card h3 { margin-bottom: .5em; }
.card p:last-child { margin-bottom: 0; }
.card__num {
  font-family: var(--mono); font-size: .78rem; color: var(--accent);
  letter-spacing: .12em; display: block; margin-bottom: .9rem;
}
.card__icon { width: 38px; height: 38px; margin-bottom: 16px; color: var(--accent); }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 0; }
.step {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 22px;
  padding: 26px 0; border-top: 1px solid var(--border-soft);
}
.step:last-child { border-bottom: 1px solid var(--border-soft); }
.step__n {
  font-family: var(--mono); font-size: .82rem; color: var(--accent);
  border: 1px solid var(--border); border-radius: 8px;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--surface);
}
.step h3 { margin-bottom: .35em; }
.step p { margin-bottom: 0; color: var(--text-muted); }

/* ---------- Tabella ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; font-size: .93rem; }
th, td { padding: 13px 18px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th { background: var(--surface-2); font-weight: 600; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
tbody tr:last-child td { border-bottom: none; }
td.mono { font-family: var(--mono); font-size: .88rem; }

.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: -1px; }
.dot--green  { background: var(--green); }
.dot--yellow { background: var(--amber); }
.dot--orange { background: var(--orange); }
.dot--red    { background: var(--red); }

/* ---------- Callout ---------- */
.callout {
  border-left: 3px solid var(--amber);
  background: rgba(240, 161, 50, .07);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}
.callout--accent { border-left-color: var(--accent); background: var(--accent-glow); }
.callout strong { color: var(--amber); }
.callout--accent strong { color: var(--accent); }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Figure ---------- */
figure { margin: 0; }
.figure {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface);
}
.figure img { width: 100%; }
.figure figcaption {
  padding: 13px 18px; font-size: .84rem; color: var(--text-muted);
  border-top: 1px solid var(--border-soft); background: var(--surface-2);
}

/* ---------- Media: video e screenshot ---------- */
.media {
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
}
.media video, .media img { width: 100%; display: block; }
.media figcaption {
  padding: 13px 18px; font-size: .85rem; color: var(--text-muted);
  border-top: 1px solid var(--border-soft); background: var(--surface-2);
}
.media figcaption strong { color: var(--text); font-weight: 600; }

/* Screenshot con cornice "browser" */
.shot { position: relative; }
.shot__bar {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
}
.shot__bar i { width: 9px; height: 9px; border-radius: 50%; background: var(--border); display: block; }
.shot__bar span { margin-left: 8px; font-family: var(--mono); font-size: .72rem; color: var(--text-dim); }

/* Galleria a due colonne con accostamento verticale */
.gallery { display: grid; gap: 22px; }
.gallery--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Blocco alternato testo/immagine */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(28px, 4vw, 56px); align-items: center; }
.split--rev > *:first-child { order: 2; }
.split + .split { margin-top: clamp(48px, 7vw, 88px); }
.split h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }

/* Evidenza numerica inline */
.figures { display: flex; flex-wrap: wrap; gap: 28px; margin: 22px 0 0; }
.figures div { min-width: 110px; }
.figures b { display: block; font-family: var(--mono); font-size: 1.35rem; color: var(--accent); font-weight: 600; }
.figures span { font-size: .82rem; color: var(--text-muted); }

/* Badge stato roadmap */
.tag {
  display: inline-block; font-family: var(--mono); font-size: .68rem;
  letter-spacing: .1em; text-transform: uppercase;
  padding: .3em .7em; border-radius: 5px; margin-bottom: .8rem;
}
.tag--live { background: rgba(63,191,143,.14); color: var(--green); }
.tag--soon { background: rgba(240,161,50,.14); color: var(--amber); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border-soft); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.stat { background: var(--surface); padding: 26px 22px; }
.stat__v { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 680; color: var(--accent); font-family: var(--mono); letter-spacing: -.02em; }
.stat__l { font-size: .84rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- Form ---------- */
.form { display: grid; gap: 18px; }
.field { display: grid; gap: 7px; }
.field label { font-size: .87rem; font-weight: 600; color: var(--text-muted); }
.field input, .field select, .field textarea {
  font-family: inherit; font-size: .97rem; color: var(--text);
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: .76em .95em; width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow);
}
.field--check { grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 11px; }
.field--check input { width: auto; margin-top: 5px; }
.field--check label { font-weight: 400; font-size: .84rem; line-height: 1.5; }
.form-note { font-size: .84rem; color: var(--text-dim); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: clamp(32px, 5vw, 52px); text-align: center;
}
.cta-band h2 { margin-bottom: .4em; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
  padding: 56px 0 32px;
  font-size: .9rem;
}
.footer__grid { display: grid; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); gap: 36px; margin-bottom: 40px; }
.footer h4 { font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; color: var(--text-dim); margin-bottom: 1em; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { margin-bottom: .55em; }
.footer a { color: var(--text-muted); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer__bottom {
  border-top: 1px solid var(--border-soft); padding-top: 24px;
  display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between;
  color: var(--text-dim); font-size: .84rem;
}

/* ---------- Page header ---------- */
.page-head {
  padding: clamp(52px, 7vw, 88px) 0 clamp(30px, 4vw, 48px);
  border-bottom: 1px solid var(--border-soft);
  background:
    radial-gradient(ellipse 60% 70% at 15% 0%, rgba(22,199,154,.09), transparent 65%),
    var(--bg);
}
.page-head h1 { margin-bottom: .3em; }
.page-head .lead { max-width: 66ch; margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split--rev > *:first-child { order: 0; }
  .gallery--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .nav__toggle { display: block; }
  .nav__links {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    flex-direction: column; align-items: flex-start; gap: 0;
    background: var(--bg-alt); border-bottom: 1px solid var(--border);
    padding: 8px 24px 18px;
  }
  .nav__links.is-open { display: flex; }
  .nav__links li { width: 100%; border-bottom: 1px solid var(--border-soft); }
  .nav__links a { display: block; padding: 13px 0; }
  .grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .gallery--2, .gallery--3 { grid-template-columns: minmax(0, 1fr); }
  .figures { gap: 18px; }
  .step { grid-template-columns: 42px minmax(0, 1fr); gap: 16px; }
  .footer__grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

/* ============================================================
   MOBILE — correzioni mirate
   Due problemi reali su schermo stretto: gli screenshot di
   interfaccia diventano illeggibili se scalati, e le tabelle
   a più colonne escono dallo schermo.
   ============================================================ */
@media (max-width: 760px) {

  /* --- Screenshot leggibili: invece di comprimerli, si scorrono --- */
  .media--zoom {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .media--zoom img { max-width: none; width: 860px; }
  .media--zoom::after {
    content: "↔ scorri l'immagine";
    position: sticky; left: 0; bottom: 0;
    display: block; padding: 6px 14px;
    font-size: .72rem; font-family: var(--mono); color: var(--text-dim);
    background: var(--surface-2);
  }

  /* --- Tabelle: da griglia a blocchi impilati --- */
  .table-wrap { border: none; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    border: 1px solid var(--border); border-radius: var(--radius);
    margin-bottom: 14px; padding: 6px 0; background: var(--surface);
  }
  .table-wrap td { border: none; padding: 9px 16px; }
  .table-wrap td::before {
    content: attr(data-label);
    display: block; font-size: .68rem; letter-spacing: .1em;
    text-transform: uppercase; color: var(--text-dim); margin-bottom: 3px;
  }
  .table-wrap td:empty { display: none; }

  /* --- Leggibilità: nessun testo sotto i 15px su schermo piccolo --- */
  body { font-size: 17px; }
  .small, .card .small, .muted.small { font-size: .94rem; }
  .lead { font-size: 1.06rem; }
  .media figcaption, .figure figcaption { font-size: .9rem; }
  .field--check label, .form-note, .footer__bottom { font-size: .9rem; }
  .site-footer { font-size: .95rem; }
  .stat__l, .figures span { font-size: .9rem; }
  .eyebrow { font-size: .8rem; }
  .card__num { font-size: .84rem; }
  .table-wrap td { font-size: 1rem; }
  .table-wrap td::before { font-size: .76rem; }
  .callout { font-size: 1rem; }

  /* --- Densità --- */
  .card { padding: 22px; }
  .cta-band { padding: 30px 22px; }
  .stats { grid-template-columns: 1fr; }
  .stat { padding: 20px; }
  .figures { flex-direction: column; gap: 14px; }
  .btn { width: 100%; justify-content: center; }
  .btn-row { flex-direction: column; }
  .shot__bar span { font-size: .66rem; }
  .media figcaption { padding: 11px 14px; font-size: .8rem; }
  .split + .split { margin-top: 44px; }

  /* --- Header --- */
  .brand__logo { height: 30px; }
  .nav { height: 60px; }
  .nav__links { top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
