@import "tailwindcss";

/* --- Base Styles and Variables --- */
@layer base {
    :root {
        --bg-color: #0f172a;
        --text-primary: #ffffff;
        --text-secondary: #94a3b8;
        --spotlight-color: rgba(29, 78, 216, 0.15);
        --nav-indicator: #475569;
        --card-hover: rgba(30, 41, 59, 0.4);
        --tag-bg: rgba(45, 212, 191, 0.1);
        --tag-text: #5eead4;
        --social-hover: #5eead4; 
        
        /* Initialization for Spotlight JS */
        --x: 50%;
        --y: 50%;
    }

    [data-theme="dark"] {
        --bg-color: #111111;
        --text-primary: #ffffff;
        --text-secondary: #a1a1aa;
        --spotlight-color: rgba(255, 255, 255, 0.05);
        --nav-indicator: #3f3f46;
        --card-hover: rgba(26, 26, 26, 0.5);
        --tag-bg: rgba(45, 212, 191, 0.1);
        --tag-text: #5eead4;
        --social-hover: #5eead4;
    }

    [data-theme="light"] {
        --bg-color: #ffffff;
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --spotlight-color: rgba(15, 23, 42, 0.05);
        --nav-indicator: #cbd5e1;
        --card-hover: rgba(241, 245, 249, 0.7);
        --tag-bg: rgba(37, 99, 235, 0.15); 
        --tag-text: #1d4ed8; 
        --social-hover: #2563eb;
    }

    body { 
        font-family: 'Inter', sans-serif; 
        background-color: var(--bg-color);
        color: var(--text-secondary);
        transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        margin: 0;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* --- Components & Animations --- */
@layer components {
    /* --- STICKY MOBILE HEADER --- */
    .mobile-header-bar {
        display: none; 
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 64px;
        background-color: var(--bg-color);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--nav-indicator);
        z-index: 1000;
        align-items: center;
        justify-content: space-between;
        padding: 0 1.5rem;
        transition: background-color 0.5s ease;
    }

    /* Navigation Line Easing (The "Magnetic" Feather) */
    .nav-indicator {
        transition: width 0.4s cubic-bezier(0.77, 0, 0.175, 1), 
                    background-color 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        will-change: width;
    }

    .nav-text {
        transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    letter-spacing 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        will-change: color, letter-spacing;
    }
    
    .nav-link.active .nav-indicator,
    .nav-link:hover .nav-indicator {
        width: 4.5rem !important; 
        background-color: var(--text-primary) !important;
    }

    .nav-link.active .nav-text,
    .nav-link:hover .nav-text {
        color: var(--text-primary) !important;
        letter-spacing: 0.15em;
    }

    .title-hover {
        transition: color 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        cursor: default;
    }
    .title-hover:hover { color: var(--tag-text); }
    .group:hover .card-title-highlight { color: var(--tag-text) !important; }

    .social-icon {
        display: inline-block; 
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        color: var(--text-secondary);
        z-index: 50;
        position: relative;
    }
    .social-icon:hover { 
        color: var(--social-hover) !important; 
        transform: translateY(-4px);
    }

    .experience-tag {
        background-color: var(--tag-bg) !important;
        color: var(--tag-text) !important;
        transition: all 0.2s ease;
    }
    .experience-tag:hover { transform: scale(1.05); }

    /* --- Hamburger Menu Icon Logic --- */
    .menu-toggle {
        z-index: 1002;
        background: none;
        border: none;
        cursor: pointer;
    }

    .hamburger {
        width: 24px;
        height: 2px;
        background-color: var(--text-primary);
        position: relative;
        transition: all 0.3s ease-in-out;
    }

    .hamburger::before, .hamburger::after {
        content: '';
        position: absolute;
        width: 24px;
        height: 2px;
        background-color: var(--text-primary);
        left: 0;
        transition: all 0.3s ease-in-out;
    }

    .hamburger::before { top: -8px; }
    .hamburger::after { top: 8px; }

    .menu-toggle.active .hamburger { background-color: transparent; }
    .menu-toggle.active .hamburger::before { transform: rotate(45deg) translate(5px, 6px); }
    .menu-toggle.active .hamburger::after { transform: rotate(-45deg) translate(5px, -6px); }

    /* --- Fullscreen Mobile Menu --- */
    .mobile-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background-color: var(--bg-color);
        z-index: 999;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: right 0.6s cubic-bezier(0.23, 1, 0.32, 1);
        backdrop-filter: blur(12px);
    }

    .mobile-menu.open { right: 0; }

    .mobile-nav-link { 
        color: var(--text-secondary); 
        font-size: 1.5rem;
        font-weight: 500;
        transition: color 0.3s ease;
    }
    
    .mobile-nav-link.active { color: var(--text-primary) !important; }

    /* --- Theme Button Transitions --- */
    .theme-btn {
        color: var(--text-secondary);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        align-items: center;
        gap: 8px;
        z-index: 50;
        position: relative;
    }
    .theme-btn:hover { color: var(--text-primary); transform: scale(1.1); }

    .view-all-link {
        display: inline-flex;
        align-items: center;
        font-weight: 600;
        color: var(--text-primary);
        transition: color 0.3s ease;
        position: relative;
        z-index: 50;
    }
    
    .view-all-link:hover { color: var(--tag-text); }
    .view-all-link svg { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
    .view-all-link:hover svg { transform: translateX(6px); }
    .view-all-link.resume-link:hover svg { transform: translate(6px, -6px); }

    @media (max-width: 1024px) {
        .mobile-header-bar { display: flex; }
        body { padding-top: 64px; } /* Ensures content starts after the sticky bar */
    }

}

/* --- Utility Classes --- */
@layer utilities {
    .spotlight {
        background: radial-gradient(600px at var(--x) var(--y), var(--spotlight-color), transparent 80%);
        pointer-events: none;
        position: fixed;
        inset: 0;
        z-index: 1;
        transition: background 0.15s ease-out;
    }
}