/* =================================================================== */
/*        PORTFOLIO STYLESHEET - THE ABSOLUTE FINAL VERSION        */
/* =================================================================== */

:root {
    --primary-color: #6D5B97;
    --secondary-color: #A0D2DB;
    --background-color: #FEF9F3;
    --card-bg: #FFFFFF;
    --text-color: #4a4a4a;
    --heading-color: #333;
    --shadow: 0 5px 15px rgba(109, 91, 151, 0.07);
    --hero-gradient: linear-gradient(135deg, rgba(160, 210, 219, 0.2), rgba(109, 91, 151, 0.2));
    --header-bg: rgba(254, 249, 243, 0.8);
    --border-color: #EAEAEA;
    --subtitle-color: #7e61b2;
}

body.dark-mode {
    --primary-color: #b39ddb;
    --secondary-color: #8c7ca8;
    --background-color: #161222;
    --card-bg: #211a33;
    --text-color: #c9c3d9;
    --heading-color: #FFFFFF;
    --shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    --hero-gradient: linear-gradient(135deg, #2a214a, #161222);
    --header-bg: rgba(22, 18, 34, 0.8);
    --border-color: #3a3052;
    --subtitle-color: #9575cd;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.7;
    transition: background-color 0.5s ease, color 0.5s ease;
    -webkit-font-smoothing: antialiased;
}
.container { max-width: 1200px; margin: auto; padding: 0 20px; }

h1, h3 { font-family: 'Poppins', sans-serif; color: var(--heading-color); transition: color 0.5s ease; }
h2 {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 600;
    margin-bottom: 50px;
    position: relative;
    color: #6D5B97;
}
h2::after {
    content: ""; width: 70px; height: 4px; background: var(--secondary-color); display: block; margin: 15px auto 0; border-radius: 2px; transition: background-color 0.5s ease;
}
section { padding: 100px 0; }

header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: fixed; width: 100%; top: 0; z-index: 1000;
    transition: background-color 0.5s ease, border-color 0.5s ease;
}
header nav { display: flex; justify-content: space-between; align-items: center; height: 70px; }
.logo img { height: 50px; transition: transform 0.3s ease; }
.logo:hover img { transform: scale(1.05) rotate(-3deg); }
.nav-right { display: flex; align-items: center; gap: 15px; }
.nav-links { display: flex; list-style: none; gap: 35px; }
.nav-links a { text-decoration: none; color: var(--text-color); font-weight: 500; position: relative; transition: color 0.3s ease; }
.nav-links a::after { content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 50%; transform: translateX(-50%); background-color: var(--primary-color); transition: width 0.4s ease; }
.nav-links a:hover { color: var(--primary-color); }
.nav-links a:hover::after { width: 100%; }

main { padding-top: 60px; }
#hero {
    background: var(--hero-gradient);
    background-size: 150% 150%;
    min-height: 95vh;
    display: flex; align-items: center; justify-content: center; text-align: center;
    position: relative; overflow: hidden;
    transition: background-position 0.1s linear, background 0.5s ease;
}
.hero-content > * { opacity: 0; transform: translateY(20px); transition: opacity 0.8s ease-out, transform 0.8s ease-out; }
.hero-content h1 {
    font-size: 3.8rem; 
    font-weight: 700;
    color: #6D5B97;
    margin-bottom: 10px;
}
body.dark-mode .hero-content h1 { color: #c3aed6; }
.tagline { font-size: 1.3rem; font-style: italic; color: var(--text-color); opacity: 0.8; margin-bottom: 40px; }

.subtitle-wrapper { position: relative; overflow: hidden; display: inline-block; margin-bottom: 20px; }
#subtitle {
    font-size: 1.8rem; font-weight: 400; color: var(--subtitle-color);
    transform: translateY(110%); animation: revealText 1s cubic-bezier(0.22, 1, 0.36, 1) 0.8s forwards; margin: 0;
}
.subtitle-wrapper::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: var(--subtitle-color);
    transform: scaleX(0); transform-origin: left; animation: revealCurtain 1s cubic-bezier(0.22, 1, 0.36, 1) 0.5s forwards;
}
@keyframes revealText { to { transform: translateY(0); } }
@keyframes revealCurtain {
    0% { transform: scaleX(0); transform-origin: left; } 45% { transform: scaleX(1); transform-origin: left; }
    55% { transform: scaleX(1); transform-origin: right; } 100% { transform: scaleX(0); transform-origin: right; }
}

