/* ==========================================================================
   CLASSTRACK PRO - MASTER DESIGN SYSTEM & CSS ENGINE
   Version: 2.0 | Aesthetic: Dark Mode SaaS / Apple / Vercel
   ========================================================================== */

/* --- 1. CSS VARIABLES (THE DESIGN TOKENS) --- */
:root {
  /* Color Palette */
  --bg-dark: #030305;
  --bg-surface: #0a0a0f;
  --bg-glass: rgba(15, 15, 20, 0.4);
  --bg-glass-heavy: rgba(20, 20, 25, 0.7);
  
  --brand-primary: #6366f1;
  --brand-secondary: #a855f7;
  --brand-accent: #ec4899;
  
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #52525b;
  
  --border-light: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;

  /* Typography */
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-heading: 'Space Grotesk', var(--font-ui);
  
  /* Spacing & Layout */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 100px;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  
  /* Z-Index Layers */
  --z-back: -10;
  --z-normal: 1;
  --z-glass: 100;
  --z-modal: 1000;
}

/* --- 2. GLOBAL RESET & BASE --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: var(--font-ui);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; /* Prevent horizontal scroll from 3D elements */
  min-height: 100vh;
}

/* Custom Scrollbar for Premium Feel */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: #27272a; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3f3f46; }

/* --- 3. AMBIENT BACKGROUND SYSTEM --- */
.ambient-universe {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  z-index: var(--z-back);
  overflow: hidden;
  background: radial-gradient(circle at 50% 0%, #11111a 0%, var(--bg-dark) 70%);
}

.glow-sphere {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: floatOrb 20s infinite alternate ease-in-out;
}

.sphere-primary { width: 600px; height: 600px; background: var(--brand-primary); top: -200px; left: -100px; }
.sphere-secondary { width: 500px; height: 500px; background: var(--brand-secondary); bottom: -100px; right: -100px; animation-delay: -5s; }
.sphere-accent { width: 400px; height: 400px; background: var(--brand-accent); top: 40%; left: 50%; animation-delay: -10s; opacity: 0.2; }

.tech-grid-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-image: linear-gradient(var(--border-light) 1px, transparent 1px), linear-gradient(90deg, var(--border-light) 1px, transparent 1px);
  background-size: 50px 50px;
  opacity: 0.15;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 20%, transparent 80%);
}

/* --- 4. GLASS NAVIGATION BAR --- */
.glass-navbar {
  position: fixed;
  top: 0; width: 100%;
  background: rgba(5, 5, 8, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-light);
  z-index: var(--z-glass);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand-identity {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}

.badge-pro {
  background: rgba(236, 72, 153, 0.15);
  color: var(--brand-accent);
  border: 1px solid rgba(236, 72, 153, 0.3);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.nav-links { display: flex; gap: 32px; }
.nav-item { color: var(--text-secondary); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color var(--transition-fast); }
.nav-item:hover { color: var(--text-primary); }

.nav-actions { display: flex; gap: 16px; align-items: center; }

/* Buttons */
button { font-family: var(--font-ui); cursor: pointer; outline: none; }
.btn-ghost { background: transparent; border: none; color: var(--text-primary); font-weight: 500; font-size: 0.95rem; transition: var(--transition-fast); }
.btn-ghost:hover { color: var(--brand-primary); }

.btn-primary-glow {
  background: var(--text-primary);
  color: var(--bg-dark);
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  transition: var(--transition-smooth);
}
.btn-primary-glow:hover { transform: translateY(-2px); box-shadow: 0 5px 25px rgba(255, 255, 255, 0.4); }

/* --- 5. MAIN HERO LAYOUT (SPLIT SCREEN) --- */
.hero-master-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 140px 24px 80px 24px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
  align-items: center;
  min-height: 90vh;
}

/* Left Column Styling */
.pill-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

.live-dot { width: 8px; height: 8px; background: var(--success); border-radius: 50%; box-shadow: 0 0 10px var(--success); animation: pulseDot 2s infinite; }

.hero-heading {
  font-family: var(--font-heading);
  font-size: 4.5rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 24px;
}

.gradient-text-animated {
  background: linear-gradient(to right, var(--brand-primary), var(--brand-secondary), var(--brand-accent), var(--brand-primary));
  background-size: 200% auto;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: shineGradient 5s linear infinite;
}

.hero-subtext {
  font-size: 1.25rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 48px;
  max-width: 520px;
}

.hero-stats {
  display: flex;
  align-items: center;
  gap: 32px;
  background: var(--bg-glass);
  padding: 24px 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  width: fit-content;
}

.stat-block { display: flex; flex-direction: column; gap: 4px; }
.stat-number { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 700; color: var(--text-primary); }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.divider-vertical { width: 1px; height: 40px; background: var(--border-light); }

/* --- 6. 3D INTERACTIVE CARD (RIGHT COLUMN) --- */
#tiltWrapper { perspective: 1500px; display: flex; justify-content: flex-end; }

.premium-glass-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out; /* JavaScript controls this */
}

