/* ── Three.js Particle Mesh Hero ── */
.hero-threejs {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0a0a0b;
  isolation: isolate;
}

/* Video background (desktop) */
.hero-threejs__video-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.hero-threejs__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-threejs__video-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}

/* Canvas sits behind everything (mobile only) */
.hero-threejs__canvas-wrap {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: auto;
  display: none; /* hidden on desktop, video plays instead */
}

.hero-threejs__canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Desktop: show video, hide canvas */
@media (min-width: 769px) {
  .hero-threejs__video-wrap { display: block; }
  .hero-threejs__canvas-wrap { display: none; }
}

/* Mobile: hide desktop video bg + canvas, show inline video */
@media (max-width: 768px) {
  .hero-threejs__video-wrap { display: none; }
  .hero-threejs__canvas-wrap { display: none; }

  .hero-threejs__mobile-video {
    display: block;
    margin-top: 32px;
    border-radius: 16px;
    overflow: hidden;
    pointer-events: auto;
    aspect-ratio: 16 / 9;
    background: #111;
  }

  .hero-threejs__mobile-video video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
  }
}

/* Gradient overlays for depth + readability */
.hero-threejs::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(47,112,255,.12) 0%, transparent 70%),
    radial-gradient(ellipse 60% 50% at 20% 80%, rgba(123,97,255,.08) 0%, transparent 60%);
  pointer-events: none;
}

.hero-threejs::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30%;
  z-index: 1;
  background: linear-gradient(to top, #0a0a0b 0%, transparent 100%);
  pointer-events: none;
}

/* Content layer */
.hero-threejs__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(100px, 14vw, 160px) 24px clamp(60px, 8vw, 100px);
  text-align: center;
  pointer-events: none; /* let mouse events pass through to canvas */
}

.hero-threejs__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-sm, 0.875rem);
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent, #2f70ff);
  margin: 0 0 24px;
  opacity: 0;
  transform: translateY(16px);
}

.hero-threejs__eyebrow::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent, #2f70ff);
  box-shadow: 0 0 8px var(--color-accent, #2f70ff);
  animation: heroEyebrowPulse 2s ease-in-out infinite;
}

@keyframes heroEyebrowPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.3); }
}

.hero-threejs__title {
  font-size: var(--font-size-5xl, clamp(3.5rem, 7vw, 5.5rem));
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: #fff;
  margin: 0 0 28px;
  opacity: 0; /* animated by hero-text-reveal.js */
}

/* Gradient text accent for keywords */
.hero-threejs__title .text-gradient {
  background: linear-gradient(135deg, var(--color-accent, #2f70ff) 0%, var(--color-accent-2, #7b61ff) 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-threejs__copy {
  font-size: var(--font-size-lg, 1.375rem);
  line-height: 1.65;
  color: rgba(230, 233, 239, 0.78);
  max-width: 720px;
  margin: 0 auto 40px;
  opacity: 0;
  transform: translateY(20px);
}

/* CTA Buttons */
.hero-threejs__cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: auto; /* re-enable clicks for buttons */
}

.hero-threejs__cta .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 36px;
  font-size: 16px;
  font-weight: 600;
  border-radius: 12px;
  background: var(--color-accent, #2f70ff);
  color: #fff;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(.4,0,.2,1), box-shadow 0.3s ease, background 0.3s ease;
  position: relative;
  overflow: hidden;
}

.hero-threejs__cta .btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(255,255,255,.15) 50%, transparent 100%);
  transform: translateX(-100%);
  transition: transform 0.5s ease;
}

.hero-threejs__cta .btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(47,112,255,.35), 0 0 0 1px rgba(47,112,255,.2);
  background: var(--color-accent-hover, #1d4ed8);
}

.hero-threejs__cta .btn-primary:hover::before {
  transform: translateX(100%);
}

.hero-threejs__cta .btn-primary:active {
  transform: translateY(-1px);
}

.hero-threejs__cta .btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 28px;
  font-size: 16px;
  font-weight: 500;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.1);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.hero-threejs__cta .btn-secondary:hover {
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.2);
  color: #fff;
  transform: translateY(-2px);
}

/* ── Mobile inline video (below CTA) ── */
.hero-threejs__mobile-video {
  display: none; /* hidden on desktop */
}

/* ── Badges / Trust Logos ── */
.hero-threejs__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(20px, 3vw, 40px);
  flex-wrap: wrap;
  margin-top: clamp(48px, 6vw, 72px);
  opacity: 0;
  transform: translateY(20px);
  pointer-events: auto;
}

