:root{
  --bg:#0b1220;
  --panel:rgba(10,14,22,.62);
  --text:rgba(255,255,255,.92);
  --muted:rgba(255,255,255,.78);
  --accent:#8fb3ff;

  /* Topbar light */
  --topbar-bg: rgba(255,255,255,.92);
  --topbar-border: rgba(0,0,0,.08);
  --topbar-link: rgba(20,24,32,.92);
  --topbar-link-hover-bg: rgba(0,0,0,.06);
  --topbar-link-hover-border: rgba(0,0,0,.14);

  --radius:18px;
  --shadow:0 10px 30px rgba(0,0,0,.35);
  --max:1040px;

  /* gutter coerente per tutti gli elementi (mobile-first) */
  --gutter: 18px;
}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:var(--bg);
  overflow-x:hidden;
}

/* Background */
body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:-2;
  background-image:url("./bg-tdc19.jpg");
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  background-attachment:fixed;
}
body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:-1;
  background:
    radial-gradient(1200px 600px at 20% 10%, rgba(143,179,255,.18), transparent 60%),
    linear-gradient(to bottom, rgba(0,0,0,.70), rgba(0,0,0,.78));
}

a{color:var(--accent); text-decoration:none;}
a:hover{text-decoration:underline;}

/* Container con padding laterale coerente */
.wrap{
  max-width:var(--max);
  margin:0 auto;
  padding:0 var(--gutter);
}

/* Topbar */
.topbar{
  position:sticky;
  top:0;
  z-index:50;
  backdrop-filter:blur(10px);
  background:var(--topbar-bg);
  border-bottom:1px solid var(--topbar-border);
}
.topbar__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 0;
  gap:12px;
}

/* Logo */
.brand{display:flex; align-items:center;}
.brand__logo{
  max-width:300px;
  width:100%;
  height:auto;
  display:block;
}

/* Nav */
.nav{
  display:flex;
  gap:14px;
  flex-wrap:wrap;
  justify-content:flex-end;
  font-size:14px;
}
.nav a{
  color:var(--topbar-link);
  padding:8px 10px;
  border-radius:999px;
  border:1px solid transparent;
  font-weight:600;
}
.nav a:hover{
  border-color:var(--topbar-link-hover-border);
  background:var(--topbar-link-hover-bg);
  text-decoration:none;
}

/* Burger */
.burger{
  display:none;
  width:44px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--topbar-link-hover-border);
  background:rgba(255,255,255,.65);
  cursor:pointer;
  align-items:center;
  justify-content:center;
  gap:6px;
  padding:10px;
}
.burger__bar{
  display:block;
  width:18px;
  height:2px;
  background:rgba(20,24,32,.85);
  border-radius:2px;
}

/* Hero */
header{padding:54px 0 18px;}
.badge{
  display:inline-flex;
  align-items:center;
  padding:7px 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.05);
  color:var(--muted);
  font-size:13px;
}
h1{
  margin:14px 0 10px;
  font-size:clamp(30px,4.2vw,52px);
  letter-spacing:-.02em;
}
.lead{
  max-width:75ch;
  font-size:16px;
  color:var(--muted);
  margin:0 0 18px;
}

.grid{
  display:grid;
  grid-template-columns:1.15fr .85fr;
  gap:16px;
}
@media(max-width:900px){
  .grid{grid-template-columns:1fr;}
}

.card{
  border:1px solid rgba(255,255,255,.14);
  background:var(--panel);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:18px;
}
.card h2{margin:0 0 10px; font-size:18px;}
.card p{margin:0 0 10px; color:var(--muted);}
.small{font-size:13px; color:rgba(255,255,255,.72);}

.cta{display:flex; gap:10px; flex-wrap:wrap; margin-top:14px;}
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 14px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(255,255,255,.06);
  color:var(--text);
  font-size:14px;
}
.btn.primary{
  background:rgba(143,179,255,.22);
  border-color:rgba(143,179,255,.28);
  color:#f5f7ff;
}
.btn:hover{filter:brightness(1.05); text-decoration:none;}

section{padding:14px 0 0; scroll-margin-top:80px;}

footer{margin:34px 0 22px; color:rgba(255,255,255,.70); font-size:13px;}
.footer__box{
  border:1px solid rgba(255,255,255,.10);
  background:rgba(0,0,0,.35);
  border-radius:var(--radius);
  padding:14px 16px;
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
}

/* Mobile menu + spacing improvements */
@media(max-width:900px){
  :root{ --gutter: 20px; } /* più aria, simmetria */
  .burger{display:inline-flex;}

  .nav{
    display:none;
    width:100%;
    flex-direction:column;
    gap:8px;
    padding:12px 0 6px;
  }
  .nav.is-open{display:flex;}
  .nav a{
    width:100%;
    padding:10px 12px;
    border-radius:12px;
    border:1px solid rgba(0,0,0,.10);
    background:rgba(255,255,255,.88);
    color:rgba(20,24,32,.92);
  }
}

@media(max-width:600px){
  :root{ --gutter: 22px; }
  .brand__logo{max-width:230px; margin: 20px; }
}
