/* ============================================================
   VITALITY — ELEVATED HOMEPAGE LAYER
   Loaded ONLY on index.html (homepage).
   Requires design-tokens.css + components.css loaded first.
   Contains: hero, marquee, features bento, about, performance, final CTA.
   All cross-page styles live in components.css.
   ============================================================ */

/* ---- Homepage: transparent body, html provides the richer aurora ---- */
body.index-page {
  background: transparent;
  padding-top: 0;
}
body.index-page::after { opacity: 0.05; }

/* Make the shader background slightly dimmer so content reads */
#vitality-shader-bg { opacity: 0.55 !important; }

/* Prevent any script from messing with the header wrapper */
header.main-hero .navbar,
header.main-hero .navbar.navbar-sticky,
header.main-hero .navbar.is-scrolled {
  transform: none !important;
  animation: none !important;
}

/* ============================================================
   HOMEPAGE HERO
   ============================================================ */
body.index-page .hero-section.main-hero {
  height: auto;
  min-height: auto;
  padding: clamp(106px, 14vh, 160px) 0 clamp(48px, 6vh, 84px);
  transform: none !important;
  position: relative;
}
.hero-section .hero-content { height: auto; }

/* Aurora orbs behind the hero */
.hero-section::before,
.hero-section::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  animation: el-float 14s ease-in-out infinite;
}
.hero-section::before {
  width: 540px; height: 540px;
  top: 6%; right: -6%;
  background: radial-gradient(circle, rgba(145,71,255,0.55), transparent 70%);
}
.hero-section::after {
  width: 460px; height: 460px;
  bottom: 4%; left: -8%;
  background: radial-gradient(circle, rgba(56,189,248,0.28), transparent 70%);
  animation-delay: -7s;
}

@keyframes el-float {
  0%, 100% { transform: translate3d(0,0,0) scale(1); }
  50%       { transform: translate3d(0,-32px,0) scale(1.06); }
}

.hero-text-content { max-width: 920px; }

.hero-badge {
  position: relative;
  display: inline-flex;
  align-items: center; gap: 8px;
  overflow: hidden;
  background: rgba(145,71,255,0.10);
  border: 1px solid rgba(145,71,255,0.30);
  backdrop-filter: blur(8px);
  padding: 6px 18px;
  border-radius: 100px;
  font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--el-violet-bright);
  margin-bottom: var(--space-lg);
}
.hero-badge::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--el-violet-bright);
  box-shadow: 0 0 10px var(--el-violet-bright);
  animation: el-pulse 2.4s ease-in-out infinite;
}
.hero-badge::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.22) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: el-shine 4.5s ease-in-out infinite;
}
@keyframes el-pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }
@keyframes el-shine { 0%{transform:translateX(-120%)} 60%,100%{transform:translateX(120%)} }

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  text-shadow: 0 2px 40px rgba(0,0,0,0.5);
  display: block;
  color: #fff;
  opacity: 1 !important;
  transform: none !important;
}

.hero-words-wrapper {
  height: clamp(2.7rem, 7.1vw, 5.7rem);
  overflow: hidden;
  margin-bottom: var(--space-lg);
}
.hero-words-track {
  display: flex; flex-direction: column;
  transition: transform 0.6s cubic-bezier(0.16,1,0.3,1);
}
.hero-word {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.02;
  background: linear-gradient(135deg, #7534b3 0%, #9147ff 40%, #b57bff 70%, #c084fc 100%);
  background-clip: text; -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  filter: drop-shadow(0 8px 30px rgba(145,71,255,0.35));
  flex-shrink: 0;
  animation: gradientShift 3s ease infinite;
}

.hero-description {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem) !important;
  color: rgba(255,255,255,0.72) !important;
  line-height: 1.6 !important;
  max-width: 40rem !important;
  margin-bottom: var(--space-2xl);
  margin-inline: auto;
}

.hero-cta-container, .hero-cta {
  display: flex; gap: var(--space-md);
  justify-content: center; flex-wrap: wrap;
}

/* Primary hero CTA: gradient (overrides the base .cta-button from components.css) */
.hero-cta .cta-button:not(.secondary),
.final-cta-buttons .cta-button:not(.secondary) {
  background: linear-gradient(135deg, var(--el-violet-deep), var(--el-violet)) !important;
  border-color: transparent !important;
  box-shadow: 0 10px 30px -10px rgba(145,71,255,0.60), inset 0 1px 0 rgba(255,255,255,0.25) !important;
}
.hero-cta .cta-button:not(.secondary):hover,
.final-cta-buttons .cta-button:not(.secondary):hover {
  filter: brightness(1.08);
  box-shadow: 0 14px 40px -8px rgba(145,71,255,0.75), inset 0 1px 0 rgba(255,255,255,0.30) !important;
}