.hero-buttons { display: flex; justify-content: center; gap: 20px; }
.btn { display: inline-block; padding: 15px 35px; border-radius: 50px; text-decoration: none; font-weight: 600; transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); border: 2px solid transparent; }
.btn-primary { background: var(--primary-color); color: #fff; }
.btn-primary:hover { background: var(--secondary-color); color: var(--heading-color); transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }
.btn-secondary { background: transparent; color: var(--primary-color); border-color: var(--primary-color); }
.btn-secondary:hover { background: var(--primary-color); color: #fff; transform: translateY(-5px); }

/* =================================================================== */
/*                    Hero Profile Photo                               */
/* =================================================================== */
.hero-photo-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.hero-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    box-shadow:
        0 0 0 6px rgba(109, 91, 151, 0.18),
        0 12px 40px rgba(109, 91, 151, 0.22);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-photo:hover {
    transform: scale(1.06);
    box-shadow:
        0 0 0 8px rgba(109, 91, 151, 0.25),
        0 16px 50px rgba(109, 91, 151, 0.3);
}

body.dark-mode .hero-photo {
    border-color: #2a214a;
    box-shadow:
        0 0 0 6px rgba(179, 157, 219, 0.2),
        0 12px 40px rgba(0, 0, 0, 0.4);
}

/* =================================================================== */
/*                    Hero Social Icons                                */
/* =================================================================== */
.hero-socials {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 30px;
}

.hero-social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--primary-color);
    border: 1.5px solid var(--border-color);
    text-decoration: none;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 3px 10px rgba(109, 91, 151, 0.08);
}

.hero-social-link:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(109, 91, 151, 0.25);
}

body.dark-mode .hero-social-link {
    background: rgba(255,255,255,0.05);
    border-color: var(--border-color);
}

body.dark-mode .hero-social-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* =================================================================== */
/*                      Education Section                              */
/* =================================================================== */
#education {
    background: linear-gradient(180deg, rgba(160, 210, 219, 0.07) 0%, var(--background-color) 100%);
    transition: background 0.5s ease;
}

body.dark-mode #education {
    background: linear-gradient(180deg, rgba(109, 91, 151, 0.08) 0%, var(--background-color) 100%);
}

.education-card {
    max-width: 860px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 40px 44px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 28px;
    align-items: flex-start;
    transition: background-color 0.5s ease, border-color 0.5s ease,
                box-shadow 0.4s ease, transform 0.4s ease;
}

.education-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(109, 91, 151, 0.13);
    border-color: rgba(109, 91, 151, 0.25);
}

body.dark-mode .education-card:hover {
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    border-color: rgba(179, 157, 219, 0.25);
}

.edu-icon {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(109, 91, 151, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: background 0.3s ease, color 0.5s ease;
}

.education-card:hover .edu-icon {
    background: var(--primary-color);
    color: #fff;
}

.edu-body { flex: 1; }

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.edu-university {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 5px;
}

.edu-faculty {
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 3px;
}

.edu-major {
    font-size: 0.9rem;
    color: var(--text-color);
    opacity: 0.75;
}

.edu-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.6;
    white-space: nowrap;
    padding-top: 4px;
    letter-spacing: 0.02em;
}

