/* ===== Variabili ===== */
:root {
    --bg: #07070b;
    --bg-2: #0c0c13;
    --surface: rgba(255, 255, 255, 0.025);
    --surface-hover: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #ecebf4;
    --muted: #9b9aad;
    --accent: #8b5cf6;
    --accent-soft: rgba(139, 92, 246, 0.14);
    --blue: #3b82f6;
    --cyan: #22d3ee;
    --grad: linear-gradient(100deg, #8b5cf6 0%, #3b82f6 50%, #22d3ee 100%);
    --radius: 22px;
    --radius-sm: 12px;
    --font-head: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --container: 1200px;
    --header-h: 72px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
img, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; line-height: 1.08; letter-spacing: -0.02em; font-weight: 600; }
p { margin: 0; }
::selection { background: var(--accent); color: #fff; }

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

.skip-link {
    position: absolute; left: -9999px; top: 10px; z-index: 100;
    background: #fff; color: #000; padding: 8px 14px; border-radius: 8px;
}
.skip-link:focus { left: 10px; }

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

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

/* ===== Pulsanti ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 24px; border-radius: 999px;
    font-family: var(--font-body); font-weight: 600; font-size: 0.95rem;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .25s var(--ease), box-shadow .25s var(--ease), background .25s, border-color .25s;
    white-space: nowrap;
}
.btn-primary {
    background: var(--grad); color: #fff;
    box-shadow: 0 8px 30px -10px rgba(139, 92, 246, 0.7);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 40px -10px rgba(59, 130, 246, 0.8); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-hover); border-color: rgba(255,255,255,.3); transform: translateY(-2px); }
.btn-sm { padding: 10px 18px; font-size: 0.88rem; }
.btn-block { width: 100%; }

/* ===== Header ===== */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    height: var(--header-h);
    transition: background .3s, border-color .3s, backdrop-filter .3s;
    border-bottom: 1px solid transparent;
}
.site-header.is-scrolled, .site-header.nav-open {
    background: rgba(7, 7, 11, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom-color: var(--border);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 20px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.logo-mark { width: 22px; height: 22px; border-radius: 7px; background: var(--grad); box-shadow: 0 0 18px rgba(139,92,246,.6); flex-shrink: 0; }
.logo-dot { color: var(--muted); }

.nav-toggle {
    width: 44px; height: 44px; border-radius: 12px;
    border: 1px solid var(--border-strong); background: var(--surface);
    display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
    cursor: pointer; padding: 0;
}
.nav-toggle span { width: 18px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .3s var(--ease), opacity .3s; }
.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0;
    background: rgba(7, 7, 11, 0.97);
    padding: 32px 20px;
    display: flex; flex-direction: column; gap: 28px;
    transform: translateY(-12px); opacity: 0; visibility: hidden;
    transition: opacity .3s var(--ease), transform .3s var(--ease), visibility .3s;
    overflow-y: auto;
}
.nav-open .site-nav { transform: none; opacity: 1; visibility: visible; }
.site-nav ul { display: flex; flex-direction: column; gap: 4px; }
.site-nav ul a {
    display: block; padding: 12px 0;
    font-family: var(--font-head); font-size: 1.6rem; font-weight: 500;
    border-bottom: 1px solid var(--border); color: var(--text);
    transition: color .2s;
}
.site-nav ul a:hover, .site-nav ul a.is-active { color: var(--cyan); }
.nav-cta { align-self: flex-start; }

/* ===== Hero ===== */
.hero {
    position: relative;
    padding: calc(var(--header-h) + 56px) 0 80px;
    min-height: 100vh;
    display: flex; align-items: center;
    overflow: hidden;
}
.hero::before {
    content: ""; position: absolute; inset: 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: 64px 64px;
    mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 70%);
    -webkit-mask-image: radial-gradient(ellipse at 60% 40%, #000 20%, transparent 70%);
    pointer-events: none;
}
.hero-glow { position: absolute; border-radius: 50%; filter: blur(90px); pointer-events: none; }
.hero-glow-1 { width: 480px; height: 480px; background: rgba(139, 92, 246, 0.35); top: -120px; right: -120px; }
.hero-glow-2 { width: 380px; height: 380px; background: rgba(34, 211, 238, 0.18); bottom: -140px; left: -100px; }

.hero-inner { position: relative; display: grid; gap: 48px; align-items: center; }
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 14px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--surface);
    font-size: 0.85rem; font-weight: 500; color: var(--muted);
    margin-bottom: 24px;
}
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 0 rgba(34,211,238,.6); animation: pulse 2.2s infinite; }
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34,211,238,.6); }
    70% { box-shadow: 0 0 0 10px rgba(34,211,238,0); }
    100% { box-shadow: 0 0 0 0 rgba(34,211,238,0); }
}
.hero-title { font-size: clamp(2.5rem, 8vw, 5.4rem); font-weight: 600; letter-spacing: -0.035em; }
.hero-title .grad-text { display: block; }
.hero-lead { margin-top: 24px; font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); max-width: 580px; }
.hero-actions { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 12px; }

