* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: #fffaed;
    color: #000000;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 3rem;
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Back Arrow */
.back-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: #000000;
    font-size: 1.4rem;
    transition: background-color 0.25s ease, transform 0.25s ease;
}

.back-arrow:hover {
    background-color: rgba(0, 0, 0, 0.06);
    transform: translateX(-2px);
}

.back-arrow svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

/* Navigation */
.cv-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.cv-nav a {
    color: #000000;
    text-decoration: none;
    text-transform: uppercase;
    position: relative;
    padding: 0.2rem 0;
    transition: color 0.3s ease;
    font-weight: 700;
}

.cv-nav a::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 1.5px;
    bottom: 0;
    left: 0;
    background-color: #000000;
    transform-origin: bottom right;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cv-nav a:hover {
    color: #333333;
}

.cv-nav a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.cv-nav a.active-page::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.cv-nav .separator {
    color: #000000;
    font-weight: 700;
    user-select: none;
}

/* Language Flag Button */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    background: none;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.25s ease, transform 0.2s ease;
}

.lang-toggle:hover {
    background-color: rgba(0, 0, 0, 0.06);
    transform: scale(1.1);
}

.lang-toggle svg {
    width: 42px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

/* Top Bar Right */
.top-bar-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    /* Hidden on desktop */
    position: relative;
    width: 28px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    z-index: 105;
}

.menu-toggle .hamburger-line {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #000000;
    border-radius: 3px;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s ease;
    transform-origin: center;
}

/* Active hamburger animation */
.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scale(0);
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

.cv-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 3rem 3rem 5rem;
}

.cv-section {
    font-size: 0.9rem;
    line-height: 1.6;
    letter-spacing: 0.01em;
    animation: fadeIn 0.6s ease forwards;
}

.cv-section.hidden {
    display: none;
}

.cv-layout {
    display: grid;
    grid-template-columns: 1.25fr 0.75fr;
    gap: 5rem;
    align-items: start;
}

.cv-text-side {
    display: flex;
    flex-direction: column;
}

.cv-images-side {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: center;
}

.cv-images-side img {
    width: 65%;
    height: auto;
    display: block;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    filter: grayscale(10%) contrast(1.02);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
}

