/*@import url('https://fonts.googleapis.com/css2?family=Lexend+Giga:wght@100..900&display=swap');

*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    border: none;
    outline: none;
    font-family: 'Lexend Giga', sans-serif;
}

html{
    font-size: 90%;
}
.logo{
    font-size: 2.25rem;
    font-weight: 550;
    color: #d2c1b6;
    cursor: pointer; // shows hand cursor on hover 
}
body{
    width: 100%;
    min-height: 100vh;
    overflow-y: auto;
    background-color: #456882;
    color: #d2c1b6
}
nav{
    background-color: transparent;
    box-shadow: 3px 3px 5px rgba(0,0,0,0.35);
}
nav ul{
    width: 100%;
    list-style: none;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
nav li{
    height: 50px;
}
nav a{
    height: 100%;
    padding: 0 30px;
    text-decoration: none;
    display: flex;
    align-items: center;
    color:#d2c1b6
}
nav a:hover{
    background-color: #234C6A;
}
nav li:first-child{
    margin-right: auto;
}
.sidebar{
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 250px;
    z-index: 999;
    background-color: #1b3c53b6;
    backdrop-filter: blur(10px);
    box-shadow: -10px 0 10px rgba(117, 84, 84, 0.1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
}
.sidebar li{
    width: 100%;
}
.sidebar a{
    width: 100%;
}
.menu-button{
    display: none;
}
@media (max-width: 1052px){ //website inspect mobile view --> px count bis liste sich überschneidet --> falls weniger listenteile dann Anpassen!
    .hideOnMobile{
        display: none;
    }
    .menu-button{
        display: block;
    }
}
@media (max-width: 540px){ //website inspect mobile view --> px count bis liste sich überschneidet --> falls weniger listenteile dann Anpassen!
    .sidebar{
        width: 100%;
    }
}*/



/* Reset and base styles */
* {
    box-sizing: border-box;
}

html {
    color-scheme: light dark;
    scrollbar-gutter: stable;
    scroll-behavior: smooth;
}

/* CSS Custom Properties for theming */
:root {
    /* Light theme colors - WCAG AAA Compliant */
    --color-global-bg: #F8FAFC;
    --color-global-text: #0F172A;
    --color-link: #2563EB;
    --color-accent: #2563EB;
    --color-accent-2: #0891B2;
    --color-quote: #0F172A;
    --color-border: #e5e7eb;
    --color-card-bg: rgba(248, 250, 252, 0.8);
    --color-shadow: rgba(0, 0, 0, 0.1);
}

/* Dark theme colors - WCAG AAA Compliant */
[data-theme="dark"] {
    --color-global-bg: #0F172A;
    --color-global-text: #F8FAFC;
    --color-link: #60A5FA;
    --color-accent: #60A5FA;
    --color-accent-2: #22D3EE;
    --color-quote: #F8FAFC;
    --color-border: #1E293B;
    --color-card-bg: rgba(30, 41, 59, 0.6);
    --color-shadow: rgba(0, 0, 0, 0.7);
    --color-hover: #22D3EE;
}

/* Dark mode specific overrides for better readability */
[data-theme="dark"] .mobile-nav-menu > a {
    color: #F8FAFC;
}

[data-theme="dark"] .mobile-nav-menu > a:hover {
    color: #22D3EE;
}

[data-theme="dark"] .title,
[data-theme="dark"] .prose h1,
[data-theme="dark"] .prose h2,
[data-theme="dark"] .prose h3,
[data-theme="dark"] .projects-title,
[data-theme="dark"] .projects-link,
[data-theme="dark"] .project-card h3,
[data-theme="dark"] .timeline-org {
    color: #60A5FA !important;
}

[data-theme="dark"] .projects-venue,
[data-theme="dark"] .timeline-dates,
[data-theme="dark"] .timeline-meta {
    color: #F8FAFC;
    opacity: 0.8;
}

[data-theme="dark"] .tag {
    color: #F8FAFC;
    border-color: #60A5FA;
    background-color: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .tag:hover {
    background-color: rgba(34, 211, 238, 0.25);
    border-color: #22D3EE;
}

[data-theme="dark"] .timeline-dot {
    background: #22D3EE;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.2);
}

[data-theme="dark"] .timeline::before {
    background: rgba(34, 211, 238, 0.3);
}

[data-theme="dark"] .timeline-role {
    color: #60A5FA;
}

[data-theme="dark"] .header-title .text-xl {
    color: #60A5FA;
}

/* Light mode header title color */
.header-title .text-xl {
    color: #2563EB;
}

/* Base typography */
body {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--color-global-bg);
    color: var(--color-global-text);
    transition: opacity 0.2s ease;
    padding-top: 8rem; /* Increased to account for fixed header */
}