.edu-details {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.edu-badge,
.edu-activity {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    transition: background 0.3s ease, border-color 0.3s ease;
}

.edu-badge {
    background: rgba(109, 91, 151, 0.09);
    color: var(--primary-color);
    border: 1px solid rgba(109, 91, 151, 0.18);
}

.edu-activity {
    background: rgba(160, 210, 219, 0.15);
    color: var(--text-color);
    border: 1px solid rgba(160, 210, 219, 0.35);
}

body.dark-mode .edu-badge {
    background: rgba(179, 157, 219, 0.1);
    border-color: rgba(179, 157, 219, 0.2);
}

body.dark-mode .edu-activity {
    background: rgba(140, 124, 168, 0.12);
    border-color: rgba(140, 124, 168, 0.25);
    color: var(--text-color);
}

/* =================================================================== */
/*                    Enhanced Contact Section                         */
/* =================================================================== */
#contact { text-align: center; background: var(--hero-gradient); transition: background 0.5s ease; }
#contact p { margin-bottom: 40px; font-size: 1.1rem; max-width: 600px; margin-left: auto; margin-right: auto; }

.contact-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.contact-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 28px;
    text-decoration: none;
    color: var(--text-color);
    min-width: 260px;
    box-shadow: var(--shadow);
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.contact-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(109, 91, 151, 0.15);
    border-color: var(--primary-color);
}

body.dark-mode .contact-card:hover {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.contact-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(109, 91, 151, 0.09);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: background 0.3s ease, color 0.3s ease;
}

.contact-card:hover .contact-icon {
    background: var(--primary-color);
    color: #fff;
}

.contact-info {
    display: flex;
    flex-direction: column;
    text-align: left;
    gap: 3px;
}

.contact-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.contact-value {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-color);
}

/* =================================================================== */
/*             Existing Cards (Projects, Skills, Certs)                */
/* =================================================================== */
.project-card, .skills-category, .cert-card {
    background: var(--card-bg); box-shadow: var(--shadow); border: 1px solid var(--border-color);
    transition: background-color 0.5s ease, box-shadow 0.4s ease, transform 0.4s ease, border-color 0.5s ease;
}

.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 40px; }
.project-card { border-radius: 15px; overflow: hidden; display: flex; flex-direction: column; }
.project-card:hover { transform: translateY(-15px); box-shadow: 0 15px 30px rgba(109, 91, 151, 0.12); }
body.dark-mode .project-card:hover { box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4); }
.project-card img { width: 100%; height: 220px; object-fit: cover; }
.project-info { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.project-info h3 { font-size: 1.5rem; margin-bottom: 15px; }
.project-info p { margin-bottom: 25px; font-size: 1rem; flex-grow: 1; }
.project-info .tools span { display: inline-block; background: var(--background-color); color: var(--primary-color); padding: 6px 12px; border-radius: 6px; font-size: 0.85rem; font-weight: 600; margin-right: 6px; margin-bottom: 6px; transition: background-color 0.5s ease, color 0.5s ease; }

.btn-project {
    display: inline-block; background: var(--primary-color); color: #fff; padding: 12px 25px;
    border-radius: 8px;
    text-decoration: none; font-weight: 600; text-align: center; margin-top: auto;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); border: 2px solid transparent;
}
.btn-project:hover { background: #5a4a7d; color: #fff; transform: scale(1.05); }
body.dark-mode .btn-project { background: #8c7ca8; }
body.dark-mode .btn-project:hover { background: var(--primary-color); }

.skills-wrapper { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.skills-category { padding: 40px; border-radius: 15px; width: 100%; max-width: 450px; }
.skills-category:hover { transform: translateY(-10px); }
.skills-category h3 { font-size: 1.6rem; margin-bottom: 25px; border-bottom: 3px solid var(--secondary-color); padding-bottom: 15px; }
.skills-category ul { list-style: none; padding-left: 5px; }
.skills-category li { margin-bottom: 15px; font-size: 1.1rem; position: relative; padding-left: 25px; }
.skills-category li::before { content: '✓'; color: var(--primary-color); position: absolute; left: 0; font-weight: bold; transition: color 0.5s ease; }

.tools-grid { display: flex; justify-content: center; align-items: flex-start; flex-wrap: wrap; gap: 50px 70px; padding-top: 20px; }
.tool-card { display: flex; flex-direction: column; align-items: center; width: 110px; text-align: center; }
.tool-card img { height: 70px; width: 70px; object-fit: contain; margin-bottom: 15px; transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1); }
.tool-card span { font-weight: 600; font-size: 1rem; }
.tool-card:hover img { transform: scale(1.15) rotate(5deg); }

.certifications-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 30px; }
.cert-card { border-radius: 12px; display: flex; align-items: center; padding: 20px; cursor: pointer; }
.cert-card:hover { transform: translateY(-8px); box-shadow: 0 10px 25px rgba(109, 91, 151, 0.1); }
body.dark-mode .cert-card:hover { box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); }
.cert-thumbnail { width: 90px; height: 65px; object-fit: cover; border-radius: 8px; margin-right: 20px; }
.cert-text p { font-size: 1.05rem; font-weight: 600; }
.cert-text span { font-size: 0.9rem; color: var(--text-color); opacity: 0.8; }

