/* ==========================================================================
   MOTION GRACE — DARK GLASSMORPHISM DESIGN SYSTEM (css/style.css)
   ========================================================================== */

:root {
  /* Core Palette (Overridable via Google Sheets CMS) */
  --bg-obsidian: #05070e;
  --bg-elevated: #0b0f1d;
  --accent-cobalt: #4f6bff;
  --accent-indigo: #818cf8;
  --accent-gold: #d4af37;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;

  /* Glass Surfaces */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-bright: rgba(79, 107, 255, 0.45);
  --radius-card: 20px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-obsidian);
  color: var(--text-main);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-obsidian) !important;
  color: var(--text-main) !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, h4, .font-display {
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: -0.02em;
}

/* --- AMBIENT LIGHTING & BACKGROUNDS --- */
.ambient-hero-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 650px;
  background: radial-gradient(circle, rgba(79, 107, 255, 0.22) 0%, rgba(129, 140, 248, 0.06) 45%, rgba(5, 7, 14, 0) 72%);
  pointer-events: none;
  z-index: 0;
}

.bg-grid-pattern {
  background-size: 48px 48px;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
}

/* --- FLOATING GLASS NAVBAR --- */
.glass-nav {
  background: rgba(5, 7, 14, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.45);
}

/* --- GLASS CARDS & VIBRANT BENTO CARDS --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, background 0.35s ease, box-shadow 0.35s ease;
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-bright);
  box-shadow: 0 16px 42px -12px rgba(79, 107, 255, 0.28);
}

/* Interactive 3D Lift & Mouse-Tracked Glow (Desktop Cards) */
.gsap-hub-card,
.gsap-bento-card,
.tpl-card {
  position: relative;
  overflow: hidden;
  will-change: transform;
}

.gsap-hub-card::before,
.gsap-bento-card.glass-card::before,
.tpl-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(
    380px circle at var(--mx, 50%) var(--my, 50%),
    rgba(79, 107, 255, 0.22),
    rgba(129, 140, 248, 0.08) 45%,
    transparent 72%
  );
  z-index: 0;
}

.gsap-hub-card > :not(.pointer-events-none),
.gsap-bento-card.glass-card > :not(.pointer-events-none),
.tpl-card > :not(.pointer-events-none) {
  position: relative;
  z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
  .gsap-hub-card:hover,
  .gsap-bento-card:hover,
  .tpl-card:hover {
    transform: perspective(900px) translateY(-6px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  }

  .gsap-hub-card:hover::before,
  .gsap-bento-card.glass-card:hover::before,
  .tpl-card:hover::before {
    opacity: 1;
  }
}

/* Reference Video Vibrant Cobalt-Indigo Highlight Card */
.vibrant-card {
  background: linear-gradient(135deg, #3b52f5 0%, #6d5dfc 55%, #8b5cf6 100%);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius-card);
  box-shadow: 0 20px 50px -12px rgba(79, 107, 255, 0.45);
  position: relative;
  overflow: hidden;
}

.vibrant-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.25), transparent 60%);
  pointer-events: none;
}

/* --- TYPOGRAPHY & BUTTONS --- */
.text-gradient {
  color: #818cf8;
  background: linear-gradient(90deg, #ffffff 0%, #818cf8 50%, #4f6bff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-glow {
  background: linear-gradient(135deg, var(--accent-cobalt), var(--accent-indigo));
  color: #ffffff;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 22px rgba(79, 107, 255, 0.38);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-glow:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(79, 107, 255, 0.6);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
}

/* --- DIGITAL TWIN CORE HUB & CIRCUIT LINES (Reference Section 2) --- */
.core-chip {
  width: 140px;
  height: 140px;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 50%, rgba(79, 107, 255, 0.38), rgba(5, 7, 14, 0.96) 72%);
  border: 1.5px solid rgba(129, 140, 248, 0.65);
  box-shadow:
    0 0 55px rgba(79, 107, 255, 0.5),
    0 0 24px rgba(129, 140, 248, 0.3),
    inset 0 0 28px rgba(129, 140, 248, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
}

.core-chip::before {
  content: "";
  position: absolute;
  inset: -28px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 107, 255, 0.28) 0%, rgba(129, 140, 248, 0.1) 45%, transparent 72%);
  filter: blur(14px);
  pointer-events: none;
  z-index: -1;
}

