/* ======================= */
/* CSS Reset Section       */
/* ======================= */
:root {
    /* Color Variables */
    --primary-color: #1a1a1a;
    --secondary-color: #333333;
    --accent-color: #4a9eff;
    --background-color: #000000;
    --text-color: #e0e0e0;
    --text-muted: #8b9cb3;
    --card-background: #FFFFFF;
    --gradient-start: #2D3047;
    --gradient-end: #419D78;
    --font-primary: 'Space Grotesk', sans-serif;
    --header-height: 70px;
    
    /* Spacing Variables */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    
    /* Font Sizes */
    --text-xs: 0.85rem;
    --text-sm: 1rem;
    --text-md: 1.25rem;
    --text-lg: 1.5rem;
    --text-xl: 1.75rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 10px;

    --bg-color: #0a0f1c;
    --header-bg: rgba(10, 15, 28, 0.98);
    --nav-hover: rgba(74, 158, 255, 0.1);
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Inter', sans-serif;
    --card-bg: #111827;
    --card-border: rgba(74, 158, 255, 0.1);
}

/* Modern CSS Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, header, nav, main, footer, img, h1, h2, h3, ul, aside, figure, figcaption, video {
    margin: 0;
    padding: 0;
    border: 0;
}

/* ======================= */
/* Base Styles             */
/* ======================= */
html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

/* Advanced Starry Background with Space Travel Effect */
.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
    overflow: hidden;
    will-change: transform;
    transform-origin: center center;
}