/* Responsive body padding */
@media (max-width: 640px) {
    body {
        padding-top: 5rem; /* Reduced padding on mobile */
    }
}

/* Utility classes matching astro-theme-cactus */
.bg-global-bg { background-color: var(--color-global-bg); }
.text-global-text { color: var(--color-global-text); }
.text-accent { color: var(--color-accent); }
.text-accent-2 { color: var(--color-accent-2); }

.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.min-h-screen { min-height: 100vh; }
.max-w-3xl { max-width: 57.6rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.pt-16 { padding-top: 4rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-28 { margin-bottom: 7rem; }
.me-3 { margin-inline-end: 0.75rem; }
.me-4 { margin-inline-end: 1rem; }
.ms-auto { margin-inline-start: auto; }
.mt-auto { margin-top: auto; }
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }
.h-7 { height: 1.75rem; }
.w-7 { width: 1.75rem; }
.h-10 { height: 2.5rem; }
.w-6 { width: 1.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-normal { font-weight: 400; }
.font-bold { font-weight: 700; }
.font-mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }
.antialiased { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.scroll-smooth { scroll-behavior: smooth; }
.relative { position: relative; }
.absolute { position: absolute; }
.hidden { display: none; }
.rounded-md { border-radius: 0.375rem; }
.shadow { box-shadow: 0 1px 3px 0 var(--color-shadow), 0 1px 2px -1px var(--color-shadow); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }
.underline { text-decoration: underline; }
.underline-offset-2 { text-underline-offset: 2px; }
.grayscale { filter: grayscale(100%); }
.opacity-75 { opacity: 0.75; }
.text-center { text-align: center; }
.text-xs { font-size: 0.75rem; }

/* Responsive utilities */
@media (min-width: 640px) {
    .sm\:px-8 { padding-left: 2rem; padding-right: 2rem; }
    .sm\:flex { display: flex; }
    .sm\:flex-row { flex-direction: row; }
    .sm\:flex-col { flex-direction: column; }
    .sm\:items-center { align-items: center; }
    .sm\:invisible { visibility: hidden; }
    .sm\:hidden { display: none; }
    .sm\:static { position: static; }
    .sm\:relative { position: relative; }
    .sm\:absolute { position: absolute; }
    .sm\:z-auto { z-index: auto; }
    .sm\:mt-1 { margin-top: 0.25rem; }
    .sm\:me-0 { margin-inline-end: 0; }
    .sm\:py-0 { padding-top: 0; padding-bottom: 0; }
    .sm\:h-20 { height: 5rem; }
    .sm\:w-12 { width: 3rem; }
    .sm\:text-2xl { font-size: 1.5rem; }
    .sm\:ps-18 { padding-inline-start: 4.5rem; }
    .sm\:-ms-4 { margin-inline-start: -1rem; }
    .sm\:divide-accent > :not([hidden]) ~ :not([hidden]) { 
        border-inline-start-width: 1px; 
        border-color: var(--color-accent); 
    }
    .sm\:rounded-none { border-radius: 0; }
    .sm\:bg-transparent { background-color: transparent; }
    .sm\:shadow-none { box-shadow: none; }
    .sm\:backdrop-blur-none { backdrop-filter: none; }
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.focus\:not-sr-only:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* Custom component styles */
.title {
    color: var(--color-accent-2) !important;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
}

/* Make section titles clickable on index page */
.title-link {
    color: var(--color-accent-2) !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.title-link:hover {
    color: var(--color-accent);
    text-decoration: underline;
    cursor: pointer;
}

/* Section card styling - boxes around each major section */
section.mb-16 {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

section.mb-16:hover {
    box-shadow: 0 4px 16px var(--color-shadow);
    transform: translateY(-2px);
}

/* Responsive padding for sections on mobile */
@media (max-width: 640px) {
    section.mb-16 {
        padding: 1.5rem;
        border-radius: 8px;
    }
}

.cactus-link {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: opacity 0.2s ease;
}

.cactus-link:hover {
    text-decoration-thickness: 2px;
}


/* Header styles */
#main-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    max-width: 57.6rem; /* Same as max-w-3xl */
    width: 100%;
    background-color: color-mix(in srgb, var(--color-global-bg) 95%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 50%, transparent);
    z-index: 100;
    padding: 1rem 1rem 0.5rem 1rem; /* Match main content px-4 */
}



/* Header grid layout */
.header-grid {
    display: grid;
    grid-template-columns: auto 1fr minmax(0, auto);
    grid-template-rows: auto auto;
    grid-template-areas:
        "logo title controls"
        "logo nav controls";
    align-items: center;
    column-gap: 1rem;
}

.header-logo {
    grid-area: logo;
    align-self: center;
    display: flex;
    align-items: center;
}
.header-logo img {
    object-position: center top;
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
}

@media (min-width: 640px) {
    .header-logo img {
        width: 3rem;
        height: 3rem;
    }
}
.header-title { grid-area: title; align-self: center; }
.header-nav { grid-area: nav; align-self: center; }
.header-controls { 
    grid-area: controls; 
    justify-self: end; 
    max-width: 100%; 
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Nav links now centered with title - no additional margin needed */

@media (min-width: 640px) {
    #main-header {
        padding: 1rem 2rem 0.5rem 2rem; /* Match main content sm:px-8 */
    }
}

.group:hover .grayscale {
    filter: none;
}

/* Make logo clickable with cursor pointer and subtle hover effect */
#main-header a[href="#"] {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

#main-header a[href="#"]:hover svg {
    transform: scale(1.05);
    transition: opacity 0.2s ease;
}

#main-header a[href="#"]:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* Navigation styles - Desktop */
.mobile-nav-menu {
    /* Desktop styles */
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    position: static;
    background: transparent;
    margin-top: 0.25rem;
    margin-left: -1rem;
}

.mobile-nav-menu > a {
    padding: 0 1rem;
    border-left: 1px solid var(--color-accent);
    color: var(--color-accent);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.mobile-nav-menu > a:first-child {
    border-left: none;
}

.mobile-nav-menu > a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Mobile navigation - completely override everything */
@media (max-width: 640px) {
    .mobile-nav-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background-color: color-mix(in srgb, var(--color-global-bg) 98%, transparent) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        z-index: 150 !important;
        display: none !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 2rem !important;
        padding: 2rem !important;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        margin: 0 !important;
        transform: none !important;
        inset: 0 !important;
    }
    
    .mobile-nav-menu > a {
        font-size: 1.5rem !important;
        padding: 1rem 2rem !important;
        border-radius: 0.5rem !important;
        transition: opacity 0.2s ease !important;
        text-align: center !important;
        min-width: 200px !important;
        background-color: color-mix(in srgb, var(--color-accent) 10%, transparent) !important;
        border: 1px solid var(--color-accent) !important;
        color: var(--color-accent) !important;
        text-decoration: none !important;
        display: block !important;
        margin: 0 !important;
    }
    
    .mobile-nav-menu > a:hover {
        background-color: var(--color-accent) !important;
        color: var(--color-global-bg) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px color-mix(in srgb, var(--color-accent) 30%, transparent) !important;
        text-decoration: none !important;
    }
}

/* Show mobile menu when menu-open class is present */
.group.menu-open .mobile-nav-menu {
    display: flex !important;
    z-index: 150 !important;
}

/* Mobile menu button improvements */
#toggle-navigation-menu {
    z-index: 200; /* Highest z-index to stay above menu */
    position: relative;
    background-color: color-mix(in srgb, var(--color-accent-2) 10%, transparent);
    border-radius: 0.375rem;
    border: 1px solid color-mix(in srgb, var(--color-accent-2) 20%, transparent);
    transition: opacity 0.2s ease;
}

#toggle-navigation-menu:hover {
    background-color: color-mix(in srgb, var(--color-accent-2) 20%, transparent);
    transform: scale(1.05);
}

/* Hamburger icon sizing and toggling */
#toggle-navigation-menu svg {
    width: 24px;
    height: 24px;
    transition: opacity 0.2s ease;
}

