/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #55cc55;
    --secondary-dark: #059669;
    --accent: #f59e0b;
    --accent-dark: #d97706;
    
    /* Background Colors */
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-tertiary: #16213e;
    --bg-card: #1e293b;
    --bg-code: #0d1117;
    
    /* Text Colors */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-accent: #60a5fa;
    
    /* Border Colors */
    --border-primary: #334155;
    --border-secondary: #475569;
    --border-accent: #6366f1;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    --gradient-secondary: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-accent: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    --gradient-bg: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%);
    
    /* Shadows */
    --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);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 350ms ease-in-out;
}

html {
    scroll-behavior: smooth;
    scrollbar-width: none;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    padding-top: 80px;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-md);
    }
}

/* Constrained sections - all sections except demo use 1200px max-width */
.hero .container,
.diff-showcase .container,
.features .container,
.algorithms .container,
.performance .container,
.docs .container,
.algo-comparison-section .algo-comparison-container,
.footer .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
    .hero .container,
    .diff-showcase .container,
    .features .container,
    .algorithms .container,
    .performance .container,
    .docs .container,
    .algo-comparison-section .algo-comparison-container,
    .footer .container {
        padding: 0 var(--space-md);
    }
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 3.5rem;
    font-weight: 900;
}

h2 {
    font-size: 2.5rem;
}

h3 {
    font-size: 1.875rem;
}

h4 {
    font-size: 1.5rem;
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left var(--transition-slow);
}

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

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    color: white;
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    color: var(--text-primary);
}

.btn-small {
    padding: var(--space-sm) var(--space-sm);
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    min-width: auto;
    white-space: nowrap;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 35, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
    z-index: 1000;
    transition: all var(--transition-normal);
    height: 80px; /* Fixed height to remove extra space */
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    height: 100%; /* Ensure full height of navbar */
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-xl);
}

