/* ============================================================
   COREFLOW — Design System
   "Il cuore che muove il tuo business."
   ============================================================ */

:root {
  /* Color system */
  --color-bg: #05050F;
  --color-surface: #0D0D1A;
  --color-surface-2: #12122a;
  --color-border: rgba(120, 100, 255, 0.15);
  --color-border-strong: rgba(120, 100, 255, 0.35);
  --color-blue: #0099FF;
  --color-violet: #7B2FFF;
  --color-gradient: linear-gradient(135deg, #0099FF, #7B2FFF);
  --color-glow-blue: rgba(0, 153, 255, 0.30);
  --color-glow-violet: rgba(123, 47, 255, 0.30);
  --color-text: #F0F0FF;
  --color-muted: #888899;

  /* Type */
  --font-display: "Syne", sans-serif;
  --font-body: "DM Sans", sans-serif;

  /* Layout */
  --maxw: 1200px;
  --nav-h: 76px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
::selection { background: var(--color-violet); color: #fff; }

/* ---------- Helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.gradient-text {
  background: var(--color-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--color-muted);
  margin-bottom: 22px;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px;
  background: var(--color-gradient);
}
.section { padding: clamp(90px, 12vw, 150px) 0; position: relative; }
.section-head { max-width: 720px; margin-bottom: 64px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 700; line-height: 1.04; letter-spacing: -0.03em; }
h2.section-title { font-size: clamp(2.1rem, 5vw, 3.4rem); }
.section-head p { color: var(--color-muted); font-size: 1.15rem; margin-top: 20px; max-width: 560px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 15px 28px; border-radius: 100px;
  font-weight: 600; font-size: 1rem; letter-spacing: -0.01em;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .35s var(--ease);
  white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary {
  background: var(--color-gradient);
  color: #fff;
  box-shadow: 0 8px 30px -8px var(--color-glow-violet), 0 4px 14px -6px var(--color-glow-blue);
}
.btn-primary:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 18px 44px -10px var(--color-glow-violet), 0 8px 22px -8px var(--color-glow-blue); }
.btn-ghost {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text);
}
.btn-ghost:hover { transform: translateY(-3px); border-color: var(--color-blue); background: rgba(0,153,255,0.06); }

/* Glass gradient-border CTA (navbar) */
.btn-glass {
  position: relative;
  padding: 12px 24px; border-radius: 100px;
  font-weight: 600; font-size: .95rem; white-space: nowrap;
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  color: var(--color-text);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.btn-glass::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--color-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  pointer-events: none;
}
.btn-glass:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px var(--color-glow-violet); }

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: background .4s var(--ease), border-color .4s var(--ease), backdrop-filter .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav.scrolled {
  background: rgba(5, 5, 15, 0.72);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--color-border);
}
.nav .container { display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo .mark { height: 32px; width: auto; flex-shrink: 0; mix-blend-mode: screen; }
.logo .wordmark {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.28rem; letter-spacing: 0.02em;
}
.nav-links { display: flex; align-items: center; gap: 38px; }
.nav-links a {
  font-size: .96rem; font-weight: 500; color: var(--color-muted);
  position: relative; transition: color .3s var(--ease);
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1px; width: 0;
  background: var(--color-gradient); transition: width .35s var(--ease);
}
.nav-links a:hover { color: var(--color-text); }
.nav-links a:hover::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 26px; }
.nav-toggle { display: none; }

/* Mobile menu hidden by default (desktop) — revealed in media query below */
.mobile-menu { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  overflow: hidden;
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; }
.hero::after { /* vignette + bottom fade */
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(900px 600px at 70% 35%, rgba(123,47,255,0.14), transparent 60%),
    radial-gradient(700px 500px at 20% 60%, rgba(0,153,255,0.12), transparent 60%),
    linear-gradient(to bottom, transparent 60%, var(--color-bg));
}
.hero .container { position: relative; z-index: 2; }
.hero-inner { max-width: 880px; }
.hero h1 { font-size: clamp(2.7rem, 7.2vw, 5.4rem); margin: 24px 0; }
.hero h1 .line2 { color: var(--color-text); }
.hero-sub {
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  color: #b8b8cc; max-width: 600px; margin-bottom: 40px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px; border-radius: 100px;
  background: rgba(255,255,255,0.03); border: 1px solid var(--color-border);
  font-size: .85rem; color: var(--color-muted); letter-spacing: .01em;
}
.hero-badge .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2bd47e; box-shadow: 0 0 10px #2bd47e;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse { 0%,100% { opacity:1; transform: scale(1);} 50% { opacity:.5; transform: scale(.8);} }

/* scroll indicator */
.scroll-ind {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: var(--color-muted); font-size: .72rem; letter-spacing: .22em; text-transform: uppercase;
}
.scroll-ind .mouse {
  width: 24px; height: 38px; border: 1.5px solid var(--color-border-strong);
  border-radius: 14px; position: relative;
}
.scroll-ind .mouse::after {
  content: ""; position: absolute; top: 7px; left: 50%; transform: translateX(-50%);
  width: 4px; height: 7px; border-radius: 3px; background: var(--color-gradient);
  animation: scrolldot 1.8s var(--ease) infinite;
}
@keyframes scrolldot { 0% {opacity:0; top:7px;} 30% {opacity:1;} 70% {opacity:1; top:18px;} 100% {opacity:0; top:18px;} }

/* ============================================================
   PAIN POINTS
   ============================================================ */
.pain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pain-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 20px; padding: 34px 30px;
  transition: transform .4s var(--ease), border-color .4s var(--ease);
}
.pain-card:hover { transform: translateY(-4px); border-color: var(--color-border-strong); }
.pain-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 24px;
  background: rgba(123,47,255,0.10); border: 1px solid var(--color-border);
  color: var(--color-blue);
}
.pain-icon svg { width: 26px; height: 26px; }
.pain-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.pain-card p { color: var(--color-muted); font-size: .98rem; }
.pain-stat { font-family: var(--font-display); font-weight: 800; font-size: 2.4rem; line-height:1; margin-bottom: 6px; }