.hero-visual { width: 100%; max-width: 420px; margin: 0 auto; }
.hero-visual svg { width: 100%; height: auto; overflow: visible; }
.ring { transform-origin: 200px 200px; transform-box: view-box; }
.ring-slow { animation: spin 40s linear infinite; }
.ring-reverse { animation: spin 28s linear infinite reverse; }
.core { transform-origin: 200px 200px; transform-box: view-box; animation: breathe 6s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ===== Sezioni ===== */
.section { position: relative; padding: 96px 0; }
.section-label {
    font-family: var(--font-head); font-size: 0.9rem; font-weight: 500;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em;
    margin-bottom: 20px; display: flex; align-items: center; gap: 10px;
}
.section-label span { color: var(--cyan); letter-spacing: 0.04em; }
.section-label::after { content: ""; flex: 0 0 48px; height: 1px; background: var(--border-strong); }
.section-title { font-size: clamp(2.1rem, 6vw, 4rem); letter-spacing: -0.03em; }
.section-title-sm { font-size: clamp(1.9rem, 5vw, 3.2rem); }
.section-title-xl { font-size: clamp(2.4rem, 8vw, 5.4rem); }
.section-head { display: grid; gap: 20px; margin-bottom: 56px; }
.section-intro { color: var(--muted); font-size: 1.08rem; max-width: 520px; margin-top: 4px; }

/* ===== Card ===== */
.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color .3s, background .3s, transform .3s var(--ease);
}
.card:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.card h3 { font-size: 1.35rem; margin-bottom: 12px; }
.card p { color: var(--muted); }

/* ===== Chi sono ===== */
.about-grid { display: grid; gap: 32px; }
.about-text { display: grid; gap: 24px; font-size: 1.1rem; }
.about-text > p { color: #c9c8d6; }
.info-box {
    display: flex; gap: 14px; align-items: flex-start;
    padding: 18px 20px; border-radius: var(--radius-sm);
    background: var(--accent-soft); border: 1px solid rgba(139, 92, 246, 0.3);
    font-size: 0.98rem;
}
.info-box p { color: var(--text); }
.info-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--grad); margin-top: 8px; flex-shrink: 0; }

.stats { display: grid; gap: 16px; margin-top: 56px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-value {
    font-family: var(--font-head); font-size: clamp(2.6rem, 7vw, 3.6rem); font-weight: 600; letter-spacing: -0.03em; line-height: 1;
    background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-small { font-size: 0.45em; font-weight: 500; }
.stat-label { color: var(--muted); }

/* ===== Servizi ===== */
.services-grid { display: grid; gap: 20px; }
.service-card { padding: 32px 28px; overflow: hidden; }
.service-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
    background: var(--grad); opacity: 0; transition: opacity .35s;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
    pointer-events: none;
}
.service-card:hover::before { opacity: 0.7; }
.service-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 36px; }
.card-num { font-family: var(--font-head); color: var(--cyan); font-weight: 500; }
.card-orb { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c4b5fd, var(--accent) 45%, var(--blue) 80%); box-shadow: 0 0 24px rgba(139,92,246,.5); }
.service-card h3 { font-size: clamp(1.5rem, 3vw, 1.9rem); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags li {
    font-size: 0.82rem; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--border-strong); color: #cfcedc; background: rgba(255,255,255,.02);
}

/* ===== Competenze ===== */
.skills-grid { display: grid; gap: 16px; }
.skill-card { display: flex; flex-direction: column; }
.skill-index { font-family: var(--font-head); font-size: 0.85rem; color: var(--muted); margin-bottom: 28px; }
.skill-card h3 { font-size: 1.2rem; }