.nav-link {
    position: relative;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-link svg {
    flex-shrink: 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

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

.nav-link:focus {
    outline: none;
}

.nav-link:visited {
    color: var(--text-primary);
}

.nav-link:active {
    color: var(--text-primary);
    border: none;
    outline: none;
    background: none;
}

/* Override any active states from JavaScript */
.nav-link.active {
    color: var(--text-primary) !important;
}

.github-link {
    /* Removed custom styling */
}

.github-link:hover {
    /* Removed custom hover styling */
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 28px;
    cursor: pointer;
    padding: 4px;
    background: none;
    border: none;
    position: relative;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.nav-toggle:active {
    transform: scale(0.95);
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: absolute;
    border-radius: 1px;
    transform-origin: center;
}

.nav-toggle span:nth-child(1) {
    top: 6px;
    transform-origin: center;
}

.nav-toggle span:nth-child(2) {
    top: 14px;
    transform-origin: center;
}

.nav-toggle span:nth-child(3) {
    top: 22px;
    transform-origin: center;
}

/* Active state - X formation */
.nav-toggle.active span:nth-child(1) {
    top: 14px;
    transform: rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.nav-toggle.active span:nth-child(3) {
    top: 14px;
    transform: rotate(-45deg);
}

.nav-toggle.active:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-toggle.active span {
    background: #ffffff;
}

/* Mobile menu overlay */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 80px;
        right: 0;
        width: 280px;
        background: #000000;
        border-left: 1px solid var(--border-primary);
        flex-direction: column;
        padding: var(--space-lg);
        gap: 0;
        transform: translateX(100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 999;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        transform: translateX(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-toggle {
        display: flex;
    }
    
    .nav-link {
        position: relative;
        display: block;
        text-align: left;
        padding: var(--space-sm) 0;
        width: 100%;
        color: var(--text-primary) !important;
        font-weight: 500;
        transition: all var(--transition-normal);
        text-decoration: none;
        border: none !important;
        outline: none !important;
        background: none !important;
    }

    .nav-link:hover {
        color: var(--text-primary) !important;
        transform: translateX(4px);
    }

    .nav-link:focus,
    .nav-link:active,
    .nav-link:visited,
    .nav-link.active {
        color: var(--text-primary) !important;
        border: none !important;
        outline: none !important;
        background: none !important;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 4px;
        left: 0;
        width: 0;
        height: 2px;
        background: var(--gradient-primary);
        transition: width var(--transition-normal);
        border-radius: 1px;
    }

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

/* Remove any unwanted X styling */
.nav-close,
.close-icon,
.navbar .close {
    display: none !important;
}

/* Hero Section */
.hero {
    position: relative;
    height: auto;
    display: flex;
    align-items: center;
    padding: 125px 0 30px 0;
    overflow: hidden;
    text-align: center;
}

.hero-background {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-grid {
    display: none;
}

.hero-gradient {
    display: none;
}

.hero-content {
    flex: 0 0 auto;
    max-width: 600px;
    z-index: 3;
    position: relative;
    margin: 0 auto;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: var(--radius-xl);
    color: #a78bfa;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-icon {
    font-size: 0.875rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: var(--space-sm);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: inherit;
}

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

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

.d1f-shimmer {
    background: linear-gradient(
        90deg, 
        #8b5cf6, 
        #ffffff, 
        #a78bfa, 
        #8b5cf6
    );
    background-size: 600% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-size: inherit;
    animation: glitter 18s linear infinite;
    position: relative;
}

.d1f-shimmer::before,
.d1f-shimmer::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 2;
}

.d1f-shimmer::before {
    top: 10px;
    left: 60px;
    animation: fairy-dust-2 5s ease-in-out infinite;
    animation-delay: 1s;
}

.d1f-shimmer::after {
    bottom: 10px;
    left: 80px;
    animation: fairy-dust-1 6s ease-in-out infinite;
    animation-delay: 3s;
}

.d1f-shimmer span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.d1f-shimmer span:nth-child(1) {
    top: 10%;
    left: 70%;
    animation: sparkle 4s ease-in-out infinite;
    animation-delay: 0.5s;
}

.d1f-shimmer span:nth-child(2) {
    top: 60%;
    left: 10%;
    animation: sparkle 5s ease-in-out infinite;
    animation-delay: 2s;
}

.d1f-shimmer span:nth-child(3) {
    bottom: 10%;
    left: 80%;
    animation: sparkle 6s ease-in-out infinite;
    animation-delay: 1.2s;
}

.d1f-shimmer span:nth-child(4) {
    top: 80%;
    left: 40%;
    animation: sparkle 5.5s ease-in-out infinite;
    animation-delay: 2.7s;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: var(--space-xl);
    margin-bottom: 15px;
    justify-content: center;
}

.stat {
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    display: block;
    line-height: 1.05;
    margin-bottom: 0.1em;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.1;
}

.hero-actions {
    display: flex;
    gap: var(--space-lg);
    flex-wrap: wrap;
    justify-content: center;
    z-index: 4;
    position: relative;
}

.hero-visual {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

.code-demo {
    background: var(--bg-code);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    max-width: 500px;
    width: 100%;
}

.code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-primary);
}

.code-dots {
    display: flex;
    gap: var(--space-sm);
}

.code-dots span {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--text-muted);
}

.code-dots span:nth-child(1) { background: #ef4444; }
.code-dots span:nth-child(2) { background: #f59e0b; }
.code-dots span:nth-child(3) { background: #10b981; }

.code-title {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.code-content {
    padding: var(--space-lg);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    overflow-x: auto;
    background: #000 !important;
}

.code-content pre {
    margin: 0;
}

.code-content code {
    color: var(--text-primary);
}

/* Section Styles */
section {
    padding: var(--space-lg) 0;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 2.7rem;
    font-weight: 900;
    margin-bottom: var(--space-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-title-small {
    font-size: calc(2.7rem - 3px);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Features Section */
.features {
    background: var(--bg-secondary);
    padding-bottom: 15px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--space-xl);
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-accent);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: var(--space-lg);
    display: block;
}

.feature-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.feature-stats {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.stat-badge {
    padding: var(--space-xs) var(--space-sm);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-light);
}

.feature-highlight {
    padding: var(--space-md);
    background: var(--bg-code);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-accent);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        gap: var(--space-sm);
        height: auto;
        padding: 105px 0 30px 0;
    }
    
    .hero-visual {
        order: -1;
    }
    
    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 85px 0 var(--space-sm) 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: var(--space-md);
        max-width: 400px;
        margin: 0 auto var(--space-sm) auto;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    section {
        padding: var(--space-lg) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-md);
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 80px 0 var(--space-xs) 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        max-width: 320px;
        gap: var(--space-sm);
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .feature-card {
        padding: var(--space-lg);
    }
    
    section {
        padding: var(--space-lg) 0;
    }
    
    .section-header {
        margin-bottom: var(--space-sm);
    }
}

/* Animations */

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-in-left {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slide-in-right {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes glitter {
    0% {
        background-position: -300% 0;
    }
    100% {
        background-position: 300% 0;
    }
}

@keyframes fairy-dust-1 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    25% { transform: translate(40px, -30px) rotate(120deg); opacity: 0.8; }
    50% { transform: translate(-20px, 40px) rotate(240deg); opacity: 0.6; }
    75% { transform: translate(30px, -20px) rotate(360deg); opacity: 0.8; }
    100% { transform: translate(0, 0) rotate(480deg); opacity: 0; }
}

@keyframes fairy-dust-2 {
    0% { transform: translate(0, 0) rotate(0deg); opacity: 0; }
    25% { transform: translate(-30px, 20px) rotate(-120deg); opacity: 0.7; }
    50% { transform: translate(40px, -40px) rotate(-240deg); opacity: 0.5; }
    75% { transform: translate(-20px, 30px) rotate(-360deg); opacity: 0.7; }
    100% { transform: translate(0, 0) rotate(-480deg); opacity: 0; }
}

@keyframes sparkle {
    0% { transform: scale(0) rotate(0deg); opacity: 0; }
    50% { transform: scale(1.2) rotate(180deg); opacity: 0.8; }
    100% { transform: scale(0) rotate(360deg); opacity: 0; }
}

.glitter-text {
    position: relative;
    background: linear-gradient(
        90deg, 
        #8b5cf6, 
        #ffffff, 
        #a78bfa, 
        #8b5cf6
    );
    background-size: 600% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 900;
    font-size: 2.7rem;
    animation: glitter 18s linear infinite;
}

.glitter-text::before,
.glitter-text::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    pointer-events: none;
    z-index: 2;
}

.glitter-text::before {
    top: -20px;
    left: -10px;
    animation: fairy-dust-1 4s ease-in-out infinite;
    animation-delay: 0s;
}

.glitter-text::after {
    bottom: -20px;
    right: -10px;
    animation: fairy-dust-2 4s ease-in-out infinite;
    animation-delay: 2s;
}

.glitter-text span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #fff;
    border-radius: 50%;
    pointer-events: none;
    z-index: 2;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.glitter-text span:nth-child(1) {
    top: 0;
    left: 20%;
    animation: sparkle 3s ease-in-out infinite;
    animation-delay: 0s;
}

.glitter-text span:nth-child(2) {
    top: 20%;
    right: 0;
    animation: sparkle 3s ease-in-out infinite;
    animation-delay: 1s;
}

.glitter-text span:nth-child(3) {
    bottom: 0;
    left: 50%;
    animation: sparkle 3s ease-in-out infinite;
    animation-delay: 2s;
}

.glitter-text span:nth-child(4) {
    top: 50%;
    left: 0;
    animation: sparkle 3s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Utility Classes */
.fade-in {
    animation: fade-in 0.6s ease-out;
}

.slide-in-left {
    animation: slide-in-left 0.6s ease-out;
}

.slide-in-right {
    animation: slide-in-right 0.6s ease-out;
}

/* Scrollbar Styling - Hidden */
::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: transparent;
}

::-webkit-scrollbar-thumb:hover {
    background: transparent;
}

/* Selection Styling */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: var(--text-primary);
}

/* Focus Styles */
*:focus {
    outline: none;
}

button:focus,
a:focus {
    outline: none;
}

.nav-link:focus {
    outline: none;
    border: none;
}

.nav-toggle:focus {
    outline: none;
    border: none;
}

/* Desktop full-width with reasonable maximum for ultrawide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .nav-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

.fairy-dust {
    position: absolute;
    width: 24px;
    height: 24px;
    pointer-events: none;
    z-index: 1;
    background: radial-gradient(circle, #fff 60%, #ec4899 80%, transparent 100%);
    border-radius: 50%;
    opacity: 0.7;
    filter: blur(1px) drop-shadow(0 0 8px #fff) drop-shadow(0 0 16px #8b5cf6);
    animation: fairy-dust-bg 7s linear infinite;
    display: block;
}

.fairy-dust::after {
    content: '✨';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.1);
    font-size: 1.2rem;
    color: #fff;
    opacity: 0.8;
    pointer-events: none;
}

@keyframes fairy-dust-bg {
    0% {
        opacity: 0.7;
        transform: translateY(0) scale(1) rotate(0deg);
    }
    30% {
        opacity: 1;
        transform: translateY(-30px) scale(1.2) rotate(10deg);
    }
    60% {
        opacity: 0.8;
        transform: translateY(-60px) scale(0.9) rotate(-10deg);
    }
    100% {
        opacity: 0.7;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

.milkyway-star {
    position: absolute;
    background: radial-gradient(circle, #fff 80%, #a78bfa 100%, transparent 100%);
    border-radius: 50%;
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
    box-shadow: 0 0 6px 2px #fff, 0 0 12px 4px #8b5cf6;
    animation: milkyway-twinkle 3.5s ease-in-out infinite;
    display: block;
}

@keyframes milkyway-twinkle {
    0%, 100% {
        opacity: 0.7;
        filter: blur(0.5px) brightness(1.1);
        transform: scale(1);
    }
    20% {
        opacity: 1;
        filter: blur(0.5px) brightness(1.3);
        transform: scale(1.2);
    }
    50% {
        opacity: 0.5;
        filter: blur(1.5px) brightness(0.8);
        transform: scale(0.8);
    }
    80% {
        opacity: 1;
        filter: blur(0.5px) brightness(1.3);
        transform: scale(1.1);
    }
}

@media (max-width: 1050px) {
  #showcase .section-title {
    white-space: nowrap;
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    letter-spacing: -0.5px;
    overflow-x: auto;
    text-overflow: ellipsis;
    display: block;
  }
}

#showcase .showcase-text .showcase-subtitle {
  font-size: 1rem;
  margin-bottom: 15px;
}

.showcase-visual .code-demo .code-content {
    background: #000 !important;
}

section.diff-showcase .showcase-visual .code-demo .code-content,
.diff-showcase .showcase-visual .code-demo .code-content {
    background: #000 !important;
}

.showcase-visual .code-demo .code-content pre[class*="language-"],
.showcase-visual .code-demo .code-content code[class*="language-"] {
    background: #000 !important;
}