#toggle-navigation-menu[aria-expanded="false"] svg:first-of-type { display: block; opacity: 1; }
#toggle-navigation-menu[aria-expanded="false"] svg:last-of-type  { display: none;  opacity: 0; }

#toggle-navigation-menu[aria-expanded="true"]  svg:first-of-type { display: none;  opacity: 0; }
#toggle-navigation-menu[aria-expanded="true"]  svg:last-of-type  { display: block; opacity: 1; }

/* Theme toggle styles */
#theme-toggle {
    background-color: color-mix(in srgb, var(--color-accent-2) 20%, transparent);
    border: 1px solid color-mix(in srgb, var(--color-accent-2) 30%, transparent);
    transition: opacity 0.2s ease;
    z-index: 50;
    position: relative;
}

#theme-toggle:hover {
    background-color: color-mix(in srgb, var(--color-accent-2) 30%, transparent);
    transform: scale(1.05);
}

/* Theme icon visibility */
[data-theme="dark"] .sun-icon {
    display: block;
}

[data-theme="dark"] .moon-icon {
    display: none;
}

[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

:root .sun-icon {
    display: none;
}

:root .moon-icon {
    display: block;
}

/* Prose styles (typography) */
.prose {
    color: var(--color-global-text);
    max-width: none; /* Allow prose to use full container width */
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: var(--color-accent-2) !important;
    font-weight: 600;
    line-height: 1.25;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h1 { font-size: 2.75rem; }
.prose h2 { font-size: 2.25rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.125rem; }

.prose p {
    margin-bottom: 1.25rem;
}

.prose ul, .prose ol {
    margin-bottom: 1.25rem;
    padding-left: 1.625rem;
}

.prose li {
    margin-bottom: 0.5rem;
}

.prose a {
    color: var(--color-link);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.prose a:visited {
    color: var(--color-link);
}

.prose a:hover {
    text-decoration-thickness: 2px;
}

/* About section layout */
.about-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: nowrap;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

.about-avatar {
    width: 120px;
    height: 120px;
    border-radius: 9999px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--color-border);
    box-shadow: 0 2px 10px color-mix(in srgb, var(--color-shadow) 50%, transparent);
    background-color: var(--color-border);
}

.about-header-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* Reduce default heading top margin inside about header to better center with avatar */
.about-header .title {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

@media (max-width: 640px) {
    .about-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .about-avatar {
        width: 88px;
        height: 88px;
        margin-top: 1.5rem; /* Add padding above the avatar on mobile */
    }
    .about-header-content {
        align-items: center;
    }
}

.prose strong {
    color: var(--color-accent-2);
    font-weight: 600;
}

.prose code {
    background-color: color-mix(in srgb, var(--color-accent-2) 10%, transparent);
    border: 1px dotted #666;
    border-radius: 2px;
    padding: 0.125rem 0.25rem;
    font-size: 0.875rem;
}

.prose blockquote {
    border-left: 4px solid var(--color-accent);
    padding-left: 1rem;
    margin-left: 0;
    font-style: italic;
    color: var(--color-quote);
}

/* Project grid */
.project-grid {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

@media (min-width: 768px) {
    .project-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
}

.project-card {
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    transition: opacity 0.2s ease;
}

.project-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--color-shadow);
}

.project-card h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--color-accent-2);
}

