:root {
  --bg: #0b0c0e;
  --panel: #121316;
  --panel-2: #17181c;
  --line: #24262b;
  --line-2: #33363d;
  --text: #ececec;
  --muted: #8e9198;
  --accent: #b6f24a;
  --accent-ink: #0d1203;
  --red: #ff5d52;
  --blue: #6aa8ff;
  --radius: 14px;
  --font: "Geist", "Noto Sans SC", system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
b { font-weight: 600; }
main { counter-reset: sec; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 10px;
  font-weight: 500; font-size: 15px;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; transition: transform .2s ease; }
.btn:hover svg { transform: translateX(3px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #c9ff63; }
.btn-ghost { border: 1px solid var(--line-2); background: var(--panel); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-sm { padding: 9px 16px; font-size: 14px; }
.btn-lg { padding: 16px 28px; font-size: 16px; }

/* -------------------------------------------------------------------- nav */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px max(24px, calc((100% - 1200px) / 2));
  border-bottom: 1px solid transparent;
  transition: background .25s ease, border-color .25s ease;
}
.nav.scrolled { background: rgba(11, 12, 14, .94); border-color: var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { width: 26px; height: 26px; }
.links { display: flex; gap: 28px; font-size: 14px; color: var(--muted); }
.links a:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 10px; }

.lang { position: relative; }
.lang-btn {
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: transparent; color: var(--text); border: 1px solid var(--line-2);
  border-radius: 10px; padding: 8px 11px; font: 500 13px var(--mono);
}
.lang-btn svg { width: 15px; height: 15px; }
.lang-menu {
  position: absolute; right: 0; top: calc(100% + 8px); list-style: none; min-width: 170px;
  background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 6px;
  opacity: 0; transform: translateY(-4px); pointer-events: none; transition: .18s ease;
}
.lang.open .lang-menu { opacity: 1; transform: none; pointer-events: auto; }
.lang-menu li { padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; display: flex; justify-content: space-between; }
.lang-menu li span { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.lang-menu li:hover { background: rgba(255,255,255,.05); }
.lang-menu li[aria-selected="true"] { color: var(--accent); }

/* ------------------------------------------------------------------- hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; overflow: hidden; padding: 120px 24px 90px; }
#scene { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-glow {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 12, 14, .92) 0%, rgba(11, 12, 14, .55) 42%, transparent 66%),
    linear-gradient(180deg, transparent 72%, var(--bg));
}
.hero-inner {
  position: relative; z-index: 2; width: min(1200px, 100%); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 60px; align-items: center;
}
.badge {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 13px; color: var(--muted);
}
.badge::before { content: ""; width: 22px; height: 1px; background: var(--accent); }
h1 {
  font-weight: 600; letter-spacing: -.045em;
  font-size: clamp(44px, 6.4vw, 86px); line-height: 1; margin: 22px 0 24px;
}
.grad { color: var(--accent); }
.lead { font-size: clamp(17px, 1.45vw, 19px); color: #b3b6bd; max-width: 580px; }
.hero-ctas { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats { display: flex; margin-top: 52px; border-top: 1px solid var(--line); max-width: 560px; }
.hero-stats div { flex: 1; display: flex; flex-direction: column; padding: 16px 16px 0 0; }
.hero-stats div + div { border-left: 1px solid var(--line); padding-left: 16px; }
.hero-stats b { font-family: var(--mono); font-weight: 500; font-size: 28px; letter-spacing: -.02em; }
.hero-stats span { font-size: 13px; color: var(--muted); }

/* phone */
.phone-wrap { position: relative; display: flex; justify-content: center; perspective: 1400px; }
.phone {
  width: 320px; border-radius: 40px; padding: 12px; position: relative;
  background: #16171b; border: 1px solid var(--line-2);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .9), 0 0 0 6px #0f1013;
  transform-style: preserve-3d; transform: rotateY(-12deg) rotateX(5deg);
}
.phone-notch { width: 96px; height: 24px; background: #0f1013; border-radius: 0 0 14px 14px; margin: -12px auto 6px; }
.tg-head { display: flex; gap: 10px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--line); }
.tg-head b { display: block; font-size: 14px; }
.tg-head small { color: var(--muted); font-size: 11px; }
.tg-avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: var(--accent-ink); background: var(--accent); }
.tg-body { padding: 12px 6px 6px; display: flex; flex-direction: column; gap: 10px; min-height: 410px; background: #0f1013; border-radius: 0 0 28px 28px; }
.msg { position: relative; background: #1b1d22; border-radius: 14px 14px 14px 4px; padding: 12px 14px 20px; font-size: 13px; }
.msg time { position: absolute; right: 10px; bottom: 5px; font-size: 10px; color: var(--muted); font-family: var(--mono); }
.msg .row { display: flex; justify-content: space-between; gap: 10px; color: #a9acb3; margin-top: 4px; }
.msg .row b { color: var(--text); font-family: var(--mono); font-weight: 500; }
.msg .row.tp b { color: var(--accent); }
.msg .row.sl b { color: var(--red); }
.msg .pill { margin-top: 10px; display: inline-block; padding: 4px 10px; border-radius: 6px; background: rgba(106,168,255,.12); color: var(--blue); font-weight: 500; }
.msg .foot { margin-top: 8px; color: var(--muted); font-size: 12px; }
.msg-close .reply { border-left: 2px solid var(--blue); padding-left: 8px; color: var(--blue); font-size: 11px; margin-bottom: 6px; }
.up { color: var(--accent); }
.float-chip {
  position: absolute; padding: 8px 12px; border-radius: 8px; font: 500 12px var(--mono);
  background: var(--panel-2); border: 1px solid var(--line-2);
}
.chip-a { left: 0; top: 20%; color: var(--accent); animation: float 7s ease-in-out infinite; }
.chip-b { right: 0; bottom: 18%; color: var(--text); animation: float 8s ease-in-out infinite reverse; }
@keyframes float { 50% { transform: translateY(-10px); } }

.scroll-hint { display: none; }

/* ----------------------------------------------------------------- ticker */
.ticker { border-block: 1px solid var(--line); overflow: hidden; padding: 13px 0; }
.ticker-track { display: flex; gap: 44px; width: max-content; animation: tick 50s linear infinite; font-family: var(--mono); font-size: 13px; color: var(--muted); }
.ticker-track span b { color: var(--text); font-weight: 500; margin-right: 6px; }
.ticker-track .up { color: var(--accent); }
@keyframes tick { to { transform: translateX(-50%); } }

/* --------------------------------------------------------------- sections */
.section { width: min(1200px, calc(100% - 48px)); margin: 0 auto; padding: 120px 0 30px; }
.section.narrow { width: min(860px, calc(100% - 48px)); }
.head { max-width: 760px; margin: 0 0 56px; }
.kicker {
  display: inline-block; font: 500 13px var(--mono); color: var(--muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 18px;
  counter-increment: sec;
}
.kicker::before { content: counter(sec, decimal-leading-zero) " / "; color: var(--accent); }
h2 { font-weight: 600; font-size: clamp(32px, 4.2vw, 54px); line-height: 1.05; letter-spacing: -.04em; }
.head p, .control-copy > p { color: var(--muted); font-size: 18px; margin-top: 18px; max-width: 620px; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.step { position: relative; padding: 30px 26px 34px; background: var(--panel); }
.step-n { font: 500 13px var(--mono); color: var(--accent); margin-bottom: 40px; }
.step-n::before { content: "0"; }
.step h3, .card h3 { font-size: 20px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 8px; }
.step p, .card p { color: var(--muted); font-size: 15px; }

/* features */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.card { position: relative; padding: 30px 26px; background: var(--panel); transition: background .2s ease; }
.card:hover { background: var(--panel-2); }
.card .ico { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line-2); color: var(--accent); margin-bottom: 28px; }
.card .ico svg { width: 18px; height: 18px; }

/* control */
.control { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.checks { list-style: none; margin-top: 30px; border-top: 1px solid var(--line); counter-reset: li; }
.checks li { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--line); color: #c8cad0; }
.checks li::before { content: counter(li, decimal-leading-zero); counter-increment: li; font: 500 12px var(--mono); color: var(--accent); }
.chat-wrap { perspective: 1400px; display: flex; justify-content: center; }
.chat { width: min(420px, 100%); display: grid; gap: 12px; transform-style: preserve-3d; transform: rotateY(8deg) rotateX(3deg); }
.chat-card { padding: 18px; border-radius: 14px; background: #16171b; border: 1px solid var(--line-2); font-size: 14px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.chat-card.alert { border-color: rgba(182, 242, 74, .45); }
.chat-title { display: flex; justify-content: space-between; font-weight: 600; padding-bottom: 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.chat-title small { color: var(--muted); font: 400 12px var(--mono); }
.chat-line { margin: 4px 0; color: #c3c5cb; }
.g { color: var(--accent); }
.kbd { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; }
.key { text-align: center; padding: 9px 6px; border-radius: 8px; background: #22242a; font-size: 13px; font-weight: 500; }
.key.wide { grid-column: 1 / -1; }

/* research */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { padding: 30px 26px; background: var(--panel); }
.stat b { display: block; font: 500 clamp(38px, 3.8vw, 52px) var(--mono); letter-spacing: -.04em; line-height: 1; color: var(--text); }
.stat:first-child b { color: var(--accent); }
.stat span { display: block; color: var(--muted); font-size: 15px; margin-top: 14px; }
.equity { margin-top: 16px; height: 220px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); padding: 10px; overflow: hidden; }
.equity svg { width: 100%; height: 100%; }
.note { margin-top: 16px; font-size: 13px; color: var(--muted); }

/* pricing */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; padding: 32px 28px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); }
.plan.hot { border-color: var(--accent); }
.plan .tag { position: absolute; top: 18px; right: 18px; padding: 3px 8px; border-radius: 6px; font: 500 11px var(--mono); text-transform: uppercase; color: var(--accent-ink); background: var(--accent); }
.plan h3 { font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.plan .desc { color: var(--muted); margin-top: 6px; font-size: 15px; }
.plan .price { font: 500 22px var(--mono); margin: 26px 0; padding: 18px 0; border-block: 1px solid var(--line); }
.plan ul { list-style: none; display: grid; gap: 11px; margin-bottom: 30px; }
.plan li { display: flex; gap: 10px; font-size: 15px; color: #c8cad0; }
.plan li::before { content: ""; flex: 0 0 14px; height: 1px; background: var(--accent); margin-top: 12px; }
.plan .btn { margin-top: auto; justify-content: center; }

/* faq */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 22px 0; font-weight: 500; font-size: 18px; display: flex; justify-content: space-between; gap: 20px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 22px var(--mono); line-height: 1; color: var(--muted); transition: transform .25s ease; }
.faq details[open] summary::after { transform: rotate(45deg); color: var(--accent); }
.faq details p { color: var(--muted); padding-bottom: 22px; max-width: 680px; }

/* cta */
.cta-final { padding: 120px 24px 100px; }
.cta-box {
  width: min(1200px, 100%); margin: 0 auto; padding: 70px 56px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line);
  display: grid; grid-template-columns: 1fr auto; gap: 16px 60px; align-items: end;
}
.cta-box h2 { max-width: 640px; }
.cta-box p { color: var(--muted); font-size: 18px; max-width: 560px; grid-column: 1; }
.cta-box .btn { grid-column: 2; grid-row: 1 / span 2; align-self: end; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 40px max(24px, calc((100% - 1200px) / 2)) 50px; color: var(--muted); display: grid; grid-template-columns: auto 1fr; gap: 10px 40px; align-items: start; }
.footer p { font-size: 13px; max-width: 640px; }
.footer small { font: 400 12px var(--mono); grid-column: 2; }
.brand.small { font-size: 16px; color: var(--text); grid-row: 1 / span 2; }
.brand.small .brand-mark { width: 22px; height: 22px; }

/* inclinazione 3D: ogni scheda sul suo livello GPU, niente ridisegno della pagina */
.tilt { will-change: transform; }
/* la transizione solo dopo l'entrata: durante l'animazione di GSAP la rallenterebbe */
.tilt:not(.reveal), .tilt.ready { transition: transform .35s cubic-bezier(.2,.8,.2,1); }

/* reveal (gestito da GSAP, visibile se JS è spento) */
.js .reveal { opacity: 0; transform: translateY(24px); }
.js .reveal.ready { opacity: 1; transform: none; }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .links { display: none; }
  .grid, .stats, .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .hero-inner, .control { grid-template-columns: 1fr; gap: 50px; }
  .hero-glow { background: linear-gradient(180deg, rgba(11,12,14,.7), rgba(11,12,14,.5) 50%, var(--bg)); }
  .phone, .chat { transform: none; }
  .plans { grid-template-columns: 1fr; max-width: 460px; }
  .cta-box { grid-template-columns: 1fr; padding: 48px 28px; }
  .cta-box .btn { grid-column: 1; grid-row: auto; justify-self: start; }
  .footer { grid-template-columns: 1fr; }
  .footer small, .brand.small { grid-column: auto; grid-row: auto; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { padding: 12px 16px; }
  .nav .btn-sm { display: none; }
  .grid, .stats, .steps { grid-template-columns: 1fr; }
  .section { width: calc(100% - 32px); padding-top: 90px; }
  .hero { padding: 100px 16px 70px; }
  .phone { width: 100%; max-width: 310px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
