/* ═══════════════════════════════════════════════════
   FLEXWAVE PAYMENTS — restyle by CVR LLC
   Palette: near-black / electric violet / warm cream
   Fonts: Space Grotesk (display) + Inter (body) — max 2
   ═══════════════════════════════════════════════════ */

:root {
  --bg: #050508;
  --bg-soft: #0b0b12;
  --violet: #7C3AED;
  --violet-light: #A78BFA;
  --violet-glow: rgba(124, 58, 237, 0.55);
  --cream: #FFF5F2;
  --cream-dim: rgba(255, 245, 242, 0.62);
  --line: rgba(167, 139, 250, 0.14);
  --font-display: "Space Grotesk", sans-serif;
  --font-body: "Inter", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: initial; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
body.has-cursor { cursor: none; }

::selection { background: var(--violet); color: var(--cream); }

.mono {
  font-family: "Space Grotesk", monospace;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--violet-light);
  opacity: 0.75;
}

.accent {
  background: linear-gradient(100deg, var(--violet) 0%, var(--violet-light) 60%, var(--cream) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ═══════════ PRELOADER ═══════════ */
.preloader {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  /* failsafe: se JS/CDN non caricano, il preloader si toglie da solo */
  animation: preloader-failsafe 0.6s ease 5s forwards;
}
@keyframes preloader-failsafe { to { opacity: 0; visibility: hidden; } }
.preloader-inner { text-align: center; }
.preloader-dots {
  display: grid;
  grid-template-columns: repeat(9, 10px);
  gap: 7px;
  justify-content: center;
  margin-bottom: 28px;
}
.preloader-dots i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--violet);
  opacity: 0.15;
}
.preloader-word {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  letter-spacing: 0.42em;
  color: var(--cream);
}
.preloader-word span { display: inline-block; opacity: 0; transform: translateY(18px); }

/* ═══════════ FIXED LAYERS ═══════════ */
#waveCanvas {
  position: fixed; inset: 0; z-index: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
}
.grain {
  position: fixed; inset: -50%; z-index: 90;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 7s steps(10) infinite;
}
@keyframes grain {
  0%,100% { transform: translate(0,0); } 20% { transform: translate(-3%,2%); }
  40% { transform: translate(2%,-3%); } 60% { transform: translate(-2%,-2%); }
  80% { transform: translate(3%,3%); }
}

.cursor-dot {
  position: fixed; z-index: 150; pointer-events: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--violet-light);
  transform: translate(-50%, -50%);
}
.cursor-glow {
  position: fixed; z-index: 149; pointer-events: none;
  width: 400px; height: 400px; border-radius: 50%;
  background: radial-gradient(circle, rgba(124,58,237,0.10) 0%, transparent 65%);
  transform: translate(-50%, -50%);
}
@media (hover: none), (max-width: 900px) { .cursor-dot, .cursor-glow { display: none; } }

/* ═══════════ NAV ═══════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 4vw, 56px);
  transition: background 0.4s, backdrop-filter 0.4s, padding 0.4s;
}
.nav.scrolled {
  padding: 14px clamp(20px, 4vw, 56px);
  background: rgba(5, 5, 8, 0.72);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-logo img { height: 34px; display: block; }
.nav-links { display: flex; gap: clamp(18px, 3vw, 40px); }
.nav-links a {
  color: var(--cream-dim); text-decoration: none;
  font-size: 0.85rem; font-weight: 500; letter-spacing: 0.04em;
  transition: color 0.25s;
}
.nav-links a:hover { color: var(--cream); }
@media (max-width: 760px) { .nav-links { display: none; } }

/* ═══════════ BUTTONS ═══════════ */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-weight: 600; font-size: 0.9rem; letter-spacing: 0.03em;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: 100px;
  transition: transform 0.25s, box-shadow 0.25s, background 0.25s, color 0.25s;
  border: none; cursor: none;
}
@media (hover: none), (max-width: 900px) { .btn { cursor: pointer; } }
.btn-primary {
  background: linear-gradient(120deg, var(--violet), #9155F7);
  color: var(--cream);
  box-shadow: 0 0 24px rgba(124, 58, 237, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 44px rgba(124, 58, 237, 0.65);
}
.btn-ghost {
  color: var(--cream);
  border: 1px solid rgba(255, 245, 242, 0.22);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--violet-light); color: var(--violet-light); }
.btn-nav { padding: 10px 22px; font-size: 0.8rem; }
.btn-block { width: 100%; text-align: center; }

/* ═══════════ HERO ═══════════ */
.hero {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  padding: 120px clamp(20px, 5vw, 72px) 60px;
  perspective: 1200px;
}
.hero-meta {
  position: absolute; z-index: 2;
  font-size: 0.6rem;
}
.hero-meta-tl { top: 96px; left: clamp(20px, 4vw, 56px); }
.hero-meta-tr { top: 96px; right: clamp(20px, 4vw, 56px); }
.hero-meta-bl { bottom: 34px; left: clamp(20px, 4vw, 56px); }
.hero-meta-br { bottom: 34px; right: clamp(20px, 4vw, 56px); }
@media (max-width: 760px) { .hero-meta-tl, .hero-meta-tr { display: none; } }

.hero-content { position: relative; z-index: 3; }

.pill {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 0.78rem; color: var(--cream-dim);
  text-decoration: none;
  border: 1px solid var(--line);
  background: rgba(124, 58, 237, 0.07);
  padding: 8px 18px; border-radius: 100px;
  margin-bottom: 34px;
  transition: border-color 0.3s;
}
.pill:hover { border-color: var(--violet); }
.pill em { font-style: normal; color: var(--violet-light); }
.pill-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--violet);
  box-shadow: 0 0 10px var(--violet);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 8.5vw, 7.2rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.hero-title .line { display: block; overflow: hidden; }