.circuit-line {
  stroke: rgba(129, 140, 248, 0.26);
  stroke-width: 1.5;
  fill: none;
}

.circuit-pulse {
  stroke: var(--accent-indigo);
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
  stroke-dasharray: 18 110;
  animation: pulseFlow 2.6s linear infinite;
}

.circuit-pulse-diag {
  stroke: var(--accent-cobalt);
  animation-delay: -1.3s;
}

.circuit-dot {
  filter: drop-shadow(0 0 6px rgba(129, 140, 248, 0.95));
}

@keyframes pulseFlow {
  from { stroke-dashoffset: 18; }
  to { stroke-dashoffset: -110; }
}

/* --- EXPANDABLE CAPABILITY DRAWERS --- */
.drawer-content {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, margin-top 0.3s ease;
}

.glass-card.open .drawer-content,
.accordion-item.open .drawer-content {
  max-height: 900px;
  opacity: 1;
  margin-top: 16px;
}

.accordion-item.open .chevron-icon {
  transform: rotate(180deg);
}

/* --- 5-CARD TILTED FOUNDATION STACK (Dynamic Hover Color Fill) --- */
.foundation-card {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease;
}

.foundation-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #3b52f5 0%, #6d5dfc 55%, #8b5cf6 100%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 0;
}

.foundation-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 60%);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
  z-index: 1;
}

.foundation-card > * {
  position: relative;
  z-index: 2;
}

.foundation-card:hover {
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 22px 52px -12px rgba(79, 107, 255, 0.55);
  transform: translateY(-10px) scale(1.03);
  z-index: 10;
}

.foundation-card:hover::before,
.foundation-card:hover::after {
  opacity: 1;
}

.foundation-card:hover .foundation-icon {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

.foundation-card:hover p {
  color: rgba(238, 242, 255, 0.94);
}

.foundation-card:hover .foundation-tag {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

@media (min-width: 1024px) {
  .tilt-left-far   { transform: rotate(-7deg) translateY(14px); }
  .tilt-left-near  { transform: rotate(-3.5deg) translateY(4px); }
  .tilt-center     { transform: rotate(0deg) translateY(-6px); z-index: 5; }
  .tilt-right-near { transform: rotate(3.5deg) translateY(4px); }
  .tilt-right-far  { transform: rotate(7deg) translateY(14px); }

  .foundation-card:hover {
    transform: rotate(0deg) translateY(-12px) scale(1.04) !important;
    z-index: 10;
  }
}

/* --- VOLUMETRIC SPOTLIGHT BEAM FOOTER (Reference Section 5) --- */
.spotlight-section {
  position: relative;
  overflow: hidden;
}

.volumetric-beam {
  position: absolute;
  top: -120px;
  left: 50%;
  transform: translateX(-50%);
  width: 680px;
  height: 120%;
  background: conic-gradient(
    from 180deg at 50% 0%,
    transparent 41%,
    rgba(79, 107, 255, 0.16) 47%,
    rgba(255, 255, 255, 0.32) 50%,
    rgba(129, 140, 248, 0.16) 53%,
    transparent 59%
  );
  filter: blur(28px);
  pointer-events: none;
  z-index: 0;
}

.beam-floor-glow {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 460px;
  height: 90px;
  background: radial-gradient(ellipse, rgba(129, 140, 248, 0.45) 0%, rgba(5, 7, 14, 0) 70%);
  filter: blur(18px);
  pointer-events: none;
  z-index: 0;
}

/* --- FLOATING AI STRATEGIST WIDGET --- */
#ai-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(11, 15, 29, 0.9);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--accent-cobalt);
  box-shadow: 0 10px 30px rgba(79, 107, 255, 0.4);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

#ai-fab:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 14px 36px rgba(79, 107, 255, 0.65);
}

#ai-fab img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

#ai-window {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 380px;
  height: 580px;
  max-height: 78vh;
  max-width: calc(100vw - 32px);
  background: var(--bg-elevated);
  border: 1px solid rgba(129, 140, 248, 0.35);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#ai-window.active {
  display: flex;
}

/* --- FAQ ACCORDION OPEN STATE --- */
.accordion-item.open .accordion-body {
  display: block;
}

.accordion-item.open .accordion-icon {
  transform: rotate(45deg);
  color: #ffffff;
}