/* ==========================================================================
   DESIGN SYSTEM & VARIABLES
   ========================================================================== */
:root {
    /* Muted Slate Green, Teal, Graphite, and Off-White Color System (Light Mode) */
    --color-bg-primary: #f8faf9;
    --color-bg-secondary: #ffffff;
    --color-bg-alt: #f0f4f2;
    --color-text-main: #1f2723;
    --color-text-muted: #586660;
    --color-text-light: #809089;
    
    --color-primary: #2d5040;        /* Forest/Slate Green */
    --color-primary-light: #3e6854;  /* Muted Sage */
    --color-primary-dark: #1b3529;   /* Deep Moss */
    --color-accent: #2e6b75;         /* Spatial Muted Blue/Teal */
    --color-accent-light: #e6eff0;   /* Light Teal background */
    --color-border: #dbe4e0;
    
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --shadow-sm: 0 2px 8px rgba(27, 53, 41, 0.04);
    --shadow-md: 0 8px 20px rgba(27, 53, 41, 0.08);
    --shadow-lg: 0 16px 36px rgba(27, 53, 41, 0.12);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    
    --container-width: 1200px;
    --header-height: 80px;
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg-primary);
    color: var(--color-text-main);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

/* World Map Background Container */
#map-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#map-background svg {
    width: 95%;
    height: 95%;
}

/* Faint background countries */
#map-background svg path {
    fill: #2d5040 !important; /* Slate green */
    opacity: 0.08 !important; /* Slightly increased for visibility on white background */
    transition: opacity 0.3s ease, fill 0.3s ease, filter 0.3s ease;
}

/* Highlight Germany - Muted, elegant visibility (current residence) */
#map-background svg #de {
    fill: #2d5040 !important; /* Forest green */
    opacity: 0.25 !important;  /* Toned down opacity */
    filter: drop-shadow(0 0 5px rgba(45, 80, 64, 0.35));
}

/* Dynamic Hover-Sync Active state for country paths */
#map-background svg path.active-marker {
    fill: var(--color-accent) !important;
    opacity: 0.8 !important;
    filter: drop-shadow(0 0 8px rgba(61, 168, 181, 0.6)) !important;
}

/* World Map Pins Overlay (floats inside sticky map container) */
#map-pins-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 3; /* Render pins on top of map background */
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
}

#map-pins-overlay svg {
    width: 95%;
    height: 95%;
}

/* Teardrop map pin styling */
.map-pin-path {
    fill: var(--color-primary) !important;
    stroke: var(--color-bg-secondary) !important;
    stroke-width: 0.8;
    transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
}

.map-pin-dot {
    fill: var(--color-bg-secondary) !important;
}

.map-pin-inner {
    transform-origin: 0px 0px; /* Origin is at the bottom tip of the pin */
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: pinBob 2.8s infinite ease-in-out;
}

/* Gentle bobbing animation for pins */
@keyframes pinBob {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px); /* Floating effect */
    }
}

/* Active states (hover sync) */
.map-pin-inner.active-marker {
    animation-play-state: paused; /* Pause bobbing while active */
    transform: scale(1.4) translateY(-2px); /* Scale up and lift slightly */
}

.map-pin-inner.active-marker .map-pin-path {
    fill: var(--color-accent) !important;
    filter: drop-shadow(0 0 6px rgba(46, 107, 117, 0.6));
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-primary-dark);
    font-weight: 600;
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button, .btn {
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 500;
    transition: var(--transition-fast);
}

/* ==========================================================================
   LAYOUT & UTILITIES
   ========================================================================== */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 40px;
    width: 100%;
}

.section {
    padding: 75px 0;
    position: relative;
    z-index: 2;
}

.bg-alt {
    background-color: rgba(240, 244, 242, 0.45) !important; /* Semi-transparent alternative background */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.section-header {
    margin-bottom: 40px;
    position: relative;
}

.section-tag {
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-accent);
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.section-title {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 15px;
}

.section-line {
    width: 60px;
    height: 3px;
    background-color: var(--color-primary);
    border-radius: 2px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 15px;
}

.btn-primary {
    background-color: var(--color-primary);
    color: var(--color-bg-secondary);
}

.btn-primary:hover {
    background-color: var(--color-primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 80, 64, 0.2);
}

.btn-secondary {
    background-color: transparent;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
}

.btn-secondary:hover {
    background-color: rgba(45, 80, 64, 0.05);
    transform: translateY(-2px);
}

.btn-large {
    padding: 16px 36px;
    font-size: 16px;
    border-radius: 10px;
}

/* ==========================================================================
   SPATIAL CANVAS ANIMATION BACKGROUND
   ========================================================================== */
#spatial-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.88;
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background-color: rgba(248, 250, 249, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(219, 228, 224, 0.5);
    z-index: 100;
    transition: var(--transition-normal);
}

.site-header.scrolled {
    height: 70px;
    background-color: rgba(248, 250, 249, 0.95);
    box-shadow: var(--shadow-sm);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.logo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--color-accent);
}

