/*
    animations.css
    --------------
    Dedicated stylesheet for all transitions, entrance reveals,
    hover micro-interactions, and accordion drawer animations.
*/

/* ----------------------------------------
    1. Global Theme Switch Smoothing
    ---------------------------------------- */
*,
*::before,
*::after {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* ----------------------------------------
    2. Staggered Entrance Reveal (Top to Bottom)
    ---------------------------------------- */
.reveal,
.project-list li {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

body.ready .reveal,
body.ready .project-list li {
    opacity: 1;
    transform: translateY(0);
}

/* Cascading load delays */
body.ready .profile.reveal { transition-delay: 0.10s; }
body.ready .currently.reveal { transition-delay: 0.24s; }
body.ready .about.reveal { transition-delay: 0.38s; }
body.ready .projects-header.reveal { transition-delay: 0.50s; }

body.ready .project-list li:nth-child(1) { transition-delay: 0.62s; }
body.ready .project-list li:nth-child(2) { transition-delay: 0.74s; }
body.ready .project-list li:nth-child(3) { transition-delay: 0.86s; }
body.ready .project-list li:nth-child(4) { transition-delay: 0.98s; }

body.ready .more-works.reveal { transition-delay: 1.10s; }
body.ready .socials.reveal { transition-delay: 1.25s; }

/* Once initial load sequence completes, reset transition delays so resizes respond instantly */
body.anim-done .reveal,
body.anim-done .project-list li {
    transition-delay: 0s !important;
}

/* ----------------------------------------
    3. Accordion: History Collapse / Expand
    ---------------------------------------- */
.prev-roles-toggle {
    transition: color 0.2s ease;
}

.prev-roles-toggle .toggle-icon {
    transition: transform 0.25s ease;
}

.prev-roles-toggle.expanded .toggle-icon {
    transform: rotate(180deg);
}

.prev-roles-grid {
    transition: max-height 0.25s ease, opacity 0.25s ease;
}

/* ----------------------------------------
    4. Project Row Interactions
    ---------------------------------------- */
.project-list li a {
    transition: background-color 0.15s ease;
}

.project-left {
    transition: transform 0.15s ease;
}

.arrow-box {
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.project-list li a:hover .arrow-box {
    transform: translate(1px, -1px);
}

/* ----------------------------------------
    5. More Works & Socials Micro-interactions
    ---------------------------------------- */
.more-works a {
    transition: color 0.2s ease;
}

.more-works a svg {
    transition: transform 0.2s ease;
}

.more-works a:hover svg {
    transform: translate(2px, -2px);
}

.socials a {
    transition: color 0.2s ease;
}

.socials a::after {
    transition: opacity 0.2s ease;
}

/* ----------------------------------------
    6. Hover Card Preview Transitions
    ---------------------------------------- */
#hover-card {
    transition: opacity 0.2s ease, transform 0.2s ease;
}
