/* ==========================================================================
   CodeX404 Solutions — Main Design Tokens & Base Styles
   Theme: Aurora Midnight — Vibrant, Colorful, Premium
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  /* Brand Color Palette — Expanded Vivid Spectrum */
  --midnight: #060B18;
  --deep-navy: #0A1628;
  --navy-light: #111D3A;
  --electric-blue: #3B82F6;
  --electric-blue-hover: #2563EB;
  --cyan: #06D6A0;
  --cyan-bright: #22D3EE;
  --violet: #8B5CF6;
  --soft-violet: #A78BFA;
  --purple-deep: #7C3AED;
  --magenta: #EC4899;
  --rose: #F43F5E;
  --amber: #F59E0B;
  --orange: #F97316;
  --teal: #14B8A6;
  --white: #FFFFFF;
  --slate: #94A3B8;
  --slate-dark: #64748B;
  --light: #F8FAFC;
  --dark-text: #0F172A;
  --danger: #EF4444;
  --success: #10B981;
  --warning: #F59E0B;

  /* Surfaces & Glassmorphism */
  --bg-primary: #060B18;
  --bg-surface: rgba(10, 22, 40, 0.85);
  --bg-surface-elevated: rgba(17, 29, 58, 0.9);
  --bg-glass: rgba(10, 22, 40, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-highlight: rgba(6, 214, 160, 0.3);
  --border-glow: rgba(59, 130, 246, 0.4);
  --border-vivid: rgba(139, 92, 246, 0.3);

  /* Gradients — Richer Multi-Stop */
  --gradient-signature: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 40%, #EC4899 70%, #06D6A0 100%);
  --gradient-btn: linear-gradient(135deg, #3B82F6 0%, #8B5CF6 50%, #EC4899 100%);
  --gradient-glow: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.2) 0%, transparent 60%);
  --gradient-text: linear-gradient(135deg, #FFFFFF 10%, #A78BFA 40%, #EC4899 65%, #06D6A0 100%);
  --gradient-card: linear-gradient(160deg, rgba(17, 29, 58, 0.7) 0%, rgba(10, 22, 40, 0.9) 100%);
  --gradient-aurora: linear-gradient(135deg, 
    rgba(59, 130, 246, 0.12) 0%,
    rgba(139, 92, 246, 0.1) 25%,
    rgba(236, 72, 153, 0.08) 50%,
    rgba(6, 214, 160, 0.1) 75%,
    rgba(34, 211, 238, 0.08) 100%
  );

  /* Typography */
  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 5rem;
  --space-4xl: 7.5rem;

  /* Shadows & Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.4);
  --shadow-glow-blue: 0 0 40px rgba(59, 130, 246, 0.3);
  --shadow-glow-violet: 0 0 40px rgba(139, 92, 246, 0.25);
  --shadow-glow-cyan: 0 0 40px rgba(6, 214, 160, 0.25);
  --shadow-glow-magenta: 0 0 40px rgba(236, 72, 153, 0.2);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 500ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-slow: 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Global Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-main);
  background-color: var(--bg-primary);
  color: var(--slate);
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-color: var(--midnight);
  position: relative;
}

/* ===== Animated Aurora Background ===== */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: 
    radial-gradient(ellipse 600px 400px at 15% 15%, rgba(59, 130, 246, 0.15), transparent 70%),
    radial-gradient(ellipse 500px 350px at 85% 20%, rgba(139, 92, 246, 0.12), transparent 70%),
    radial-gradient(ellipse 400px 300px at 70% 65%, rgba(236, 72, 153, 0.08), transparent 70%),
    radial-gradient(ellipse 450px 350px at 25% 75%, rgba(6, 214, 160, 0.1), transparent 70%),
    radial-gradient(ellipse 350px 250px at 50% 50%, rgba(34, 211, 238, 0.06), transparent 70%);
  animation: auroraFloat 25s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

@keyframes auroraFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(3%, 2%) rotate(1deg); }
  50% { transform: translate(-2%, 4%) rotate(-1deg); }
  75% { transform: translate(1%, -2%) rotate(0.5deg); }
}

/* Subtle grid pattern overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 60px 60px;
  z-index: 0;
  pointer-events: none;
}

/* Ensure all content above the bg layers */
body > * {
  position: relative;
  z-index: 1;
}

/* Typography Defaults */
h1, h2, h3, h4, h5, h6 {
  color: var(--white);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.85rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--slate);
}

p:last-child {
  margin-bottom: 0;
}

/* ===== Vivid Gradient Text ===== */
.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: inline-block;
  animation: shimmerText 6s ease-in-out infinite;
  background-size: 200% 200%;
}

@keyframes shimmerText {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.text-cyan { color: var(--cyan); }
.text-violet { color: var(--soft-violet); }
.text-magenta { color: var(--magenta); }
.text-white { color: var(--white); }
.text-muted { color: var(--slate-dark); }

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--white);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Layout Containers */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-wide {
  max-width: 1400px;
}

.container-narrow {
  max-width: 860px;
}

.section {
  padding-top: 3.25rem;
  padding-bottom: 3.25rem;
  position: relative;
}

/* First section on any page (serves as the subpage hero/header) */
body > .section:first-of-type,
main > .section:first-of-type,
.site-header + .section,
.site-header + main > .section:first-child,
.site-header + * .section:first-of-type {
  padding-top: 1.75rem;
  padding-bottom: 2.25rem;
}

.section-sm {
  padding-top: 1.75rem;
  padding-bottom: 1.75rem;
}

/* Section Header Structure */
.section-header {
  text-align: center;
  margin-bottom: 2rem;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Animated Section Tag ===== */
.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1.15rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(139, 92, 246, 0.25);
  color: var(--soft-violet);
  font-size: 0.825rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  position: relative;
  overflow: hidden;
}

.section-tag::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: tagShine 4s ease-in-out infinite;
}

@keyframes tagShine {
  0%, 100% { left: -100%; }
  50% { left: 100%; }
}

.section-tag i, .section-tag span.dot {
  width: 7px;
  height: 7px;
  background: var(--cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--cyan), 0 0 20px rgba(6, 214, 160, 0.3);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 0.7; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--slate);
  line-height: 1.6;
}

/* Accessibility Focus Outline */
:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

/* Grid System */
.grid {
  display: grid;
  gap: 1.75rem;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* Flex Helpers */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 0.5rem; }
.gap-md { gap: 1rem; }
.gap-lg { gap: 1.5rem; }

/* ===== Scroll-Triggered Fade-In Animations ===== */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children */
.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children > *:nth-child(7) { transition-delay: 480ms; }

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