.products-band {
    margin-top: 32px; border-radius: var(--radius); padding: 1px; background: var(--grad);
}
.products-band-inner {
    border-radius: calc(var(--radius) - 1px);
    background: linear-gradient(135deg, rgba(20, 16, 40, 0.96), rgba(9, 12, 24, 0.96));
    padding: 36px 28px; display: grid; gap: 14px;
}
.products-band h3 { font-size: clamp(1.4rem, 3vw, 2rem); }
.products-band p { color: #c9c8d6; font-size: 1.05rem; max-width: 760px; }

/* ===== Strumenti ===== */
.section-tools { padding-bottom: 80px; }
.section-tools .section-title { margin-bottom: 44px; }
.marquee {
    overflow: hidden;
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track { display: flex; width: max-content; animation: marquee 45s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-list { display: flex; gap: 12px; padding-right: 12px; }
.pill {
    padding: 12px 22px; border-radius: 999px; white-space: nowrap;
    border: 1px solid var(--border-strong); background: var(--surface);
    font-family: var(--font-head); font-weight: 500; font-size: 1rem;
    transition: border-color .25s, color .25s;
}
.pill:hover { border-color: var(--accent); color: #fff; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== Metodo ===== */
.steps { display: grid; gap: 16px; counter-reset: none; }
.step { padding: 32px 28px 36px; overflow: hidden; }
.step-num { display: block; font-family: var(--font-head); font-size: 2.6rem; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 28px; }
.step-num span { font-size: 1rem; color: var(--muted); font-weight: 500; margin-left: 2px; }
.step h3 { font-size: 1.5rem; }
.step-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--grad); transform: scaleX(0); transform-origin: left; transition: transform 1s var(--ease) .3s; }
.step.is-visible .step-bar { transform: scaleX(1); }

/* ===== Perché io ===== */
.why-grid { display: grid; gap: 16px; }
.why-card { display: flex; gap: 18px; align-items: flex-start; }
.why-check {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--cyan); border: 1px solid rgba(139,92,246,.3);
}
.why-card h3 { font-size: 1.25rem; margin-bottom: 8px; }

/* ===== FAQ ===== */
.faq-layout { display: grid; gap: 40px; }
.faq-layout .section-intro { margin-top: 20px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); transition: border-color .3s, background .3s; }
.faq-item[open] { border-color: rgba(139, 92, 246, 0.45); background: var(--surface-hover); }
.faq-item summary {
    list-style: none; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 20px 22px; font-family: var(--font-head); font-size: 1.12rem; font-weight: 500;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { position: relative; width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--border-strong); flex-shrink: 0; transition: transform .3s var(--ease), border-color .3s; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 1.5px; background: var(--text); transform: translate(-50%, -50%); }
.faq-icon::after { transform: translate(-50%, -50%) rotate(90deg); transition: transform .3s var(--ease); }
.faq-item[open] .faq-icon { border-color: var(--accent); transform: rotate(180deg); }
.faq-item[open] .faq-icon::after { transform: translate(-50%, -50%) rotate(0deg); }
.faq-answer { padding: 0 22px 22px; }
.faq-answer p { color: var(--muted); }

