/* Custom styles for the personal site */

/* CSS Variables for consistent theming */
:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #dbeafe;
    --secondary-color: #8b5cf6;
    --accent-color: #06b6d4;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-accent: #f1f5f9;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ✨ SPARKLE MAGIC STARTS HERE ✨ */

/* Sparkle container for dark sections only */
.sparkle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Sparkle container specifically for navigation */
.sparkle-nav {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

/* Sparkle container specifically for hero sections */
.sparkle-hero {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Sparkle container specifically for footer */
.sparkle-footer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Individual sparkle */
.sparkle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff;
    animation: sparkleFloat 3s linear infinite;
    opacity: 0;
}

/* Different sparkle sizes */
.sparkle.small {
    width: 3px;
    height: 3px;
    box-shadow: 0 0 5px #fff, 0 0 10px #fff;
}

.sparkle.medium {
    width: 6px;
    height: 6px;
    box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #fff;
}

.sparkle.large {
    width: 10px;
    height: 10px;
    box-shadow: 0 0 15px #fff, 0 0 30px #fff, 0 0 45px #fff;
}

/* Colored sparkles */
.sparkle.blue {
    background: radial-gradient(circle, #3b82f6 0%, transparent 70%);
    box-shadow: 0 0 10px #3b82f6, 0 0 20px #3b82f6;
}

.sparkle.purple {
    background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
    box-shadow: 0 0 10px #8b5cf6, 0 0 20px #8b5cf6;
}

.sparkle.pink {
    background: radial-gradient(circle, #ec4899 0%, transparent 70%);
    box-shadow: 0 0 10px #ec4899, 0 0 20px #ec4899;
}

.sparkle.gold {
    background: radial-gradient(circle, #f59e0b 0%, transparent 70%);
    box-shadow: 0 0 10px #f59e0b, 0 0 20px #f59e0b;
}

/* Sparkle animation */
@keyframes sparkleFloat {
    0% {
        opacity: 0;
        transform: translateY(100vh) scale(0) rotate(0deg);
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1) rotate(36deg);
    }
    90% {
        opacity: 1;
        transform: translateY(10vh) scale(1) rotate(324deg);
    }
    100% {
        opacity: 0;
        transform: translateY(0vh) scale(0) rotate(360deg);
    }
}

/* Twinkling stars for background - only in dark sections with galaxy vibes */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    /* Mask to only show stars in dark sections */
    clip-path: polygon(
        /* Top navigation area */
        0% 0%, 100% 0%, 100% 80px, 0% 80px,
        /* Gap for white content */
        0% 80px, 0% 80px, 0% 80px, 0% 80px,
        /* Bottom footer area */
        0% calc(100% - 150px), 100% calc(100% - 150px), 100% 100%, 0% 100%
    );
}

.star {
    position: absolute;
    border-radius: 50%;
    animation: twinkle 2s infinite;
}

/* Different types of stars for galaxy effect */
.star.tiny {
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

.star.small {
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.6);
}

.star.medium {
    width: 3px;
    height: 3px;
    background: white;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
}

.star.bright {
    width: 4px;
    height: 4px;
    background: white;
    box-shadow: 0 0 8px rgba(255, 255, 255, 1), 0 0 12px rgba(255, 255, 255, 0.7);
}

/* Colored stars for galaxy diversity */
.star.blue {
    background: #87ceeb;
    box-shadow: 0 0 6px rgba(135, 206, 235, 0.8);
}

.star.purple {
    background: #dda0dd;
    box-shadow: 0 0 6px rgba(221, 160, 221, 0.8);
}

.star.gold {
    background: #ffd700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.8);
}

/* Galaxy nebula effects */
.nebula {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.1;
    animation: nebulaPulse 8s ease-in-out infinite;
}

.nebula.purple {
    background: radial-gradient(circle, rgba(147, 51, 234, 0.3) 0%, rgba(147, 51, 234, 0.1) 30%, transparent 70%);
}

.nebula.blue {
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, rgba(59, 130, 246, 0.1) 30%, transparent 70%);
}

.nebula.pink {
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, rgba(236, 72, 153, 0.1) 30%, transparent 70%);
}

/* Shooting stars */
.shooting-star {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    animation: shootingStar 3s linear;
}

