/* ============================================================
   FLC — 3D layer: WebGL hero, depth, tilt and glow.
   Loaded after style.css.
   ============================================================ */

/* ---------- Hero with the WebGL scene ---------- */
.hero-3d {
  position: relative; overflow: hidden; isolation: isolate;
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 128px 0 var(--s-900); text-align: left;
  background: radial-gradient(120% 90% at 72% 45%, #1a0f06 0%, #050505 46%, #000 100%);
}
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; opacity: 0; transition: opacity 1200ms var(--ease); }
.hero-ready #hero-canvas { opacity: 1; }
.hero-glow {
  position: absolute; z-index: -3; right: -10%; top: 50%; width: 70vw; height: 70vw; max-width: 1000px; max-height: 1000px;
  transform: translateY(-50%); border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,122,26,0.22), rgba(255,122,26,0.05) 55%, transparent 72%);
  filter: blur(20px); animation: glow-breathe 7s var(--ease) infinite alternate;
}
@keyframes glow-breathe { from { opacity: 0.65; transform: translateY(-50%) scale(0.94); } to { opacity: 1; transform: translateY(-50%) scale(1.06); } }
.hero-3d::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px; z-index: -1;
  background: linear-gradient(to bottom, transparent, #0b0b0b);
}
.hero-3d .hero-inner { position: relative; width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 var(--s-300); }
.hero-3d h1 {
  margin: 0; max-width: 680px;
  font-size: 72px; line-height: 72px; letter-spacing: -0.03em;
}
.hero-3d .lead { margin: var(--s-300) 0 0; max-width: 520px; color: var(--text-dim); }
.hero-3d .hero-buttons, .hero-3d .compliance-badges { justify-content: flex-start; }
.hero-3d .compliance-badges { max-width: 520px; }
.hero-3d .compliance-badges span { background: rgba(24,24,24,0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero-3d .btn-primary { padding: var(--s-100) var(--s-300); font-size: 18px; line-height: 28px; }

.hero-3d.hero-stacked { text-align: center; align-items: flex-end; padding-bottom: var(--s-800); }
.hero-stacked h1, .hero-stacked .lead, .hero-stacked .compliance-badges { margin-left: auto; margin-right: auto; }
.hero-stacked .hero-buttons, .hero-stacked .compliance-badges { justify-content: center; }
.hero-stacked .hero-glow { right: 50%; top: 26%; width: 120vw; height: 120vw; transform: translate(50%, -50%); animation: none; }
.hero-stacked::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 66%; z-index: -1;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.86) 36%, #000 80%);
}