.project-card p {
    margin-bottom: 1.5rem;
    color: var(--color-global-text);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-links a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-accent);
    border-radius: 0.25rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.project-links a:hover {
    background-color: var(--color-accent);
    color: var(--color-global-bg);
}

/* PDF Download button - special styling */
.project-links a.pdf-download-btn {
    background-color: var(--color-accent);
    color: var(--color-global-bg);
    font-weight: 500;
    border: 2px solid var(--color-accent);
}

.project-links a.pdf-download-btn:hover {
    background-color: transparent;
    color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 2px 8px var(--color-shadow);
}

/* Contact links */
.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-links a {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.contact-links a:hover {
    background-color: var(--color-accent);
    color: var(--color-global-bg);
    transform: translateY(-1px);
}

/* Smooth transitions */
* {
    transition: opacity 0.2s ease;
}

/* Focus styles for accessibility: only show on keyboard navigation */
a:focus,
button:focus {
    outline: none;
}
a:focus-visible,
button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* Scroll margin for anchor links */
:target {
    scroll-margin-top: 8rem; /* Increased to account for fixed header */
}

@media (max-width: 640px) {
    :target {
        scroll-margin-top: 5rem; /* Reduced for mobile */
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    .title {
        font-size: 1.25rem;
    }
    
    .prose h1 { font-size: 2.25rem; }
    .prose h2 { font-size: 1.875rem; }
    .prose h3 { font-size: 1.125rem; }
    
    .contact-links {
        flex-direction: column;
    }
    
    .project-links {
        flex-direction: column;
    }
    
    /* Mobile header adjustments */
    #main-header {
        /* Keep fixed position on mobile - removed position: relative override */
        z-index: 100; /* Ensure proper z-index on mobile */
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
        height: 100vh;
    }
    
    /* Logo and title spacing on mobile */
    #main-header .text-xl {
        font-size: 1.125rem;
    }
    
    /* Mobile menu animation */
    .mobile-nav-menu {
        animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .group.menu-open .mobile-nav-menu {
        animation: fadeInScale 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Menu animation keyframes */
@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Touch-friendly improvements */
@media (max-width: 640px) {
    /* Collapse grid to a simple row on mobile; keep existing overlay menu */
    .header-grid {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        flex-wrap: nowrap;
    }

    .header-title { display: flex; align-items: center; flex: 1; min-width: 0; }
    .header-nav { display: none; }

    /* Adjust controls spacing on mobile */
    .header-controls {
        gap: 0.5rem;
        white-space: nowrap;
    }

    /* Add spacing after logo on mobile */
    .header-logo { margin-right: 0.5rem; }

    /* Enlarge hamburger icon visuals on mobile */
    #toggle-navigation-menu svg {
        width: 24px;
        height: 24px;
    }

    /* Larger touch targets */
    #theme-toggle,
    #toggle-navigation-menu {
        min-width: 44px;
        min-height: 44px;
        padding: 0.5rem;
    }
    
    /* Better touch feedback */
    #toggle-navigation-menu:active,
    #theme-toggle:active {
        transform: scale(0.95);
    }
    
    /* Improved header spacing on mobile */
    #main-header {
        /* Keep fixed positioning - only adjust padding */
        padding-bottom: 1rem;
        /* Remove margin-bottom since fixed headers don't need margin */
    }

    /* Reduce first section top padding to avoid excessive gap under fixed header */
    #about {
        padding-top: 1rem !important;
    }
    
    /* Better logo visibility and size */
    #main-header svg {
        filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        height: 4rem !important; /* Increase from 3.5rem to 4rem */
        width: 2.4rem !important;  /* Increase from 2.1rem to 2.4rem, maintaining aspect ratio */
    }
}