.shooting-star::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, white, transparent);
    transform-origin: 0 50%;
    animation: shootingStarTail 3s linear;
}

/* Galaxy animations */
@keyframes twinkle {
    0%, 100% { 
        opacity: 0.3; 
        transform: scale(1); 
    }
    25% { 
        opacity: 0.8; 
        transform: scale(1.2); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5); 
    }
    75% { 
        opacity: 0.6; 
        transform: scale(1.1); 
    }
}

@keyframes nebulaPulse {
    0%, 100% { 
        opacity: 0.05;
        transform: scale(1);
    }
    50% { 
        opacity: 0.15;
        transform: scale(1.1);
    }
}

@keyframes shootingStar {
    0% {
        opacity: 0;
        transform: translate(-100px, 100px);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(300px, -100px);
    }
}

@keyframes shootingStarTail {
    0% {
        opacity: 0;
        transform: scaleX(0);
    }
    10% {
        opacity: 1;
        transform: scaleX(1);
    }
    90% {
        opacity: 1;
        transform: scaleX(1);
    }
    100% {
        opacity: 0;
        transform: scaleX(0);
    }
}

/* Magical hover sparkles on interactive elements - REMOVED */

/* Rainbow sparkle trail for cursor */
.cursor-trail {
    position: fixed;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
    animation: trailFade 0.8s ease-out forwards;
}

@keyframes trailFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.3);
    }
}

/* Smooth transitions for HTMX swaps */
.htmx-settling {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.htmx-request {
    cursor: wait;
}

/* Beautiful gradient backgrounds */
.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gradient-bg-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.gradient-bg-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Enhanced navigation with blur effect */
nav {
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* Code syntax highlighting adjustments */
pre {
    background: #282c34 !important;
    border: 1px solid #3e4451;
    border-radius: 0.75rem;
    padding: 1.5rem;
    overflow-x: auto;
    box-shadow: var(--shadow-sm);
    position: relative;
    margin: 1.5rem 0;
}

pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Inline code (not in pre blocks) */
code:not(pre code) {
    background-color: var(--bg-accent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
}

/* Code blocks - let Highlight.js handle the styling completely */
pre code {
    background-color: transparent !important;
    padding: 0 !important;
    font-weight: normal !important;
    /* Remove any color overrides - let Highlight.js theme control everything */
}

/* Project card hover effects with enhanced animations and sparkles */
.project-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

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

/* Sparkle effect on project cards */
.project-card::after {
    content: '✨';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 18px;
    opacity: 0;
    transform: scale(0) rotate(0deg);
    transition: all 0.3s ease;
    animation: sparkleRotate 2s infinite;
}

@keyframes sparkleRotate {
    0%, 100% { transform: scale(0.8) rotate(0deg); }
    50% { transform: scale(1) rotate(180deg); }
}

.project-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl), 0 0 30px rgba(59, 130, 246, 0.3);
    border-color: var(--primary-color);
}

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

.project-card:hover::after {
    opacity: 1;
    transform: scale(1.2) rotate(360deg);
    animation: sparkleRotate 0.6s infinite;
}

/* Magical sparkle burst effect */
.sparkle-burst {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.sparkle-burst::before,
.sparkle-burst::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #fff 0%, transparent 70%);
    border-radius: 50%;
    box-shadow: 0 0 10px #fff;
    opacity: 0;
    animation: burstSparkle 1.5s infinite;
}

.sparkle-burst::before {
    top: 20%;
    left: 20%;
    animation-delay: 0s;
}

.sparkle-burst::after {
    top: 60%;
    right: 30%;
    animation-delay: 0.7s;
}

@keyframes burstSparkle {
    0%, 100% { 
        opacity: 0; 
        transform: scale(0) rotate(0deg); 
    }
    50% { 
        opacity: 1; 
        transform: scale(1.5) rotate(180deg); 
    }
}

/* Enhanced buttons with gradients and sparkles */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    border: none;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(59, 130, 246, 0.4);
    text-decoration: none;
    color: white;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-primary:hover::after {
    width: 300px;
    height: 300px;
}

.btn-secondary {
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.btn-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), 0 0 15px rgba(59, 130, 246, 0.2);
    text-decoration: none;
}

