:root {
    --primary-color: #4f46e5;
    --secondary-color: #06b6d4;
    --bg: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.7);
    --text: #1e293b;
    --text-muted: #64748b;
    --border: rgba(0, 0, 0, 0.05);
    --glass-border: rgba(255, 255, 255, 0.4);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    --bg: #0f172a;
    --bg-card: rgba(30, 41, 59, 0.7);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    line-height: 1.6;
    /* transition: background-color 0.5s ease; REMOVED because it causes flash on load */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Glassmorphism */
.glass {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.animate-up {
    animation: fadeInUp 0.8s ease forwards;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 3rem 8%;
    display: flex;
    /* Default header Flexbox: Space Between handles left (logo) and right (nav/actions) */
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-left: 3rem;
    /* Extra space between Nav and Actions */
}

header.scrolled {
    padding: 1.5rem 8%;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--border);
}

.logo-container {
    text-decoration: none;
    display: flex;
    /* keep flex for logo text stack if needed */
    flex-direction: column;
    justify-content: center;
    line-height: 1;
    margin-right: 3rem;
    /* Extra space between Logo and Nav */
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text);
    text-transform: uppercase;
}


/* Language Dropdown */
.lang-dropdown {
    position: relative;
    display: inline-block;
}

/* Hover Bridge on Container */
.lang-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 110%;
    height: 1rem;
    background: transparent;
    display: none;
}

.lang-dropdown:hover::after {
    display: block;
}

.lang-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem 0.8rem;
    height: 40px;
    min-width: 65px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    gap: 0.4rem;
}

.lang-btn:hover {
    background: var(--border);
    border-color: var(--primary-color);
}

.lang-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--bg-card);
    backdrop-filter: blur(15px);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    min-width: unset;
    display: none;
    flex-direction: column;
    overflow: hidden;
    margin-top: 0.4rem;
    z-index: 1001;
    box-shadow: var(--shadow);
}

/* Hover Bridge */
/* Removed previous bridge from here as it only exists when menu is open */

.lang-menu a {
    padding: 0.8rem;
    text-decoration: none;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
}

.lang-menu a:last-child {
    border-bottom: none;
}

.lang-menu a:hover {
    background: rgba(var(--primary-color), 0.1);
    color: var(--primary-color);
}

.lang-dropdown:hover .lang-menu,
.lang-dropdown.active .lang-menu {
    display: flex;
}

/* Hamburger & Mobile Nav */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background: var(--text);
    border-radius: 5px;
    transition: var(--transition);
}

@media (max-width: 1150px) {
    header {
        padding: 1.5rem 5% !important;
    }

    nav {
        width: 100%;
        display: flex;
        justify-content: flex-end;
    }

    .logo-container {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-right: 0;
        /* Remove the desktop spacing */
        width: max-content;
    }

    .logo-text {
        font-size: 1.8rem;
    }


    .header-actions {
        display: none;
        /* Hide desktop actions on mobile */
    }

    .mobile-actions {
        display: block !important;
        margin-bottom: 0px;
        margin-top: 0;
        width: 100%;
        /* removed min-height to reduce gap */
    }

    .mobile-nav-actions {
        display: flex !important;
        justify-content: flex-start;
        /* Left align buttons */
        align-items: center;
        gap: 1.5rem;
        width: calc(100% - 50px);
        /* Leave space for X icon on the right */
        margin-left: -5px;
        /* Slight optical adjustment */
    }

    .mobile-nav-actions .lang-btn,
    .mobile-nav-actions .toggle-btn {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
        width: 42px;
        height: 42px;
        color: var(--text) !important;
        background: transparent;
        border: 1px solid var(--border) !important;
        border-radius: 12px;
        z-index: 10;
    }

    .lang-btn,
    .toggle-btn {
        width: 35px;
        height: 35px;
        padding: 0.4rem;
        font-size: 0.8rem;
    }

    .lang-dropdown::after {
        display: block !important;
        /* Enable bridge on mobile too */
        height: 1.5rem;
        /* Larger bridge for touch safety */
        width: 120%;
        /* Wider catch area */
    }

    .hamburger {
        display: flex;
        margin-left: auto;
        /* Push to right */
        /* No explicit margin needed if space-between works, but safe to keep if needed */
        z-index: 2001;
        /* Above the menu overlay */
    }

    nav ul {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 60%;
        /* Narrower menu */
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        /* Align content to top */
        transition: transform 0.3s ease;
        padding: 1.5rem 2rem 2rem 2rem;
        /* Extremely minimal top padding */
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        z-index: 2000;
    }

    nav ul li {
        list-style: none;
        margin: 0;
        /* ZERO spacing */
        padding: 0;
        line-height: 0.9;
        /* Ultra tight line height */
        margin-bottom: -5px;
        /* Negative margin to pull items together */
    }

    nav ul li a {
        font-family: 'Outfit', sans-serif;
        /* Stylish modern font */
        font-size: 1.3rem;
        /* Slightly smaller, refined size */
        /* Bigger, bolder text */
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 1px;
        display: block;
        color: var(--text);
        padding: 0;
        line-height: 1;
        /* Reset line height for link */
        color: var(--text);
        /* Explicit color */
    }

    /* Ensure it's above everything */
    /* Ensure it's above everything */

    nav ul.active {
        right: 0;
    }

    .hamburger.toggle span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger.toggle span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.toggle span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }
}

nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    transition: var(--transition);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

#nav-links {
    display: flex;
    list-style: none;
    gap: 3rem;
    align-items: center;
}

nav a:hover {
    color: var(--primary-color);
}

.toggles {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.toggle-btn {
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.6rem;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.toggle-btn:hover {
    background: var(--border);
}

/* Base state for mobile actions: hidden on desktop */
.mobile-actions {
    display: none;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0 10%;
    background: radial-gradient(circle at 50% 50%, rgba(79, 70, 229, 0.1) 0%, transparent 60%);
}

.hero h1 {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    font-weight: 900;
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 650px;
    margin-bottom: 2.5rem;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 900px;
    margin: 4rem auto;
    padding: 2rem 0;
    z-index: 1;
}

.timeline::after {
    display: none;
}

.timeline-wave {
    position: absolute;
    left: 50%;
    top: 0;
    height: 100%;
    width: 60px;
    transform: translateX(-50%);
    z-index: -1;
    pointer-events: none;
}

.timeline-item {
    padding: 20px 40px;
    position: relative;
    width: 50%;
    opacity: 1;
}

.timeline-item.animate-up {
    opacity: 1;
}

html {
    scroll-behavior: smooth;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    right: -11px;
    background: radial-gradient(circle at 30% 30%, #6366f1, var(--primary-color));
    border: none;
    top: 25px;
    border-radius: 50%;
    z-index: 10;
    transition: var(--transition);
    box-shadow:
        0 0 0 3px rgba(79, 70, 229, 0.15),
        0 0 0 6px rgba(79, 70, 229, 0.08),
        0 4px 12px rgba(79, 70, 229, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.timeline-item:hover::after {
    transform: scale(1.3);
    box-shadow:
        0 0 0 4px rgba(79, 70, 229, 0.2),
        0 0 0 8px rgba(79, 70, 229, 0.1),
        0 6px 20px rgba(79, 70, 229, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.left {
    left: 0;
    text-align: right;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
}

.timeline-content {
    padding: 2rem;
    border-radius: 20px;
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px) scale(1.03);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.timeline-content h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-content .date {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 1rem;
}

/* Career List */
.career-card {
    margin-bottom: 2rem;
    padding: 2rem;
    border-radius: 20px;
}

/* Left-side career cards - gradient from right (timeline) to left */
.timeline .left .timeline-content {
    background: linear-gradient(to left,
            rgba(79, 70, 229, 0.08) 0%,
            rgba(79, 70, 229, 0.02) 50%,
            rgba(6, 182, 212, 0.01) 100%);
    border-right: 3px solid var(--primary-color) !important;
    border-left: none !important;
}

/* Right-side career cards - gradient from left (timeline) to right */
.timeline .right .timeline-content {
    background: linear-gradient(to right,
            rgba(79, 70, 229, 0.08) 0%,
            rgba(79, 70, 229, 0.02) 50%,
            rgba(6, 182, 212, 0.01) 100%);
    border-left: 3px solid var(--primary-color) !important;
    border-right: none !important;
}

.timeline-content h3 {
    color: var(--primary-color);
}

.career-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.career-title h3 {
    font-size: 1.5rem;
    margin-bottom: 0.2rem;
}

.career-company {
    color: var(--secondary-color);
    font-weight: 600;
}

.career-date {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* CTA Button */
.cta-button {
    display: inline-block;
    padding: 1.2rem 3rem;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    background-size: 200% auto;
    border: none;
    border-radius: 50px;
    color: white;
    font-weight: 700;
    text-decoration: none;
    transition: 0.5s;
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.cta-button:hover {
    background-position: right center;
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 35px rgba(79, 70, 229, 0.4);
}

/* Typography */
section {
    padding: 8rem 10%;
}

.section-title {
    font-size: 3.5rem;
    margin-bottom: 4rem;
    text-align: center;
    font-weight: 900;
}

/* Modern Footer */
.modern-footer {
    padding: 6rem 8% 3rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    font-family: 'Inter', sans-serif;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    margin-bottom: 5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.footer-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text);
    text-decoration: none;
    text-transform: uppercase;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 300px;
}

.footer-col h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col a,
.footer-social-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: var(--transition);
    display: inline-block;
}

.footer-social-links {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-col a:hover,
.footer-social-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

/* Volunteer Timeline Styling */
.volunteer-timeline .timeline-item::before {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.volunteer-timeline .timeline-item::after {
    background: radial-gradient(circle at 30% 30%, #fbbf24, #f59e0b);
    border: none;
    box-shadow:
        0 0 0 3px rgba(245, 158, 11, 0.15),
        0 0 0 6px rgba(245, 158, 11, 0.08),
        0 4px 12px rgba(245, 158, 11, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.volunteer-timeline .timeline-item:hover::after {
    transform: scale(1.4);
    box-shadow:
        0 0 0 4px rgba(245, 158, 11, 0.2),
        0 0 0 8px rgba(245, 158, 11, 0.1),
        0 6px 20px rgba(245, 158, 11, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.volunteer-card {
    border-left: none !important;
    transition: var(--transition);
}

.volunteer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* Left-side volunteer cards - gradient from right (timeline) to left */
.volunteer-timeline .left .volunteer-card {
    background: linear-gradient(to left,
            rgba(245, 158, 11, 0.08) 0%,
            rgba(245, 158, 11, 0.02) 50%,
            rgba(217, 119, 6, 0.01) 100%);
    border-right: 3px solid #f59e0b !important;
    border-left: none !important;
}

/* Right-side volunteer cards - gradient from left (timeline) to right */
.volunteer-timeline .right .volunteer-card {
    background: linear-gradient(to right,
            rgba(245, 158, 11, 0.08) 0%,
            rgba(245, 158, 11, 0.02) 50%,
            rgba(217, 119, 6, 0.01) 100%);
    border-left: 3px solid #f59e0b !important;
    border-right: none !important;
}

.volunteer-card h3 {
    color: #f59e0b;
}

.volunteer-card:hover {
    transform: translateY(-5px) scale(1.03);
}

:root {
    --accent-gold: #f59e0b;
}

/* Tab Navigation */
.tab-navigation {
    margin: 3rem 0 2rem 0;
}

.tab-button {
    padding: 1rem 2.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 50px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Outfit', sans-serif;
}

.tab-button:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.tab-button.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.tab-button.volunteer-tab:hover {
    border-color: #f59e0b;
}

.tab-button.volunteer-tab.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    color: white;
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

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

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

.footer-bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }

    .footer-brand {
        align-items: center;
    }

    .footer-bottom {
        text-align: center;
    }
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.8rem;
    }

    .timeline::after {
        left: 15px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 45px;
        padding-right: 15px;
        text-align: left;
    }

    .timeline-item::after {
        left: 5px;
    }

    .right {
        left: 0;
    }

    nav ul {
        gap: 1rem;
    }

    nav a {
        font-size: 0.85rem;
    }

    /* Mobile Timeline Card Optimizations */
    .timeline-content {
        padding: 1.25rem;
        overflow: hidden;
        word-wrap: break-word;
    }

    .timeline-content * {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .timeline-content h3 {
        font-size: 1.1rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
    }

    .timeline-content h4,
    .timeline-content .career-company {
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
        word-break: break-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -moz-hyphens: auto;
    }

    .timeline-content p,
    .timeline-content .date {
        font-size: 0.85rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .timeline-item {
        padding-left: 45px;
        overflow: visible;
    }

    .tab-button {
        padding: 0.8rem 1.8rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 2.5rem;
        text-align: center;
        padding: 0 1rem;
        margin-left: auto;
        margin-right: auto;
    }

    section {
        padding: 6rem 5%;
    }

    /* Mobile Timeline Wave Positioning */
    .timeline::after {
        left: 15px;
    }

    .timeline-wave {
        left: -5px;
        transform: translateX(0);
        width: 40px;
    }

    /* Mobile: All cards on left, border on left */
    .timeline .left .timeline-content,
    .timeline .right .timeline-content {
        border-left: 3px solid var(--primary-color) !important;
        border-right: none !important;
        background: linear-gradient(to right,
                rgba(79, 70, 229, 0.08) 0%,
                rgba(79, 70, 229, 0.02) 50%,
                rgba(6, 182, 212, 0.01) 100%);
    }

    .volunteer-timeline .left .volunteer-card,
    .volunteer-timeline .right .volunteer-card {
        border-left: 3px solid #f59e0b !important;
        border-right: none !important;
        background: linear-gradient(to right,
                rgba(245, 158, 11, 0.08) 0%,
                rgba(245, 158, 11, 0.02) 50%,
                rgba(217, 119, 6, 0.01) 100%);
    }
}

/* Extra small screens (iPhone SE, etc.) */
@media (max-width: 400px) {
    .timeline-content {
        padding: 1rem;
    }

    .timeline-content h3 {
        font-size: 1rem;
    }

    .timeline-content h4,
    .timeline-content .career-company {
        font-size: 0.85rem;
    }

    .timeline-content p,
    .timeline-content .date {
        font-size: 0.8rem;
    }

    .timeline-item {
        padding-left: 60px;
        padding-right: 15px;
    }

    .tab-button {
        padding: 0.7rem 1.5rem;
        font-size: 0.85rem;
    }
}