.scroll-hint {
  position: absolute; left: 50%; bottom: var(--s-300); width: 24px; height: 40px; margin-left: -12px;
  border: 1px solid #4A4A4A; border-radius: var(--r-full);
}
.scroll-hint span { position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px; background: var(--orange); border-radius: var(--r-full); animation: scroll-dot 1.8s var(--ease) infinite; }
@keyframes scroll-dot { 0% { transform: translateY(0); opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }

/* ---------- Primary button glow ---------- */
.btn-primary { box-shadow: 0 0 0 1px rgba(255,160,90,0.4) inset, 0 12px 40px -12px rgba(255,122,26,0.7); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(255,190,130,0.6) inset, 0 18px 50px -10px rgba(255,122,26,0.9); }

/* ---------- Cards with depth, tilt and a light that follows the pointer ---------- */
.feature-grid, .clinic-grid, .process-grid, .stat-grid, .impact-grid { perspective: 1400px; }
.feature-card, .clinic-card, .process-step, .stat-item, .impact-item, .demo-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, rgba(255,255,255,0.055), rgba(255,255,255,0.015) 60%);
  border-color: rgba(255,255,255,0.09);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset, 0 30px 60px -30px rgba(0,0,0,0.9);
}
.section-alt .feature-card, .section-alt .clinic-card, .section-alt .process-step,
.section-alt .stat-item, .section-alt .impact-item, .section-alt .demo-panel {
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02) 60%);
}
.feature-card::before, .clinic-card::before, .process-step::before, .stat-item::before, .impact-item::before, .demo-panel::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255,122,26,0.20), transparent 60%);
  transition: opacity 500ms var(--ease);
}
.feature-card:hover::before, .clinic-card:hover::before, .process-step:hover::before,
.stat-item:hover::before, .impact-item:hover::before, .demo-panel:hover::before { opacity: 1; }
.tilting { transition: transform 120ms linear, border-color 300ms var(--ease) !important; border-color: rgba(255,145,66,0.45) !important; }
a.feature-card:hover, a.clinic-card:hover,
.section-alt a.feature-card:hover, .section-alt a.clinic-card:hover { background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02) 60%); }
.feature-card > *, .process-step > *, .stat-item > *, .impact-item > *, .demo-panel > * { position: relative; }
.icon, .feature-card .icon {
  background: linear-gradient(145deg, #3a2413, #1a1a1a); border-color: rgba(255,145,66,0.35);
  box-shadow: 0 10px 24px -8px rgba(255,122,26,0.55), 0 1px 0 rgba(255,255,255,0.12) inset;
}
.step-num { box-shadow: 0 10px 28px -6px rgba(255,122,26,0.8); }
.stat-number, .impact-number {
  background: linear-gradient(180deg, #fff 20%, #ff9a52 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Sections: depth instead of flat bands ---------- */
.section-alt { background: radial-gradient(90% 70% at 50% 0%, #1c1510 0%, #121212 50%, #0b0b0b 100%); }
.tagline-section { background: #000; perspective: 1200px; }
.tagline .w { display: inline-block; transform: translateY(12px) rotateX(50deg); transform-origin: 50% 100%; transition: opacity 500ms var(--ease), transform 700ms var(--ease); }
.tagline .w.on { transform: none; }
.cta-section { position: relative; overflow: hidden; background: radial-gradient(70% 120% at 50% 110%, #3a1c06 0%, #120a04 45%, #000 100%); }

/* Reveal: elements swing up out of the page */
.reveal, .reveal-scale, .reveal-left, .reveal-right {
  transform: perspective(1200px) translateY(40px) rotateX(14deg); transform-origin: 50% 100%;
}
.reveal.in, .reveal-scale.in, .reveal-left.in, .reveal-right.in { transform: perspective(1200px) translateY(0) rotateX(0); }

/* ---------- Sub page heroes: a horizon grid receding into the distance ---------- */
.page-hero { padding-bottom: 160px; }
.page-hero, .notfound { position: relative; overflow: hidden; isolation: isolate; background: radial-gradient(80% 90% at 50% 100%, #2a1505 0%, #0a0705 50%, #000 100%); }
.page-hero::before, .notfound::before {
  content: ""; position: absolute; z-index: -1; left: -50%; right: -50%; bottom: -40px; height: 760px;
  background-image:
    linear-gradient(rgba(255,145,66,0.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,145,66,0.34) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(64deg); transform-origin: 50% 100%;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 96%); mask-image: linear-gradient(to top, #000 10%, transparent 96%);
  animation: grid-run 6s linear infinite;
}
@keyframes grid-run { from { background-position: 0 0, 0 0; } to { background-position: 0 64px, 0 0; } }
.page-hero::after, .notfound::after {
  content: ""; position: absolute; z-index: -1; left: 50%; bottom: 150px; width: 560px; height: 560px; margin-left: -280px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,122,26,0.28), transparent 70%); filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-scale, .reveal-left, .reveal-right { transform: none; }
  .tagline .w { transform: none; }
  .page-hero::before, .notfound::before, .hero-glow, .scroll-hint span { animation: none; }
}
@media (max-width: 960px) {
  .hero-3d h1 { font-size: 48px; line-height: 48px; }
}
@media (max-width: 640px) {
  .hero-3d { padding-top: 96px; }
  .hero-3d h1 { font-size: 30px; line-height: 36px; }
  .hero-3d .hero-inner { padding: 0 var(--s-200); }
  .scroll-hint { display: none; }
}
