#page-wipe {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh; /* Cover the hero section height (nav + header content) */
  z-index: 9999;
  background-color: var(--bg-color);
  animation: wipeUp 1.0s ease forwards;
  pointer-events: none;
  opacity: 1;
  will-change: transform;
}

@keyframes wipeUp {
  0% {
    transform: translateY(0%);
  }
  100% {
    transform: translateY(-100%);
  }
}

/* Fade/slide-in after loading (page-transition wipe removed) */
body.loaded header {
  animation: fadeInHeader 0.85s ease forwards;
}

body.loaded nav {
  animation: slideDownNav 0.7s ease forwards;
}

body.loaded section,
body.loaded footer {
  animation: fadeInContent 0.85s ease forwards;
}

@keyframes fadeInContent {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDownNav {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInHeader {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Home page hero panels - staggered slide-in */
body.loaded header .hero-left {
  animation: slideInFromLeft 0.9s ease forwards;
  animation-delay: 0.15s;
  opacity: 0;
}

body.loaded header .hero-center {
  animation: fadeInContent 0.9s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}

body.loaded header .hero-right {
  animation: slideInFromRight 0.9s ease forwards;
  animation-delay: 0.45s;
  opacity: 0;
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 1. Pulse animation for social links */
.social-links a {
    transition: all 0.3s ease;
}

.social-links a:hover {
    animation: pulse 0.6s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}


/* 2. Smooth scroll progress indicator */
.scroll-progress {
    display: none;
}

/* 3. Magnetic hover effect for buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);

    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

/* 4. Bouncing arrow for scroll hint - simplified and clickable */
.scroll-hint {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* Make sure it's on top */
}

.scroll-hint a {
    display: inline-block;
    color: var(--comment-color);
    font-size: 2rem; /* Make it bigger for easier clicking */
    text-decoration: none;
    padding: 10px; /* Add padding for larger click area */
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}
/* 5. Smooth reveal for section decorators */
.section-decorator {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s ease;
}

/* Add this class when section comes into view */
.section-decorator.animate {
    transform: scaleX(1);
}

@keyframes revealBar {
    to {
        transform: scaleX(1);
    }
}

/* 6. Breathing effect for the GitHub link */
.github-link {
    animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

/* 7. Smooth line drawing for timeline - triggered on scroll */
.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2px;
    height: 0;
    background-color: var(--function-color);
    transition: height 2s ease-out;
}

/* Add this class when timeline comes into view */
.timeline.animate::before {
    height: 100%;
}

@keyframes drawLine {
    from {
        height: 0;
    }
    to {
        height: 100%;
    }
}

/* 8. project card hover with 3D effect */
.project-card:hover {
    border-color: var(--variable-color);
}

/* 9. skill category hover with 3D effect */
.skill-category:hover {
    border-color: var(--variable-color);
}

/* 10. Photo gallery enhanced hover */
.gallery-item:hover {
    border-color: var(--variable-color);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* 11. Smooth zoom on image hover */
.zoomable {
    overflow: hidden;
    border-radius: 8px;
}

.zoomable img {
    transition: transform 0.5s ease;
}

.zoomable:hover img {
    transform: scale(1.15);
}

/* Typing Effect Loader - Fixed Width */
.typing-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    font-family: var(--font-code);
    opacity: 1;
    transition: opacity 0.5s ease;
}

.typing-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.typing-text {
    color: var(--function-color);
    font-size: 1.5rem;
    white-space: nowrap;
    overflow: hidden;
    border-right: 2px solid var(--function-color);
    width: 0;
    animation: 
        typing 2.0s steps(50) forwards,
        loaderBlink 1s infinite; /* Changed from 'blink' to 'loaderBlink' */
}

.typing-text.finished {
    animation: loaderBlink 1s infinite; /* Changed here too */
    width: 50;
    border-right: none;
}

@keyframes typing {
    from { 
        width: 0; 
    }
    to { 
        width: 50ch;
    }
}

@keyframes loaderBlink { /* Renamed from 'blink' to 'loaderBlink' */
    0%, 50% { border-color: var(--function-color); }
    51%, 100% { border-color: transparent; }
}
/* ========================================
   PAGE-TO-PAGE NAVIGATION
   ======================================== */

/* Cross-page transitions (Chrome, Edge, Safari): the old page stays up until the
   new one is ready, then crossfades. The nav is its own layer so it holds still. */
@view-transition {
  navigation: auto;
}

nav {
  view-transition-name: site-nav;
}

::view-transition-group(site-nav) {
  animation: none;
}

::view-transition-old(site-nav) {
  display: none;
}

::view-transition-new(site-nav) {
  animation: none;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.25s;
}

/* Returning visitors (set by the inline <head> script): nav is just there,
   content does a quicker, subtler fade, and the first-visit loader never shows */
html.returning .loading-screen {
  display: none;
}

html.returning nav,
html.returning body.loaded nav {
  opacity: 1;
  pointer-events: auto;
  animation: none;
}

html.returning body.loaded header,
html.returning body.loaded section,
html.returning body.loaded footer {
  animation-duration: 0.45s;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }
}