/* Loading states with beautiful animations */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.htmx-request.htmx-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Beautiful loading spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Animated progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-accent);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    animation: progress 2s infinite;
}

@keyframes progress {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Enhanced tags with gradients */
.tag {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid;
    transition: all 0.3s ease;
}

.tag-blue {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: #1e40af;
    border-color: #3b82f6;
}

.tag-purple {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #6b21a8;
    border-color: #8b5cf6;
}

.tag-green {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
    border-color: #22c55e;
}

.tag-pink {
    background: linear-gradient(135deg, #fce7f3, #fbcfe8);
    color: #be185d;
    border-color: #ec4899;
}

.tag:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Enhanced prose styling for markdown content */
.prose {
    line-height: 1.75;
    color: var(--text-primary);
}

.prose h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    margin-top: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.prose h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.prose h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 3rem;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.prose h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.8;
    font-size: 1.1rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.5rem;
    margin-left: 2rem;
    color: var(--text-secondary);
}

.prose ul {
    list-style-type: disc;
    padding-left: 1.5rem;
}

.prose ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
}

.prose li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
    display: list-item;
}

.prose li::marker {
    color: var(--primary-color);
}

.prose a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    position: relative;
    transition: all 0.3s ease;
}

.prose a:hover {
    color: var(--primary-hover);
}

.prose a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.3s ease;
}

.prose a:hover::after {
    width: 100%;
}

.prose blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
    font-style: italic;
    color: var(--text-secondary);
    margin: 2rem 0;
    background: linear-gradient(135deg, var(--primary-light), rgba(59, 130, 246, 0.05));
    border-radius: 0 0.5rem 0.5rem 0;
    position: relative;
}

.prose blockquote::before {
    content: '"';
    font-size: 4rem;
    color: var(--primary-color);
    position: absolute;
    top: -0.5rem;
    left: 1rem;
    font-family: serif;
    opacity: 0.3;
}

.prose img {
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    transition: all 0.3s ease;
}

.prose img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-xl);
}

/* Table styling */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-primary);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.prose th,
.prose td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.prose th {
    background: linear-gradient(135deg, var(--bg-accent), var(--bg-secondary));
    font-weight: 600;
    color: var(--text-primary);
}

.prose tr:hover {
    background: var(--bg-secondary);
}

/* Enhanced galaxy backgrounds for hero sections and footer */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    position: relative;
    overflow: hidden;
}

footer {
    /* Keep original footer gradient but add positioning for galaxy effects */
    position: relative;
    overflow: hidden;
}

.hero::before, footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        /* Subtle star field pattern */
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 130px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 160px 30px, rgba(255,255,255,0.3), transparent),
        /* Nebula clouds */
        radial-gradient(ellipse 200px 100px at 25% 50%, rgba(147, 51, 234, 0.1), transparent),
        radial-gradient(ellipse 150px 80px at 75% 30%, rgba(59, 130, 246, 0.1), transparent),
        radial-gradient(ellipse 180px 120px at 50% 80%, rgba(236, 72, 153, 0.08), transparent);
    background-repeat: repeat;
    background-size: 200px 100px, 180px 120px, 160px 90px, 220px 110px, 190px 95px, 100% 100%, 100% 100%, 100% 100%;
    opacity: 0.8;
    animation: galaxyShift 20s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

/* Special footer galaxy effects */
footer::before {
    /* More stars and deeper nebulas for footer */
    background: 
        /* Extra stars for footer */
        radial-gradient(1px 1px at 15px 25px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 35px 65px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 85px 35px, rgba(255,255,255,0.5), transparent),
        radial-gradient(1px 1px at 125px 75px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 155px 25px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 65px 85px, rgba(255,255,255,0.2), transparent),
        /* Deep space nebulas */
        radial-gradient(ellipse 250px 120px at 30% 60%, rgba(147, 51, 234, 0.15), transparent),
        radial-gradient(ellipse 180px 90px at 70% 40%, rgba(59, 130, 246, 0.12), transparent),
        radial-gradient(ellipse 200px 140px at 45% 75%, rgba(236, 72, 153, 0.1), transparent);
    background-repeat: repeat;
    background-size: 180px 90px, 160px 100px, 140px 80px, 200px 95px, 170px 85px, 190px 100px, 100% 100%, 100% 100%, 100% 100%;
    opacity: 0.6;
    animation: galaxyShift 25s ease-in-out infinite reverse;
}