.hero-threejs__badge {
  height: clamp(28px, 3.5vw, 40px);
  width: auto;
  filter: brightness(0) invert(1);
  opacity: 0.5;
  transition: opacity 0.3s ease, filter 0.3s ease;
}

.hero-threejs__badge:hover {
  opacity: 0.85;
}

/* ── Trusted-by marquee strip ── */
.hero-threejs__trust {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
  padding: 32px 0 40px;
  background: linear-gradient(to top, rgba(10,10,11,.95) 0%, rgba(10,10,11,.6) 60%, transparent 100%);
  opacity: 0;
  animation: heroScrollFade 1s 2s ease forwards;
}

.hero-threejs__trust-label {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,.45);
  margin: 0 0 20px;
}

.hero-threejs__marquee {
  width: 100%;
  overflow: hidden;
  mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 8%, #000 92%, transparent 100%);
}

.hero-threejs__marquee-track {
  display: flex;
  align-items: center;
  gap: clamp(40px, 5vw, 72px);
  width: max-content;
  animation: heroMarqueeScroll 30s linear infinite;
}

.hero-threejs__marquee-logo {
  height: clamp(24px, 3vw, 36px);
  width: auto;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
  opacity: 0.55;
  transition: opacity 0.3s ease;
}

@keyframes heroMarqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-33.333%); } /* 1/3 since we repeat 3x */
}

@media (max-width: 768px) {
  .hero-threejs__trust {
    padding: 24px 0 28px;
  }

  .hero-threejs__trust-label {
    font-size: 11px;
    margin-bottom: 14px;
  }

  .hero-threejs__marquee-logo {
    height: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-threejs__marquee-track {
    animation: none;
  }

  .hero-threejs__trust {
    animation: none;
    opacity: 0.5;
  }
}

/* ── Scroll indicator ── */
.hero-threejs__scroll {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: heroScrollFade 1s 2.5s ease forwards;
}

@keyframes heroScrollFade {
  to { opacity: 0.5; }
}

.hero-threejs__scroll-line {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,.4), transparent);
  animation: heroScrollPulse 2s ease-in-out infinite;
}

@keyframes heroScrollPulse {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(0.6); opacity: 0.2; }
}

.hero-threejs__scroll-text {
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,.35);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-threejs {
    min-height: auto;
    flex-direction: column;
  }

  .hero-threejs__content {
    padding: 100px 20px 40px;
  }

  .hero-threejs__eyebrow {
    margin-bottom: 16px;
    font-size: 0.75rem;
  }

  .hero-threejs__title {
    font-size: clamp(2rem, 8vw, 3rem);
    margin-bottom: 16px;
  }

  .hero-threejs__copy {
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 24px;
  }

  .hero-threejs__cta {
    flex-direction: column;
    gap: 12px;
  }

  .hero-threejs__cta .btn-primary,
  .hero-threejs__cta .btn-secondary {
    width: 100%;
    max-width: 320px;
    justify-content: center;
    padding: 14px 28px;
  }

  .hero-threejs__badges {
    gap: 12px;
    margin-top: clamp(28px, 4vw, 40px);
  }

  .hero-threejs__badge {
    height: 22px;
  }

  .hero-threejs__scroll {
    display: none;
  }

  .hero-threejs__trust {
    position: relative;
    padding: 28px 0 32px;
    background: none;
    opacity: 1;
    animation: none;
  }

  .hero-threejs__trust-label {
    font-size: 10px;
    margin-bottom: 12px;
  }

  .hero-threejs__marquee-logo {
    height: 20px;
  }

  .hero-threejs__marquee-track {
    gap: clamp(24px, 3vw, 40px);
  }
}

@media (max-width: 480px) {
  .hero-threejs__content {
    padding: 72px 16px 32px;
  }

  .hero-threejs__title {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .hero-threejs__copy {
    font-size: 0.85rem;
    margin-bottom: 20px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .hero-threejs__eyebrow::before {
    animation: none;
  }

  .hero-threejs__scroll {
    animation: none;
    opacity: 0.5;
  }

  .hero-threejs__scroll-line {
    animation: none;
  }

  .hero-threejs__eyebrow,
  .hero-threejs__title,
  .hero-threejs__copy,
  .hero-threejs__cta,
  .hero-threejs__badges {
    opacity: 1 !important;
    transform: none !important;
  }
}