/* ===== Contatti ===== */
.section-contact { overflow: hidden; }
.contact-glow { position: absolute; width: 600px; height: 600px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.22), transparent 65%); top: 0; left: 50%; transform: translateX(-50%); pointer-events: none; }
.section-contact .section-title { margin-bottom: 56px; position: relative; }
.contact-grid { position: relative; display: grid; gap: 32px; }
.contact-lead { font-size: 1.12rem; color: #c9c8d6; margin-bottom: 32px; }
.contact-list { display: grid; border-top: 1px solid var(--border); }
.contact-list li { display: grid; gap: 4px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.contact-k { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.contact-v { font-family: var(--font-head); font-size: 1.12rem; display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; word-break: break-word; }
a.contact-v:hover { color: var(--cyan); }
.copy-btn {
    font: inherit; font-family: var(--font-body); font-size: 0.78rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px; cursor: pointer;
    background: var(--accent-soft); color: var(--text); border: 1px solid rgba(139,92,246,.35);
}
.copy-btn:hover { border-color: var(--accent); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.form-card { padding: 28px 22px; }
.contact-form { display: grid; gap: 18px; }
.form-row { display: grid; gap: 18px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 0.88rem; font-weight: 500; color: #cfcedc; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field textarea {
    width: 100%; font: inherit; color: var(--text);
    background: rgba(0, 0, 0, 0.35); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); padding: 13px 15px;
    transition: border-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input::placeholder, .field textarea::placeholder { color: #6d6c80; }
.field-check { grid-template-columns: auto 1fr; align-items: start; gap: 12px; }
.field-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }
.field-check label { font-weight: 400; color: var(--muted); }
.field-check a { color: var(--cyan); text-decoration: underline; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-alert { border-radius: var(--radius-sm); padding: 16px 18px; margin-bottom: 20px; }
.form-alert strong { display: block; margin-bottom: 4px; }
.form-alert p { color: inherit; opacity: .85; font-size: .95rem; }
.form-alert-ok { background: rgba(34, 211, 238, 0.1); border: 1px solid rgba(34, 211, 238, 0.4); }
.form-alert-err { background: rgba(244, 63, 94, 0.1); border: 1px solid rgba(244, 63, 94, 0.45); }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--border); padding: 64px 0 32px; background: var(--bg-2); }
.footer-top { display: grid; gap: 40px; }
.footer-brand { display: grid; gap: 16px; justify-items: start; }
.footer-brand p { color: var(--muted); max-width: 320px; }
.footer-col h2 { font-family: var(--font-body); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; margin-bottom: 16px; }
.footer-col ul { display: grid; gap: 10px; }
.footer-col a { color: #cfcedc; transition: color .2s; }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: grid; gap: 6px; color: var(--muted); font-size: 0.88rem; }

/* ===== Reveal allo scroll ===== */
.js .reveal {
    opacity: 0; transform: translateY(26px);
    transition: opacity .8s var(--ease), transform .8s var(--ease);
    transition-delay: calc(var(--i, 0) * 90ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ===== Breakpoint ===== */
@media (min-width: 640px) {
    .container { padding: 0 32px; }
    .stats { grid-template-columns: repeat(3, 1fr); }
    .skills-grid { grid-template-columns: repeat(2, 1fr); }
    .why-grid { grid-template-columns: repeat(2, 1fr); }
    .form-row { grid-template-columns: 1fr 1fr; }
    .form-card { padding: 36px 32px; }
    .footer-top { grid-template-columns: 2fr 1fr 1fr; }
    .footer-bottom { grid-template-columns: 1fr auto; }
    .products-band-inner { padding: 44px 40px; }
}

@media (min-width: 900px) {
    .section { padding: 130px 0; }
    .hero-inner { grid-template-columns: 1.25fr 1fr; }
    .hero-visual { max-width: 480px; }
    .about-grid { grid-template-columns: 1fr 1fr; gap: 64px; align-items: start; }
    .section-head { grid-template-columns: 1.2fr 1fr; align-items: end; gap: 48px; }
    .services-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
    .service-card { padding: 40px 36px; }
    .skills-grid { grid-template-columns: repeat(4, 1fr); }
    .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
    .faq-layout { grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: start; }
    .contact-grid { grid-template-columns: 1fr 1.1fr; gap: 56px; align-items: start; }
}

@media (min-width: 1100px) {
    .nav-toggle { display: none; }
    .site-nav {
        position: static; background: none; padding: 0;
        flex-direction: row; align-items: center; gap: 28px;
        transform: none; opacity: 1; visibility: visible; overflow: visible;
    }
    .site-nav ul { flex-direction: row; gap: 22px; }
    .site-nav ul a { font-family: var(--font-body); font-size: 0.92rem; padding: 6px 0; border: 0; color: var(--muted); }
    .site-nav ul a:hover, .site-nav ul a.is-active { color: var(--text); }
    .nav-cta { align-self: auto; }
    .site-header.nav-open { background: transparent; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .js .reveal { opacity: 1; transform: none; }
    .step-bar { transform: scaleX(1); }
    .marquee-track { flex-wrap: wrap; width: auto; }
    .marquee-list[aria-hidden="true"] { display: none; }
    .marquee-list { flex-wrap: wrap; padding: 0 20px; }
    .marquee { mask-image: none; -webkit-mask-image: none; }
}