footer { text-align: center; padding: 30px 0; background: var(--card-bg); border-top: 1px solid var(--border-color); }

.modal { display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.9); }
.modal-content { margin: auto; display: block; max-width: 90%; max-height: 90%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.close-button { position: absolute; top: 20px; right: 35px; color: #f1f1f1; font-size: 40px; font-weight: bold; transition: 0.3s; }
.close-button:hover, .close-button:focus { color: #bbb; text-decoration: none; cursor: pointer; }

.theme-toggle {
    --size: 2rem; --icon-fill: var(--text-color); --icon-fill-hover: var(--primary-color);
    background: none; border: none; padding: 0; inline-size: var(--size); block-size: var(--size); aspect-ratio: 1; border-radius: 50%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; outline-offset: 5px;
}
body.dark-mode .theme-toggle { --icon-fill: #A0D2DB; }
.theme-toggle > svg { inline-size: 100%; block-size: 100%; stroke-linecap: round; }
.sun-and-moon { color: var(--icon-fill); transition: color 0.5s ease; }
.theme-toggle:hover .sun-and-moon, .theme-toggle:focus-visible .sun-and-moon { color: var(--icon-fill-hover); }
.sun-and-moon > .moon, .sun-and-moon > .sun, .sun-and-moon > .sun-beams { transform-origin: center center; transition: transform 0.6s cubic-bezier(0.5, 0.75, 0.25, 1.25); }
.sun-and-moon > .sun { transform: scale(1.75); }
.sun-and-moon > .sun-beams { transform: rotateZ(-25deg); }
.dark-mode .sun-and-moon > .sun { transform: scale(1); }
.dark-mode .sun-and-moon > .moon > circle { transform: translateX(-7px); }
@supports (cx: 1) { .dark-mode .sun-and-moon > .moon > circle { transform: translateX(0); cx: 17; } }
.dark-mode .sun-and-moon > .sun-beams { transform: rotateZ(0deg); }

.hamburger-btn { display: none; }

/* =================================================================== */
/*                      Scroll Reveal Animation                        */
/* =================================================================== */
.reveal {
    opacity: 0;
    transform: translateY(35px);
    transition: opacity 0.65s ease-out, transform 0.65s ease-out;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for grid items */
.projects-grid .project-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.projects-grid .project-card.reveal:nth-child(3) { transition-delay: 0.2s; }
.projects-grid .project-card.reveal:nth-child(4) { transition-delay: 0.1s; }
.projects-grid .project-card.reveal:nth-child(5) { transition-delay: 0.2s; }
.projects-grid .project-card.reveal:nth-child(6) { transition-delay: 0.3s; }

.tools-grid .tool-card.reveal:nth-child(2) { transition-delay: 0.08s; }
.tools-grid .tool-card.reveal:nth-child(3) { transition-delay: 0.16s; }
.tools-grid .tool-card.reveal:nth-child(4) { transition-delay: 0.24s; }
.tools-grid .tool-card.reveal:nth-child(5) { transition-delay: 0.32s; }

.certifications-grid .cert-card.reveal:nth-child(2) { transition-delay: 0.1s; }
.certifications-grid .cert-card.reveal:nth-child(3) { transition-delay: 0.2s; }
.certifications-grid .cert-card.reveal:nth-child(4) { transition-delay: 0.1s; }
.certifications-grid .cert-card.reveal:nth-child(5) { transition-delay: 0.2s; }
.certifications-grid .cert-card.reveal:nth-child(6) { transition-delay: 0.3s; }

/* =================================================================== */
/*                      Active Nav Link                                */
/* =================================================================== */
.nav-links a.active-link {
    color: var(--primary-color);
}

.nav-links a.active-link::after {
    width: 100%;
}

/* =================================================================== */
/*             PROJECT CARD IMAGE CAROUSEL (Homepage Grid)             */
/* =================================================================== */
.card-carousel {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--background-color);
}

.card-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-carousel-track img,
.card-carousel-track video {
    width: 100%;
    height: 220px;
    object-fit: cover;
    flex-shrink: 0;
}

.card-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(20, 15, 30, 0.45);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

.card-carousel:hover .card-carousel-btn { opacity: 1; }
.card-carousel-btn:hover { background: var(--primary-color); }
.card-carousel-btn.prev { left: 10px; }
.card-carousel-btn.next { right: 10px; }
.card-carousel-btn svg { width: 16px; height: 16px; }

.card-carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.card-carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
}

.card-carousel-dot.active {
    background: #fff;
    width: 18px;
    border-radius: 4px;
}

.card-carousel-play-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(20, 15, 30, 0.55);
    color: #fff;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.card-carousel-play-badge svg { width: 16px; height: 16px; }

/* Card image area now hosts the carousel instead of a plain <img> */
.project-card .card-carousel { border-radius: 0; }

.btn-project {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-project svg { width: 16px; height: 16px; flex-shrink: 0; }

/* =================================================================== */
/*                   PROJECT DETAIL PAGE                                */
/* =================================================================== */
.detail-back-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 110px 20px 0;
}

.detail-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: gap 0.3s ease, color 0.3s ease;
}
.detail-back-link:hover { gap: 12px; }
.detail-back-link svg { width: 18px; height: 18px; }

.detail-hero {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px 10px;
    text-align: center;
}

.detail-hero .detail-kicker {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-color);
    background: rgba(109, 91, 151, 0.09);
    border: 1px solid rgba(109, 91, 151, 0.2);
    padding: 6px 18px;
    border-radius: 30px;
    margin-bottom: 22px;
}
body.dark-mode .detail-hero .detail-kicker {
    background: rgba(179, 157, 219, 0.1);
    border-color: rgba(179, 157, 219, 0.2);
}

.detail-hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    color: #6D5B97;
    margin-bottom: 18px;
    line-height: 1.25;
}
body.dark-mode .detail-hero h1 { color: #c3aed6; }

.detail-hero .detail-tagline {
    font-size: 1.05rem;
    color: var(--text-color);
    opacity: 0.85;
    max-width: 680px;
    margin: 0 auto 26px;
}

.detail-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.detail-tags span {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 600;
    background: rgba(109, 91, 151, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(109, 91, 151, 0.18);
}
body.dark-mode .detail-tags span {
    background: rgba(179, 157, 219, 0.1);
    border-color: rgba(179, 157, 219, 0.2);
}

/* Big gallery carousel */
.detail-gallery {
    max-width: 950px;
    margin: 40px auto 20px;
    padding: 0 20px;
}
.detail-carousel {
    position: relative;
    width: 100%;
    height: 520px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
}
.detail-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.45s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.detail-carousel-track img,
.detail-carousel-track video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0000;
    flex-shrink: 0;
}
.detail-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(20, 15, 30, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background 0.3s ease, transform 0.3s ease;
}
.detail-carousel-btn:hover { background: var(--primary-color); transform: translateY(-50%) scale(1.08); }
.detail-carousel-btn.prev { left: 16px; }
.detail-carousel-btn.next { right: 16px; }
.detail-carousel-btn svg { width: 20px; height: 20px; }

.detail-carousel-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.detail-carousel-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: all 0.3s ease;
}
.detail-carousel-dot.active { background: #fff; width: 24px; border-radius: 5px; }

.detail-carousel-counter {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(20, 15, 30, 0.5);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 2;
}

/* Content sections */
.detail-content {
    max-width: 850px;
    margin: 0 auto;
    padding: 30px 20px 40px;
}

.detail-content h2 {
    text-align: left;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--heading-color);
    margin: 55px 0 22px;
    position: relative;
}
.detail-content h2:first-child { margin-top: 10px; }
.detail-content h2::after {
    content: "";
    width: 55px;
    height: 4px;
    background: var(--secondary-color);
    display: block;
    margin: 12px 0 0;
    border-radius: 2px;
}

