/* Premium Hero Enhancements */

/* 1. Subtle fade-in stagger animation */
body:not(.is-preload) #header > .logo {
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s !important;
}

body:not(.is-preload) #header > .content {
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s !important;
}

body:not(.is-preload) #header > nav {
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s, transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s !important;
}

#header .inner > * {
    opacity: 0;
    transform: translateY(15px);
}

body:not(.is-preload) #header .inner h1 {
    animation: fadeUpStagger 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.4s forwards;
}

body:not(.is-preload) #header .inner p:first-of-type {
    animation: fadeUpStagger 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.55s forwards;
}

body:not(.is-preload) #header .inner p:last-of-type {
    animation: fadeUpStagger 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) 0.7s forwards;
}

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

/* 2. Floating laptop icon and breathing animation */
#header .logo {
    animation: logoBreathe 5s ease-in-out infinite alternate !important;
    transform-origin: center;
}

#header .logo .fa-laptop {
    display: inline-block;
    animation: logoFloat 4s ease-in-out infinite alternate;
}

@keyframes logoBreathe {
    0% {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
        border-color: rgba(255, 255, 255, 0.6);
    }
    100% {
        box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 1);
    }
}

@keyframes logoFloat {
    0% {
        transform: translateY(2px);
    }
    100% {
        transform: translateY(-4px);
    }
}

/* 3. Animated gradient underline beneath name */
#header .inner h1 {
    position: relative;
    display: inline-block; 
}

#header .inner h1::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    background-size: 200% 100%;
    animation: gradientShimmer 4s linear infinite;
    border-radius: 2px;
}

@keyframes gradientShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}



/* 5. Resume button styling & Magnetic transition */
#header .inner p:last-of-type a {
    display: inline-block;
    transition: transform 0.15s cubic-bezier(0.2, 0.8, 0.2, 1), text-shadow 0.3s ease;
    will-change: transform;
    padding: 8px 16px;
    border-radius: 8px; 
    border-bottom: none !important; /* Remove legacy dotted border */
}

/* 6. General Elegance for Navigation */
#header nav ul li a {
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

#header nav ul li a:hover {
    background-color: transparent !important;
    text-shadow: 0 0 12px rgba(255,255,255,0.4);
    transform: translateY(-2px);
    color: #fff;
}

/* 7. Layout overrides to remove gap and center text */

#header > nav::before {
    display: none !important; /* Hide the original unaligned vertical line */
}

/* Draw a perfectly aligned connecting line up into the content box */
@media screen and (min-width: 481px) {
    #header nav ul li:nth-child(5) {
        position: relative;
    }

    #header nav ul li:nth-child(5)::after {
        content: '';
        display: block;
        position: absolute;
        bottom: 100%; /* Extends directly up from the border */
        left: -1px; /* Align perfectly with the 1px border-left */
        width: 1px;
        height: 3.5rem;
        background: #ffffff;
        pointer-events: none;
    }
}

#header nav ul {
    justify-content: center !important;
    align-items: stretch !important;
}

#header nav ul li {
    display: flex;
}

#header nav ul li a {
    text-align: center !important;
    padding: 0 1rem !important;
    min-width: 5rem !important; /* Reduced to shrink boxes */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important; /* Prevent text wrapping from breaking alignment */
}

/* 8. Restore List Formatting for Content Articles */
#main article ul:not(.alt):not(.actions):not(.contact) {
    list-style-type: disc !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin-bottom: 2rem;
}

#main article ol {
    list-style-type: decimal !important;
    list-style-position: outside !important;
    padding-left: 1.5rem !important;
    margin-bottom: 2rem;
}

#main article ul:not(.alt):not(.actions):not(.contact) li,
#main article ol li {
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}
