/* Liminal - Mystical Web Design */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700&family=Philosopher:ital,wght@0,400;0,700;1,400;1,700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,300;1,400;1,500;1,600;1,700&display=swap');

/* CSS Variables for Mystical Theme */
:root {
  --primary-dark: #0f0f1e;
  --secondary-dark: #1a1a2e;
  --tertiary-dark: #16213e;
  --accent-purple: #6c5ce7;
  --accent-gold: #fdcb6e;
  --accent-cyan: #74b9ff;
  --mystical-purple: #a29bfe;
  --ethereal-blue: #81ecec;
  --ancient-gold: #e17055;
  --soul-white: #f8f9fa;
  --shadow-deep: rgba(0, 0, 0, 0.8);
  --glow-purple: rgba(108, 92, 231, 0.4);
  --glow-gold: rgba(253, 203, 110, 0.3);
  --glow-cyan: rgba(116, 185, 255, 0.3);
  
  --font-ancient: 'Cinzel', serif;
  --font-mystical: 'Philosopher', sans-serif;
  --font-elegant: 'Cormorant Garamond', serif;
}

/* Global Styles with Performance Optimizations */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
}

/* Performance optimizations */
* {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

/* GPU acceleration for animations (excluding nav) */
.hero, .feature-card, .btn-mystical, .particle, .sacred-circle {
  will-change: transform;
  transform: translateZ(0);
}

/* NAVIGATION - STICKY APPROACH */
.nav-container {
  position: sticky !important;
  position: -webkit-sticky !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 999999 !important;
  
  background: rgba(15, 15, 30, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  border-bottom: 1px solid rgba(108, 92, 231, 0.2) !important;
  
  margin: 0 !important;
  padding: 0 !important;
}

.navbar {
  transform: none !important;
  will-change: auto !important;
}

body {
  font-family: var(--font-mystical);
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 50%, var(--tertiary-dark) 100%);
  color: var(--soul-white);
  overflow-x: hidden;
  position: relative;
  padding-top: 0; /* No padding needed since nav is overlay */
}

/* Cosmic Background Animation */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, var(--glow-purple) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, var(--glow-cyan) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, var(--glow-gold) 0%, transparent 50%);
  opacity: 0.3;
  animation: cosmicPulse 8s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

@keyframes cosmicPulse {
  0% { transform: scale(1) rotate(0deg); opacity: 0.2; }
  100% { transform: scale(1.1) rotate(5deg); opacity: 0.4; }
}

/* Mystical Particles with performance optimizations */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  contain: strict;
  will-change: contents;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--ethereal-blue);
  border-radius: 50%;
  animation: floatParticle 15s linear infinite;
  opacity: 0;
}

