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

: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: #CBD5E1;
  --slate-dark: #94A3B8;
  --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;
  scroll-padding-top: 80px;
  scrollbar-gutter: stable;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  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; }
h5 { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.015em; }
h6 { font-size: 0.95rem; font-weight: 600; letter-spacing: -0.01em; text-transform: uppercase; color: var(--slate); }

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--electric-blue);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 99999;
  text-decoration: none;
  font-weight: 600;
  border-bottom-right-radius: var(--radius-md);
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 0;
}
main:focus {
  outline: none;
}

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; }

/* Scroll margin for anchor targets */
main:target {
  scroll-margin-top: 80px;
}

/* ==========================================================================
   Top Announcement / Utility Bar (Senior Studio & Direct Access)
   ========================================================================== */
.top-announcement-bar {
  background: rgba(6, 12, 24, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.75rem;
  line-height: 1;
  position: relative;
  z-index: 1002;
  color: var(--slate);
  backdrop-filter: blur(14px) saturate(1.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
}

.top-announcement-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  min-height: 28px;
}

.top-announcement-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.status-indicator {
  width: 6px;
  height: 6px;
  min-width: 6px;
  background-color: #10B981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #10B981, 0 0 16px rgba(16, 185, 129, 0.5);
  animation: statusPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.top-announcement-text {
  font-size: 0.72rem;
  letter-spacing: 0.015em;
  color: #94A3B8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-label-bold {
  color: #F1F5F9;
  font-weight: 600;
}

.status-divider {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.65rem;
}

.status-subtext {
  color: #94A3B8;
}

.top-founder-link {
  color: var(--cyan);
  font-weight: 700;
  text-decoration: underline dashed;
  text-underline-offset: 3px;
  transition: all var(--transition-fast);
}

.top-founder-link:hover {
  color: #FFFFFF;
  text-shadow: 0 0 8px var(--cyan);
  text-decoration: underline solid;
}

.top-announcement-right {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.top-announcement-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #CBD5E1;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.18rem 0.55rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  line-height: 1.2;
  transition: all var(--transition-fast);
}

.top-announcement-pill:hover {
  color: #FFFFFF;
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
  transform: translateY(-1px);
}

.top-announcement-pill svg {
  transition: transform var(--transition-fast);
}

.top-announcement-pill:hover svg {
  transform: translate(1px, -1px);
}

/* WhatsApp Icon Button: Compact, clickable, high visual fidelity */
.top-announcement-wa-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.32);
  color: #25D366;
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.top-announcement-wa-btn:hover {
  background: #25D366;
  border-color: #25D366;
  color: #0B1120;
  box-shadow: 0 0 12px rgba(37, 211, 102, 0.65), 0 2px 6px rgba(0, 0, 0, 0.35);
  transform: scale(1.08) translateY(-1px);
}

.top-announcement-wa-btn:active {
  transform: scale(0.95);
}

/* ==========================================================================
   Scroll Reading Progress Bar
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, #00F0FF, #3B82F6, #8B5CF6, #EC4899);
  z-index: 100000;
  box-shadow: 0 0 12px rgba(6, 214, 160, 0.6);
  transition: width 0.08s linear;
  pointer-events: none;
}

/* ==========================================================================
   Neural Constellation Background Canvas
   ========================================================================== */
#neural-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0.75;
  transition: opacity var(--transition-normal);
}

/* ==========================================================================
   Dynamic Typewriter & Headline Motion
   ========================================================================== */
.hero-typewriter-box {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  background: rgba(17, 29, 58, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: var(--slate);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(10px);
}

.type-prefix {
  color: var(--slate-dark);
  font-weight: 500;
}

.typewriter-text {
  color: #38BDF8;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(56, 189, 248, 0.4);
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.15em;
  background-color: var(--cyan);
  margin-left: 2px;
  animation: cursorBlink 0.8s infinite;
  box-shadow: 0 0 8px var(--cyan);
  vertical-align: middle;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ==========================================================================
   Vibrant Colorful Text & Holographic Animations
   ========================================================================== */
@keyframes holographicShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-text-animated {
  background: linear-gradient(135deg, #00F0FF 0%, #3B82F6 25%, #A855F7 50%, #EC4899 75%, #00F0FF 100%);
  background-size: 250% 250%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: holographicShift 6s ease-in-out infinite;
  display: inline-block;
}

.text-glow {
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.5);
}

.text-cyan { color: #06D6A0 !important; text-shadow: 0 0 10px rgba(6, 214, 160, 0.35); }
.text-violet { color: #A78BFA !important; text-shadow: 0 0 10px rgba(167, 139, 250, 0.35); }
.text-pink { color: #EC4899 !important; text-shadow: 0 0 10px rgba(236, 72, 153, 0.35); }
.text-blue { color: #38BDF8 !important; text-shadow: 0 0 10px rgba(56, 189, 248, 0.35); }
.text-emerald { color: #10B981 !important; text-shadow: 0 0 10px rgba(16, 185, 129, 0.35); }
.text-yellow { color: #FACC15 !important; text-shadow: 0 0 10px rgba(250, 204, 21, 0.35); }
.text-amber { color: #F59E0B !important; text-shadow: 0 0 10px rgba(245, 158, 11, 0.35); }

/* ==========================================================================
   Back-to-Top Floating Control
   ========================================================================== */
.back-to-top-btn {
  position: fixed;
  bottom: 92px;
  right: 28px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(17, 29, 58, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), 0 0 15px rgba(59, 130, 246, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all var(--transition-normal);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:hover {
  background: var(--electric-blue);
  border-color: var(--cyan);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.5), 0 0 20px var(--cyan);
  transform: translateY(-3px) scale(1.05);
}

@media (max-width: 640px) {
  .back-to-top-btn {
    bottom: 78px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

/* ==========================================================================
   Strict Overflow & Overlap Prevention Safeguards
   ========================================================================== */
html, body {
  overflow: visible;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

* {
  min-width: 0;
}

.container, .container-wide, .container-narrow {
  overflow-x: clip;
}

h1, h2, h3, h4, h5, h6, p, span, a {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

code, pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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