/* ==========================================================================
   Abu Talha Akash - Engineering Portfolio
   Theme: Red & White Glassmorphic Cinematic Architecture
   ========================================================================== */

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

:root {
    --primary-red: #e11d48;
    --primary-red-hover: #be123c;
    --primary-red-light: #fff1f2;
    --primary-red-glow: rgba(225, 29, 72, 0.25);
    --primary-red-border: rgba(225, 29, 72, 0.15);
    
    --bg-white: #ffffff;
    --bg-surface: #f8fafc;
    --bg-glass: rgba(255, 255, 255, 0.78);
    --bg-glass-strong: rgba(255, 255, 255, 0.92);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    
    --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: #fcfcfd;
}

/* Custom Scrollbar - Red & White */
::-webkit-scrollbar {
    width: 9px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #f43f5e;
    border-radius: 999px;
    border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
    background: #e11d48;
}

/* ==========================================================================
   Cinematic Background Lighting & Moving Red/Rose Blobs
   ========================================================================== */
.cinematic-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cyber-grid-red {
    background-size: 40px 40px;
    background-image: 
        linear-gradient(to right, rgba(225, 29, 72, 0.04) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(225, 29, 72, 0.04) 1px, transparent 1px);
}

.aurora-red-1 {
    background: radial-gradient(circle, rgba(225, 29, 72, 0.16) 0%, rgba(244, 63, 94, 0.06) 50%, transparent 75%);
}

.aurora-red-2 {
    background: radial-gradient(circle, rgba(239, 68, 68, 0.14) 0%, rgba(251, 113, 133, 0.05) 50%, transparent 75%);
}

.aurora-rose-3 {
    background: radial-gradient(circle, rgba(225, 29, 72, 0.12) 0%, rgba(254, 205, 211, 0.08) 50%, transparent 75%);
}

/* ==========================================================================
   Cinematic Animations
   ========================================================================== */
@keyframes float-cinematic-1 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(45px, -50px) scale(1.08);
    }
    66% {
        transform: translate(-30px, 35px) scale(0.95);
    }
}

@keyframes float-cinematic-2 {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(-50px, 40px) scale(1.06);
    }
    66% {
        transform: translate(35px, -45px) scale(0.94);
    }
}

@keyframes float-badge {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(1deg);
    }
}

@keyframes float-badge-reverse {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(8px) rotate(-1deg);
    }
}

@keyframes pulse-red-glow {
    0%, 100% {
        box-shadow: 0 0 25px rgba(225, 29, 72, 0.25), 0 0 50px rgba(225, 29, 72, 0.1);
    }
    50% {
        box-shadow: 0 0 45px rgba(225, 29, 72, 0.45), 0 0 80px rgba(225, 29, 72, 0.2);
    }
}

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

.animate-float-1 {
    animation: float-cinematic-1 18s ease-in-out infinite;
}

.animate-float-2 {
    animation: float-cinematic-2 22s ease-in-out infinite;
}

.animate-float-badge {
    animation: float-badge 6s ease-in-out infinite;
}

.animate-float-badge-delayed {
    animation: float-badge-reverse 7s ease-in-out infinite;
    animation-delay: -2s;
}

.animate-pulse-glow {
    animation: pulse-red-glow 4s ease-in-out infinite;
}

.animate-ring-slow {
    animation: ring-rotate 35s linear infinite;
}

/* ==========================================================================
   Glassmorphic & Red Glow Components
   ========================================================================== */
.glass-nav-white {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(225, 29, 72, 0.1);
    box-shadow: 0 4px 20px -2px rgba(225, 29, 72, 0.05);
}

.glass-card-white {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.03), 0 2px 10px -2px rgba(225, 29, 72, 0.04);
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.glass-card-white:hover {
    transform: translateY(-6px);
    border-color: rgba(225, 29, 72, 0.4);
    box-shadow: 0 24px 48px -12px rgba(225, 29, 72, 0.18), 0 0 25px rgba(225, 29, 72, 0.1);
}

.project-card {
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: rgba(225, 29, 72, 0.45);
    box-shadow: 0 25px 50px -12px rgba(225, 29, 72, 0.2), 0 0 25px rgba(225, 29, 72, 0.08);
}

.project-card img {
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.04));
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-card:hover img {
    transform: scale(1.04);
}

.glass-card-red-accent {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 241, 242, 0.6) 100%);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(225, 29, 72, 0.2);
    box-shadow: 0 10px 30px -5px rgba(225, 29, 72, 0.1);
}

.glass-pill {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(225, 29, 72, 0.15);
    box-shadow: 0 4px 15px rgba(225, 29, 72, 0.08);
}

.text-gradient-red {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 50%, #991b1b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-gradient-dark-red {
    background: linear-gradient(135deg, #0f172a 20%, #e11d48 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.font-mono-tech {
    font-family: var(--font-mono);
}

/* ==========================================================================
   Buttons with Red Glow
   ========================================================================== */
.btn-red-glow {
    background: linear-gradient(135deg, #e11d48 0%, #be123c 100%);
    color: #ffffff;
    box-shadow: 0 6px 20px -2px rgba(225, 29, 72, 0.4);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-red-glow:hover {
    background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
    box-shadow: 0 10px 28px -2px rgba(225, 29, 72, 0.55), 0 0 15px rgba(225, 29, 72, 0.3);
    transform: translateY(-2px);
}

.btn-red-outline {
    background: rgba(255, 255, 255, 0.85);
    color: #e11d48;
    border: 1.5px solid rgba(225, 29, 72, 0.3);
    transition: all 0.3s ease;
}

.btn-red-outline:hover {
    background: #fff1f2;
    border-color: #e11d48;
    color: #be123c;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px -3px rgba(225, 29, 72, 0.15);
}

/* ==========================================================================
   Scroll-Driven Animations (Modern Web Guidance Implementation)
   ========================================================================== */
@media (prefers-reduced-motion: no-preference) {
    @supports ((animation-timeline: view()) and (animation-range: entry)) {
        @keyframes reveal-entry {
            from {
                opacity: 0;
                transform: translateY(30px) scale(0.97);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .scroll-reveal {
            animation: reveal-entry auto ease backwards;
            animation-timeline: view(block);
            animation-range: entry 10% entry 35%;
        }
    }
}

/* Fallback class for IntersectionObserver */
.reveal-visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Case Study Modal System
   ========================================================================== */
.modal-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-container {
    transform: scale(0.95) translateY(20px);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-container {
    transform: scale(1) translateY(0);
}

/* Back to Top Floating Button */
#back-to-top {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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