/* Prevent text selection on interactive elements */
#toggle-navigation-menu,
#theme-toggle {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Smooth transitions for better UX */
.mobile-nav-menu a {
    transition: opacity 0.2s ease;
}

/* Active navigation link styling */
@media (max-width: 640px) {
    .mobile-nav-menu a.active {
        background-color: var(--color-accent) !important;
        color: var(--color-global-bg) !important;
        border-color: var(--color-accent) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px color-mix(in srgb, var(--color-accent) 30%, transparent) !important;
    }
}

@media (min-width: 640px) {
    .mobile-nav-menu a.active {
        background-color: transparent !important;
        color: var(--color-accent) !important;
        text-decoration: underline !important;
        text-underline-offset: 4px !important;
        /* Keep vertical dividers visible even when active */
        border-left: 1px solid var(--color-accent) !important;
    }
    .mobile-nav-menu a.active:first-child {
        border-left: none !important;
    }
}

/* Animation for theme transitions */
html {
    transition: opacity 0.2s ease;
}

/* Loading spinner */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--color-accent);
    font-style: italic;
}

.loading-spinner::after {
    content: '';
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid var(--color-accent);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error message styling */
.error-message {
    padding: 1rem;
    background-color: color-mix(in srgb, #ef4444 10%, transparent);
    border: 1px solid #ef4444;
    border-radius: 0.5rem;
    color: #ef4444;
    text-align: center;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-global-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent-2);
}

/* Project card styles */
.projects-card {
    display: flex;
    background-color: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
    transition: opacity 0.2s ease;
    gap: 1.5rem;
}

.projects-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--color-shadow);
}

.projects-image {
    flex-shrink: 0;
    width: 120px;
    height: 90px;
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--color-border);
}

.projects-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.projects-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.projects-title {
    margin: 0 !important;
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
}

/* Override prose heading margins for projects titles */
.prose .projects-title {
    margin-top: 0 !important;
    margin-bottom: 0.5rem;
}

.projects-link {
    color: var(--color-accent-2);
}