.cv-images-side img:hover {
    transform: translateY(-6px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.cv-image-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.cv-image-caption {
    font-size: 0.75rem;
    color: #777777;
    font-style: italic;
    text-align: center;
    width: 65%;
    line-height: 1.3;
}

.cv-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 2rem;
    padding-bottom: 0.6rem;
    border-bottom: 2px solid #000000;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

.cv-signature {
    font-size: 0.8rem;
    color: #888888;
    margin-top: 6rem;
    margin-bottom: 2rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.bio-text {
    font-size: 0.88rem;
    line-height: 1.7;
    margin-bottom: 1rem;
    color: #000000;
    font-weight: 400;
}

.bio-text:last-of-type {
    margin-bottom: 2rem;
}

.awards-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding-bottom: 0.4rem;
}

.timeline-group {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.timeline-entry {
    display: flex;
    gap: 1.25rem;
    align-items: start;
}

.year {
    font-weight: 700;
    min-width: 48px;
    flex-shrink: 0;
    font-size: 0.88rem;
    color: #000000;
}

.entry-content {
    flex-grow: 1;
}

.entry-main {
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 0.25rem;
    color: #000000;
}

.entry-sub {
    font-size: 0.83rem;
    font-weight: 400;
    color: #444444;
    margin-bottom: 0.2rem;
    padding-left: 0.5rem;
}

.entry-sub:last-child {
    margin-bottom: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

@media (max-width: 1024px) {
    .cv-layout {
        grid-template-columns: 1fr;
        gap: 4rem;
    }

    .cv-container {
        max-width: 850px;
        padding: 2rem 2rem 4rem;
    }

    .cv-images-side {
        gap: 2rem;
        max-width: 600px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .top-bar {
        padding: 1rem 1.2rem;
    }

    .top-bar-left {
        gap: 0.75rem;
    }

    .cv-nav {
        gap: 0.35rem;
        font-size: clamp(0.7rem, 3.5vw, 0.9rem);
    }

    .cv-container {
        padding: 1.5rem 1.2rem 3rem;
    }

    .cv-section {
        font-size: 0.85rem;
    }

    .back-arrow {
        width: 34px;
        height: 34px;
    }

    .back-arrow svg {
        width: 18px;
        height: 18px;
    }

    .cv-title {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .bio-text {
        font-size: 0.83rem;
        line-height: 1.6;
    }

    .timeline-group {
        gap: 1rem;
    }

    .timeline-entry {
        gap: 0.75rem;
    }

    .year {
        min-width: 40px;
        font-size: 0.83rem;
    }

    .entry-main {
        font-size: 0.83rem;
    }

    .entry-sub {
        font-size: 0.78rem;
        padding-left: 0.25rem;
    }

    .cv-images-side {
        gap: 1.5rem;
    }
}

/* Mobile Gallery (swipeable, shown only on mobile) */
.mobile-gallery {
    display: none;
}

@media (max-width: 1024px) {
    .mobile-gallery {
        display: block;
        position: relative;
        width: 100%;
        margin: 1.5rem 0 0.5rem;
        overflow: hidden;
        border-radius: 8px;
    }

    .mobile-gallery .gallery-track {
        display: flex;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: transform;
        width: 100%;
    }

    .mobile-gallery .gallery-slide {
        min-width: 100%;
        width: 100%;
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 1rem;
        box-sizing: border-box;
    }

    .mobile-gallery .gallery-slide img {
        width: auto;
        max-width: 85%;
        max-height: 45vh;
        height: auto;
        border-radius: 8px;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
        object-fit: contain;
    }

    .mobile-gallery .gallery-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 8px;
        padding: 12px 0 4px;
    }

    .mobile-gallery .gallery-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background-color: rgba(0, 0, 0, 0.2);
        border: none;
        cursor: pointer;
        transition: background-color 0.3s ease, transform 0.3s ease;
        padding: 0;
    }

    .mobile-gallery .gallery-dot.active {
        background-color: #000;
        transform: scale(1.3);
    }

    .mobile-gallery .gallery-counter {
        text-align: center;
        font-size: 0.75rem;
        color: rgba(0, 0, 0, 0.45);
        font-weight: 500;
        letter-spacing: 0.05em;
        padding-bottom: 4px;
    }

    .mobile-gallery .gallery-nav {
        position: absolute;
        top: calc(50% - 20px);
        transform: translateY(-50%);
        width: 38px;
        height: 38px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border: 1px solid rgba(0, 0, 0, 0.08);
        color: #000000;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
        z-index: 10;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
        padding: 0;
    }

    .mobile-gallery .gallery-nav:active {
        transform: translateY(-50%) scale(0.9);
        background-color: #ffffff;
    }

    .mobile-gallery .gallery-prev {
        left: 12px;
    }

    .mobile-gallery .gallery-next {
        right: 12px;
    }

    .mobile-gallery .gallery-nav svg {
        width: 20px;
        height: 20px;
        stroke: currentColor;
        stroke-width: 2.5;
        fill: none;
    }

    .mobile-gallery .cv-image-caption {
        width: 85%;
    }

    /* Hide the original images column on mobile */
    .cv-images-side {
        display: none !important;
    }
}

/* Backdrop Overlay */
.menu-backdrop {
    display: none;
}

/* Mobile Navigation Dropdown */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
        /* Show hamburger button */
    }

    .menu-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.08);
        /* Very soft dimming, no blur */
        z-index: 90;
        /* Behind header but in front of body content */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.35s ease, visibility 0.35s ease;
    }

    .menu-backdrop.active {
        opacity: 1;
        visibility: visible;
    }

    .top-bar {
        background-color: rgba(255, 255, 255, 1) !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* Target with higher specificity to override other mobile styles */
    .top-bar-left .cv-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: rgba(255, 255, 255, 0.5) !important;
        /* Semi-transparent white background */
        backdrop-filter: blur(4px) !important;
        -webkit-backdrop-filter: blur(4px) !important;
        z-index: 110;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08);
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 0.5rem 0;
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        visibility: hidden;
        transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1),
            opacity 0.35s ease,
            visibility 0.35s ease;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    }

    .top-bar-left .cv-nav.active {
        max-height: 350px;
        opacity: 1;
        visibility: visible;
    }

    .top-bar-left .cv-nav a {
        display: block;
        padding: 1.2rem 2rem;
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        border-bottom: 1px solid rgba(0, 0, 0, 0.04);
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .top-bar-left .cv-nav a:hover,
    .top-bar-left .cv-nav a:active {
        background-color: rgba(0, 0, 0, 0.03);
    }

    .top-bar-left .cv-nav a:last-child {
        border-bottom: none;
    }

    /* Disable underline hover effect on mobile */
    .top-bar-left .cv-nav a::after {
        display: none !important;
    }

    /* Hide separators on mobile */
    .top-bar-left .cv-nav .separator {
        display: none !important;
    }
}