/* =====================================================================
   3D hero + motion layer (homepage)
   ===================================================================== */

/* Lenis smooth scroll */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Hero ---------- */
.hero3d {
  position: relative; overflow: hidden; isolation: isolate;
  background: #0A1428; color: #fff;
  min-height: min(calc(100vh - 160px), 860px);
  display: flex; align-items: center;
}
.hero3d-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.h3d-glow { position: absolute; border-radius: 50%; filter: blur(80px); }
.h3d-glow.g1 { width: 760px; height: 760px; right: -120px; top: -160px; background: radial-gradient(circle, rgba(16,112,236,.55), transparent 65%); }
.h3d-glow.g2 { width: 520px; height: 520px; left: -200px; bottom: -260px; background: radial-gradient(circle, rgba(106,164,250,.22), transparent 65%); }
.h3d-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 70% at 65% 50%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 70% at 65% 50%, #000 30%, transparent 75%);
}
.hero3d::after { /* film grain */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero3d-wrap {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center; gap: 24px; padding-top: 40px; padding-bottom: 64px;
}
.hero3d-copy { position: relative; z-index: 2; max-width: 560px; }
.hero3d-pill {
  display: inline-flex; align-items: center; gap: 9px; padding: 7px 15px 7px 7px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
  border-radius: 100px; font-size: .82rem; font-weight: 600; color: #C9D6EC; margin-bottom: 26px;
  backdrop-filter: blur(8px);
}
.hero3d-pill .tag { background: var(--blue); color: #fff; font-size: .7rem; font-weight: 800; padding: 4px 11px; border-radius: 100px; text-transform: uppercase; letter-spacing: .04em; }
.hero3d h1 {
  font-size: clamp(2.6rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -.045em;
  font-weight: 800; color: #fff; margin-bottom: 24px;
}
.h3d-line { display: block; overflow: hidden; padding-bottom: .06em; }
.h3d-line > span { display: inline-block; }
.hero3d h1 em {
  font-style: normal; color: transparent;
  background: linear-gradient(100deg, #6AA4FA 0%, #1070EC 60%, #6AA4FA 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text;
  animation: h3dShine 6s linear infinite;
}
@keyframes h3dShine { to { background-position: -200% 0; } }
.hero3d-sub { font-size: 1.08rem; color: #A9B8D2; max-width: 470px; margin: 0 0 34px; line-height: 1.65; }
.hero3d-cta { display: flex; gap: 13px; flex-wrap: wrap; }
.btn-hero3d-ghost { color: #fff; border: 1.5px solid rgba(255,255,255,.28); background: rgba(255,255,255,.04); }
.btn-hero3d-ghost:hover { border-color: #fff; background: rgba(255,255,255,.1); transform: translateY(-2px); }
.hero3d-stats { display: flex; gap: 38px; flex-wrap: wrap; margin-top: 42px; padding-top: 28px; border-top: 1px solid rgba(255,255,255,.12); }
.hero3d-stat b { display: block; font-family: var(--f-head); font-size: 2.2rem; font-weight: 800; color: #fff; line-height: 1; letter-spacing: -.03em; }
.hero3d-stat > span { font-size: .84rem; color: #8597B5; margin-top: 7px; display: block; }

.hero3d-stage { position: relative; height: min(calc(100vh - 220px), 680px); min-height: 440px; margin-right: -40px; }
.hero3d-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.hero3d-fallback { position: absolute; inset: 0; display: none; }
.hero3d-fallback img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
.hero3d.no-webgl .hero3d-fallback { display: block; }

.hero3d-scroll {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: #8597B5;
}
.hero3d-scroll span { width: 20px; height: 32px; border: 1.5px solid rgba(255,255,255,.35); border-radius: 12px; position: relative; }
.hero3d-scroll span::after {
  content: ""; position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px;
  background: #fff; border-radius: 2px; animation: h3dWheel 1.8s var(--ease) infinite;
}
@keyframes h3dWheel { 0% { opacity: 0; transform: translateY(-3px); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px); } }

/* Pre-animation states (only when JS motion is running) */
.motion-ready .hero3d .h3d-line > span { transform: translateY(110%); }
.motion-ready .hero3d-pill,
.motion-ready .hero3d-sub,
.motion-ready .hero3d-cta,
.motion-ready .hero3d-stats { opacity: 0; transform: translateY(18px); }

@media (max-width: 960px) {
  .hero3d { min-height: 0; display: block; }
  .hero3d-wrap { grid-template-columns: 1fr; padding-top: 40px; padding-bottom: 40px; gap: 0; }
  .hero3d-copy { max-width: none; text-align: center; margin: 0 auto; }
  .hero3d-sub { margin-left: auto; margin-right: auto; }
  .hero3d-cta, .hero3d-stats { justify-content: center; }
  .hero3d-stage { height: 62vw; min-height: 320px; max-height: 520px; margin: 8px -16px 0; order: -1; }
  .hero3d-scroll { display: none; }
}
@media (max-width: 680px) {
  .hero3d-stats { gap: 24px; }
  .hero3d-stat b { font-size: 1.7rem; }
  .hero3d-stage { height: 92vw; }
}
@media (prefers-reduced-motion: reduce) {
  .hero3d h1 em, .hero3d-scroll span::after { animation: none; }
}