.projects-venue {
    font-size: 0.875rem;
    color: var(--color-accent);
    font-weight: 500;
    background-color: color-mix(in srgb, var(--color-accent) 10%, transparent);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
    width: fit-content;
}

.projects-authors {
    font-size: 0.875rem;
    color: var(--color-global-text);
    opacity: 0.8;
}

.projects-authors a {
    color: var(--color-link);
}

.projects-authors a:visited {
    color: var(--color-link);
}

.projects-year {
    font-size: 0.875rem;
    color: var(--color-global-text);
    opacity: 0.6;
    font-style: italic;
}

.projects-description {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-global-text);
    opacity: 0.9;
}

.projects-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.tag {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid;
    transition: opacity 0.2s ease;
}

.tag-safety {
    background-color: color-mix(in srgb, #ef4444 15%, transparent);
    border-color: #ef4444;
    color: #ef4444;
}

.tag-interpretability {
    background-color: color-mix(in srgb, #af67ff 15%, transparent);
    border-color: #af67ff;
    color: #af67ff;
}

.tag-arxiv {
    background-color: color-mix(in srgb, #10b981 15%, transparent);
    border-color: #10b981;
    color: #10b981;
}

.tag-workshop {
    background-color: color-mix(in srgb, #f59e0b 15%, transparent);
    border-color: #f59e0b;
    color: #f59e0b;
}

.tag-conference {
    background-color: color-mix(in srgb, #3b82f6 15%, transparent);
    border-color: #3b82f6;
    color: #3b82f6;
}

.tag-bibtex {
    background-color: color-mix(in srgb, #6b7280 15%, transparent);
    border-color: #6b7280;
    color: #6b7280;
}

.tag:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px var(--color-shadow);
}

.projects-citations {
    font-size: 0.75rem;
    color: var(--color-global-text);
    opacity: 0.6;
    font-style: italic;
    margin-top: 0.5rem;
}

/* Responsive projects cards */
@media (max-width: 768px) {
    .projects-card {
        flex-direction: column;
        gap: 1rem;
    }
    
    .projects-image {
        width: 100%;
        height: 120px;
    }
    
    .projects-tags {
        justify-content: center;
    }
}

/* Party Hat Explosion Animation Styles */
.party-hat {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 40px;
    height: 40px;
    opacity: 1;
    transform-origin: center;
}

.party-hat svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3));
}

@keyframes partyHatExplosion {
    0% {
        opacity: 1;
        transform: scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1.2) rotate(72deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) rotate(360deg);
    }
}

.party-hat.exploding {
    animation: partyHatExplosion 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* Logo pulse animation for party mode */
.logo-party-pulse {
    animation: partyPulse 0.6s ease-out;
}

@keyframes partyPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Confetti-like sparkles */
.party-sparkle {
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    width: 8px;
    height: 8px;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 1;
}

@keyframes sparkleExplosion {
    0% {
        opacity: 1;
        transform: scale(0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1.5) rotate(180deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(720deg);
    }
}

.party-sparkle.exploding {
    animation: sparkleExplosion 1.5s ease-out forwards;
}

/* Smaller party hats on mobile */
@media (max-width: 768px) {
    .party-hat {
        width: 30px;
        height: 30px;
    }
}

/* ============================= */
/* CV Timeline Component     */
/* ============================= */
.timeline {
    position: relative;
    margin: 2.5rem 0 1rem 0;
    /* space reserved for the timeline gutter (line + dot area) */
    --gutter: 2.75rem;
    padding-left: var(--gutter);
    /* alignment vars */
    --dot-size: 0.85rem;
    --line-x: 1.25rem;
    --line-w: 2px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: var(--line-x);
    top: 0.25rem;
    bottom: 0.25rem;
    width: var(--line-w);
    background: color-mix(in srgb, var(--color-accent-2) 20%, transparent);
}

.timeline-item {
    position: relative;
    padding: 0 0 1.75rem 0;
}

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

.timeline-dot {
    position: absolute;
    /* place dot so its center matches the line center; adjust for gutter since dot is inside content box */
    left: calc((var(--line-x) - var(--gutter)) + ((var(--line-w) - var(--dot-size)) / 2));
    top: 0.25rem;
    width: var(--dot-size);
    height: var(--dot-size);
    border-radius: 9999px;
    background: var(--color-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-accent) 20%, transparent);
}

.timeline-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-org {
    font-weight: 700;
    font-size: 1rem;
    color: var(--color-accent-2);
}

.timeline-role {
    color: var(--color-global-text);
    font-size: 1rem;
    opacity: 0.9;
}

.timeline-dates {
    margin-left: auto;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
    color: color-mix(in srgb, var(--color-accent-2) 65%, transparent);
}

.timeline-meta {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: color-mix(in srgb, var(--color-accent-2) 75%, transparent);
}

.timeline-desc {
    margin-top: 0.5rem;
}

@media (max-width: 640px) {
    .timeline {
        --gutter: 2rem;
        padding-left: var(--gutter);
        --line-x: 0.9rem;
    }
    .timeline-dates {
        width: 100%;
        margin-left: 0;
        opacity: 0.8;
    }
}

/* Projects Carousel Styles */
.projects-carousel-container {
    position: relative;
    width: 100%;
    overflow: visible;
    margin-top: 2rem;
    padding: 0 60px;
}

.projects-carousel {
    position: relative;
    width: 100%;
    min-height: 400px;
}

.projects-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    visibility: hidden;
    transform: translateX(50px);
    transition: all 0.5s ease-in-out;
    pointer-events: none;
}

.projects-card.active {
    position: relative;
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* Directional slide animations */
.projects-card.slide-out-left {
    animation: slideOutLeft 0.5s ease-in-out forwards;
}

.projects-card.slide-out-right {
    animation: slideOutRight 0.5s ease-in-out forwards;
}

.projects-card.slide-in-left {
    animation: slideInLeft 0.5s ease-in-out forwards;
}

.projects-card.slide-in-right {
    animation: slideInRight 0.5s ease-in-out forwards;
}

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

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

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

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

/* Carousel Navigation Container */
.projects-carousel-container {
    position: relative;
}

/* Carousel Dots and Arrows Container */
.carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 2rem;
    padding: 1rem 0;
}

/* Carousel Navigation Arrows */
.carousel-arrow {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    transform: none;
    background: var(--color-card-bg);
    border: 2px solid var(--color-border);
    color: var(--color-accent-2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--color-shadow);
}

.carousel-arrow:hover {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: white;
    box-shadow: 0 4px 12px var(--color-shadow);
    transform: scale(1.1);
}

.carousel-arrow:active {
    transform: scale(0.95);
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-border);
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: color-mix(in srgb, var(--color-accent-2) 60%, var(--color-border));
    transform: scale(1.2);
}