/* divider arrow into solution */
.flow-divider {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  margin-top: 70px; color: var(--color-muted);
}
.flow-divider .line { width: 1px; height: 56px; background: linear-gradient(to bottom, transparent, var(--color-border-strong)); }
.flow-divider .arrow {
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--color-border-strong); display: grid; place-items: center;
  color: var(--color-blue);
}

/* ============================================================
   SERVICES
   ============================================================ */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.svc-card {
  position: relative; isolation: isolate;
  background: var(--color-surface);
  border-radius: 22px; padding: 38px 32px;
  border: 1px solid var(--color-border);
  overflow: hidden;
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.svc-card::before { /* gradient border on hover */
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px;
  background: var(--color-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity .45s var(--ease); pointer-events: none; z-index: 2;
}
.svc-card::after { /* glow wash */
  content: ""; position: absolute; top: -40%; right: -30%; width: 280px; height: 280px;
  background: radial-gradient(circle, var(--color-glow-violet), transparent 65%);
  opacity: 0; transition: opacity .5s var(--ease); z-index: -1;
}
.svc-card:hover { transform: translateY(-6px); box-shadow: 0 30px 60px -30px rgba(0,0,0,.8); }
.svc-card:hover::before { opacity: 1; }
.svc-card:hover::after { opacity: 1; }
.svc-num {
  font-family: var(--font-display); font-weight: 800; font-size: .9rem;
  color: var(--color-muted); letter-spacing: .1em;
}
.svc-icon {
  width: 58px; height: 58px; border-radius: 16px; margin: 22px 0 26px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(0,153,255,0.14), rgba(123,47,255,0.14));
  border: 1px solid var(--color-border);
  color: #fff;
}
.svc-icon svg { width: 28px; height: 28px; }
.svc-card h3 { font-size: 1.45rem; margin-bottom: 14px; }
.svc-card p { color: var(--color-muted); font-size: 1rem; }
.svc-card .svc-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 24px;
  font-weight: 600; font-size: .92rem; color: var(--color-blue);
  transition: gap .3s var(--ease);
}
.svc-card:hover .svc-link { gap: 14px; }

/* ============================================================
   HOW IT WORKS
   ============================================================ */
.how { position: relative; }
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px;
  position: relative;
}
.steps::before { /* dashed connector */
  content: ""; position: absolute; top: 38px; left: 12%; right: 12%; height: 2px;
  background-image: linear-gradient(90deg, var(--color-border-strong) 50%, transparent 50%);
  background-size: 14px 2px; background-repeat: repeat-x;
  z-index: 0;
}
.step { position: relative; z-index: 1; text-align: center; padding: 0 10px; }
.step-badge {
  width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 28px;
  display: grid; place-items: center; position: relative;
  background: var(--color-surface); border: 1px solid var(--color-border-strong);
  font-family: var(--font-display); font-weight: 800; font-size: 1.6rem;
}
.step-badge::before {
  content: ""; position: absolute; inset: -1px; border-radius: 50%; padding: 1px;
  background: var(--color-gradient);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.step-badge span { background: var(--color-gradient); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.step h3 { font-size: 1.35rem; margin-bottom: 12px; }
.step p { color: var(--color-muted); font-size: 1rem; max-width: 280px; margin: 0 auto; }

/* ============================================================
   MANIFESTO
   ============================================================ */
.manifesto { position: relative; overflow: hidden; text-align: center; }
.manifesto::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(700px 400px at 30% 30%, rgba(0,153,255,0.16), transparent 60%),
    radial-gradient(700px 400px at 70% 70%, rgba(123,47,255,0.18), transparent 60%);
  animation: meshmove 16s ease-in-out infinite alternate;
}
@keyframes meshmove {
  0% { transform: translate(-3%, -2%) scale(1); }
  100% { transform: translate(3%, 2%) scale(1.08); }
}
.manifesto .container { position: relative; z-index: 1; max-width: 1000px; }
.manifesto blockquote {
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.9rem, 4.6vw, 3.4rem); line-height: 1.12; letter-spacing: -0.03em;
  text-wrap: balance;
}
.manifesto blockquote em { font-style: normal; }
.manifesto .sub { color: var(--color-muted); font-size: 1.2rem; margin-top: 30px; }