.nav-menu ul {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-link {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-muted);
    position: relative;
    padding: 8px 0;
}

.nav-link:hover,
.nav-link.active-nav {
    color: var(--color-primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-primary);
    transition: var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active-nav::after {
    width: 100%;
}

.contact-btn-nav {
    color: var(--color-accent);
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.print-cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: var(--color-bg-alt);
    color: var(--color-primary);
    font-size: 14px;
    border: 1px solid var(--color-border);
}

.print-cv-btn:hover {
    background-color: var(--color-primary);
    color: var(--color-bg-secondary);
    border-color: var(--color-primary);
}

.mobile-nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 25px;
    height: 20px;
}

.mobile-nav-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--color-primary-dark);
    border-radius: 2px;
    transition: var(--transition-fast);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
    min-height: 80vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: var(--header-height);
    z-index: 2;
}

.hero-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    height: 100%;
    z-index: 2;
}

.hero-content {
    max-width: 760px;
}

.hero-background-graphic {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.22; /* Increased visibility as requested */
    overflow: hidden;
    animation: fadeInBackground 2.0s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-background-graphic img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Covers the full width and height */
    -webkit-mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    mask-image: radial-gradient(ellipse at center, rgba(0,0,0,1) 30%, rgba(0,0,0,0) 80%);
    mix-blend-mode: multiply;
    animation: floatGraphic 12s ease-in-out infinite;
}

/* Hero Content Animations */
.hero-content > * {
    opacity: 0;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.hero-content .hero-badge {
    animation-delay: 0.15s;
}

.hero-content .hero-title {
    animation-delay: 0.3s;
}

.hero-content .hero-subtitle {
    animation-delay: 0.45s;
}

.hero-content .hero-actions-group {
    animation-delay: 0.6s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInBackground {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 0.10;
        transform: scale(1);
    }
}

@keyframes floatGraphic {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    50% {
        transform: translateY(-8px) scale(1.02);
    }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.hero-title {
    font-size: 64px;
    font-weight: 800;
    letter-spacing: -1.5px;
    margin-bottom: 20px;
    color: var(--color-primary-dark);
}

.hero-subtitle {
    font-size: 20px;
    line-height: 1.6;
    color: var(--color-text-muted);
    margin-bottom: 36px;
    font-weight: 400;
}

.hero-actions-group {
    display: flex;
    gap: 16px;
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
}

.hero-scroll-indicator a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--color-border);
    color: var(--color-primary-light);
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    animation: floatScrollIndicator 2.5s ease-in-out infinite;
    transition: var(--transition-fast);
}

.hero-scroll-indicator a:hover {
    background-color: var(--color-primary);
    color: var(--color-bg-secondary);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

@keyframes floatScrollIndicator {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==========================================================================
   ABOUT SECTION
   ========================================================================== */
.about-section {
    padding-top: 38px;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 60px;
    align-items: flex-start;
}

.about-text p {
    margin-bottom: 20px;
    color: var(--color-text-muted);
}

.about-text p.lead {
    font-size: 18px;
    color: var(--color-primary-dark);
    font-weight: 500;
    line-height: 1.5;
}

.about-highlights {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.highlight-card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 24px;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 16px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-fast);
}

.highlight-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.card-icon {
    width: 48px;
    height: 48px;
    background-color: var(--color-bg-alt);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    font-size: 20px;
}

.highlight-card h3 {
    font-size: 18px;
    margin-bottom: 6px;
}

.highlight-card p {
    color: var(--color-text-muted);
    font-size: 14px;
    grid-column: 2;
}

/* ==========================================================================
   TIMELINE (EXPERIENCE & EDUCATION)
   ========================================================================== */
.timeline-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 60px;
}