/* Hero trust strip */
.hero-trust {
  display: flex; flex-wrap: wrap;
  justify-content: center; align-items: stretch;
  gap: 0;
  margin: 44px auto 0; max-width: 720px;
  z-index: 2; position: relative;
  background: var(--el-surface);
  border: 1px solid var(--el-hairline);
  border-radius: 18px; padding: 22px 8px;
  box-shadow: var(--el-shadow-card);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.hero-trust .trust-item {
  flex: 1 1 0; min-width: 120px;
  padding: 0 clamp(8px,2vw,22px);
  display: flex; flex-direction: column; align-items: center; line-height: 1.1;
}
.hero-trust .trust-num {
  font-family: var(--font-heading);
  font-size: clamp(1.4rem,2.4vw,2rem); font-weight: 700;
  background: linear-gradient(120deg, #fff, var(--el-violet-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-trust .trust-label {
  font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted); margin-top: 4px;
}
.hero-trust .trust-divider { width: 1px; height: 34px; background: var(--el-hairline-strong); }
@media (max-width: 560px) { .hero-trust .trust-divider { display: none; } }

/* ============================================================
   "WORKS WITH" MARQUEE
   ============================================================ */
.works-with {
  position: relative; z-index: 2;
  padding: 28px 0 8px;
  border-top: 1px solid var(--el-hairline);
  border-bottom: 1px solid var(--el-hairline);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent);
}
.works-with .ww-label {
  text-align: center; font-size: 0.75rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 18px;
}
.marquee {
  position: relative; overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee-track {
  display: flex; width: max-content;
  gap: 48px; padding: 6px 24px;
  animation: el-marquee 38s linear infinite;
}
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item {
  font-family: var(--font-mono); font-size: 0.95rem;
  font-weight: 500; letter-spacing: 0.02em;
  color: rgba(255,255,255,0.55); white-space: nowrap;
  transition: color 0.25s var(--el-ease);
}
.marquee-item:hover { color: #fff; }
@keyframes el-marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ============================================================
   FEATURES — BENTO GRID
   ============================================================ */
.feature-section { position: relative; z-index: 2; padding: var(--space-3xl) 0; background: transparent; }

.feature-grid.el-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px; align-items: stretch;
}
.feature-grid.el-features .feature-item {
  position: relative; text-align: left;
  display: flex; flex-direction: column;
  background: var(--el-surface) !important;
  border: 1px solid var(--el-hairline) !important;
  border-radius: var(--el-card-radius) !important;
  padding: 30px 28px !important;
  overflow: hidden;
  box-shadow: var(--el-shadow-card);
  transition: transform 0.4s var(--el-ease), border-color 0.4s var(--el-ease), box-shadow 0.4s var(--el-ease);
}
.feature-grid.el-features .feature-item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  opacity: 0; transition: opacity 0.4s var(--el-ease);
  background: radial-gradient(300px circle at var(--mx,50%) var(--my,0%), rgba(145,71,255,0.16), transparent 60%);
  z-index: 0;
}
.feature-grid.el-features .feature-item:hover::before { opacity: 1; }
.feature-grid.el-features .feature-item:hover {
  transform: translateY(-4px);
  border-color: rgba(145,71,255,0.4) !important;
  box-shadow: 0 30px 70px -30px rgba(0,0,0,0.9), var(--el-glow-violet);
}
.feature-grid.el-features .feature-item > * { position: relative; z-index: 1; }
.feature-grid.el-features .feature-item h3 {
  font-family: var(--font-heading); font-size: 1.3rem;
  letter-spacing: -0.01em; margin: 0 0 10px;
}
.feature-grid.el-features .feature-item p { color: var(--text-dim); line-height: 1.6; margin: 0; }
.feature-grid.el-features .feature-icon {
  width: 48px; height: 48px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 13px; margin: 0 0 20px;
  color: var(--el-violet-bright);
  background: linear-gradient(150deg, rgba(145,71,255,0.22), rgba(145,71,255,0.06));
  border: 1px solid rgba(145,71,255,0.28);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.12);
  transition: color 0.3s var(--el-ease), background 0.3s var(--el-ease);
}
.feature-grid.el-features .feature-item:hover .feature-icon {
  color: #fff;
  background: linear-gradient(150deg, var(--el-violet), var(--el-violet-deep));
}
.feature-grid.el-features .feature-icon svg { width: 24px; height: 24px; }
@media (max-width: 980px) { .feature-grid.el-features { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 620px) { .feature-grid.el-features { grid-template-columns: 1fr; } }

/* ============================================================
   ABOUT SECTION
   ============================================================ */
.about-section { position: relative; z-index: 2; padding: var(--space-3xl) 0; }
.about-content {
  display: grid; grid-template-columns: repeat(2,1fr);
  align-items: start; gap: 18px;
}
.about-content .about-column {
  background: var(--el-surface);
  border: 1px solid var(--el-hairline);
  border-radius: var(--el-card-radius);
  padding: 28px 30px;
  box-shadow: var(--el-shadow-card);
  transition: transform 0.4s var(--el-ease), border-color 0.4s var(--el-ease);
}
.about-content .about-column:hover {
  transform: translateY(-3px);
  border-color: rgba(145,71,255,0.35);
}
.about-content .about-column h3 {
  font-family: var(--font-heading); font-size: 1.35rem;
  letter-spacing: -0.01em; margin-bottom: 12px;
}
.about-content .about-column p,
.about-content .about-column li { color: var(--text-dim); line-height: 1.65; }
.about-content .feature-link,
.about-content .cta-button { margin-top: 16px; }
@media (max-width: 820px) { .about-content { grid-template-columns: 1fr; } }

/* ============================================================
   PERFORMANCE SECTION
   ============================================================ */
.performance-section { position: relative; z-index: 2; }
.performance-content { align-items: center; gap: 48px; }
.performance-stats {
  background: var(--el-surface-strong);
  border: 1px solid var(--el-hairline);
  border-radius: 24px; padding: 34px;
  box-shadow: var(--el-shadow-card);
}
.boost-percentage {
  font-family: var(--font-heading);
  background: linear-gradient(120deg, var(--el-violet), var(--el-violet-bright));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.fps-bar {
  background: rgba(255,255,255,0.05);
  border-radius: 12px; overflow: hidden; margin-bottom: 12px;
}
.fps-bar .with-vitality,
.fps-bar .without-vitality {
  display: flex; align-items: center; padding: 12px 16px;
  font-family: var(--font-mono); font-size: 0.82rem;
  letter-spacing: 0.04em; color: #fff; border-radius: 12px;
  width: 0; white-space: nowrap;
  transition: width 1.4s var(--el-ease);
}
.fps-bar .with-vitality {
  background: linear-gradient(90deg, var(--el-violet-deep), var(--el-violet));
  box-shadow: var(--el-glow-violet);
}
.fps-bar .without-vitality { background: rgba(255,255,255,0.12); color: rgba(255,255,255,0.7); }
.methodology { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--el-hairline); }
.methodology h4 { font-family: var(--font-heading); margin-bottom: 10px; }
.methodology ul { color: var(--text-dim); }

/* ============================================================
   FINAL CTA SECTION
   ============================================================ */
.final-cta-section {
  position: relative; z-index: 2;
  padding: calc(var(--space-3xl) * 1.5) 0;
}
.final-cta-content {
  position: relative; overflow: hidden;
  text-align: center;
  padding: clamp(48px,8vw,90px) clamp(24px,6vw,80px);
  border-radius: 32px;
  border: 1px solid rgba(145,71,255,0.28);
  background:
    radial-gradient(700px 400px at 50% -20%, rgba(145,71,255,0.30), transparent 65%),
    linear-gradient(180deg, rgba(20,16,32,0.8), rgba(12,10,18,0.9));
  box-shadow: 0 40px 90px -40px rgba(145,71,255,0.5);
}
.final-cta-content::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  padding: 1px;
  background: linear-gradient(120deg, rgba(145,71,255,0.6), transparent 40%, transparent 60%, rgba(56,189,248,0.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
}
.final-cta-content h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 4vw, 3rem);
  letter-spacing: -0.02em;
  color: var(--text-light);
}
.final-cta-content > p { color: var(--text-dim); font-size: 1.125rem; margin-bottom: var(--space-2xl); }
.final-cta-buttons {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 24px;
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  #vitality-shader-bg, .webgl-background { display: none !important; }
  .hero-section::before, .hero-section::after,
  .hero-badge::after, .hero-badge::before,
  .marquee-track, .hero-word { animation: none !important; }
  .marquee-track { transform: none; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ============================================================
   HOMEPAGE MOBILE (index.html only)
   ============================================================ */
@media (max-width: 640px) {
  body.index-page .hero-section.main-hero { padding: 96px 0 48px; }
  .hero-title, .hero-word { font-size: clamp(2.3rem, 11vw, 3.2rem); }
  .hero-description { font-size: 1rem !important; padding: 0 6px; }
  .hero-cta-container, .hero-cta { gap: 10px; }
  .hero-cta .cta-button,
  .final-cta-buttons .cta-button { width: 100%; max-width: 320px; }
  .hero-trust { padding: 18px 10px; max-width: 100%; }
  .hero-trust .trust-item { flex: 0 0 50%; min-width: 0; padding: 10px 6px; }
  .hero-trust .trust-num { font-size: 1.5rem; }
  .section-title { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .feature-grid.el-features { grid-template-columns: 1fr !important; }
  .about-content { grid-template-columns: 1fr !important; }
  .final-cta-content { padding: 40px 22px; }
}