/* ============================================================
   CTA
   ============================================================ */
.cta-wrap { position: relative; padding: clamp(60px, 8vw, 96px) 0; }
.cta-card {
  position: relative; overflow: hidden;
  border-radius: 32px; padding: clamp(48px, 7vw, 84px) clamp(28px, 6vw, 80px);
  background: var(--color-gradient);
  text-align: center;
}
.cta-card .circuit-overlay {
  position: absolute; inset: 0; z-index: 0; opacity: .5;
  background-image:
    linear-gradient(rgba(255,255,255,0.10) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.10) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask: radial-gradient(circle at 50% 40%, #000, transparent 75%);
  mask: radial-gradient(circle at 50% 40%, #000, transparent 75%);
}
.cta-card > * { position: relative; z-index: 1; }
.cta-card h2 { font-size: clamp(2rem, 5vw, 3.2rem); color: #fff; max-width: 760px; margin: 0 auto 18px; text-wrap: balance; }
.cta-card p { color: rgba(255,255,255,0.85); font-size: 1.15rem; max-width: 540px; margin: 0 auto 40px; }
.cta-form {
  display: flex; gap: 12px; max-width: 520px; margin: 0 auto; flex-wrap: wrap;
  justify-content: center;
}
.cta-form input {
  flex: 1; min-width: 240px;
  padding: 16px 22px; border-radius: 100px;
  background: rgba(5,5,15,0.4); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; font-size: 1rem; backdrop-filter: blur(8px);
}
.cta-form input::placeholder { color: rgba(255,255,255,0.6); }
.cta-form input:focus { outline: none; border-color: #fff; background: rgba(5,5,15,0.55); }
.cta-form .btn {
  background: #05050F; color: #fff; box-shadow: 0 8px 24px -8px rgba(0,0,0,.6);
}
.cta-form .btn:hover { transform: translateY(-3px) scale(1.02); }
.cta-alt { margin-top: 24px; font-size: .92rem; color: rgba(255,255,255,0.82); }
.cta-alt a { text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.cta-success { color: #fff; font-weight: 600; font-size: 1.1rem; min-height: 1.2em; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { border-top: 1px solid var(--color-border); padding: 64px 0 40px; }
.footer-top { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; margin-bottom: 48px; }
.footer-brand { max-width: 320px; }
.footer-brand .logo { margin-bottom: 18px; }
.footer-brand .tagline {
  font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  letter-spacing: .02em;
}
.footer-brand .tagline span { color: var(--color-muted); }
.footer-links { display: flex; gap: 56px; flex-wrap: wrap; }
.footer-col h4 { font-family: var(--font-body); font-size: .78rem; text-transform: uppercase; letter-spacing: .16em; color: var(--color-muted); margin-bottom: 18px; font-weight: 700; }
.footer-col a { display: block; color: var(--color-text); font-size: .96rem; margin-bottom: 12px; transition: color .3s var(--ease); }
.footer-col a:hover { color: var(--color-blue); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  padding-top: 28px; border-top: 1px solid var(--color-border);
  flex-wrap: wrap; color: var(--color-muted); font-size: .88rem;
}

/* ============================================================
   SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .08s; }
.reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .pain-grid, .svc-grid, .steps { grid-template-columns: 1fr; }
  .steps::before { display: none; }
  .step p { max-width: 360px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav-links, .nav-right .btn-glass { display: none; }
  .nav-toggle { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--color-border); }
  .mobile-menu {
    display: flex;
    position: fixed; inset: var(--nav-h) 0 auto 0; z-index: 99;
    background: rgba(5,5,15,0.96); backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--color-border);
    display: flex; flex-direction: column; gap: 4px; padding: 18px 28px 28px;
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity .3s var(--ease), transform .3s var(--ease);
  }
  .mobile-menu.open { transform: none; opacity: 1; pointer-events: auto; }
  .mobile-menu a { padding: 14px 0; font-size: 1.1rem; border-bottom: 1px solid var(--color-border); }
  .mobile-menu .btn-primary { margin-top: 16px; justify-content: center; }
  .hero-ctas { width: 100%; }
  .hero-ctas .btn { flex: 1; }
  .footer-top { flex-direction: column; }
  .cta-form .btn { width: 100%; }
}
