/* Basic Reset & Body Styles */
body {
    padding: 0;
    margin: 0;
    font-family: Verdana, sans-serif;
    /* From provided CSS */
    font-size: 16px;
    line-height: 1.6;
    background-color: #fff;
    color: #333;
    /* Slightly softer than pure black */
    overflow-y: scroll;
    /* Always show scrollbar to prevent layout shift */
}

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

a {
    color: #0056b3;
    /* Standard link blue */
    text-decoration: none;
}

a:hover {
    color: #003d80;
    text-decoration: underline;
}

/* Headings and Paragraphs */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 1.2em 0 0.6em 0;
    line-height: 1.3;
    color: #000;
}

h1 {
    font-size: 2rem;
}

h2 {
    font-size: 1.75rem;
}

h3 {
    font-size: 1.4rem;
}

p {
    margin-bottom: 1em;
    /* Use bottom margin for spacing */
}

ul,
ol {
    margin-left: 1.5em;
    margin-bottom: 1em;
}

hr {
    border: none;
    border-top: 1px solid #ccc;
    /* Lighter horizontal rule */
    margin: 2em 0;
}

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

/* Header & Navigation (CSES Inspired) */
.header {
    background-color: #292929;
    /* Dark background from provided CSS */
    color: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    /* Subtle shadow */
    padding: 0 15px;
    /* Padding on the sides */
    position: sticky;
    /* Make header stick on scroll */
    top: 0;
    z-index: 1000;
}

.header a {
    color: inherit;
    /* Links inherit white color */
    text-decoration: none;
}

.header-container {
    max-width: 960px;
    /* Max width for content */
    min-height: 50px;
    /* Min height */
    margin: 0 auto;
    /* Center the container */
    display: flex;
    justify-content: space-between;
    /* Space between title and nav */
    align-items: center;
    flex-wrap: wrap;
    /* Allow wrapping on small screens */
}

.site-title {
    font-size: 1.4rem;
    font-weight: bold;
    padding: 10px 0;
}

.site-title a:hover {
    text-decoration: none;
    opacity: 0.9;
}

/* Main Navigation Links */
.main-nav ul.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* Horizontal layout */
}

.main-nav li {
    margin-left: 5px;
    /* Spacing between links */
}

.main-nav a {
    display: block;
    padding: 15px 12px;
    /* Padding for clickable area */
    text-transform: uppercase;
    /* Like provided CSS */
    font-size: 0.88rem;
    /* Like provided CSS */
    border-bottom: 3px solid transparent;
    /* Space for active indicator */
    transition: background-color 0.2s ease, border-bottom-color 0.2s ease;
}

.main-nav a:hover {
    background-color: #444;
    /* Slightly lighter hover */
    text-decoration: none;
    border-bottom-color: #666;
}

.main-nav a.current {
    /* background-color: #555; */
    font-weight: bold;
    border-bottom-color: #eee;
    /* Highlight current section */
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    /* Hidden by default */
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 10px;
}

.menu-toggle:hover {
    color: #ddd;
}

/* Layout Structure */
.skeleton {
    width: 100%;
    max-width: 960px;
    /* Max content width */
    margin: 20px auto;
    /* Centering and spacing from header */
    padding: 0 15px;
    /* Padding on the sides */
}

.content-wrapper {
    display: flex;
    /* To potentially accommodate a sidebar later */
    width: 100%;
}

.content {
    flex-grow: 1;
    /* Main content takes available space */
    min-width: 0;
    /* Prevent flex item overflow */
}

section {
    padding: 20px 0;
    /* Add vertical padding to sections */
    /* Scroll margin to offset sticky header */
    scroll-margin-top: 70px;
    /* Adjust based on header height */
}

section:first-of-type {
    padding-top: 0;
    /* No extra padding above the first section */
}


/* Project/Paper Items */
.project-item,
.paper-item {
    margin-bottom: 1.8em;
    padding-bottom: 1em;
    border-bottom: 1px solid #eee;
    /* Separator */
}

.project-item:last-child,
.paper-item:last-child {
    border-bottom: none;
}

.project-item h3 {
    margin-top: 0;
    margin-bottom: 0.3em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    /* Space between title and link icon */
}

.paper-item p {
    margin-bottom: 0.3em;
    /* Tighter spacing for paper details */
}

.paper-item p strong {
    font-size: 1.1em;
}

.icon-small {
    font-size: 0.9em;
    /* Make icons slightly smaller */
    color: #555;
    transition: color 0.2s ease;
}

.icon-small:hover {
    color: #0056b3;
}

/* Tags for Projects */
.tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 0.2em 0.6em;
    border-radius: 3px;
    font-size: 0.85em;
    margin-right: 0.5em;
    margin-top: 0.3em;
}


/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    border-top: 1px solid #ccc;
    font-size: 0.9em;
    color: #666;
}

/* Utility Classes (Inspired by provided CSS) */
.float {
    /* Simple float utility */
    float: right;
    margin: 0 0 1em 1em;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .site-title {
        font-size: 1.2rem;
    }

    .menu-toggle {
        display: block;
        /* Show hamburger button */
    }

    .main-nav ul.nav-links {
        display: none;
        /* Hide nav links by default */
        position: absolute;
        top: 100%;
        /* Position below the header */
        left: 0;
        width: 100%;
        background-color: #333;
        /* Slightly different background for dropdown */
        flex-direction: column;
        /* Stack links vertically */
        padding: 0;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    .main-nav ul.nav-links.active {
        display: flex;
        /* Show when active */
    }

    .main-nav li {
        margin-left: 0;
        width: 100%;
    }

    .main-nav a {
        padding: 12px 15px;
        /* Adjust padding */
        border-bottom: 1px solid #444;
        /* Separator between mobile links */
        text-align: left;
    }

    .main-nav a.current {
        background-color: #4a4a4a;
        border-bottom-color: #444;
        /* Reset border */
    }

    .header-container {
        /* Ensure toggle is on the right even if title wraps */
        justify-content: space-between;
    }

    /* Optional: make header taller when nav is open */
    .header.nav-open {
        padding-bottom: 10px;
    }

    .float {
        float: none;
        display: block;
        margin: 1em auto;
        /* Center floated elements */
    }
}