@keyframes galaxyShift {
    0%, 100% { 
        transform: translateX(0) translateY(0);
        opacity: 0.8;
    }
    25% { 
        transform: translateX(-10px) translateY(-5px);
        opacity: 0.9;
    }
    50% { 
        transform: translateX(5px) translateY(-10px);
        opacity: 0.7;
    }
    75% { 
        transform: translateX(-5px) translateY(5px);
        opacity: 0.8;
    }
}

/* Constellation lines */
.constellation {
    position: absolute;
    pointer-events: none;
    z-index: 1;
    opacity: 0.2;
}

.constellation-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, rgba(255,255,255,0.6), rgba(255,255,255,0.2), rgba(255,255,255,0.6));
    animation: constellationGlow 4s ease-in-out infinite;
}

@keyframes constellationGlow {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

/* Floating cosmic particles */
.cosmic-particle {
    position: absolute;
    width: 1px;
    height: 1px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: cosmicFloat 6s ease-in-out infinite;
}

@keyframes cosmicFloat {
    0%, 100% { 
        transform: translateY(0) translateX(0) scale(1);
        opacity: 0.3;
    }
    25% { 
        transform: translateY(-20px) translateX(10px) scale(1.2);
        opacity: 0.8;
    }
    50% { 
        transform: translateY(-15px) translateX(-5px) scale(0.8);
        opacity: 1;
    }
    75% { 
        transform: translateY(-25px) translateX(15px) scale(1.1);
        opacity: 0.6;
    }
}

/* Adorable UFO animations */
.ufo {
    position: absolute;
    width: 40px;
    height: 20px;
    z-index: 5;
    pointer-events: none;
    opacity: 0;
}

.ufo-body {
    position: relative;
    width: 100%;
    height: 60%;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 50%, #94a3b8 100%);
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    box-shadow: 
        0 0 10px rgba(147, 51, 234, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    animation: ufoWobble 0.5s ease-in-out infinite alternate;
}

.ufo-dome {
    position: absolute;
    top: -40%;
    left: 20%;
    width: 60%;
    height: 80%;
    background: linear-gradient(135deg, rgba(147, 197, 253, 0.8) 0%, rgba(59, 130, 246, 0.6) 50%, rgba(37, 99, 235, 0.4) 100%);
    border-radius: 50%;
    box-shadow: 
        0 0 8px rgba(59, 130, 246, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
    animation: ufoGlow 1s ease-in-out infinite;
}

.ufo-light {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 40px;
    background: radial-gradient(ellipse closest-side, rgba(147, 51, 234, 0.3) 0%, rgba(147, 51, 234, 0.1) 70%, transparent 100%);
    border-radius: 50%;
    animation: ufoBeam 2s ease-in-out infinite;
}

.ufo-trail {
    position: absolute;
    top: 50%;
    right: 100%;
    width: 30px;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, rgba(147, 51, 234, 0.8) 50%, transparent 100%);
    border-radius: 1px;
    animation: ufoTrail 0.3s ease-in-out infinite;
}

@keyframes ufoWobble {
    0% { transform: translateY(0) rotate(-1deg); }
    100% { transform: translateY(-2px) rotate(1deg); }
}

@keyframes ufoGlow {
    0%, 100% { 
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.5), inset 0 1px 2px rgba(255, 255, 255, 0.4);
        background: linear-gradient(135deg, rgba(147, 197, 253, 0.8) 0%, rgba(59, 130, 246, 0.6) 50%, rgba(37, 99, 235, 0.4) 100%);
    }
    50% { 
        box-shadow: 0 0 15px rgba(59, 130, 246, 0.8), inset 0 1px 2px rgba(255, 255, 255, 0.6);
        background: linear-gradient(135deg, rgba(147, 197, 253, 1) 0%, rgba(59, 130, 246, 0.8) 50%, rgba(37, 99, 235, 0.6) 100%);
    }
}

@keyframes ufoBeam {
    0%, 100% { 
        opacity: 0.3;
        transform: translateX(-50%) scaleY(0.8);
    }
    50% { 
        opacity: 0.6;
        transform: translateX(-50%) scaleY(1.2);
    }
}

@keyframes ufoTrail {
    0% { opacity: 0.8; transform: scaleX(1); }
    100% { opacity: 0.2; transform: scaleX(0.6); }
}

/* UFO flight paths */
@keyframes ufoFlyAcross {
    0% {
        left: -60px;
        top: 20%;
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-5deg) scale(0.8);
    }
    10% {
        opacity: 1;
        transform: translateX(0) translateY(-5px) rotate(-3deg) scale(1);
    }
    50% {
        transform: translateX(50vw) translateY(-15px) rotate(2deg) scale(1.1);
    }
    90% {
        opacity: 1;
        transform: translateX(100vw) translateY(-10px) rotate(5deg) scale(1);
    }
    100% {
        left: calc(100vw + 60px);
        top: 30%;
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(5deg) scale(0.8);
    }
}

