/* Premium SaaS homepage — motion, glass nav, glow, particles */

:root {
  --premium-crimson: #8b0000;
  --premium-crimson-glow: rgba(139, 0, 0, 0.25);
  --premium-glass-bg: rgba(255, 255, 255, 0.72);
  --premium-glass-border: rgba(139, 0, 0, 0.08);
}

/* Hero sections stay visible — animations enhance without hiding layout */
body.homepage .hero-content h1,
body.homepage .hero-content p,
body.homepage .hero-ctas .btn,
body.homepage .hero-stats .stat,
body.homepage .hero-media-stack,
body.homepage .hero-sidebar,
body.homepage .hero-sidebar-item,
body.homepage .hero-sidebar-group,
body.homepage .hero-float-card,
body.homepage .scroll-indicator {
  opacity: 1;
  visibility: visible;
}

/* ── Sticky glassmorphism navbar ───────────────────────────────────── */
body.homepage .top-nav {
  position: sticky;
  z-index: 80;
  transition:
    background 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.45s ease,
    backdrop-filter 0.45s ease;
}

body.homepage .top-nav {
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

body.homepage .top-nav.is-scrolled {
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

body.homepage .nav-links {
  position: relative;
}

body.homepage .nav-active-indicator {
  position: absolute;
  bottom: 2px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b0000, #e50914);
  box-shadow: 0 0 12px rgba(139, 0, 0, 0.45);
  pointer-events: none;
  z-index: 0;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    width 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.25s ease;
  opacity: 0;
  will-change: transform, width;
}

body.homepage .nav-links a {
  position: relative;
  z-index: 1;
  transition:
    color 0.28s ease,
    background 0.28s ease,
    border-color 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
}

body.homepage .nav-links a:hover {
  transform: translateY(-2px);
}

body.homepage .nav-links a.active {
  color: #8b0000;
}

/* ── Header auth buttons — white premium style ─────────────────────── */
body.homepage .auth-actions-shell,
body.homepage .auth-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

body.homepage .auth-actions-shell {
  flex-shrink: 1;
  min-width: 0;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(139, 0, 0, 0.1);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.06);
}

body.homepage .auth-btn,
body.homepage .auth-btn.primary {
  background: #ffffff;
  color: #171a20;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 14px;
  box-shadow: none;
  transition:
    background 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.28s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    border-color 0.28s ease;
  will-change: transform;
}

body.homepage .auth-btn:hover,
body.homepage .auth-btn.primary:hover {
  background: #171a20;
  color: #ffffff;
  border-color: #171a20;
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

body.homepage .auth-actions .dark-mode-toggle {
  width: 30px;
  height: 30px;
  font-size: 14px;
}

/* Magnetic button base */
body.homepage .magnetic-btn {
  transform-style: preserve-3d;
  will-change: transform;
}

/* ── Hero ambient layer ────────────────────────────────────────────── */
body.homepage .hero {
  position: relative;
  overflow: hidden !important;
  isolation: isolate;
  contain: paint;
}

body.homepage .hero-inner {
  display: grid !important;
}

/* Remove dark strip between white header and hero */
body.homepage .top-nav + .hero {
  margin-top: 0 !important;
  padding-top: 0;
}

body.homepage .hero-stats,
body.homepage .hero-media-stack {
  animation: none !important;
}

body.homepage .hero-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

body.homepage .hero-gradient-mesh {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(ellipse 80% 70% at 38% 44%, rgba(255, 30, 40, 0.72), transparent 58%),
    radial-gradient(ellipse 60% 55% at 58% 50%, rgba(255, 0, 20, 0.48), transparent 55%),
    radial-gradient(ellipse 35% 50% at 92% 46%, rgba(0, 0, 0, 0.22), transparent 58%),
    radial-gradient(ellipse 55% 42% at 48% 100%, rgba(220, 0, 24, 0.32), transparent 48%);
  animation: premiumMeshDrift 18s ease-in-out infinite alternate;
  will-change: transform;
}

body.homepage .hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  will-change: transform;
}

body.homepage .hero-glow--one {
  width: 580px;
  height: 580px;
  top: 6%;
  left: 4%;
  background: rgba(255, 30, 40, 0.62);
  animation: premiumGlowFloat 12s ease-in-out infinite;
}

body.homepage .hero-glow--two {
  width: 240px;
  height: 240px;
  bottom: 20%;
  right: 6%;
  background: rgba(120, 0, 12, 0.28);
  animation: premiumGlowFloat 14s ease-in-out infinite reverse;
}

body.homepage .hero-particles {
  position: absolute;
  inset: 0;
}

body.homepage .hero-particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 220, 228, 0.55);
  box-shadow: 0 0 8px rgba(229, 9, 20, 0.35);
  will-change: transform, opacity;
  pointer-events: none;
}

/* ── Video / visual container premium effects ──────────────────────── */
body.homepage .hero-visual {
  position: relative;
  transform: translate3d(0, 0, 0);
  will-change: transform, box-shadow;
}

body.homepage .hero-visual-shine {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    125deg,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 38%,
    transparent 62%,
    rgba(255, 255, 255, 0.08) 100%
  );
  z-index: 3;
  pointer-events: none;
  opacity: 0.7;
}

body.homepage .hero-visual-reflection {
  position: absolute;
  width: 120px;
  height: 120px;
  top: 12%;
  right: 10%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 68%);
  filter: blur(2px);
  z-index: 2;
  pointer-events: none;
  animation: premiumReflectionFloat 6s ease-in-out infinite;
}