.detail-content p {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 18px;
}

.detail-list {
    list-style: none;
    padding: 0;
    margin: 0 0 10px 0;
}
.detail-list li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 14px;
    font-size: 0.98rem;
    line-height: 1.7;
    color: var(--text-color);
}
.detail-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--secondary-color);
}
.detail-list li strong { color: var(--heading-color); }

.detail-recommend-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 10px;
}
.detail-recommend-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: var(--shadow);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.detail-recommend-item:hover {
    transform: translateX(6px);
    box-shadow: 0 12px 30px rgba(109, 91, 151, 0.12);
}
.detail-recommend-item h4 {
    font-size: 1.05rem;
    color: var(--heading-color);
    margin-bottom: 8px;
}
.detail-recommend-item p { margin-bottom: 0; font-size: 0.95rem; }
.detail-recommend-item p + p { margin-top: 8px; }

.detail-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}
.detail-tools-row span {
    background: rgba(109, 91, 151, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(109, 91, 151, 0.18);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}
body.dark-mode .detail-tools-row span {
    background: rgba(179, 157, 219, 0.1);
    border-color: rgba(179, 157, 219, 0.2);
}

.detail-model-img {
    width: 100%;
    max-width: 620px;
    display: block;
    margin: 10px auto 0;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
}

.detail-contributors {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.detail-contributors li a {
    display: inline-block;
    background: rgba(109, 91, 151, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(109, 91, 151, 0.18);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}
.detail-contributors li a:hover { background: var(--primary-color); color: #fff; }
body.dark-mode .detail-contributors li a {
    background: rgba(179, 157, 219, 0.1);
    border-color: rgba(179, 157, 219, 0.2);
}

/* GitHub CTA */
.detail-cta {
    text-align: center;
    padding: 20px 20px 100px;
}
.detail-github-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: #fff;
    padding: 16px 40px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: 2px solid transparent;
}
.detail-github-btn:hover {
    background: var(--secondary-color);
    color: var(--heading-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.detail-github-btn svg { width: 20px; height: 20px; }

/* =================================================================== */
/*             RESPONSIVE — Carousels & Detail Page                    */
/* =================================================================== */
@media (max-width: 992px) {
    .detail-carousel { height: 340px; }
    .detail-hero h1 { font-size: 2rem; }
    .detail-content h2 { font-size: 1.4rem; }
    .detail-back-wrap { padding-top: 90px; }
    .detail-recommend-item { padding: 18px 20px; }
}

/* =================================================================== */
/*              TIMELINE — Work Experience & Volunteering              */
/* =================================================================== */

#experience,
#volunteering {
    background-color: var(--background-color);
    transition: background-color 0.5s ease;
}

#volunteering {
    background: linear-gradient(180deg, var(--background-color) 0%, rgba(160, 210, 219, 0.07) 100%);
}
body.dark-mode #volunteering {
    background: linear-gradient(180deg, var(--background-color) 0%, rgba(109, 91, 151, 0.08) 100%);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: linear-gradient(
        to bottom,
        transparent,
        var(--secondary-color) 10%,
        var(--primary-color) 50%,
        var(--secondary-color) 90%,
        transparent
    );
    border-radius: 2px;
    transition: background 0.5s ease;
}

.timeline-item {
    position: relative;
    padding: 0 0 50px 40px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
    position: absolute;
    left: -9px;
    top: 22px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 0 4px rgba(109, 91, 151, 0.15);
    transition: all 0.4s ease;
    z-index: 1;
}

.timeline-item:hover .timeline-dot {
    background: var(--primary-color);
    box-shadow: 0 0 0 6px rgba(109, 91, 151, 0.2);
    transform: scale(1.2);
}

.timeline-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 32px 36px;
    box-shadow: var(--shadow);
    transition: background-color 0.5s ease, border-color 0.5s ease,
                box-shadow 0.4s ease, transform 0.4s ease;
}

.timeline-item:hover .timeline-content {
    transform: translateX(6px);
    box-shadow: 0 12px 35px rgba(109, 91, 151, 0.12);
    border-color: rgba(109, 91, 151, 0.3);
}

body.dark-mode .timeline-item:hover .timeline-content {
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
    border-color: rgba(179, 157, 219, 0.3);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.timeline-role {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--heading-color);
    margin-bottom: 4px;
    line-height: 1.3;
}

.timeline-company {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--primary-color);
    opacity: 0.85;
}