@keyframes ufoFlyDiagonal {
    0% {
        left: 100%;
        top: 10%;
        opacity: 0;
        transform: translateX(60px) translateY(0) rotate(15deg) scale(0.7);
    }
    15% {
        opacity: 1;
        transform: translateX(0) translateY(10px) rotate(10deg) scale(1);
    }
    85% {
        opacity: 1;
        transform: translateX(-100vw) translateY(80px) rotate(-10deg) scale(1);
    }
    100% {
        left: -60px;
        top: 80%;
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-15deg) scale(0.7);
    }
}

@keyframes ufoFlyWave {
    0% {
        left: -60px;
        top: 60%;
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-8deg) scale(0.9);
    }
    10% {
        opacity: 1;
        transform: translateX(20px) translateY(-20px) rotate(-5deg) scale(1);
    }
    30% {
        transform: translateX(30vw) translateY(-30px) rotate(0deg) scale(1.1);
    }
    50% {
        transform: translateX(50vw) translateY(-10px) rotate(3deg) scale(1);
    }
    70% {
        transform: translateX(70vw) translateY(-25px) rotate(-2deg) scale(1.1);
    }
    90% {
        opacity: 1;
        transform: translateX(90vw) translateY(-15px) rotate(5deg) scale(1);
    }
    100% {
        left: calc(100vw + 60px);
        top: 40%;
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(8deg) scale(0.9);
    }
}

/* Floating elements animation */
.floating {
    animation: floating 6s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Card entrance animations */
.card-entrance {
    opacity: 0;
    transform: translateY(30px);
    animation: cardEntrance 0.6s ease-out forwards;
}

.card-entrance:nth-child(1) { animation-delay: 0.1s; }
.card-entrance:nth-child(2) { animation-delay: 0.2s; }
.card-entrance:nth-child(3) { animation-delay: 0.3s; }
.card-entrance:nth-child(4) { animation-delay: 0.4s; }
.card-entrance:nth-child(5) { animation-delay: 0.5s; }
.card-entrance:nth-child(6) { animation-delay: 0.6s; }

@keyframes cardEntrance {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Table of Contents Styling */
.toc-nav ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc-nav ul ul {
    padding-left: 1rem;
    margin-top: 0.5rem;
}

.toc-nav li {
    margin-bottom: 0.5rem;
}

.toc-nav a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.4;
}

.toc-nav a:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
    transform: translateX(2px);
}

.toc-nav a.active {
    color: var(--primary-color);
    background-color: var(--primary-light);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

/* Nested TOC items styling */
.toc-nav ul ul a {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
}

.toc-nav ul ul ul a {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    opacity: 0.9;
}

/* TOC sidebar with scrollable content */
aside .lg\:sticky {
    max-height: calc(100vh - 7rem);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

/* Custom scrollbar for TOC */
aside .lg\:sticky::-webkit-scrollbar {
    width: 6px;
}

aside .lg\:sticky::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

aside .lg\:sticky::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
    transition: background 0.2s ease;
}

aside .lg\:sticky::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
}

/* Responsive navigation */
@media (max-width: 640px) {
    nav .flex {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
    }
    
    nav .flex > div:last-child {
        margin-top: 1rem;
    }
    
    .prose h1 {
        font-size: 2rem;
    }
    
    .prose h2 {
        font-size: 1.5rem;
    }
}