body.homepage .hero-visual::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), rgba(139, 0, 0, 0.2), rgba(255, 255, 255, 0.1));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  z-index: 4;
  pointer-events: none;
}

body.homepage .hero-visual.is-glow-active {
  box-shadow:
    0 36px 80px rgba(4, 6, 10, 0.72),
    0 0 60px rgba(139, 0, 0, 0.35),
    0 12px 32px rgba(160, 0, 20, 0.28);
}

/* ── Statistics cards ──────────────────────────────────────────────── */
body.homepage .hero-stats .stat {
  border: 1.5px solid rgba(255, 255, 255, 0.82);
  border-radius: 18px;
  padding: 18px 12px 14px;
  background: rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease;
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

body.homepage .hero-stats .stat:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(139, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.95);
}

body.homepage .hero-stats strong {
  font-variant-numeric: tabular-nums;
}

/* ── Hero CTAs magnetic + glow ─────────────────────────────────────── */
body.homepage .hero-ctas .btn {
  will-change: transform;
  transition:
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.3s ease;
}

body.homepage .hero-ctas .btn:hover {
  box-shadow: 0 16px 36px rgba(139, 0, 0, 0.32);
}

/* ── Scroll reveal premium ─────────────────────────────────────────── */
body.homepage .reveal-on-scroll {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  transition-delay: var(--reveal-delay, 0ms);
  will-change: transform, opacity;
}

body.homepage .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* ── Full-width white band below hero (light mode only) ───────────── */
body.homepage:not(.dark-mode) {
  background: #ffffff !important;
  background-image: none !important;
}

body.homepage:not(.dark-mode) main#modules,
body.homepage:not(.dark-mode) main#modules [class*="-section"] {
  background: #ffffff !important;
}

body.homepage:not(.dark-mode) main#modules .section-head h2 {
  color: #171a20 !important;
}

body.homepage:not(.dark-mode) main#modules .section-head p {
  color: #5e636d !important;
}

body.homepage:not(.dark-mode) main#modules .card {
  background: #ffffff !important;
  border-color: #e6e7eb !important;
}

body.homepage:not(.dark-mode) main#modules .card h3 {
  color: #171a20 !important;
}

body.homepage:not(.dark-mode) main#modules .card p {
  color: #5e636d !important;
}

body.homepage .floating-actions {
  left: 16px;
  border-radius: 18px !important;
}

body.homepage:not(.dark-mode) .floating-actions {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08) !important;
}

body.homepage:not(.dark-mode) .floating-actions a,
body.homepage:not(.dark-mode) .floating-actions button {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #171a20 !important;
}

html:has(body.homepage:not(.dark-mode)) {
  background: #ffffff;
}

body.homepage main#modules > section {
  max-width: none !important;
  width: 100% !important;
  opacity: 1 !important;
}

body.homepage:not(.dark-mode) .reveal-on-scroll,
body.homepage:not(.dark-mode) #modules > section.section-head {
  background: #ffffff !important;
}

body.homepage #modules .reveal-on-scroll,
body.homepage #modules > section {
  opacity: 1 !important;
  transform: none !important;
}

body.homepage:not(.dark-mode) .site-footer {
  background: #ffffff !important;
  border-top: 1px solid #e6e7eb !important;
}

body.homepage:not(.dark-mode) .site-footer-col h3,
body.homepage:not(.dark-mode) .site-footer-col a,
body.homepage:not(.dark-mode) .site-footer-brand p,
body.homepage:not(.dark-mode) .site-footer-col p,
body.homepage:not(.dark-mode) .site-footer-bottom-inner,
body.homepage:not(.dark-mode) .site-footer .site-footer-bottom-inner span {
  color: #171a20 !important;
}

body.homepage:not(.dark-mode) .site-footer-brand p,
body.homepage:not(.dark-mode) .site-footer-col p,
body.homepage:not(.dark-mode) .site-footer-bottom-inner span {
  color: #5e636d !important;
}

/* ── Section entrance glow line ────────────────────────────────────── */
body.homepage #modules > section.section-head h2 {
  position: relative;
}

body.homepage #modules > section.section-head h2::after {
  content: '';
  display: block;
  width: 0;
  height: 3px;
  margin: 10px auto 0;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--premium-crimson), transparent);
  transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1);
}

body.homepage #modules > section.section-head.is-visible h2::after {
  width: 80px;
}

/* ── Keyframes ─────────────────────────────────────────────────────── */
@keyframes premiumMeshDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(2%, -3%, 0) scale(1.04); }
}

@keyframes premiumGlowFloat {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(18px, -24px, 0); }
}

@keyframes premiumReflectionFloat {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.6; }
  50% { transform: translate3d(-12px, 16px, 0) scale(1.15); opacity: 0.9; }
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  body.homepage .hero-gradient-mesh,
  body.homepage .hero-glow,
  body.homepage .hero-visual-reflection,
  body.homepage .hero-particle {
    animation: none !important;
  }

  body.homepage .nav-active-indicator,
  body.homepage .nav-links a,
  body.homepage .auth-btn,
  body.homepage .hero-stats .stat,
  body.homepage .reveal-on-scroll {
    transition: none !important;
  }

  body.homepage .reveal-on-scroll {
    opacity: 1;
    transform: none;
  }
}
