/* ============================================
   The Dawn of Intelligence - Personal Website
   A sophisticated dark theme with neural aesthetics
   ============================================ */

/* CSS Variables */
:root {
    --color-bg-primary: #020617;
    --color-bg-secondary: #0f172a;
    --color-text-primary: #f1f5f9;
    --color-text-secondary: #94a3b8;
    --color-accent-amber: #f59e0b;
    --color-accent-indigo: #6366f1;
    --color-accent-violet: #8b5cf6;
    
    --font-display: 'Cinzel', serif;
    --font-body: 'Cormorant Garamond', serif;
    --font-ui: 'Space Grotesk', sans-serif;
    
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: cubic-bezier(0.16, 1, 0.3, 1);
}

/* Base Reset & Typography */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Custom Font Classes */
.font-cinzel {
    font-family: 'Cinzel', serif;
}

.font-cormorant {
    font-family: 'Cormorant Garamond', serif;
}

.font-space {
    font-family: 'Space Grotesk', sans-serif;
}

/* ============================================
   Glassmorphism Card Component
   ============================================ */
.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 
        0 4px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transition: all 0.5s var(--transition-smooth);
}

.glass-card:hover {
    border-color: rgba(245, 158, 11, 0.2);
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(245, 158, 11, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* ============================================
   Neural Canvas Background
   ============================================ */
#neuralCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   Navigation Styles
   ============================================ */
#navbar {
    transition: all 0.7s var(--transition-slow);
}

#navbar.visible {
    opacity: 1;
    transform: translateY(0);
}

.nav-link {
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #f59e0b, transparent);
    transition: width 0.3s var(--transition-smooth);
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Menu */
#mobileMenu {
    transition: opacity 0.5s var(--transition-smooth);
}

#mobileMenu.active {
    opacity: 1;
    pointer-events: all;
}

.mobile-nav-link {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s var(--transition-slow);
}

#mobileMenu.active .mobile-nav-link {
    opacity: 1;
    transform: translateY(0);
}

#mobileMenu.active .mobile-nav-link:nth-child(1) { transition-delay: 0.1s; }
#mobileMenu.active .mobile-nav-link:nth-child(2) { transition-delay: 0.2s; }
#mobileMenu.active .mobile-nav-link:nth-child(3) { transition-delay: 0.3s; }
#mobileMenu.active .mobile-nav-link:nth-child(4) { transition-delay: 0.4s; }

/* ============================================
   Hero Section Animations
   ============================================ */
.hero-pre,
.hero-title,
.hero-subtitle,
.hero-cta {
    transition: all 1s var(--transition-slow);
}

.hero-pre.animate,
.hero-title.animate,
.hero-subtitle.animate,
.hero-cta.animate {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Animation Delays */
.hero-pre.animate { transition-delay: 0.2s; }
.hero-title.animate { transition-delay: 0.5s; }
.hero-subtitle.animate { transition-delay: 0.8s; }
.hero-cta.animate { transition-delay: 1.1s; }

/* ============================================
   Scroll Reveal Animations
   ============================================ */
.about-visual,
.about-content,
.philosophy-title,
.works-title,
.works-desc,
.work-item,
.contact-pre,
.contact-title,
.contact-desc,
.contact-cta,
.contact-social,
.philosophy-card {
    transition: all 0.8s var(--transition-slow);
}

/* Animation States */
.about-visual.animate,
.about-content.animate,
.philosophy-title.animate,
.works-title.animate,
.works-desc.animate,
.work-item.animate,
.contact-pre.animate,
.contact-title.animate,
.contact-desc.animate,
.contact-cta.animate,
.contact-social.animate,
.philosophy-card.animate {
    opacity: 1;
    transform: translateY(0) translateX(0);
}

/* ============================================
   Custom Animations
   ============================================ */
@keyframes pulse-slow {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(245, 158, 11, 0.5);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 6s ease-in-out infinite;
}

.animate-fade-in {
    animation: fade-in 1s var(--transition-slow) forwards;
}

.animate-float {
    animation: float 4s ease-in-out infinite;
}

.animate-glow {
    animation: glow 3s ease-in-out infinite;
}

/* ============================================
   Gradient Text Effects
   ============================================ */
.gradient-text {
    background: linear-gradient(135deg, #f59e0b 0%, #8b5cf6 50%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Button & Link Hover Effects
   ============================================ */
.btn-primary {
    position: relative;
    overflow: hidden;
    transition: all 0.4s var(--transition-smooth);
}

.btn-primary::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 var(--transition-smooth);
}

.btn-primary:hover::before {
    left: 100%;
}

/* ============================================
   Selection Styling
   ============================================ */
::selection {
    background: rgba(245, 158, 11, 0.3);
    color: #f1f5f9;
}

::-moz-selection {
    background: rgba(245, 158, 11, 0.3);
    color: #f1f5f9;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #020617;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #334155, #1e293b);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #475569, #334155);
}

/* ============================================
   Focus States for Accessibility
   ============================================ */
a:focus-visible,
button:focus-visible {
    outline: 2px solid rgba(245, 158, 11, 0.5);
    outline-offset: 4px;
}

/* ============================================
   Work Item Hover Effects
   ============================================ */
.work-item {
    transition: all 0.5s var(--transition-smooth);
}

.work-item:hover {
    transform: translateY(-4px);
}

.work-item:hover h3 {
    color: #f59e0b;
}

/* ============================================
   Philosophy Card Enhancements
   ============================================ */
.philosophy-card .glass-card {
    position: relative;
    overflow: hidden;
}

.philosophy-card .glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transition: left 0.8s var(--transition-smooth);
}

.philosophy-card:hover .glass-card::before {
    left: 100%;
}

/* ============================================
   Responsive Typography Adjustments
   ============================================ */
@media (max-width: 640px) {
    html {
        font-size: 14px;
    }
    
    .font-cinzel {
        letter-spacing: 0.02em;
    }
}

@media (min-width: 1920px) {
    html {
        font-size: 18px;
    }
}

/* ============================================
   Reduced Motion Support
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    #neuralCanvas {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    #neuralCanvas,
    #navbar,
    #mobileMenu {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .glass-card {
        background: white;
        border: 1px solid #ccc;
        box-shadow: none;
    }
}