.carousel-dot.active {
    background: var(--color-accent);
    width: 32px;
    border-radius: 6px;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .carousel-arrow {
        width: 40px;
        height: 40px;
    }

    .carousel-arrow-left {
        left: 8px;
    }

    .carousel-arrow-right {
        right: 8px;
    }
}

@media (max-width: 640px) {
    .carousel-arrow {
        width: 36px;
        height: 36px;
        opacity: 0.8;
    }

    .carousel-arrow-left {
        left: 5px;
    }

    .carousel-arrow-right {
        right: 5px;
    }

    .projects-carousel {
        min-height: 500px;
    }
}

/* ============================================
   Projects List View (for projects.html page)
   ============================================ */

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.project-list-item {
    background: var(--color-card-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px var(--color-shadow);
    transition: all 0.3s ease;
    display: flex;
    gap: 1.5rem;
    flex-direction: column;
}

.project-list-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px var(--color-shadow);
    border-color: var(--color-accent);
}

/* Project list image */
.project-list-image {
    width: 100%;
    max-width: 300px;
    flex-shrink: 0;
}

.project-list-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

/* Project list content */
.project-list-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-list-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-accent-2);
    line-height: 1.3;
}

.project-list-year {
    display: inline-block;
    background: var(--color-accent);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    width: fit-content;
}

.project-list-venue {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text-muted);
    font-style: italic;
}

.project-list-authors {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.project-list-authors a {
    color: var(--color-link);
}

.project-list-authors a:visited {
    color: var(--color-link);
}

.project-list-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--color-global-text);
    margin: 0.5rem 0 0 0;
}

/* Desktop layout - side by side */
@media (min-width: 768px) {
    .project-list-item {
        flex-direction: row;
    }

    .project-list-image {
        max-width: 250px;
    }
}

/* Larger screens - more space */
@media (min-width: 1024px) {
    .project-list-item {
        padding: 2rem;
    }

    .project-list-image {
        max-width: 300px;
    }

    .project-list-title {
        font-size: 1.75rem;
    }
}