body.dark-mode .timeline-company { color: var(--subtitle-color); }

.timeline-date {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.6;
    white-space: nowrap;
    padding-top: 4px;
    letter-spacing: 0.02em;
}

.timeline-bullets { list-style: none; padding: 0; margin: 0 0 20px 0; }

.timeline-bullets li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 10px;
    font-size: 0.97rem;
    line-height: 1.65;
    color: var(--text-color);
}

.timeline-bullets li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--secondary-color);
    flex-shrink: 0;
    transition: background-color 0.5s ease;
}

.timeline-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }

.timeline-tags span {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: rgba(109, 91, 151, 0.08);
    color: var(--primary-color);
    border: 1px solid rgba(109, 91, 151, 0.18);
    letter-spacing: 0.02em;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

body.dark-mode .timeline-tags span {
    background: rgba(179, 157, 219, 0.1);
    color: var(--primary-color);
    border-color: rgba(179, 157, 219, 0.2);
}

.timeline-item:hover .timeline-tags span {
    background: rgba(109, 91, 151, 0.14);
    border-color: rgba(109, 91, 151, 0.3);
}

body.dark-mode .timeline-item:hover .timeline-tags span {
    background: rgba(179, 157, 219, 0.18);
    border-color: rgba(179, 157, 219, 0.35);
}

/* =================================================================== */
/*                      RESPONSIVE DESIGN (MOBILE)                     */
/* =================================================================== */
@media (max-width: 992px) {
    section { padding: 60px 0; }
    .container { padding: 0 15px; }
    h2 { font-size: 2.2rem; }
    .hero-content h1 { font-size: 2.8rem; }
    #subtitle { font-size: 1.5rem; }
    .tagline { font-size: 1.1rem; }

    .nav-links {
        position: fixed; top: 70px; left: 0; width: 100%; height: calc(100vh - 70px);
        background-color: var(--background-color); flex-direction: column; justify-content: center;
        align-items: center; gap: 40px; transform: translateX(100%);
        transition: transform 0.4s ease-in-out, background-color 0.5s ease; padding-bottom: 70px;
    }
    .btn { padding: 12px 28px; font-size: 0.9rem; }
    .hero-buttons { flex-direction: column; gap: 15px; align-items: center; }

    .nav-links.active { transform: translateX(0); }
    .nav-links a { font-size: 1.5rem; }

    .hamburger-btn {
        display: flex; flex-direction: column; justify-content: space-around; width: 2rem; height: 2rem;
        background: transparent; border: none; cursor: pointer; padding: 0; z-index: 10;
    }
    .hamburger-btn span {
        width: 2rem; height: 0.25rem; background: var(--text-color); border-radius: 10px;
        transition: all 0.3s linear; position: relative; transform-origin: 1px;
    }
    .hamburger-btn.active span:nth-child(1) { transform: rotate(45deg); }
    .hamburger-btn.active span:nth-child(2) { opacity: 0; transform: translateX(20px); }
    .hamburger-btn.active span:nth-child(3) { transform: rotate(-45deg); }

    .projects-grid, .certifications-grid { grid-template-columns: 1fr; gap: 30px; }
    .skills-wrapper { flex-direction: column; align-items: center; gap: 30px; }
    .tools-grid { gap: 30px 40px; }

    /* Education mobile */
    .education-card {
        flex-direction: column;
        padding: 28px 24px;
        gap: 20px;
    }
    .edu-header { flex-direction: column; gap: 10px; }
    .edu-date { font-size: 0.8rem; }

    /* Contact cards mobile */
    .contact-links { flex-direction: column; align-items: center; }
    .contact-card { width: 100%; max-width: 340px; min-width: unset; }

    /* Hero photo mobile */
    .hero-photo { width: 170px; height: 170px; }
}