.hero-title .word { display: inline-block; }

.hero-sub {
  max-width: 440px;
  margin-top: 30px;
  color: var(--cream-dim);
  font-size: clamp(0.95rem, 1.4vw, 1.08rem);
}
.hero-cta { display: flex; gap: 16px; margin-top: 40px; flex-wrap: wrap; }

/* card */
.card-scene {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  transform-style: preserve-3d;
}
.card-3d {
  position: relative;
  width: min(620px, 46vw);
  transform-style: preserve-3d;
  will-change: transform;
}
.card-img {
  width: 100%; display: block;
  filter: drop-shadow(0 30px 60px rgba(124, 58, 237, 0.25));
  user-select: none;
}
.card-shadow {
  position: absolute; bottom: -8%; left: 15%; right: 15%; height: 60px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.35) 0%, transparent 70%);
  filter: blur(24px);
  z-index: -1;
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 130px; }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
  .card-3d { width: min(480px, 88vw); margin-top: 48px; }
}

/* ═══════════ SECTIONS COMMON ═══════════ */
section { position: relative; z-index: 1; }
.section-head { margin-bottom: 64px; }
.label { margin-bottom: 18px; }
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
}

/* ═══════════ MANIFESTO ═══════════ */
.manifesto {
  padding: 22vh clamp(20px, 8vw, 120px);
  max-width: 1200px; margin: 0 auto;
}
.manifesto-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.6rem, 3.8vw, 3rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}
.manifesto-text .w { opacity: 0.12; display: inline-block; }

/* ═══════════ BRAND FILM ═══════════ */
.brandfilm {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brandfilm-video {
  /* più largo del viewport: nasconde i bordi tagliati a dx e sx */
  width: 136%;
  max-width: none;
  flex: none;
  display: block;
}
/* vignetta radiale: sfuma i bordi interni del video nel background, niente tagli */
.brandfilm-fade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to right, var(--bg), transparent 22%),
    linear-gradient(to left, var(--bg), transparent 22%),
    radial-gradient(ellipse 70% 58% at 50% 50%,
      transparent 34%, rgba(5, 5, 8, 0.5) 60%, var(--bg) 92%);
}
.brandfilm::before, .brandfilm::after {
  content: "";
  position: absolute; left: 0; right: 0; height: 26%;
  z-index: 2; pointer-events: none;
}
.brandfilm::before { top: 0; background: linear-gradient(to bottom, var(--bg), transparent); }
.brandfilm::after { bottom: 0; background: linear-gradient(to top, var(--bg), transparent); }

/* ═══════════ FEATURES / SPOTLIGHT CARDS ═══════════ */
.features { padding: 14vh clamp(20px, 5vw, 72px); max-width: 1400px; margin: 0 auto; }
.features-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr; } }

.spot-card {
  --mx: 50%; --my: 50%;
  position: relative;
  padding: 44px 34px 40px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(124,58,237,0.07), rgba(11,11,18,0.6));
  border: 1px solid var(--line);
  overflow: hidden;
  transition: transform 0.3s ease, border-color 0.3s;
  will-change: transform;
}
.spot-card::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(420px circle at var(--mx) var(--my), rgba(124,58,237,0.22), transparent 55%);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.spot-card::after {
  content: "";
  position: absolute; inset: -1px;
  border-radius: 20px;
  padding: 1px;
  background: radial-gradient(300px circle at var(--mx) var(--my), var(--violet-light), transparent 60%);
  -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 0.35s;
  pointer-events: none;
}
.spot-card:hover::before, .spot-card:hover::after { opacity: 1; }

.spot-num {
  font-size: 0.75rem;
  margin-bottom: 60px;
  color: var(--violet-light);
}
.spot-card h3 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 600;
  margin-bottom: 14px;
}
.spot-card p { color: var(--cream-dim); font-size: 0.94rem; }