/* Multiple star layers for depth and variety */
.stars::before,
.stars::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Main star layer - small white and colored stars */
.stars::before {
    background: 
        /* Bright white stars */
        radial-gradient(1px 1px at 23px 41px, #ffffff, transparent),
        radial-gradient(1px 1px at 87px 134px, #ffffff, transparent),
        radial-gradient(1px 1px at 156px 67px, #ffffff, transparent),
        radial-gradient(1px 1px at 203px 156px, #ffffff, transparent),
        radial-gradient(1px 1px at 45px 187px, #ffffff, transparent),
        radial-gradient(1px 1px at 134px 23px, #ffffff, transparent),
        radial-gradient(1px 1px at 67px 98px, #ffffff, transparent),
        radial-gradient(1px 1px at 198px 89px, #ffffff, transparent),
        radial-gradient(1px 1px at 78px 156px, #ffffff, transparent),
        radial-gradient(1px 1px at 167px 23px, #ffffff, transparent),
        
        /* Blue stars */
        radial-gradient(1px 1px at 34px 123px, #87ceeb, transparent),
        radial-gradient(1px 1px at 145px 78px, #87ceeb, transparent),
        radial-gradient(1px 1px at 76px 45px, #87ceeb, transparent),
        radial-gradient(1px 1px at 189px 134px, #87ceeb, transparent),
        radial-gradient(1px 1px at 123px 167px, #87ceeb, transparent),
        
        /* Yellow/Orange stars */
        radial-gradient(1px 1px at 98px 67px, #ffd700, transparent),
        radial-gradient(1px 1px at 56px 123px, #ffd700, transparent),
        radial-gradient(1px 1px at 178px 45px, #ffd700, transparent),
        radial-gradient(1px 1px at 134px 187px, #ffb347, transparent),
        radial-gradient(1px 1px at 23px 89px, #ffb347, transparent),
        
        /* Red stars */
        radial-gradient(1px 1px at 167px 123px, #ff6b6b, transparent),
        radial-gradient(1px 1px at 89px 34px, #ff6b6b, transparent),
        radial-gradient(1px 1px at 45px 156px, #ff6b6b, transparent);
    
    background-size: 200px 200px;
    background-position: 0 0;
    background-repeat: repeat;
    animation: twinkle-stars 6s ease-in-out infinite alternate;
}

/* Secondary layer - larger stars and occasional supernovas */
.stars::after {
    background: 
        /* Larger bright stars */
        radial-gradient(2px 2px at 67px 89px, #ffffff, transparent),
        radial-gradient(2px 2px at 156px 134px, #ffffff, transparent),
        radial-gradient(2px 2px at 89px 178px, #ffffff, transparent),
        radial-gradient(2px 2px at 23px 67px, #ffffff, transparent),
        radial-gradient(2px 2px at 178px 23px, #ffffff, transparent),
        
        /* Supernova/bright stars with prominent glow */
        radial-gradient(6px 6px at 134px 89px, #ffffff, rgba(255,255,255,0.6) 30%, rgba(255,255,255,0.2) 60%, transparent),
        radial-gradient(5px 5px at 78px 156px, #87ceeb, rgba(135,206,235,0.5) 30%, rgba(135,206,235,0.1) 60%, transparent),
        radial-gradient(7px 7px at 198px 67px, #ffd700, rgba(255,215,0,0.6) 30%, rgba(255,215,0,0.2) 60%, transparent),
        radial-gradient(5px 5px at 45px 123px, #ff6b6b, rgba(255,107,107,0.5) 30%, rgba(255,107,107,0.1) 60%, transparent),
        
        /* Distant cluster effect */
        radial-gradient(1px 1px at 112px 45px, rgba(255,255,255,0.6), transparent),
        radial-gradient(1px 1px at 115px 47px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 109px 49px, rgba(255,255,255,0.5), transparent);
    
    background-size: 240px 240px;
    background-position: 90px 150px;
    background-repeat: repeat;
    animation: twinkle-bright 7s ease-in-out infinite alternate;
}

/* Add tertiary layer for extra micro stars */
.stars::before {
    box-shadow:
        2px 3px #fff, 50px 80px #fff, 120px 40px #fff,
        180px 90px #87ceeb, 30px 170px #ffd700, 90px 140px #ff6b6b;
}

/* Subtle twinkle animations */
@keyframes twinkle-stars {
    0% { opacity: 0.6; }
    50% { opacity: 0.9; }
    100% { opacity: 0.7; }
}

@keyframes twinkle-bright {
    0% { opacity: 0.75; }
    50% { opacity: 1; }
    100% { opacity: 0.8; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stars::before {
        background-size: 180px 180px;
    }
    .stars::after {
        background-size: 200px 200px;
    }
}

@media (max-width: 480px) {
    .stars::before {
        background-size: 150px 150px;
    }
    .stars::after {
        background-size: 170px 170px;
    }
}

/* ======================= */
/* Typography              */
/* ======================= */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Emblema One', cursive;
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* ======================= */
/* Body and Images Section */
/* ======================= */
/* Sets page background color and image/video defaults */
/* Removed legacy beige background - using dark theme consistently */

/* Responsive media handling */
img, video {
    max-width: 100%; /* Prevent media overflow while maintaining aspect ratio */
    display: block;  /* Remove inline spacing under images */
}

/* ======================= */
/* Mobile Viewport Styles  */
/* ======================= */
/* Mobile-first visibility control */
.mobile, .mobile-tablet {
    display: block; /* Default mobile elements visibility */
}

.tab-desk, .desktop {
    display: none;  /* Hide non-mobile elements by default */
}

/* ======================= */
/* Header Styles           */
/* ======================= */
/* Mobile header typography */
.mobile h1, .mobile h3 {
    padding: 2%;    /* Responsive padding relative to container */
    text-align: center;
}

.mobile h1 {
    font-family: 'Emblema One', cursive; /* Decorative font for main heading */
}

.mobile h3 {
    font-family: 'Lora', serif; /* Readable serif font for subheadings */
}

/* ======================= */
/* Navigation Styles       */
/* ======================= */
/* Main navigation container */
nav {
    background-color: var(--secondary-color);
    padding: var(--spacing-xs) 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

nav ul {
    list-style-type: none;
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-xs);
}

nav li {
    display: inline-block;
    font-size: var(--text-md);
    font-family: Geneva, Arial, sans-serif;
    font-weight: bold;
}

nav li a {
    display: block;
    color: var(--text-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    text-decoration: none;
    transition: background-color 0.3s ease;
    border-radius: var(--radius-sm);
}

nav li a:hover {
    background-color: var(--accent-color);
}

/* ======================= */
/* Main Content Styles     */
/* ======================= */
main {
    padding: 2%;         /* Breathing room around content */
    font-family: 'Lora', serif; /* Primary content font */
    margin-top: calc(var(--header-height) + 2rem);
}

main p {
    font-size: 1.25em;   /* Enhanced readability for paragraphs */
}

main h3 {
    padding-top: 2%;     /* Spacing before subheadings */
}

main ul {
    list-style-type: square; /* Visible bullet style for lists */
}

.link {
    color: #4d3319;        /* Dark brown link color */
    text-decoration: none;  /* Remove underline */
    font-weight: bold;      /* Emphasize links */
    font-style: italic;      /* Differentiate from regular text */
}

.action {
    font-size: 1.75em;     /* Prominent call-to-action text */
    font-weight: bold;     
    text-align: center;    
}

.round {
    border-radius: 6px;    /* Softened element corners */
}

aside {
    text-align: center;    
    font-size: 1.5em;      /* Larger text for supplementary content */
    font-weight: bold;     
    text-shadow: 4px 4px 10px #c5a687; /* Decorative text effect */
}

figure {
    border: 4px solid #2a1f14;    /* Frame around images */
    box-shadow: 6px 6px 10px #c5a687; /* Depth effect */
    max-width: 400px;      /* Limit width while maintaining responsiveness */
    margin: 2% auto;       /* Centered with vertical spacing */
}

figcaption {
    padding: 2%;           /* Spacing around caption text */
    border-top: 4px solid #2a1f14; /* Separator between image and caption */
}

#info ul {
    margin-left: 10%;      /* Indented list for visual hierarchy */
}

#contact, #form h2 {
    text-align: center;    /* Centered contact section headings */
}

.tel-link {
    background-color: #2a1f14; /* Dark background for phone number */
    padding: 2%;           /* Spacing inside container */
    width: 80%;            /* Responsive width with margins */
    margin: 0 auto;        /* Centered container */
}

.tel-link a {
    color: #f6eee4;        /* Contrast text color */
    text-decoration: none; /* Remove underline */
    font-weight: bold;     /* Emphasize phone number */
}

/* ======================= */
/* Form Styles             */
/* ======================= */
fieldset, input, textarea { 
    margin-bottom: 2%;     /* Vertical spacing between form elements */
}

fieldset legend {
    font-weight: bold;     /* Emphasize fieldset labels */
    font-size: 1.25em;    /* Larger text for legends */
}

label {
    display: block;        /* Stack labels above inputs */
    padding-top: 2%;       /* Spacing between form sections */
}

form #submit {
    margin: 0 auto;        /* Centered submit button */
    display: block;        
    padding: 2%;           /* Generous button sizing */
    background-color: #78593a; /* Dark brown button color */
    color: #f6eee4;       /* Contrast text color */
    font-size: 1.25em;     /* Large, readable button text */
    border-radius: 10px;   /* Rounded button corners */
}

/* ======================= */
/* Footer Styles           */
/* ======================= */
footer {
    text-align: center;    
    font-size: 0.95em;      /* Slightly larger footer text */
    background-color: transparent; /* Blend with page background */
    color: var(--text-color);
    padding: 3rem 0 2rem;   /* Comfortable vertical spacing */
    border-top: none; /* Remove divider line */
    margin-top: 4rem;
    width: 100%;
}

.footer-changelog {
    margin-top: 0.75rem;
}

.footer-changelog a {
    color: var(--accent-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-changelog a:hover {
    opacity: 1;
}

.footer-links {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
}

.footer-links a {
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    position: relative;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.footer-links a::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.footer-links a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* ======================= */
/* Media Queries           */
/* ======================= */
/* Tablet/Desktop Breakpoint */
@media screen and (min-width: 620px), print {
    .tab-desk {
        display: block;    /* Show tablet/desktop elements */
    }
    .mobile {
        display: none;     /* Hide mobile-specific elements */
    }
    nav li {
        border-top: none;      /* Remove mobile separators */
        display: inline-block; /* Horizontal navigation items */
        font-size: 1.25em;     /* Slightly smaller text */
    }
    nav li a {
        padding: 0.5em;        /* Adjust spacing for horizontal layout */
    }
    .grid {
        display: grid;                    /* Enable grid layout */
        grid-template-columns: auto auto; /* Two-column layout */
        grid-gap: 10px;                  /* Spacing between columns */
    }
    aside {
        grid-column: 1 / span 2; /* Full-width aside in grid */
    }
    form {
        width: 70%;             /* Constrain form width */
        margin: 0 auto;         /* Centered form */
    }
}

/* Desktop Breakpoint */
@media screen and (min-width: 1000px), print {
    .desktop {
        display: block;    /* Show desktop-specific elements */
    }
    .mobile-tablet {
        display: none;     /* Hide mobile/tablet elements */
    }
    nav li {
        font-size: 1.5em;  /* Larger navigation text */
    }
    nav li a {
        padding: 0.5em 1.5em; /* Horizontal padding for nav items */
    }
    nav li a:hover {
        color: #2a1f14;        /* Hover text color */
        background-color: #f6eee4; /* Hover background */
        transition: all 0.5s ease; /* Smooth color transition */
    }
    #info ul {
        margin-left: 5%;  /* Adjust list indentation */
    }
    .grid {
        grid-template-columns: auto auto auto; /* Three-column layout */
        grid-gap: 30px;                      /* Increased spacing */
    }
    aside {
        grid-column: 1 / span 3; /* Full-width aside in 3-col grid */
        font-size: 2em;         /* Larger aside text */
    }
    table {
        border: 1px solid #2a1f14; /* Table borders */
        border-collapse: collapse; /* Clean table layout */
        margin: 0 auto;           /* Centered tables */
    }
    caption {
        font-size: 1.5em;    /* Table caption size */
        font-weight: bold;   
        padding: 1%;         /* Caption spacing */
    }
    th, td {
        border: 1px solid #2a1f14; /* Cell borders */
        padding: 1%;         /* Cell spacing */
    }
    th {
        background-color: #2a1f14; /* Header cell color */
        color: #fff;              /* Header text color */
        font-size: 1.15em;       /* Header text size */
    }
    tr:nth-child(odd) {
        background-color: #deccba; /* Zebra striping */
    }
    form {
        width: auto;       /* Auto-width forms */
    }
    .form-grid {
        display: grid;                    /* Form grid layout */
        grid-template-columns: auto auto; /* Two-column form */
        grid-gap: 20px;                  /* Form element spacing */
    }
    .btn {
        grid-column: 1 / span 2; /* Full-width submit button */
    }
}

/* Large Desktop Breakpoint */
@media screen and (min-width: 1921px), print {
    /* Removed gradient background - maintaining dark theme consistency */
    #wrapper {
        width: 1920px;     /* Fixed width for ultra-wide screens */
        margin: 0 auto;    /* Centered container */
    }
    /* main background inherits from body - no override needed */
    .grid {
        grid-template-columns: auto auto auto auto; /* Four-column layout */
    }
    aside {
        grid-column: 1 / span 4; /* Full-width aside in 4-col grid */
        font-size: 3em;         /* Very large aside text */
    }
}

/* Print Styles */
@media print {
    body {
        background-color: #fff; /* White background for printing */
        color: #000;           /* Black text for printing */
    }
}

/* ======================= */
/* External Links Section  */
/* ======================= */
.external-links {
    background: var(--card-bg);
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
}

.external-links h2 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.modern-2x2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 2rem;
    justify-content: center;
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.link-item {
    margin: 0;
    padding: 0;
}

.link-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.link-button:hover {
    background: rgba(74, 158, 255, 0.15);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.link-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* Icon color override */
.icon-white {
    filter: brightness(0) invert(1) brightness(1.3);
}

/* Remove previous specific icon fixes for GitHub/LinkedIn (if present) */

.link-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

.external-links nav {
    background: none;
    padding: 0;
}

/* ======================= */
/* Changelog Styles        */
/* ======================= */
.changelog {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.version-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.2);
}

.version-card h3 {
    color: var(--accent-color);
    font-family: 'Emblema One', cursive;
    margin: 0 0 0.5rem 0;
    font-size: 1.3em;
    letter-spacing: 0.5px;
}

.version-card ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0 0 0;
}

.version-card li {
    color: #4d3319;
    line-height: 1.5;
    margin: 0.5rem 0;
}

@media (max-width: 620px) {
    .version-card {
        padding: 1rem;
        margin: 1rem 0;
    }
    
    .version-card h3 {
        font-size: 1.1em;
    }
}

/* Fade-in animation for changelog cards */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    animation: fadeInUp 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: none;
    }
}

.version-card li {
    color: var(--text-color);
}

/* ======================= */
/* Tablet/Desktop Images   */
/* ======================= */
.tab-desk img {
    display: block;      /* Block-level images */
    margin: 0 auto;     /* Centered images */
}

/* ======================= */
/* Mobile Override         */
/* ======================= */
@media (max-width: 767px) {
    .tab-desk {
        display: none;  /* Hide desktop images on mobile */
    }
    
    .mobile:not(.mobile-tablet) {
        display: block; /* Ensure mobile elements show */
    }
}

/* ======================= */
/* Card Styles             */
/* ======================= */
.card {
    background: var(--card-bg);
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card h2 {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 2rem;
}

.project {
    margin-bottom: 2rem;
}

.project h3 {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    color: var(--text-color);
    margin-bottom: 1rem;
}

.project-description {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.project-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--accent-color);
    color: var(--bg-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.project-link:hover {
    background: #3a8eff;
    transform: translateY(-2px);
}

.project-meta {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Curriculum Vitae & Résumé section: center download buttons */
#resume-CV .documents-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#resume-CV .action-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem;
}

#resume-CV .document-meta {
    justify-content: center;
    margin-top: 1.25rem;
}

.tech-stack {
    font-family: var(--font-mono);
}

/* ======================= */
/* Form Styles             */
/* ======================= */
input, textarea {
    width: 100%;
    padding: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: var(--text-sm);
    transition: border-color 0.3s ease;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(120, 89, 58, 0.2);
}

button, .btn {
    background-color: var(--accent-color);
    color: var(--text-color);
    padding: var(--spacing-xs) var(--spacing-md);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: var(--text-md);
    transition: background-color 0.3s ease;
}

button:hover, .btn:hover {
    background-color: var(--secondary-color);
}

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

:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* All styles for Connect & Collaborate buttons have been removed. */

@media (max-width: 900px) {
    .link-grid {
        flex-direction: column;
        gap: 1.25rem;
    }
    .link-item {
        flex: 1 1 100%;
    }
    .link-button {
        font-size: 1.1rem;
        padding: 1rem 1.25rem;
        min-width: 0;
    }
    .link-icon {
        width: 28px;
        height: 28px;
    }
}

/* Modern Welcome Section */
.welcome-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 3.5rem 2.5rem 2.5rem 2.5rem;
    border-radius: 22px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.3);
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

.welcome-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.main-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
    text-align: center;
}

.greeting {
    font-size: 1.35rem;
    color: #444;
    margin-bottom: 0;
}

/* Academic Profile Highlight Card */
.highlight-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    width: 100%;
    max-width: 600px;
    margin: 0 auto 0.5rem auto;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    text-align: center;
}

.academic-timeline {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 1.15rem;
}

.degree-label {
    font-weight: 500;
    margin-left: 0.25em;
}

.degree-list {
    list-style: none;
    padding-left: 1.5em;
    margin: 0.5em 0 0 0;
}

.degree-list li {
    display: flex;
    align-items: center;
    gap: 0.5em;
    margin-bottom: 0.25em;
    font-size: 1.08rem;
}

.degree-icon {
    font-size: 1.25em;
    margin-right: 0.25em;
    vertical-align: middle;
}

@media (max-width: 700px) {
    .welcome-card {
        padding: 1.5rem 0.5rem 1.5rem 0.5rem;
        border-radius: 14px;
        gap: 1.25rem;
    }
    .main-title {
        font-size: 2rem;
    }
    .highlight-card {
        padding: 1.25rem 0.5rem 1rem 0.5rem;
        border-radius: 10px;
    }
    .section-title {
        font-size: 1.15rem;
    }
}

/* Modern Welcome Grid Layout */
.welcome-card-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 3rem;
}

.intro-col {
    background: var(--card-bg);
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
}

.main-title {
    font-family: var(--font-mono);
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.greeting {
    color: var(--text-color);
    font-size: 1.1rem;
    line-height: 1.8;
}

.academics-col {
    background: var(--card-bg);
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
    position: relative;
}

.accent-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-color);
}

.section-title {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
}

.degree-list-modern {
    list-style: none;
}

.degree-list-modern li {
    color: var(--text-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
}

.degree-icon {
    font-size: 1.5rem;
}

.external-links {
    background: var(--card-bg);
    padding: 2rem;
    border: 1px solid var(--card-border);
    border-radius: 4px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.link-item {
    list-style: none;
}

.link-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid var(--card-border);
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.link-button:hover {
    background: rgba(74, 158, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.link-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.link-text {
    font-family: var(--font-mono);
    font-size: 0.9rem;
}

/* About Page Modern Layout */
.about-flex {
    display: flex;
    flex-direction: row;
    gap: 2rem;
    align-items: flex-start;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.profile-photo {
    max-width: 280px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(60,60,60,0.12);
    object-fit: cover;
    border: 3px solid #000;
}

.profile-photo img {
    border-radius: 12px;
}

.about-text {
    flex: 1 1 300px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--primary-color);
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

@media (max-width: 700px) {
    .about-flex {
        flex-direction: column;
        align-items: center;
    }
    .about-text {
        text-align: left; /* Avoid justify on narrow columns — prevents huge word spacing on mobile */
    }
}

/* Modern Gallery Grid Layout */
.gallery-title {
    text-align: center;
    font-size: 2.2rem;
    font-family: 'Emblema One', cursive;
    margin: 2.5rem 0 2rem 0;
    letter-spacing: 0.01em;
}

/* Masonry Gallery Layout */
.gallery-grid {
    column-count: 3;
    column-gap: 1.5rem;
    padding: 0 1.5rem 2.5rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.gallery-card {
    display: inline-block;
    width: 100%;
    margin: 0 0 1.5rem;
    background: transparent;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(60,60,60,0.10);
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
    break-inside: avoid;
}
.gallery-card:hover {
    box-shadow: 0 8px 32px rgba(60,60,60,0.16);
    transform: translateY(-3px) scale(1.03);
}
.gallery-card img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}
.gallery-card figcaption {
    padding: 1.1rem 1rem 1.2rem 1rem;
    font-size: 1.08rem;
    color: #333;
    text-align: center;
    background: #f8f9fb;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
}
@media (max-width: 900px) {
    .gallery-grid { column-count: 2; column-gap: 1.2rem; padding: 0 1rem 2rem 1rem; }
}
@media (max-width: 600px) {
    .gallery-grid { column-count: 1; column-gap: 0; padding: 0 0.5rem 1.5rem 0.5rem; }
}

/* Header Branding - Stairway to Space */
header {
    background: linear-gradient(90deg, #0d0d2b 0%, #1b2747 100%);
    position: relative;
}
.logo-link {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}
.site-logo {
    max-height: 40px;
    width: auto;
    margin-right: 0;
}
.site-title {
    font-family: 'Emblema One', cursive;
    font-size: 1.9rem;
    color: #f6eee4;
    margin: 0.3rem 0;
}
.tagline {
    text-align: center;
    color: #ddd;
    font-size: 0.9rem;
    margin-top: -0.2rem;
}
@media (max-width: 700px) {
    .site-logo {
        max-height: 140px;
    }
}

/* Modern Space Theme CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

#wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Modern Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background-color: var(--header-bg);
    padding: 0;           /* Override any header padding that could create a line under nav */
    border: none;
    box-shadow: none;
    z-index: 1000;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.logo-text {
    font-family: var(--font-mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
}

.logo-subtitle {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--accent-color);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.dot {
    color: var(--accent-color);
}

.main-nav {
    height: 100%;
    background-color: transparent; /* Remove inherited dark block */
    padding: 0;                    /* Align vertically with header */
    box-shadow: none;              /* No line/shadow under nav bar */
}

.main-nav ul {
    display: flex;
    height: 100%;
    list-style: none;
    gap: 2.5rem;
    flex-wrap: nowrap;           /* Override generic nav */
    justify-content: flex-start; /* Align with header content */
    align-items: center; /* Vertically center nav items */
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 1.05rem;  /* Slightly larger text */
    text-transform: none; /* Use human-readable casing */
    padding: 0.75rem 0;  /* Increase vertical space so links center nicely */
    position: relative;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.main-nav a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.main-nav a::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--accent-color);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.main-nav a:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

.main-nav a[aria-current="page"] {
    opacity: 1;
    color: var(--accent-color);
}

.main-nav a[aria-current="page"]::before {
    transform: scaleX(1);
}

/* Main Content Spacing */
main {
    margin-top: calc(var(--header-height) + 2rem);
}

/* Responsive Design */
@media (max-width: 768px) {
    .logo-text {
        font-size: 1.3rem;
    }

    .main-nav ul {
        gap: 1.5rem;
    }

    .main-nav a {
        font-size: 0.8rem;
    }
}

@media (max-width: 600px) {
    .header-content {
        flex-direction: column;
        justify-content: center;
        gap: 1rem;
        padding: 1rem 0;
    }

    .site-header {
        height: auto;
    }

    .main-nav {
        width: 100%;
    }

    .main-nav ul {
        justify-content: center;
        flex-wrap: nowrap;           /* Keep all nav items on one line on mobile */
        gap: 0.4rem;
    }

    .main-nav a {
        font-size: 0.7rem;
        padding: 0.5rem 0.25rem;
        white-space: nowrap;
    }

    main {
        margin-top: calc(var(--header-height) + 4rem);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-section,
.academic-section,
.research-section,
.connect-section {
    animation: fadeIn 0.8s ease-out;
}

/* About Page Styles */
.about-section {
    padding: 2rem 0;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
}

.about-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    margin-top: 2rem;
}

.about-text {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.about-text .lead {
    font-size: 1.3rem;
    color: var(--secondary-color);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.about-text h2 {
    color: var(--primary-color);
    margin: 2rem 0 1rem;
    font-size: 1.5rem;
}

.about-text p {
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.skills-card,
.interests-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.skills-card h3,
.interests-card h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.skills-list,
.interests-list {
    list-style: none;
}

.skills-list li,
.interests-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.skills-list li:last-child,
.interests-list li:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
    }
    
    .about-sidebar {
        order: -1;
    }
}

/* About section overrides */
.about-text,
.interests-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    color: var(--text-color);
}

.interests-list li {
    color: var(--primary-color);
}

/* Font overrides for About page headings */
.about-text h2,
.interests-card h3 {
    font-family: var(--font-sans);
    font-weight: 600; /* Semi-bold for distinction */
}

/* About page heading/list color tweaks */
.about-text h2,
.interests-card h3 {
    color: var(--accent-color);
}

.interests-list li {
    color: var(--text-color);
}

/* Remove extra top space before first heading in about-text */
.about-text h2:first-child {
    margin-top: 0;
}

/* Add missing Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Emblema+One&family=Lora:wght@400;600&family=Space+Grotesk:wght@300;400;600;700&display=swap');