.column-title {
    font-size: 22px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.column-title i {
    color: var(--color-accent);
}

.timeline {
    position: relative;
    padding-left: 24px;
    border-left: 2px solid var(--color-border);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

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

.timeline-dot {
    position: absolute;
    left: -33px;
    top: 6px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--color-bg-primary);
    border: 4px solid var(--color-primary);
    transition: var(--transition-fast);
}

.timeline-item:hover .timeline-dot {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.timeline-date {
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-accent);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timeline-content h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.timeline-location {
    font-size: 14px;
    color: var(--color-text-light);
    margin-bottom: 12px;
    font-weight: 500;
}

.timeline-bullets {
    padding-left: 16px;
    list-style-type: disc;
}

.timeline-bullets li {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.timeline-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 8px;
}

.timeline-project {
    font-size: 13px;
    color: var(--color-text-muted);
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 6px;
    margin-top: 6px;
}

.timeline-content a {
    color: var(--color-accent);
    text-decoration: underline;
    font-weight: 500;
}

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

/* ==========================================================================
   PUBLICATIONS SECTION
   ========================================================================== */
.publications-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

.publication-card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 24px;
    align-items: flex-start;
    transition: var(--transition-normal);
}

.publication-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-accent);
}

.pub-icon {
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    width: 54px;
    height: 54px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.pub-content {
    flex: 1;
}

.pub-type {
    display: inline-block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.pub-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-primary-dark);
    line-height: 1.35;
    margin-bottom: 8px;
}

.pub-authors {
    font-size: 14px;
    color: var(--color-text-main);
    margin-bottom: 12px;
}

.pub-authors strong {
    font-weight: 600;
    color: var(--color-primary);
}

.pub-abstract {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.pub-links {
    display: flex;
    gap: 12px;
}

.pub-links .btn {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   PROJECTS SECTION
   ========================================================================== */
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

.project-card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 40px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.project-meta {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
}

.project-type {
    color: var(--color-accent);
    background-color: var(--color-accent-light);
    padding: 4px 10px;
    border-radius: 4px;
}

.project-loc {
    color: var(--color-text-light);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.2px;
}

.project-description {
    color: var(--color-text-muted);
    margin-bottom: 24px;
    font-size: 15px;
}

.project-details {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 12px 16px;
    background-color: var(--color-bg-primary);
    border-radius: 8px;
    margin-bottom: 24px;
    border: 1px solid rgba(219, 228, 224, 0.4);
}

.detail-item {
    font-size: 13px;
    color: var(--color-text-muted);
}

.project-skills {
    margin-bottom: 24px;
}

.project-skills h4 {
    font-size: 14px;
    color: var(--color-text-main);
    margin-bottom: 8px;
}

.project-skills ul {
    list-style-type: square;
    padding-left: 16px;
}

.project-skills li {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags .tag {
    font-size: 12px;
    background-color: var(--color-bg-alt);
    color: var(--color-primary-light);
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
}

/* Projects split layout */

.projects-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 40px;
    align-items: start;
    margin-top: 20px;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.project-link-wrapper {
    margin-top: 15px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.project-link {
    color: var(--color-accent);
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}

.project-link:hover {
    color: var(--color-primary-dark);
}

/* Hover-glow active state for project cards when hovered from map */
.project-card.active-card-glow {
    border-color: var(--color-accent) !important;
    box-shadow: 0 0 20px rgba(46, 107, 117, 0.2) !important;
    transform: translateY(-4px);
}

.projects-map-wrapper {
    position: sticky;
    top: 110px; /* Height of site-header + margin */
    height: 350px; /* Balanced fixed height for desktop */
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition-normal);
}

.projects-map-wrapper:hover {
    box-shadow: var(--shadow-md);
}

#map-container {
    position: relative;
    width: 100%;
    height: 100%;
    background-color: #fcfdfe; /* Clean map paper background */
}

/* Tooltip popup styling */
.map-tooltip {
    position: absolute;
    background-color: var(--color-primary-dark);
    color: var(--color-bg-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-family: var(--font-heading);
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -100%) scale(0.9);
    transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.map-tooltip.visible {
    opacity: 1;
    transform: translate(-50%, -100%) scale(1);
}

/* Tooltip caret arrow */
.map-tooltip::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background-color: var(--color-primary-dark);
}

/* ==========================================================================
   SKILLS SECTION
   ========================================================================== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.skills-category-card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.skills-category-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-primary-light);
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.skill-tag {
    font-size: 13px;
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    padding: 6px 12px;
    border-radius: 6px;
    color: var(--color-text-main);
    font-weight: 500;
}

.languages-wrapper {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.languages-wrapper h3 {
    font-size: 18px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-primary-light);
}

.languages-flex {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.lang-item {
    display: flex;
    flex-direction: column;
}

.lang-name {
    font-weight: 600;
    color: var(--color-text-main);
}

.lang-level {
    font-size: 13px;
    color: var(--color-text-muted);
}

/* ==========================================================================
   CONTACT SECTION
   ========================================================================== */
.contact-container {
    display: flex;
    justify-content: center;
}

.contact-card {
    background-color: var(--color-primary-dark);
    color: var(--color-bg-secondary);
    width: 100%;
    max-width: 800px;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.contact-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(46, 107, 117, 0.15) 0%, transparent 70%);
    pointer-events: none;
}

.contact-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-bg-alt);
    font-family: var(--font-heading);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
}