.card-top-accent {
  position: absolute; top: 0; left: 0; width: 100%; height: 4px;
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-secondary));
}

.card-inner-padding { padding: 48px 40px; text-align: center; }

.icon-glow-box {
  width: 64px; height: 64px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  display: flex; justify-content: center; align-items: center;
  margin: 0 auto 24px auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transform: translateZ(40px); /* 3D pop */
}

.card-title { font-family: var(--font-heading); font-size: 1.8rem; font-weight: 600; margin-bottom: 12px; transform: translateZ(30px); }
.card-description { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 40px; line-height: 1.6; transform: translateZ(20px); }

/* Ultimate Google Auth Button */
.button-showcase { position: relative; transform: translateZ(25px); margin-bottom: 24px; }

.btn-bg-glow {
  position: absolute; top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(45deg, var(--brand-primary), var(--brand-secondary), var(--brand-primary));
  background-size: 400%;
  border-radius: calc(var(--radius-md) + 2px);
  filter: blur(10px);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  animation: shineGradient 10s linear infinite;
  z-index: -1;
}

.google-oauth-btn {
  position: relative; width: 100%;
  background: #ffffff; color: #000000;
  border: none; border-radius: var(--radius-md);
  padding: 16px;
  font-size: 1.05rem; font-weight: 600;
  cursor: pointer;
  display: flex; justify-content: center; align-items: center;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.google-oauth-btn:hover .btn-bg-glow { opacity: 1; }
.google-oauth-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 25px rgba(255,255,255,0.2); }
.google-oauth-btn:active { transform: translateY(1px) scale(0.98); }

.btn-content-wrapper { display: flex; align-items: center; gap: 12px; }
.google-svg-icon { width: 22px; height: 22px; }

.encryption-notice {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--text-muted); font-size: 0.8rem; font-weight: 500;
  transform: translateZ(10px);
}

/* --- 7. BENTO GRID FEATURES SECTION --- */
.features-section {
  max-width: 1200px; margin: 0 auto; padding: 100px 24px;
}

.section-header { text-align: center; margin-bottom: 60px; }
.section-header h2 { font-family: var(--font-heading); font-size: 3rem; margin-bottom: 16px; }
.section-header p { color: var(--text-secondary); font-size: 1.1rem; }

.bento-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
}

.bento-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-light);
  padding: 32px;
  border-radius: var(--radius-lg);
  transition: var(--transition-smooth);
}
.bento-card:hover { background: var(--bg-glass-heavy); border-color: var(--border-focus); transform: translateY(-5px); }

.bento-icon { font-size: 2rem; margin-bottom: 20px; background: rgba(255,255,255,0.05); width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; border-radius: 14px; }
.bento-card h3 { font-size: 1.3rem; margin-bottom: 12px; }
.bento-card p { color: var(--text-secondary); line-height: 1.6; font-size: 0.95rem; }

/* --- 8. UTILITIES & ANIMATIONS --- */
.spinner-loader {
  width: 20px; height: 20px;
  border: 3px solid rgba(0,0,0,0.2);
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes floatOrb { 0% { transform: translate(0,0) scale(1); } 100% { transform: translate(40px, -40px) scale(1.1); } }
@keyframes pulseDot { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); } 70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }
@keyframes shineGradient { 0% { background-position: 0% 50%; } 100% { background-position: 200% 50%; } }

/* Entry Animations */
.fade-in-down { animation: fadeDown 0.8s ease forwards; opacity: 0; }
.slide-in-left { animation: slideLeft 1s cubic-bezier(0.23, 1, 0.32, 1) forwards; opacity: 0; }
.slide-in-right { animation: slideRight 1s cubic-bezier(0.23, 1, 0.32, 1) forwards; opacity: 0; }
.fade-in-up-delayed { animation: fadeUp 1s cubic-bezier(0.23, 1, 0.32, 1) 0.5s forwards; opacity: 0; transform: translateY(40px); }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideLeft { from { opacity: 0; transform: translateX(-50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

/* --- 9. RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .hero-master-container { grid-template-columns: 1fr; text-align: center; padding-top: 120px; }
  .hero-content-left { display: flex; flex-direction: column; align-items: center; }
  #tiltWrapper { justify-content: center; perspective: none; } /* Disable 3D on smaller screens for stability */
  .premium-glass-card { transform: none !important; } 
  .hero-heading { font-size: 3.5rem; }
  .bento-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .desktop-only { display: none; }
  .hero-heading { font-size: 2.8rem; }
  .hero-stats { flex-direction: column; gap: 20px; width: 100%; }
  .divider-vertical { width: 100%; height: 1px; }
  .bento-grid { grid-template-columns: 1fr; }
  .nav-container { padding: 16px; }
}