/* ═══════════ HOW ═══════════ */
.how { padding: 14vh clamp(20px, 5vw, 72px); max-width: 1400px; margin: 0 auto; }
.how-wave { width: 100%; height: 130px; display: block; margin-bottom: -30px; }
.how-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px;
}
@media (max-width: 900px) { .how-grid { grid-template-columns: 1fr; } .how-wave { display: none; } }
.how-step {
  padding: 36px 30px;
  border-top: 1px solid var(--line);
}
.how-num {
  font-size: 2.6rem; font-weight: 700;
  font-family: var(--font-display);
  letter-spacing: 0;
  background: linear-gradient(180deg, var(--violet-light), transparent 140%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 1; display: block; margin-bottom: 20px;
}
.how-step h3 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 12px; }
.how-step p { color: var(--cream-dim); font-size: 0.94rem; }

/* ═══════════ COVERAGE ═══════════ */
.coverage {
  padding: 14vh clamp(20px, 5vw, 72px);
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 1.1fr 0.9fr;
  gap: 60px; align-items: center;
}
@media (max-width: 980px) { .coverage { grid-template-columns: 1fr; } }
.coverage-copy p { color: var(--cream-dim); max-width: 460px; margin-top: 22px; }
.coverage-copy h2 { margin-top: 0; }
.coverage-list { list-style: none; margin-top: 28px; }
.coverage-list li {
  padding: 13px 0 13px 30px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 0.95rem;
}
.coverage-list li::before {
  content: "◆";
  position: absolute; left: 2px;
  color: var(--violet);
  font-size: 0.7rem; top: 17px;
}
.coverage-stats { display: flex; gap: 44px; margin-top: 44px; flex-wrap: wrap; }
.stat-num {
  font-size: 2.8rem; font-weight: 700;
  font-family: var(--font-display);
  color: var(--cream);
  letter-spacing: -0.02em;
  opacity: 1;
}
.stat-unit { font-size: 1rem; margin-left: 4px; }
.stat p { color: var(--cream-dim); font-size: 0.8rem; margin-top: 4px; }
.coverage-globe { display: flex; justify-content: center; }
#globeCanvas { width: min(480px, 90vw); height: auto; }

/* ═══════════ MARQUEE ═══════════ */
.marquee {
  overflow: hidden;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 26px 0;
  background: rgba(124, 58, 237, 0.04);
}
.marquee-track {
  display: flex; white-space: nowrap; will-change: transform;
  font-family: var(--font-display);
  font-size: 1.05rem; font-weight: 500;
  letter-spacing: 0.22em;
  color: var(--cream-dim);
}

/* ═══════════ ABOUT ═══════════ */
.about {
  padding: 18vh clamp(20px, 8vw, 120px);
  max-width: 1100px; margin: 0 auto;
}
.about-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.42;
  margin-top: 26px;
}
.about-text .w { opacity: 0.12; display: inline-block; }

/* ═══════════ CONTACT ═══════════ */
.contact { padding: 10vh clamp(20px, 5vw, 72px) 16vh; }
.contact-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr 1fr; gap: 70px;
  padding: clamp(30px, 5vw, 70px);
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(900px circle at 0% 0%, rgba(124,58,237,0.14), transparent 55%),
    var(--bg-soft);
}
@media (max-width: 900px) { .contact-inner { grid-template-columns: 1fr; gap: 40px; } }
.contact-copy p { color: var(--cream-dim); margin-top: 20px; max-width: 380px; }

.contact-form .field { margin-bottom: 20px; }
.contact-form label {
  display: block;
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--cream-dim);
  margin-bottom: 8px;
}
.contact-form input, .contact-form textarea {
  width: 100%;
  background: rgba(255, 245, 242, 0.04);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.25s, background 0.25s;
  resize: vertical;
}
.contact-form input:focus, .contact-form textarea:focus {
  outline: none;
  border-color: var(--violet);
  background: rgba(124, 58, 237, 0.07);
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  position: relative; z-index: 1;
  border-top: 1px solid var(--line);
  padding: 50px clamp(20px, 5vw, 72px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 26px; flex-wrap: wrap;
}
.footer-logo { height: 18px; }
.footer-links { display: flex; gap: 28px; }
.footer-links a {
  color: var(--cream-dim); text-decoration: none; font-size: 0.84rem;
  transition: color 0.25s;
}
.footer-links a:hover { color: var(--cream); }
.footer-note { font-size: 0.62rem; }

.brandfilm-canvas { display: none; }

/* ═══════════ MOBILE ═══════════ */
@media (max-width: 900px) {
  .nav-logo img { height: 22px; }
  .btn-nav { padding: 8px 16px; font-size: 0.72rem; }
  /* sezione avvolge il visual: i fade cadono sui bordi veri, niente vuoto */
  .brandfilm { height: auto; padding: 8vh 0; }
  /* mobile: video inaffidabile per lo scrub -> sequenza frame su canvas */
  .brandfilm-video { display: none; }
  .brandfilm-canvas { display: block; width: 136%; max-width: none; flex: none; }
}

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  .grain { animation: none; }
  .pill-dot { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