@keyframes floatParticle {
  0% { 
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% { 
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Typography */
.ancient-title {
  font-family: var(--font-ancient);
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(45deg, var(--accent-gold), var(--mystical-purple), var(--ethereal-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px var(--glow-purple);
  position: relative;
}

.mystical-subtitle {
  font-family: var(--font-elegant);
  font-style: italic;
  font-weight: 400;
  color: var(--ethereal-blue);
  text-shadow: 0 0 20px var(--glow-cyan);
}

.sacred-text {
  font-family: var(--font-mystical);
  line-height: 1.8;
  color: rgba(248, 249, 250, 0.9);
}

/* Navigation - Removed duplicate rule, using earlier complete definition */

.nav-scrolled {
  background: rgba(15, 15, 30, 0.98);
  box-shadow: 0 5px 30px var(--shadow-deep);
  border-bottom: 1px solid rgba(108, 92, 231, 0.4);
  backdrop-filter: blur(25px);
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-family: var(--font-ancient);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent-gold);
  text-decoration: none;
  letter-spacing: 2px;
  text-shadow: 0 0 20px var(--glow-gold);
  transition: all 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
  text-shadow: 0 0 30px var(--glow-gold);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  color: var(--soul-white);
  text-decoration: none;
  font-family: var(--font-mystical);
  font-weight: 400;
  position: relative;
  padding: 0.5rem 1rem;
  transition: all 0.3s ease;
  border-radius: 25px;
}

.nav-link:hover {
  color: var(--accent-gold);
  background: rgba(108, 92, 231, 0.1);
  transform: translateY(-2px);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-gold), var(--mystical-purple));
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-link:hover::after {
  width: 80%;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 5% 150px 5%;
  position: relative;
  overflow: hidden;
}

.hero-content {
  max-width: 800px;
  z-index: 10;
  position: relative;
  animation: heroFadeIn 2s ease-out;
}

@keyframes heroFadeIn {
  0% { 
    opacity: 0;
    transform: translateY(50px);
  }
  100% { 
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 1rem;
  position: relative;
}

.hero-subtitle {
  font-size: clamp(1.2rem, 3vw, 2rem);
  margin-bottom: 2rem;
  animation: subtitleGlow 3s ease-in-out infinite alternate;
}

@keyframes subtitleGlow {
  0% { text-shadow: 0 0 20px var(--glow-cyan); }
  100% { text-shadow: 0 0 40px var(--glow-cyan); }
}

.hero-description {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Mystical Buttons */
.btn-mystical {
  display: inline-block;
  padding: 1rem 2.5rem;
  background: linear-gradient(45deg, var(--accent-purple), var(--mystical-purple));
  color: var(--soul-white);
  text-decoration: none;
  font-family: var(--font-ancient);
  font-weight: 600;
  letter-spacing: 1px;
  border-radius: 50px;
  position: relative;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-transform: uppercase;
  overflow: hidden;
}

.btn-mystical:hover {
  transform: translateY(-3px);
  box-shadow: 0 15px 40px var(--glow-purple);
  border-color: var(--accent-gold);
}

.btn-mystical::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn-mystical:hover::before {
  left: 100%;
}

.btn-secondary {
  background: transparent;
  border: 2px solid var(--accent-gold);
  color: var(--accent-gold);
}

.btn-secondary:hover {
  background: var(--accent-gold);
  color: var(--primary-dark);
  box-shadow: 0 15px 40px var(--glow-gold);
}

/* Sacred Geometry Background */
.sacred-geometry {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vw;
  height: 80vw;
  max-width: 800px;
  max-height: 800px;
  opacity: 0.1;
  z-index: 1;
}

.sacred-circle {
  position: absolute;
  border: 2px solid var(--accent-gold);
  border-radius: 50%;
  animation: sacredRotate 30s linear infinite;
}

.sacred-circle:nth-child(1) {
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.sacred-circle:nth-child(2) {
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  animation-duration: 40s;
  animation-direction: reverse;
}

.sacred-circle:nth-child(3) {
  width: 40%;
  height: 40%;
  top: 30%;
  left: 30%;
  animation-duration: 25s;
}

@keyframes sacredRotate {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Section Styles with performance optimizations */
.section {
  padding: 100px 5%;
  position: relative;
  contain: layout style;
}

/* First section after hero needs extra top spacing */
#features {
  padding-top: 100px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.section-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  text-align: center;
  margin-bottom: 3rem;
}

.section-subtitle {
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 4rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  margin-top: 5rem;
}

.feature-card {
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  border: 1px solid rgba(108, 92, 231, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-10px);
  border-color: var(--accent-gold);
  box-shadow: 0 20px 60px var(--shadow-deep);
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(108, 92, 231, 0.1), transparent);
  transition: left 0.8s ease;
}

.feature-card:hover::before {
  left: 100%;
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: var(--accent-gold);
  text-shadow: 0 0 20px var(--glow-gold);
}

.feature-title {
  font-family: var(--font-ancient);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--mystical-purple);
}

.feature-description {
  line-height: 1.7;
  color: rgba(248, 249, 250, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
  .navbar {
    padding: 1rem 3%;
  }
  
  .nav-menu {
    gap: 1rem;
  }
  
  .nav-link {
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
  }
  
  .hero-content {
    padding: 0 1rem;
  }
  
  .hero-title {
    margin-bottom: 1.5rem;
  }
  
  .hero-description {
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .feature-card {
    padding: 2rem;
  }
  
  .section {
    padding: 60px 3%;
  }
  
  /* Extra spacing for features section on mobile */
  #features {
    padding-top: 100px;
  }
  
  .hero {
    padding: 60px 3% 80px 3%;
    margin-bottom: 1rem;
  }
}

/* Scroll Animation Classes */
.fade-in {
  opacity: 0;
  transform: translateY(50px);
  transition: all 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all 0.8s ease;
}

.slide-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all 0.8s ease;
}

.slide-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Quote Carousel Styles */
.quote-carousel {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mystical-quote {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  color: var(--ethereal-blue);
  text-shadow: 0 0 20px var(--glow-cyan);
  font-family: var(--font-elegant);
  line-height: 1.6;
  padding: 0 2rem;
}

.mystical-quote.active {
  opacity: 1;
}

.mystical-quote.sparkle-out {
  animation: sparkleOut 0.8s ease-in-out forwards;
}

.mystical-quote.sparkle-in {
  animation: sparkleIn 0.8s ease-in-out forwards;
}

.quote-author {
  display: block;
  margin-top: 1rem;
  font-size: 0.9em;
  color: var(--accent-gold);
  font-weight: 500;
  text-shadow: 0 0 15px var(--glow-gold);
}

/* Sparkle Effects */
.quote-sparkles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

.sparkle {
  position: absolute;
  color: var(--accent-gold);
  font-size: 1rem;
  opacity: 0;
  pointer-events: none;
  animation: sparkleFloat 1.5s ease-out forwards;
}

/* Sparkle Animations */
@keyframes sparkleOut {
  0% { 
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% { 
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
}

@keyframes sparkleIn {
  0% { 
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.95);
  }
  50% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1.05);
  }
  100% { 
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes sparkleFloat {
  0% {
    opacity: 0;
    transform: translateY(0px) scale(0);
  }
  20% {
    opacity: 1;
    transform: translateY(-10px) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateY(-30px) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(0.5);
  }
}

/* Quote glow effect */
@keyframes quoteGlow {
  0% { text-shadow: 0 0 20px var(--glow-cyan); }
  50% { text-shadow: 0 0 30px var(--glow-cyan), 0 0 40px var(--ethereal-blue); }
  100% { text-shadow: 0 0 20px var(--glow-cyan); }
}

.mystical-quote.active {
  animation: quoteGlow 3s ease-in-out infinite;
}