.contact-card h2 {
    color: var(--color-bg-secondary);
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.contact-card p {
    color: rgba(255, 255, 255, 0.85);
    max-width: 580px;
    margin: 0 auto 36px;
    font-size: 16px;
}

.contact-card .btn-primary {
    background-color: var(--color-bg-secondary);
    color: var(--color-primary-dark);
    font-weight: 600;
}

.contact-card .btn-primary:hover {
    background-color: var(--color-bg-alt);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Circular Social Icon Buttons inside Contact Card */
.contact-buttons-group {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 24px;
}

.contact-icon-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.contact-icon-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.btn-primary-icon {
    background-color: var(--color-bg-secondary) !important;
    color: var(--color-primary-dark) !important;
    border: 1px solid var(--color-bg-secondary) !important;
}

.btn-primary-icon:hover {
    background-color: var(--color-bg-alt) !important;
    color: var(--color-primary-light) !important;
}

.btn-secondary-icon {
    border: 1px solid rgba(255, 255, 255, 0.45) !important;
    color: var(--color-bg-secondary) !important;
    background-color: transparent !important;
}

.btn-secondary-icon:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--color-bg-secondary) !important;
}

.btn-orcid-icon {
    border: 1px solid rgba(166, 206, 57, 0.5) !important;
    color: #c0f230 !important;
    background-color: transparent !important;
}

.btn-orcid-icon:hover {
    background-color: rgba(166, 206, 57, 0.1) !important;
    border-color: #c0f230 !important;
}

.contact-location-info {
    margin-top: 36px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    border-top: 1px solid var(--color-border);
    padding: 40px 0;
    text-align: center;
    font-size: 14px;
    color: var(--color-text-light);
    background-color: var(--color-bg-primary);
    position: relative;
    z-index: 2;
}

