/* MC Dev Lab — stile del sito (nessuna libreria esterna) */

:root {
  --bg: #0b1020;
  --bg-2: #10172d;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.1);
  --text: #e8ecf8;
  --muted: #a3acc6;
  --accent: #5b8cff;
  --accent-2: #2ee6c5;
  --accent-3: #ffb547;
  --grad: linear-gradient(110deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent-3) 100%);
  --radius: 18px;
  --shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.6);
  --wrap: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 3px; border-radius: 6px; }

.grad {
  background: var(--grad);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
}

.eyebrow {
  display: inline-block;
  font-size: 0.8rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 0.9em;
}

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 26px; border-radius: 999px;
  font-weight: 600; font-size: 1rem; text-decoration: none;
  border: 1px solid transparent;
  transition: transform .25s ease, box-shadow .25s ease, background-color .25s ease, border-color .25s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary {
  background: var(--grad); background-size: 160% 100%; background-position: 0 0;
  color: #0b1020;
  box-shadow: 0 10px 30px -10px rgba(91, 140, 255, 0.7);
}
.btn--primary:hover { background-position: 100% 0; box-shadow: 0 16px 40px -12px rgba(46, 230, 197, 0.65); }
.btn--ghost { border-color: var(--border); background: var(--surface); }
.btn--ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: var(--surface-2); }
.btn--small { padding: 9px 18px; font-size: 0.92rem; background: var(--grad); color: #0b1020; }

/* ---------- Barra in alto ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color .3s ease, border-color .3s ease, backdrop-filter .3s ease;
  border-bottom: 1px solid transparent;
}
.nav.is-scrolled {
  background: rgba(11, 16, 32, 0.78);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom-color: var(--border);
}
.nav__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.logo__mark {
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
  padding: 5px 8px; border-radius: 9px;
  background: var(--grad); color: #0b1020;
}

.nav__menu { display: flex; align-items: center; gap: 28px; }
.nav__menu a:not(.btn) {
  text-decoration: none; color: var(--muted); font-weight: 500; position: relative;
  transition: color .2s ease;
}
.nav__menu a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.nav__menu a:not(.btn):hover { color: var(--text); }
.nav__menu a:not(.btn):hover::after { transform: scaleX(1); }

.nav__toggle {
  display: none; width: 44px; height: 44px; border: 0; background: transparent; cursor: pointer;
  padding: 10px; flex-direction: column; justify-content: space-between;
}
.nav__toggle span { display: block; height: 2px; background: var(--text); border-radius: 2px; transition: transform .25s ease, opacity .25s ease; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 110px 0 80px; overflow: hidden; isolation: isolate;
}
.hero__bg { position: absolute; inset: 0; z-index: -1; }
.hero__particles { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero__grid {
  position: absolute; inset: -10% 0 0 0;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%);
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 70%);
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: 0.55;
  will-change: transform;
}
.blob--1 { width: 520px; height: 520px; left: -140px; top: -120px; background: radial-gradient(circle, #3d6bff 0%, transparent 70%); animation: float1 18s ease-in-out infinite; }
.blob--2 { width: 460px; height: 460px; right: -120px; top: 10%; background: radial-gradient(circle, #19c9aa 0%, transparent 70%); animation: float2 22s ease-in-out infinite; }
.blob--3 { width: 380px; height: 380px; left: 35%; bottom: -160px; background: radial-gradient(circle, #ff9f2e 0%, transparent 70%); opacity: .35; animation: float3 26s ease-in-out infinite; }

@keyframes float1 { 0%,100% { translate: 0 0; } 50% { translate: 80px 60px; } }
@keyframes float2 { 0%,100% { translate: 0 0; } 50% { translate: -70px 50px; } }
@keyframes float3 { 0%,100% { translate: 0 0; } 50% { translate: 60px -50px; } }

.hero__inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero__title { margin-bottom: 0.4em; }
.hero__brand {
  display: block; font-size: clamp(1.1rem, 2.4vw, 1.4rem); font-weight: 700;
  color: var(--muted); letter-spacing: 0.02em; margin-bottom: 0.4em;
}
.hero__slogan { display: block; font-size: clamp(2.6rem, 7vw, 4.8rem); font-weight: 800; letter-spacing: -0.035em; }
.hero__lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); max-width: 34em; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.term {
  background: rgba(13, 19, 38, 0.82);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(91,140,255,.08) inset;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  transform: perspective(900px) rotateY(-6deg) rotateX(3deg);
  transition: transform .5s ease;
}
.term:hover { transform: perspective(900px) rotateY(0) rotateX(0); }
.term__bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.term__bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.term__bar i:nth-child(2) { background: #febc2e; }
.term__bar i:nth-child(3) { background: #28c840; }
.term__bar span { margin-left: 8px; font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
.term__body {
  margin: 0; padding: 20px 22px 24px; min-height: 250px;
  font-family: var(--mono); font-size: 0.88rem; line-height: 1.7; color: #cfd7f0;
  white-space: pre-wrap; word-break: break-word;
}
.term__body .k { color: #c792ea; }
.term__body .s { color: #2ee6c5; }
.term__body .f { color: #82aaff; }
.term__body .c { color: #6b7799; font-style: italic; }
.term__body .n { color: #ffb547; }
.caret {
  display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em;
  background: var(--accent-2); animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero__scroll {
  position: absolute; left: 50%; bottom: 26px; translate: -50% 0;
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,.3); border-radius: 14px;
}
.hero__scroll span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  border-radius: 2px; background: var(--text); animation: wheel 1.8s ease-in-out infinite;
}
@keyframes wheel { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }

/* ---------- Sezioni ---------- */
.section { padding: clamp(80px, 11vw, 130px) 0; position: relative; }
.section--alt { background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 18%, var(--bg-2) 82%, var(--bg) 100%); }
.section__head { text-align: center; max-width: 680px; margin: 0 auto 56px; }
.section__head p:last-child { color: var(--muted); font-size: 1.08rem; }
.section__head--left { text-align: left; margin: 0 0 32px; }

