@import url('https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&family=Playfair+Display:italic,wght@400;700&display=swap');

:root {
    --bg: #080808;
    --text: #f0f0f0;
    --accent: #555;
    --highlight: #ffffff;
    --glass: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.15);
}

body.light-mode {
    --bg: #f5f5f5;
    --text: #121212;
    --accent: #888;
    --highlight: #000000;
    --glass: rgba(0, 0, 0, 0.03);
    --border: rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text);
    margin: 0;
    overflow-x: hidden;
    cursor: none;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease, color 0.5s ease;
}

.serif {
    font-family: 'Playfair Display', serif;
}

/* Smooth Scroll */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Decorative Layout Border */
.layout-border {
    position: fixed;
    top: 30px;
    left: 30px;
    right: 30px;
    bottom: 30px;
    border: 1px solid var(--border);
    pointer-events: none;
    z-index: 5;
    transition: border-color 0.5s ease;
}

/* Enhanced Custom Cursor */
#custom-cursor {
    width: 6px;
    height: 6px;
    background: var(--highlight);
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10000;
    mix-blend-mode: difference;
    transition: transform 0.1s ease-out, opacity 0.3s ease;
}

#cursor-follower {
    width: 44px;
    height: 44px;
    border: 1px solid var(--highlight);
    opacity: 0.4;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: width 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        height 0.3s cubic-bezier(0.23, 1, 0.32, 1),
        background 0.3s ease,
        border-color 0.3s ease,
        opacity 0.3s ease;
}

/* Ensure visibility in Light Mode */
body.light-mode #custom-cursor,
body.light-mode #cursor-follower {
    mix-blend-mode: normal;
    opacity: 1;
}

/* Hover states for the cursor */
body.hovering #cursor-follower {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--highlight);
    opacity: 1;
}

body.hovering #custom-cursor {
    transform: scale(0.5);
    opacity: 0.5;
}

/* Click state for the cursor */
body.clicking #cursor-follower {
    transform: translate(-50%, -50%) scale(0.8) !important;
    background: rgba(255, 255, 255, 0.2);
}

section {
    position: relative;
    z-index: 10;
    padding: 15vh 8vw;
    scroll-margin-top: 100px;
}

.nav-link {
    position: relative;
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.4;
    transition: all 0.4s ease;
    color: var(--text);
}

.nav-link:hover {
    opacity: 1;
    transform: translateY(-2px);
}

/* Custom Context Menu Glass Effect */
#custom-context-menu {
    position: fixed;
    z-index: 10002;
    display: none;
    flex-direction: column;
    min-width: 200px;
    padding: 8px;
    background: rgba(10, 10, 10, 0.95);
    /* Fallback */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    @supports (backdrop-filter: blur(15px)) or (-webkit-backdrop-filter: blur(15px)) {
        background: var(--glass);
    }

    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: contextMenuFade 0.2s ease-out;
}

@keyframes contextMenuFade {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

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

.context-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text);
    opacity: 0.85;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: none;
}

.context-item:hover {
    background: var(--border);
    opacity: 1;
}

/* Notification Toast */
#notification-toast {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 10005;
    padding: 12px 24px;
    background: var(--highlight);
    color: var(--bg);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
}

#notification-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Cinematic Curtain Mobile Menu */
/* Cinematic Portal Mobile Menu */
#mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    transform: translateY(-100%) scale(1.1);
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

#mobile-menu::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.03) 0%, transparent 60%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: -1;
}

#mobile-menu.active {
    transform: translateY(0) scale(1);
    opacity: 1;
}

#mobile-menu a.menu-link {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: clamp(3rem, 12vw, 4.5rem);
    line-height: 1;
    color: #fff;
    text-decoration: none;
    position: relative;
    opacity: 0;
    transform: translateY(40px) skewY(5deg);
    transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    mix-blend-mode: overlay;
}

#mobile-menu.active a.menu-link {
    opacity: 1;
    transform: translateY(0) skewY(0);
    mix-blend-mode: normal;
}

#mobile-menu a.menu-link:hover {
    opacity: 0.8;
    transform: scale(1.05);
    /* subtle scale on hover */
}

/* Resume Button Special Style */
#mobile-menu a.resume-pill {
    margin-top: 2rem;
    padding: 1rem 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 9999px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

#mobile-menu.active a.resume-pill {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.5s;
}

#mobile-menu a.resume-pill:hover {
    background: rgba(255, 255, 255, 1);
    color: #000;
    border-color: #fff;
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

/* Stagger Delays */
#mobile-menu.active a.menu-link:nth-of-type(1) {
    transition-delay: 0.1s;
}

#mobile-menu.active a.menu-link:nth-of-type(2) {
    transition-delay: 0.2s;
}

#mobile-menu.active a.menu-link:nth-of-type(3) {
    transition-delay: 0.3s;
}

#mobile-menu.active a.menu-link:nth-of-type(4) {
    transition-delay: 0.4s;
}

.mobile-socials {
    display: flex;
    gap: 2.5rem;
    margin-top: 3rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease 0.6s;
}

#mobile-menu.active .mobile-socials {
    opacity: 1;
    transform: translateY(0);
}


/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    filter: blur(5px);
    transition: all 1s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

/* Project Cards */
.project-card {
    border-bottom: 1px solid var(--border);
    transition: all 0.5s ease;
}

.project-card:hover {
    border-bottom-color: var(--highlight);
    padding-left: 20px;
}

/* Refined Animated Timeline */
.timeline-item {
    position: relative;
    padding-left: 45px;
    margin-bottom: 80px;
}

/* The Track (Stationary Background Line) */
.timeline-item::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 0;
    bottom: -80px;
    width: 1px;
    background: var(--border);
    z-index: 1;
}

/* The Animated Dot */
.dot {
    position: absolute;
    left: 0;
    top: 10px;
    width: 10px;
    height: 10px;
    background: var(--highlight);
    border-radius: 50%;
    z-index: 3;
    transform: scale(0);
    transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}


.timeline-item.active .dot {
    transform: scale(1);
    box-shadow: 0 0 20px var(--border);
}



.timeline-item:last-child::before {
    display: none;
}



/* Navbar dynamic styles */
#main-nav.scrolled {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    background: var(--bg);
    opacity: 0.95;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
    .layout-border {
        display: none;
    }

    #custom-cursor,
    #cursor-follower {
        display: none;
    }

    body {
        cursor: auto;
    }

    section {
        padding: 10vh 6vw;
    }

    h1 {
        font-size: clamp(3rem, 10vw, 5rem) !important;
        line-height: 1.1;
    }

    .project-card h4 {
        font-size: 1.75rem !important;
    }

    #mobile-menu a.menu-link {
        font-size: clamp(2.5rem, 10vw, 3.5rem) !important;
    }

    /* Better spacing for timeline on mobile */
    .timeline-item {
        padding-left: 30px;
        margin-bottom: 60px;
    }

    .timeline-item::before {
        left: 0;
    }

    .dot {
        left: -4px;
    }

    /* Adjust section padding for better mobile feel */
    section {
        padding: 12vh 6vw;
    }
}