.footer-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-note {
    font-size: 12px;
    opacity: 0.8;
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */
@media (max-width: 1024px) {
    .container {
        padding: 0 30px;
    }
    .hero-title {
        font-size: 52px;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .timeline-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .projects-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .projects-map-wrapper {
        position: relative;
        top: 0;
        height: 280px;
        order: -1; /* Place map at the top of the cards list */
    }
}

@media (max-width: 768px) {
    :root {
        --header-height: 70px;
    }
    .hero-background-graphic {
        opacity: 0.35;
    }
    .section {
        padding: 45px 0; /* Reduced from 70px */
    }
    .hero-section {
        padding-bottom: 90px; /* Give room for absolute scroll indicator */
    }
    .hero-actions-group {
        flex-direction: column;
        gap: 12px;
    }
    .hero-actions-group .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    .section-title {
        font-size: 30px;
    }
    .hero-title {
        font-size: 40px;
    }
    .hero-subtitle {
        font-size: 17px;
    }
    
    /* Mobile Menu */
    .mobile-nav-toggle {
        display: flex;
        z-index: 101;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--color-bg-secondary);
        box-shadow: var(--shadow-lg);
        z-index: 100;
        transition: var(--transition-normal);
        padding: 100px 40px 40px;
        border-left: 1px solid var(--color-border);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .nav-menu ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 24px;
    }
    
    .nav-menu ul li {
        width: 100%;
    }
    
    .nav-link {
        font-size: 18px;
        display: block;
        width: 100%;
    }
    
    /* Hamburger animation */
    .mobile-nav-toggle.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    
    .mobile-nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
    
    .project-card {
        padding: 30px 20px;
    }
    
    .project-title {
        font-size: 22px;
    }
    
    .contact-card {
        padding: 40px 20px;
    }
    
    .contact-card h2 {
        font-size: 28px;
    }
}

/* ==========================================================================
   PRINT STYLES (OPTMIZED FOR A CLEAN PDF CV EXPORT)
   ========================================================================== */
@media print {
    /* Set page margins */
    @page {
        size: A4 portrait;
        margin: 15mm;
    }
    
    /* Reset base print styles */
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 11pt !important;
        line-height: 1.4 !important;
    }
    
    h1, h2, h3, h4 {
        color: #000000 !important;
        page-break-after: avoid;
    }
    
    /* Hide non-resume interactive elements */
    #spatial-canvas,
    #map-background,
    .hero-background-graphic,
    .site-header,
    .hero-scroll-indicator,
    .hero-actions-group,
    .section-tag,
    .section-line,
    .highlight-card .card-icon,
    .project-meta,
    .detail-item strong::after,
    .site-footer p:last-child {
        display: none !important;
    }
    
    .section {
        padding: 15px 0 !important;
        page-break-inside: auto;
    }
    
    .container {
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Print Header (Replace Hero with standard Resume Header) */
    .hero-section {
        min-height: auto !important;
        padding-top: 0 !important;
        margin-bottom: 20px !important;
    }
    
    .hero-content {
        max-width: 100% !important;
        text-align: left !important;
    }
    
    .hero-title {
        font-size: 24pt !important;
        margin-bottom: 4pt !important;
        font-weight: 700 !important;
    }
    
    .hero-subtitle {
        font-size: 12pt !important;
        margin-bottom: 8pt !important;
        color: #333333 !important;
    }
    
    .hero-badge {
        display: none !important;
    }
    
    /* Add print-only contact header */
    .hero-content::after {
        content: "Address: Dortmund, Germany | LinkedIn: linkedin.com/in/mehrad-moradipour";
        display: block;
        font-size: 10pt;
        color: #555555;
        border-bottom: 2px solid #333333;
        padding-bottom: 10px;
        margin-bottom: 15px;
    }
    
    /* Sections styling for print */
    .section-title {
        font-size: 15pt !important;
        border-bottom: 1px solid #cccccc !important;
        padding-bottom: 4px !important;
        margin-bottom: 12px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    /* About Section */
    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    .about-highlights {
        display: none !important; /* Hide highlighted cards on CV print */
    }
    
    /* Timeline & History layout */
    .timeline-container {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }
    
    .column-title {
        font-size: 12pt !important;
        margin-bottom: 15px !important;
        border-bottom: 1px dashed #dddddd !important;
        padding-bottom: 2px !important;
    }
    
    .timeline {
        border-left: none !important;
        padding-left: 0 !important;
    }
    
    .timeline-dot {
        display: none !important;
    }
    
    .timeline-item {
        margin-bottom: 18px !important;
        page-break-inside: avoid;
    }
    
    .timeline-date {
        font-size: 9pt !important;
        color: #555555 !important;
        font-weight: bold !important;
        margin-bottom: 2px !important;
        float: right;
    }
    
    .timeline-content h4 {
        font-size: 11pt !important;
        display: inline-block;
    }
    
    .timeline-location {
        font-size: 10pt !important;
        color: #666666 !important;
        margin-bottom: 6px !important;
    }
    
    .timeline-bullets li {
        font-size: 10pt !important;
        color: #222222 !important;
        margin-bottom: 4px !important;
    }
    
    .timeline-project {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin-top: 4px !important;
        font-size: 9.5pt !important;
        color: #333333 !important;
    }
    
    /* Projects Section in print */
    .projects-grid {
        gap: 15px !important;
    }
    
    .project-card {
        border: none !important;
        border-bottom: 1px solid #eeeeee !important;
        border-radius: 0 !important;
        padding: 10px 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }
    
    .project-title {
        font-size: 12pt !important;
        margin-bottom: 4px !important;
    }
    
    .project-description {
        font-size: 10pt !important;
        margin-bottom: 8px !important;
    }
    
    .project-details {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin-bottom: 8px !important;
    }
    
    .detail-item {
        display: inline;
        margin-right: 15px;
        font-size: 9pt !important;
    }
    
    .detail-item::after {
        content: " |";
    }
    
    .detail-item:last-child::after {
        content: "";
    }
    
    .project-skills h4 {
        font-size: 9.5pt !important;
        font-weight: bold !important;
        margin-bottom: 4px !important;
    }
    
    .project-skills ul {
        list-style-type: disc !important;
    }
    
    .project-skills li {
        font-size: 9.5pt !important;
        margin-bottom: 3px !important;
    }
    
    .project-tags {
        margin-top: 6px !important;
    }
    
    .project-tags .tag {
        background: none !important;
        border: 1px solid #aaaaaa !important;
        color: #000000 !important;
        font-size: 8pt !important;
        padding: 2px 6px !important;
        border-radius: 3px !important;
    }
    
    /* Skills Matrix */
    .skills-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 15px !important;
        page-break-inside: avoid;
    }
    
    .skills-category-card {
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin-bottom: 10px !important;
    }
    
    .skills-category-card h3 {
        font-size: 11pt !important;
        margin-bottom: 8px !important;
        border-bottom: 1px solid #eeeeee !important;
        padding-bottom: 2px !important;
    }
    
    .skill-tag {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        margin-right: 8px !important;
        font-size: 10pt !important;
    }
    
    .skill-tag::after {
        content: ", ";
    }
    
    .skill-tag:last-child::after {
        content: "";
    }
    
    .languages-wrapper {
        border: none !important;
        box-shadow: none !important;
        padding: 10px 0 0 0 !important;
        margin-top: 15px !important;
        border-top: 1px solid #dddddd !important;
        page-break-inside: avoid;
    }
    
    .languages-wrapper h3 {
        font-size: 11pt !important;
        margin-bottom: 8px !important;
    }
    
    .languages-flex {
        gap: 20px !important;
    }
    
    .lang-item {
        flex-direction: row !important;
        gap: 6px;
        font-size: 10pt !important;
    }
    
    .lang-name {
        font-weight: bold !important;
    }
    
    .lang-level::before {
        content: "(";
    }
    
    .lang-level::after {
        content: ")";
    }
    
    /* Publications in print */
    .publications-grid {
        gap: 15px !important;
    }
    
    .publication-card {
        border: none !important;
        border-bottom: 1px solid #eeeeee !important;
        border-radius: 0 !important;
        padding: 15px 0 !important;
        box-shadow: none !important;
        display: block !important;
        page-break-inside: avoid;
    }
    
    .pub-icon {
        display: none !important;
    }
    
    .pub-title {
        font-size: 12pt !important;
        margin-bottom: 4px !important;
    }
    
    .pub-authors {
        font-size: 10pt !important;
        color: #333333 !important;
    }
    
    .pub-abstract {
        font-size: 9.5pt !important;
        line-height: 1.4 !important;
    }
    
    .pub-links {
        display: none !important;
    }
    
    /* Hide full contact card section in print */
    .contact-section {
        display: none !important;
    }
    
    /* Footer formatting */
    .site-footer {
        border-top: 1px solid #dddddd !important;
        padding: 15px 0 !important;
        font-size: 8pt !important;
        margin-top: 30px !important;
    }
}

/* ==========================================================================
   SHARE MODAL (QR CODE)
   ========================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(31, 39, 35, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 380px;
    box-shadow: var(--shadow-lg);
    position: relative;
    text-align: center;
    transform: translateY(20px);
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.open .modal-card {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    color: var(--color-text-light);
    line-height: 1;
    transition: var(--transition-fast);
}

.modal-close-btn:hover {
    color: var(--color-primary-dark);
}

.modal-card h3 {
    margin-bottom: 20px;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-primary-dark);
}

.qr-container {
    background-color: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    padding: 15px;
    border-radius: 12px;
    display: inline-flex;
    margin-bottom: 15px;
}

.qr-container img {
    display: block;
    width: 180px;
    height: 180px;
}

.qr-info {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.qr-link-copy {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.qr-link-copy input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 13px;
    color: var(--color-text-muted);
    background-color: var(--color-bg-primary);
    outline: none;
    font-family: var(--font-body);
}

.qr-link-copy button {
    background-color: var(--color-accent-light);
    color: var(--color-accent);
    width: 38px;
    height: 38px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: var(--transition-fast);
}

.qr-link-copy button:hover {
    background-color: var(--color-accent);
    color: var(--color-bg-secondary);
}

.copy-toast {
    font-size: 12px;
    color: var(--color-primary);
    font-weight: 600;
    display: block;
    opacity: 0;
    transform: translateY(-5px);
    transition: all 0.3s ease;
}

.copy-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Hide modal in print */
@media print {
    .modal-overlay {
        display: none !important;
    }
}

/* ORCID iD Custom Contact Button */
.btn-orcid {
    border: 1px solid #a6ce39 !important;
    color: #a6ce39 !important;
    background-color: transparent !important;
}

.btn-orcid:hover {
    background-color: rgba(166, 206, 57, 0.06) !important;
    color: #b5e03f !important;
    border-color: #b5e03f !important;
    transform: translateY(-2px);
}

