/* Import IBM Plex Fonts */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #2b6cb0;
    --text-dark: #1a202c;
    --text-light: #4a5568;
    --text-muted: #718096;
    --bg-light: #f7fafc;
    --bg-white: #ffffff;
    --bg-dark: #1a202c;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary-color: #4299e1;
    --secondary-color: #3182ce;
    --accent-color: #63b3ed;
    --text-dark: #e2e8f0;
    --text-light: #cbd5e0;
    --text-muted: #a0aec0;
    --bg-light: #10151d;
    --bg-white: #1a212c;
    --bg-dark: #0b0e14;
    --border-color: #303b4b;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.7;
    color: var(--text-dark);
    background-color: var(--bg-light);
    font-size: 16px;
    font-weight: 400;
    display: flex;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.sidebar-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 400;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    border-left: 3px solid transparent;
}

.sidebar-link i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.sidebar-link:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.sidebar-link.active {
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar-sublink {
    padding-left: 3rem;
    font-size: 0.9rem;
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    font-family: 'IBM Plex Sans', sans-serif;
}

.theme-toggle-btn:hover {
    background-color: var(--bg-light);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.theme-toggle-btn i {
    font-size: 1rem;
}

.sidebar-social {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.sidebar-social a {
    color: var(--text-light);
    font-size: 1.25rem;
    transition: color 0.2s ease;
}

.sidebar-social a:hover {
    color: var(--primary-color);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 40px;
    height: 40px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.mobile-menu-toggle span {
    width: 20px;
    height: 2px;
    background-color: var(--text-dark);
    transition: 0.3s;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.main-content > .footer {
    margin-top: auto;
}

/* Hero Section */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background:
        linear-gradient(180deg, rgba(13, 20, 33, 0.30) 0%, rgba(13, 20, 33, 0.68) 100%),
        url('../../images/hero-nus.jpg') center 15% / cover no-repeat;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 0;
    padding: 80px 20px 72px;
}

/* Content after the hero scrolls over it (curtain effect) */
.main-content > *:not(.hero) {
    position: relative;
    z-index: 1;
}

/* Scroll-linked fade of hero text (progressive enhancement) */
@supports (animation-timeline: scroll()) {
    .hero-content {
        animation: hero-fade linear both;
        animation-timeline: scroll(root);
        animation-range: 0 55vh;
    }

    @keyframes hero-fade {
        to {
            opacity: 0;
            transform: translateY(48px);
        }
    }
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.02em;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

.highlight {
    color: #8ec9ff;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: rgba(237, 242, 247, 0.92);
    font-weight: 400;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero .btn-secondary {
    color: #f8fafc;
    border-color: rgba(248, 250, 252, 0.75);
    background-color: rgba(13, 20, 33, 0.25);
}

.hero .btn-secondary:hover {
    background-color: rgba(248, 250, 252, 0.15);
    border-color: #f8fafc;
    color: #ffffff;
}

.btn {
    padding: 0.75rem 1.75rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-block;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
}

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

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

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

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

.scroll-down {
    display: none;
}

/* Section Styles */
section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    color: var(--text-dark);
    font-weight: 600;
    letter-spacing: -0.01em;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
    margin-top: 0.75rem;
}

/* About Section */
.about {
    background-color: var(--bg-light);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.about-text a,
.contact-subtitle a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.about-text a:hover,
.contact-subtitle a:hover {
    color: var(--secondary-color);
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-light);
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--bg-white);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.info-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    min-width: 30px;
}

.info-item h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.info-item p {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Education Section */
.education {
    background-color: var(--bg-white);
}

.education-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.education-item {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

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

.education-item::before {
    content: '';
    position: absolute;
    left: 25px;
    top: 60px;
    bottom: -30px;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
}

.education-item:last-child::before {
    display: none;
}

.education-icon {
    min-width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: var(--shadow);
}

.education-content {
    flex: 1;
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.education-content:hover {
    border-color: var(--primary-color);
}

.education-content h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.education-degree {
    font-size: 1.1rem;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.education-date {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.education-description {
    color: var(--text-light);
    line-height: 1.6;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.project-card:hover {
    border-color: var(--primary-color);
}

.project-image {
    height: 200px;
    background-color: var(--bg-light);
    overflow: hidden;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
}

.placeholder-image i {
    font-size: 3rem;
    color: white;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-light);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

.project-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Skills Section */
.skills {
    background-color: var(--bg-light);
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.skill-category {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.skill-category h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-category i {
    color: var(--primary-color);
}

.skill-context {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: -1rem 0 1.25rem;
}

.skill-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.skill-item {
    padding: 0.5rem 1rem;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 400;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.skill-item:hover {
    border-color: var(--primary-color);
}

/* Contact Section */
.contact-subtitle {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 3rem;
    font-size: 1.2rem;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
}

.contact-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 10px;
}

.contact-item i {
    font-size: 1.5rem;
    color: var(--primary-color);
    min-width: 30px;
}

.contact-item h3 {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.contact-item a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.contact-item a:hover {
    color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 2rem 0;
    text-align: center;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: white;
    font-size: 1.5rem;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* Research Pages Styles */

/* Research Header */
.research-header {
    background-color: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    padding: 4rem 0 3rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.page-description {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 800px;
}

.section-description {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
}

/* Research Interests Section */
.research-interests {
    background-color: var(--bg-light);
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.research-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.research-card:hover {
    border-color: var(--primary-color);
}

.research-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
}

.research-card h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.research-card p {
    color: var(--text-light);
    line-height: 1.7;
}

/* Current Research Section */
.current-research {
    background-color: var(--bg-white);
}

.research-list {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

.research-item {
    display: flex;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--bg-light);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.research-item:hover {
    border-color: var(--primary-color);
}

.research-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    opacity: 0.2;
    line-height: 1;
    min-width: 80px;
}

.research-content h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.research-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.research-description {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

/* Research Results - Gallery Section */
.results-gallery,
.video-gallery,
.data-viz {
    background-color: var(--bg-light);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.gallery-item {
    background-color: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.gallery-item:hover {
    border-color: var(--primary-color);
}

.gallery-image {
    height: 250px;
    background-color: var(--bg-light);
    overflow: hidden;
}

.placeholder-gallery {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-muted);
}

.placeholder-gallery i {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-info h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.gallery-info p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

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

/* Video Gallery Section */
.video-gallery {
    background-color: var(--bg-white);
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.video-item {
    background-color: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.video-item:hover {
    border-color: var(--primary-color);
}

.video-wrapper {
    aspect-ratio: 16 / 9;
    background-color: var(--bg-light);
}

.placeholder-video {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-muted);
}

.placeholder-video i {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.video-info {
    padding: 1.5rem;
}

.video-info h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.video-info p {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

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

/* Data Visualizations Section */
.data-viz {
    background-color: var(--bg-light);
}

.viz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.viz-item {
    background-color: var(--bg-white);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.viz-item:hover {
    border-color: var(--primary-color);
}

.viz-preview {
    height: 300px;
    background-color: var(--bg-light);
}

.placeholder-viz {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    color: var(--text-muted);
}

.placeholder-viz i {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

.viz-info {
    padding: 1.5rem;
}

.viz-info h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.viz-info p {
    color: var(--text-light);
    line-height: 1.6;
}

/* Research Notes Section */
.lab-notes {
    background-color: var(--bg-light);
}

.notes-container {
    max-width: 900px;
    margin: 0 auto;
}

.note-entry {
    background-color: var(--bg-white);
    border-radius: 6px;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
    overflow: hidden;
}

.note-entry:last-child {
    margin-bottom: 0;
}

.note-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.note-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.note-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.note-date,
.note-category {
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.note-category {
    padding: 0.25rem 0.75rem;
    background-color: var(--bg-white);
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.note-content {
    padding: 2rem;
}

.note-content h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.note-content h3:first-child {
    margin-top: 0;
}

.note-content p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.note-content ol,
.note-content ul {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.note-content li {
    margin-bottom: 0.5rem;
}

.note-attachments {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.note-attachments h4 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-weight: 600;
}

.attachment-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.attachment-item {
    padding: 0.5rem 1rem;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.2s ease;
}

.attachment-item:hover {
    border-color: var(--primary-color);
}

.attachment-item i {
    color: var(--primary-color);
}

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

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .hero {
        padding: 100px 20px 60px;
    }
}

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

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .education-item {
        flex-direction: column;
        gap: 1rem;
    }

    .education-item::before {
        left: 15px;
    }

    .education-icon {
        min-width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .contact-content {
        grid-template-columns: 1fr;
    }

    section {
        padding: 3rem 0;
    }

    .section-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .container {
        padding: 0 15px;
    }

    .sidebar-header h2 {
        font-size: 1.25rem;
    }
}

/* ========================================
   Blog & Post Styles
   (content-first list + reading column with side TOC)
   ======================================== */

:root {
    --measure: 780px;   /* reading column width */
    --toc-width: 220px;
}

/* ---------- Blog index ---------- */
.blog-index {
    max-width: var(--measure);
    margin: 0 auto;
    padding: 4rem 20px 5rem;
}

.blog-index-header {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
}

.blog-index-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.blog-index-lede {
    color: var(--text-light);
    font-size: 1.05rem;
    max-width: 60ch;
}

.blog-tag-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.25rem;
    margin-top: 1.25rem;
    font-size: 0.9rem;
}

.blog-tag-link {
    color: var(--text-muted);
    text-decoration: none;
    padding: 0.15rem 0;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.blog-tag-link:hover {
    color: var(--text-dark);
}

.blog-tag-link.is-active {
    color: var(--text-dark);
    border-bottom-color: var(--accent-color);
    font-weight: 500;
}

.post-item {
    padding: 2.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.post-item:last-of-type {
    border-bottom: none;
}

.post-item[hidden] {
    display: none;
}

.post-item-title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
    margin-bottom: 0.9rem;
}

.post-item-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-item-title a:hover {
    color: var(--accent-color);
}

.post-item-excerpt {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.post-item-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-item-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.post-item-tags .tag,
.post-info .tag {
    display: inline-block;
    text-decoration: none;
    border-radius: 4px;
    padding: 0.15rem 0.55rem;
    font-size: 0.8rem;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.post-item-tags .tag:hover,
.post-info .tag:hover {
    color: var(--accent-color);
    border-color: var(--accent-color);
}

.post-item time,
.post-info time {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: var(--secondary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.no-posts {
    color: var(--text-muted);
    padding: 3rem 0;
}

.no-posts[hidden] {
    display: none;
}

/* ---------- Guides list (shares the index look) ---------- */
.blog-list {
    padding: 3rem 0 4rem;
}

.posts-container {
    max-width: var(--measure);
    margin: 0 auto;
}

.post-preview {
    padding: 2.25rem 0;
    border-bottom: 1px solid var(--border-color);
}

.post-preview:last-child {
    border-bottom: none;
}

.post-preview .post-title {
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.6rem;
}

.post-preview .post-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.post-preview .post-title a:hover {
    color: var(--accent-color);
}

.post-meta {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.post-excerpt p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1rem;
}

.post-tags .tag {
    border-radius: 4px;
    padding: 0.15rem 0.55rem;
    font-size: 0.8rem;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    color: var(--text-light);
}

/* ---------- Post page ---------- */
.post-page {
    display: grid;
    grid-template-columns: minmax(0, var(--measure));
    justify-content: center;
    gap: 3rem;
    padding: 3.5rem 20px 5rem;
}

@media (min-width: 1280px) {
    .post-page {
        grid-template-columns: minmax(0, var(--measure)) var(--toc-width);
    }
}

.post-header {
    margin-bottom: 2.5rem;
}

.post-crumb {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
}

.post-crumb:hover {
    color: var(--accent-color);
}

.post-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.post-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
}

/* Reading typography */
.post-body {
    font-size: 1.02rem;
    line-height: 1.85;
    color: var(--text-dark);
}

.post-body > * + * {
    margin-top: 1.1em;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: -0.01em;
    scroll-margin-top: 1.5rem;
}

.post-body h2 {
    font-size: 1.6rem;
    margin-top: 2.75em;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
}

.post-body h3 {
    font-size: 1.25rem;
    margin-top: 2.2em;
}

.post-body h4 {
    font-size: 1.05rem;
    margin-top: 1.8em;
}

.post-body h2 + *,
.post-body h3 + *,
.post-body h4 + * {
    margin-top: 0.9em;
}

.post-body p,
.post-body li {
    color: var(--text-dark);
}

.post-body ul,
.post-body ol {
    padding-left: 1.6rem;
}

.post-body li + li {
    margin-top: 0.35em;
}

.post-body a {
    color: var(--accent-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

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

.post-body strong {
    font-weight: 600;
}

.post-body blockquote {
    border-left: 3px solid var(--accent-color);
    padding: 0.25rem 0 0.25rem 1.25rem;
    color: var(--text-light);
}

.post-body blockquote > * + * {
    margin-top: 0.75em;
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5em 0;
}

.post-body table {
    display: block;
    width: max-content;
    max-width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
    overflow-x: auto;
}

.post-body th,
.post-body td {
    border: 1px solid var(--border-color);
    padding: 0.6rem 0.9rem;
    text-align: left;
    vertical-align: top;
}

.post-body th {
    background-color: var(--bg-white);
    font-weight: 600;
}

.post-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.75em auto;
    border-radius: 4px;
}

.post-body figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: -1em;
}

/* Code */
.post-body pre {
    background-color: #1e232b;
    color: #e6edf3;
    border-radius: 6px;
    padding: 1.1rem 1.25rem;
    overflow-x: auto;
    line-height: 1.6;
    font-size: 0.9rem;
}

.post-body pre code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: inherit;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.post-body code {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.88em;
    background-color: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.1em 0.4em;
    color: var(--text-dark);
}

/* Math */
.katex-display {
    margin: 1.5em 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.25rem 0;
}

/* Pager */
.post-footer {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.post-pager a {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-decoration: none;
    color: var(--text-dark);
}

.post-pager .pager-next {
    text-align: right;
}

.pager-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.pager-title {
    font-weight: 500;
    transition: color 0.2s ease;
}

.post-pager a:hover .pager-title {
    color: var(--accent-color);
}

/* Side table of contents */
.post-toc {
    display: none;
}

@media (min-width: 1280px) {
    .post-toc {
        display: block;
        position: sticky;
        top: 3rem;
        align-self: start;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        font-size: 0.85rem;
        padding-left: 1rem;
        border-left: 1px solid var(--border-color);
    }

    .post-toc[hidden] {
        display: none;
    }
}

.post-toc-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.post-toc-nav a {
    display: block;
    color: var(--text-muted);
    text-decoration: none;
    line-height: 1.45;
    padding: 0.3rem 0;
    transition: color 0.15s ease;
}

.post-toc-nav a.toc-h3 {
    padding-left: 0.9rem;
    font-size: 0.8rem;
}

.post-toc-nav a:hover {
    color: var(--text-dark);
}

.post-toc-nav a.is-active {
    color: var(--accent-color);
    font-weight: 500;
}

/* Note entry (lab notes) link styling */
.note-entry .note-title a {
    color: var(--text-dark);
    text-decoration: none;
    transition: color 0.2s ease;
}

.note-entry .note-title a:hover {
    color: var(--primary-color);
}

.notes-container .note-entry {
    cursor: default;
}

.notes-container .note-header {
    background-color: var(--bg-light);
}

@media (max-width: 768px) {
    .blog-index {
        padding: 2.5rem 16px 4rem;
    }

    .post-page {
        padding: 2.5rem 16px 4rem;
    }

    .post-title {
        font-size: 1.8rem;
    }

    .post-item-title,
    .post-preview .post-title {
        font-size: 1.35rem;
    }

    .post-item-foot,
    .post-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .post-pager {
        grid-template-columns: 1fr;
    }

    .post-pager .pager-next {
        text-align: left;
    }
}
