/* Base Setup */
body {
    background-color: #0c0a09;
    color: #e7e5e4;
    overflow-x: hidden;
    cursor: none; /* Custom cursor on desktop */
}

/* Restore default cursor on touch devices */
@media (pointer: coarse) {
    body { cursor: auto; }
}

/* --- 1. Ambient Background --- */
.ambient-glow {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    z-index: -1; overflow: hidden;
    background: radial-gradient(circle at 50% 50%, #1c1917 0%, #0c0a09 100%);
}

.orb {
    position: absolute; border-radius: 50%;
    filter: blur(90px); opacity: 0.25;
    animation: blob 15s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes blob {
    0% { transform: translate(0px, 0px) scale(1); }
    33% { transform: translate(30px, -50px) scale(1.1); }
    66% { transform: translate(-20px, 20px) scale(0.9); }
    100% { transform: translate(0px, 0px) scale(1); }
}

/* --- 2. Utilities --- */
.glass {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.glass-nav {
    background: rgba(12, 10, 9, 0.8);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.text-gradient {
    background: linear-gradient(135deg, #e7e5e4 0%, #a78bfa 50%, #fbbf24 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-link { position: relative; }
/* Desktop underline effect */
.nav-item::after {
    content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 1px;
    background-color: #f59e0b; transition: width 0.3s ease;
}
.nav-item:hover::after { width: 100%; }

/* --- 3. Scroll & Motion System --- */

/* A. Scroll Reveal (The "Flow") */
.reveal-scroll {
    opacity: 0;
    transition: all 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Variations */
.reveal-up { transform: translateY(40px); }
.reveal-left { transform: translateX(-40px); }
.reveal-right { transform: translateX(40px); }
.reveal-scale { transform: scale(0.95); }

.reveal-scroll.active {
    opacity: 1;
    transform: translate(0) scale(1);
}

/* B. Nav Transition (The "Cinema Wipe") */
.page-wiper {
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    display: flex;
    flex-direction: column;
}

.wiper-layer {
    width: 100%;
    height: 100%;
    transform: translateY(100%);
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1);
}

.wiper-1 { background: #1c1917; z-index: 2; } /* Base dark layer */
.wiper-2 { background: rgba(139, 92, 246, 0.1); backdrop-filter: blur(20px); z-index: 3; margin-top: -100vh; transition-delay: 0.1s;} /* Glass accent layer */

/* Active state for wiping IN (Up) */
.page-wiper.wiping-in .wiper-layer {
    transform: translateY(0%);
}

/* Active state for wiping OUT (Up and away) */
.page-wiper.wiping-out .wiper-layer {
    transform: translateY(-100%);
}

/* Content Scale Effect during Transition */
#main-content {
    transition: transform 0.8s cubic-bezier(0.7, 0, 0.3, 1), opacity 0.4s ease;
    transform-origin: center top;
}
body.transitioning #main-content {
    transform: scale(0.95) translateY(20px);
    opacity: 0.6;
    filter: blur(2px);
}

/* --- 4. Custom Cursor --- */
.cursor-dot, .cursor-outline {
    position: fixed; top: 0; left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%; z-index: 10000;
    pointer-events: none; display: none;
}
.cursor-dot { width: 8px; height: 8px; background-color: #f59e0b; }
.cursor-outline {
    width: 40px; height: 40px;
    border: 1px solid rgba(245, 158, 11, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}
body.hovering .cursor-outline {
    width: 60px; height: 60px;
    background-color: rgba(245, 158, 11, 0.1);
    border-color: transparent;
}

/* --- 5. Gallery & Modal --- */
.gallery-card:hover .card-thumb { transform: scale(1.05); }
.gallery-card:hover .card-overlay { opacity: 1; }

#lightbox-modal {
    transition: opacity 0.3s ease;
}
#lightbox-modal.hidden { opacity: 0; pointer-events: none; }
#lightbox-modal:not(.hidden) { opacity: 1; pointer-events: auto; }

/* Timeline Line */
.timeline-line::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
    background: linear-gradient(to bottom, transparent, #8b5cf6, transparent); opacity: 0.5;
}
@media (min-width: 768px) { .timeline-line::before { left: 50%; transform: translateX(-50%); } }

/* --- 6. Project Cards (New Interactive Layout) --- */
.project-card {
    cursor: pointer; /* Indicates interactivity */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-thumb-container {
    position: relative;
    width: 100%;
    height: 200px; /* Fixed height for consistency */
    overflow: hidden;
    background-color: #1c1917;
}

.project-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s ease;
}

.project-card:hover .project-thumb {
    transform: scale(1.05);
}

/* Bullet points in project card */
.project-bullets {
    list-style-type: none; /* We will add custom markers if needed, or use layout */
    margin: 0;
    padding: 0;
}
.project-bullets li {
    position: relative;
    padding-left: 1.25rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem; /* text-sm */
    color: #a8a29e; /* text-stone-400 */
    line-height: 1.5;
}
.project-bullets li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #f59e0b; /* accentWarm */
    font-weight: bold;
}

/* --- 7. Navigation Cleanup (No "Ugly Box") --- */
.nav-link:focus {
    outline: none; /* Removes default browser focus ring */
}
/* Optional: Add a subtle style for keyboard navigation users only if needed, 
   but strictly removing the outline as requested for mouse clicks. */

/* --- 8. Scroll Progress Bar --- */
.scroll-progress-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, 0.05);
    z-index: 60; /* Above navbar background */
}

.scroll-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #8b5cf6, #f59e0b); /* Accent gradient */
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
    transition: width 0.1s linear;
}

/* --- 9. Back to Top Button --- */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: rgba(12, 10, 9, 0.8); /* Dark background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f59e0b; /* Accent warm */
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 40;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none; /* Not clickable when hidden */
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    backdrop-filter: blur(8px);
}

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

#back-to-top:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile adjustment for Back-to-Top */
@media (max-width: 768px) {
    #back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 2.5rem;
        height: 2.5rem;
    }
}