/* ---------- Card ---------- */
.cards { display: grid; gap: 22px; }
.cards--3 { grid-template-columns: repeat(3, 1fr); }
.cards--grid { grid-template-columns: repeat(3, 1fr); }

.card {
  position: relative; padding: 30px 28px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), border-color .35s ease, background-color .35s ease, box-shadow .35s ease;
  overflow: hidden;
}
.card::before {
  /* alone luminoso che segue il mouse */
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s ease; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(91,140,255,.16), transparent 45%);
}
.card::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform .45s ease;
}
.card:hover {
  transform: translateY(-6px);
  border-color: rgba(91,140,255,.35);
  background: var(--surface-2);
  box-shadow: var(--shadow);
}
.card:hover::before { opacity: 1; }
.card:hover::after { transform: scaleX(1); }
.card p { color: var(--muted); margin-bottom: 0; }

.card__icon {
  width: 52px; height: 52px; border-radius: 14px; margin-bottom: 20px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(91,140,255,.22), rgba(46,230,197,.14));
  border: 1px solid rgba(91,140,255,.3);
  transition: transform .35s ease;
}
.card:hover .card__icon { transform: rotate(-6deg) scale(1.08); }
.card__icon svg {
  width: 26px; height: 26px; fill: none; stroke: var(--accent-2);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.tags { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.tags li {
  font-size: 0.78rem; font-weight: 600; padding: 4px 11px; border-radius: 999px;
  background: rgba(255,255,255,.06); border: 1px solid var(--border); color: #c7cfea;
}

/* ---------- Perché noi ---------- */
.why { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 64px; align-items: center; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.checks li {
  position: relative; padding: 0 0 0 40px; color: var(--muted);
}
.checks li strong { color: var(--text); }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 8px;
  background: rgba(46,230,197,.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232ee6c5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center / 15px no-repeat;
  border: 1px solid rgba(46,230,197,.3);
}

.stats { display: grid; gap: 14px; margin-bottom: 26px; }
.stat {
  display: flex; align-items: center; gap: 18px; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  transition: transform .35s ease, border-color .35s ease;
}
.stat:hover { transform: translateX(4px); border-color: rgba(91,140,255,.35); }
.stat__num {
  flex: 0 0 76px; text-align: center;
  font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.stat__icon {
  flex: 0 0 76px; display: grid; place-items: center;
}
.stat__icon svg {
  width: 48px; height: 48px; padding: 11px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(91,140,255,.22), rgba(46,230,197,.14));
  border: 1px solid rgba(91,140,255,.3);
  fill: none; stroke: var(--accent-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.stat__body { color: var(--muted); font-size: 0.95rem; line-height: 1.45; }
.stat__body strong { display: block; color: var(--text); font-size: 1.05rem; margin-bottom: 2px; }

/* Strada animata con l'auto */
.road { position: relative; height: 120px; border-radius: var(--radius); overflow: hidden; }
.road > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.road__asphalt { fill: #1a2240; stroke: rgba(255,255,255,.08); }
.road__line {
  stroke: #ffd36b; stroke-width: 3; stroke-dasharray: 22 18;
  animation: roadline 0.9s linear infinite;
}
@keyframes roadline { to { stroke-dashoffset: -40; } }
.road__car {
  position: absolute; top: 30px; left: 0; width: 84px;
  animation: drive 7s cubic-bezier(.45,.05,.55,.95) infinite;
}
.road__car svg { width: 84px; height: 42px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.car__body { fill: var(--accent); }
.car__glass { fill: #bfe9ff; opacity: .85; }
.car__wheel { fill: #0b1020; stroke: #3a4466; stroke-width: 2; }
.car__hub { fill: #a3acc6; }
.road__plate {
  position: absolute; top: -6px; left: 30px; width: 20px; height: 20px; border-radius: 4px;
  background: #fff; color: #1b4fd6; font: 800 13px/20px var(--font); text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
}
@keyframes drive {
  0%   { transform: translateX(-100px); }
  45%  { transform: translateX(calc(var(--road-w, 400px) * 0.42)); }
  55%  { transform: translateX(calc(var(--road-w, 400px) * 0.46)); }
  100% { transform: translateX(calc(var(--road-w, 400px) + 20px)); }
}

/* ---------- Contatti ---------- */
.contact {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
  padding: clamp(28px, 5vw, 56px);
  border-radius: calc(var(--radius) + 8px);
  background:
    radial-gradient(600px circle at 0% 0%, rgba(91,140,255,.2), transparent 50%),
    radial-gradient(500px circle at 100% 100%, rgba(46,230,197,.16), transparent 50%),
    var(--surface);
  border: 1px solid var(--border);
}
.contact__text p:last-child { color: var(--muted); margin: 0; }
.contact__box {
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  padding: 26px; border-radius: var(--radius);
  background: rgba(11,16,32,.6); border: 1px solid var(--border);
}
.contact__mail { font-size: clamp(1.15rem, 3vw, 1.45rem); font-weight: 700; word-break: break-all; text-decoration-color: rgba(46,230,197,.6); text-underline-offset: 4px; }
.contact__label { font-size: 0.8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-2); }
.contact__note { font-size: 0.88rem; color: var(--muted); margin: 0 0 6px; }

/* ---------- Collaborazione (sopra il footer) ---------- */
.partner { border-top: 1px solid var(--border); padding: 18px 0; text-align: center; }
.partner p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.partner a { color: var(--text); text-decoration: underline; text-decoration-color: rgba(46,230,197,.5); text-underline-offset: 3px; transition: color .2s ease; }
.partner a:hover { color: var(--accent-2); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: 0.92rem; }
.footer__inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer p { margin: 0; }
.footer a { color: var(--muted); text-decoration: none; }
.footer a:hover { color: var(--text); text-decoration: underline; }

/* ---------- Comparse allo scroll (solo se c'e' JavaScript) ---------- */
.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Pagina privacy ---------- */
.page { padding: 130px 0 80px; }
.page .wrap { max-width: 760px; }
.page h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.page h2 { font-size: 1.35rem; margin-top: 1.8em; }
.page p, .page li { color: var(--muted); }
.page .notice {
  padding: 16px 20px; border-radius: 14px; margin: 0 0 28px;
  border: 1px dashed rgba(255,181,71,.6); background: rgba(255,181,71,.08); color: var(--text);
}

/* ---------- Intro della prima visita (js/intro.js) ----------
   Tutte le parti in movimento sono mosse da un solo ciclo JS con transform e opacity:
   qui niente transizioni, filtri o ombre animate. Il will-change sparisce con l'intro. */
.intro { display: none; }
html.intro-on, .intro-on body { overflow: hidden; }
.intro-on .intro {
  display: block; position: fixed; inset: 0; z-index: 1000; overflow: hidden; contain: strict;
  touch-action: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
.intro-on .nav .logo { opacity: 0; }
.intro-on .blob { animation-play-state: paused; }
.intro__panel {
  position: absolute; left: 0; right: 0; height: 50.5%;
  background: #05070f; will-change: transform;
}
.intro__panel--top { top: 0; }
.intro__panel--bottom { bottom: 0; }
.intro__stage { position: absolute; inset: 0; will-change: transform, opacity; }
.intro__canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.intro__logo {
  position: fixed; left: 0; top: 0; margin: 0; transform-origin: 0 0; pointer-events: none;
  white-space: nowrap; opacity: 0; will-change: transform, opacity;
}
.intro__logo .logo { display: inline-flex; }
.intro__seam {
  position: absolute; left: 0; right: 0; top: 50%; height: 2px; margin-top: -1px;
  background: var(--grad); box-shadow: 0 0 18px 2px rgba(46,230,197,.7);
  transform: scaleX(0); opacity: 0; pointer-events: none; will-change: transform, opacity;
}
.intro__skip {
  position: absolute; z-index: 3; right: 16px; bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  background: none; border: 0; padding: 10px 8px; cursor: pointer;
  color: rgba(232,236,248,.5); font: 600 .74rem/1 var(--font); letter-spacing: .16em; text-transform: uppercase;
  opacity: 0; animation: introSkip .4s .35s ease forwards;
}
.intro__skip:hover, .intro__skip:focus-visible { color: #fff; }
.intro__skip.is-hidden { animation: none; opacity: 0; transition: opacity .2s ease; }
@keyframes introSkip { to { opacity: 1; } }

/* ---------- Tablet e telefono ---------- */
@media (max-width: 960px) {
  .hero__inner, .why, .contact { grid-template-columns: 1fr; }
  .hero__inner { gap: 40px; }
  .term { transform: none; }
  .cards--3, .cards--grid { grid-template-columns: repeat(2, 1fr); }
  .why { gap: 40px; }
}

@media (max-width: 760px) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: fixed; top: 70px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 10px 20px 22px;
    background: rgba(11,16,32,.97); border-bottom: 1px solid var(--border);
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: transform .25s ease, opacity .25s ease, visibility .25s;
  }
  .nav__menu.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__menu a:not(.btn) { padding: 14px 4px; border-bottom: 1px solid var(--border); }
  .nav__menu a:not(.btn)::after { display: none; }
  .nav__menu .btn { margin-top: 16px; padding: 14px; }
  .nav.menu-open { background: rgba(11,16,32,.97); }

  body { font-size: 16px; }
  .hero { padding-top: 100px; }
  .hero__cta .btn { flex: 1 1 auto; }
  .hero__scroll { display: none; }
  .term__body { min-height: 210px; font-size: 0.8rem; padding: 16px; }
  .cards--3, .cards--grid { grid-template-columns: 1fr; }
  .card { padding: 26px 22px; }
  .stat { padding: 16px; gap: 14px; }
  .stat__num, .stat__icon { flex-basis: 60px; }
  .stat__num { font-size: 1.6rem; }
  .blob { filter: blur(50px); }
  .blob--1 { width: 340px; height: 340px; }
  .blob--2 { width: 300px; height: 300px; }
  .blob--3 { width: 260px; height: 260px; }
}

/* ---------- Chi preferisce meno movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .road__car { animation: none; transform: translateX(calc(var(--road-w, 400px) * 0.4)); }
  .term { transform: none; }
  .caret { display: none; }
}
