/* ═══════════════════════════════════════════════════════════════════════════
   PORTFOLIO WEBSITE - PASTEL THEME (Rose/Purple/Blue)
   Bi-flag inspired color palette with academic typography
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── CSS VARIABLES ─────────────────────────────────────────────────────── */
:root {
    /* Typography */
    --font-heading: 'DM Serif Display', Georgia, serif;
    --font-body: 'Nunito Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Backgrounds */
    --bg-color: #f8f6fb;
    --bg-alt: #f0eef6;
    --bg-card: #ffffff;
    --bg-sidebar: #faf8fd;

    /* Rose spectrum */
    --rose: #e8b4c8;
    --rose-light: #f5e0eb;
    --rose-muted: #d4a0b8;

    /* Purple spectrum */
    --purple: #a87bb5;
    --purple-light: #e0d0e8;
    --purple-muted: #c4a8d0;
    --purple-deep: #7b5a8c;

    /* Blue spectrum */
    --blue: #7a9ec7;
    --blue-light: #d4e2f0;
    --blue-muted: #a8c4dc;
    --blue-deep: #4a6f94;

    /* Text colors */
    --text-color: #2e2a34;
    --text-muted: #6b6478;
    --text-light: #9690a0;

    /* Borders */
    --border-color: #e4dfe8;
    --border-light: #eeeaf2;

    /* Accent & Links */
    --accent-color: #9068a8;
    --link-color: #9068a8;
    --link-hover: #7b5a8c;

    /* Legacy compatibility */
    --secondary-text: var(--text-muted);
    --card-bg: var(--bg-card);
    --sidebar-bg: var(--bg-sidebar);
    --sidebar-overlay: rgba(0, 0, 0, 0.4);
    --toggle-bg: var(--border-color);
    --search-bg: var(--bg-card);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--rose) 0%, var(--purple) 50%, var(--blue) 100%);
    --gradient-light: linear-gradient(135deg, var(--rose-light) 0%, var(--purple-light) 50%, var(--blue-light) 100%);
}

[data-theme="dark"] {
    /* Backgrounds */
    --bg-color: #1a1620;
    --bg-alt: #221e2a;
    --bg-card: #2a2534;
    --bg-sidebar: #1e1a26;

    /* Rose spectrum */
    --rose: #c4789a;
    --rose-light: #3d2a34;
    --rose-muted: #a86080;

    /* Purple spectrum */
    --purple: #9068a8;
    --purple-light: #322840;
    --purple-muted: #7b5596;
    --purple-deep: #b890cc;

    /* Blue spectrum */
    --blue: #6890b8;
    --blue-light: #1e2a3a;
    --blue-muted: #507498;
    --blue-deep: #90b8dc;

    /* Text colors */
    --text-color: #e8e4f0;
    --text-muted: #a098b0;
    --text-light: #78708a;

    /* Borders */
    --border-color: #383248;
    --border-light: #2e2838;

    /* Accent & Links */
    --accent-color: #b890cc;
    --link-color: #b890cc;
    --link-hover: #c8a4dc;

    /* Overlay */
    --sidebar-overlay: rgba(0, 0, 0, 0.6);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 400;
    line-height: 1.3;
    color: var(--text-color);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

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

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

code, pre {
    font-family: var(--font-mono);
}

/* ─── LAYOUT ────────────────────────────────────────────────────────────── */
.main-wrapper {
    margin-left: 260px;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* ─── SIDEBAR ───────────────────────────────────────────────────────────── */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: var(--sidebar-overlay);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 199;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar Logo */
.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-logo .brand-name {
    font-family: var(--font-heading);
    font-size: 1.75rem;
    color: var(--accent-color);
    letter-spacing: -0.02em;
    cursor: pointer;
}

.sidebar-logo .brand-name .dot {
    color: var(--rose);
}

.sidebar-logo .brand-subtitle {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
    letter-spacing: 0.04em;
}

/* Sidebar Search */
.sidebar-search {
    padding: 1rem 1.25rem;
}

.sidebar-search-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-alt);
    border-radius: 10px;
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.sidebar-search-wrapper:focus-within {
    border-color: var(--purple-muted);
}

.sidebar-search-wrapper .search-icon {
    font-size: 0.875rem;
    opacity: 0.5;
}

.sidebar-search input {
    border: none;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--text-color);
}

.sidebar-search input::placeholder {
    color: var(--text-light);
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.75rem;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.25s ease;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--bg-alt);
    color: var(--text-color);
}

.sidebar-nav li a.active {
    background: var(--purple-light);
    color: var(--accent-color);
    font-weight: 700;
    border-left-color: var(--accent-color);
}

.sidebar-nav .nav-icon {
    font-size: 1rem;
    width: 1.5rem;
    text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-light);
    margin-top: auto;
}

.social-grid {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.social-grid a {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    color: var(--text-muted);
}

.social-grid a:hover {
    background: var(--purple-light);
    transform: translateY(-2px);
    color: var(--accent-color);
}

.social-grid a svg {
    width: 18px;
    height: 18px;
}

.theme-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    background: var(--bg-alt);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 0.625rem 1rem;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-color);
}

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

/* Close sidebar button (mobile) */
.close-sidebar {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.5rem;
    line-height: 1;
}

/* ─── MOBILE HEADER ─────────────────────────────────────────────────────── */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 150;
    height: 56px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(16px);
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
}

.mobile-header .menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.25rem;
}

.mobile-header .brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--accent-color);
}

.mobile-header .brand-name .dot {
    color: var(--rose);
}

.mobile-header .theme-toggle {
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0.25rem;
}

/* ─── HERO SECTION ──────────────────────────────────────────────────────── */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4rem;
    padding: 5rem 3rem;
    position: relative;
    overflow: hidden;
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 1;
    flex: 1;
}

/* Hero Profile Image */
.hero-image {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.hero-image-card {
    position: relative;
    width: 320px;
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 10px 40px rgba(144, 104, 168, 0.15);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.hero-image-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow:
        0 20px 60px rgba(144, 104, 168, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.1);
}

.hero-image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    transition: transform 0.4s ease;
}

.hero-image-card:hover img {
    transform: scale(1.05);
}

/* Hand-sketched border effect */
.hero-image-card::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 3px solid var(--text-color);
    border-radius: 20px;
    opacity: 0.15;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hero-image-card:hover::before {
    opacity: 0.25;
}

.hero-tagline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.hero-tagline::before {
    content: '';
    width: 2rem;
    height: 2px;
    background: var(--gradient-primary);
    display: inline-block;
    border-radius: 1px;
}

.hero-tagline span {
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--text-color);
    line-height: 1.15;
    margin: 0 0 1.5rem 0;
    letter-spacing: -0.01em;
}

.hero-title .gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-title .dot {
    color: var(--rose);
    -webkit-text-fill-color: var(--rose);
}

.hero-bio {
    font-family: var(--font-body);
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.8;
    margin-bottom: 2rem;
    max-width: 560px;
}

.hero-cta {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 16px rgba(144, 104, 168, 0.25);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 32px rgba(144, 104, 168, 0.35);
    color: #fff;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--accent-color);
    border: 2px solid var(--purple-muted);
    border-radius: 12px;
    padding: 0.875rem 1.75rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--purple-light);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

/* ─── SECTIONS ──────────────────────────────────────────────────────────── */
.section {
    padding: 4rem 3rem;
    position: relative;
    z-index: 1;
}

.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
    margin: 0;
}

.section-title-underline {
    width: 3rem;
    height: 3px;
    background: var(--rose);
    border-radius: 2px;
    margin-top: 0.625rem;
}

.section-link {
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--accent-color);
    font-weight: 700;
    cursor: pointer;
}

/* ─── ABOUT CARD ────────────────────────────────────────────────────────── */
.about-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 3rem;
    border: 1px solid var(--border-light);
    box-shadow: 0 8px 32px rgba(123, 90, 140, 0.05);
    max-width: 1000px;
    margin: 0 auto;
}

.about-card h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
}

.about-card .underline {
    width: 3rem;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
    margin-bottom: 1.5rem;
}

.about-card p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.85;
    margin: 0;
}

/* ─── PUBLICATIONS LIST ─────────────────────────────────────────────────── */
.publications-section {
    max-width: 1000px;
    margin: 0 auto;
}

.publications-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.publication-item {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1.25rem;
    position: relative;
}

.publication-item:hover {
    transform: translateX(6px);
    border-color: var(--purple-muted);
    box-shadow: 0 4px 20px rgba(123, 90, 140, 0.08);
}

.publication-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-color);
    background: var(--purple-light);
    padding: 0.3rem 0.625rem;
    border-radius: 6px;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.publication-content {
    min-width: 0;
}

.publication-title {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0 0 0.25rem 0;
    font-weight: 400;
    line-height: 1.4;
}

.publication-title a {
    color: inherit;
    text-decoration: none;
}

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

.publication-meta {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-light);
}

.publication-arrow {
    font-size: 1.125rem;
    color: var(--purple-muted);
    transition: transform 0.3s ease;
}

.publication-item:hover .publication-arrow {
    transform: translateX(4px);
}

/* Citation Button (positioned in publication item) */
.citation-btn-container {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.citation-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.citation-btn:hover {
    background: var(--link-hover);
    transform: scale(1.05);
}

/* Citation Dropdown */
.citation-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.375rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 100;
    min-width: 120px;
    display: none;
}

.citation-dropdown.active {
    display: block;
}

.citation-dropdown button {
    width: 100%;
    padding: 0.625rem 1rem;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    color: var(--text-color);
    transition: background 0.2s ease;
    font-size: 0.9rem;
    font-family: var(--font-body);
}

.citation-dropdown button:hover {
    background: var(--bg-alt);
}

.citation-dropdown button:first-child {
    border-radius: 8px 8px 0 0;
}

.citation-dropdown button:last-child {
    border-radius: 0 0 8px 8px;
}

/* Citation Modal */
.citation-modal {
    position: fixed;
    inset: 0;
    background: var(--sidebar-overlay);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(4px);
}

.citation-modal.active {
    display: flex;
}

.citation-modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.2);
}

.citation-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.citation-modal-header h3 {
    margin: 0;
    color: var(--accent-color);
    font-size: 1.25rem;
}

.citation-modal-actions {
    display: flex;
    gap: 0.5rem;
}

.citation-copy-btn,
.citation-close-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: var(--font-body);
}

.citation-copy-btn {
    background: var(--accent-color);
    color: white;
}

.citation-copy-btn:hover {
    background: var(--link-hover);
}

.citation-copy-btn.copied {
    background: #10b981;
}

.citation-close-btn {
    background: var(--bg-alt);
    color: var(--text-color);
}

.citation-close-btn:hover {
    background: var(--border-color);
}

.citation-content {
    background: var(--bg-alt);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-light);
    overflow-x: auto;
}

.citation-content pre {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-color);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ─── BLOG PREVIEW ──────────────────────────────────────────────────────── */
.blog-section {
    max-width: 1000px;
    margin: 0 auto;
}

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

.blog-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    text-decoration: none;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 48px rgba(123, 90, 140, 0.12);
}

.blog-card-accent {
    height: 6px;
    background: var(--gradient-primary);
}

.blog-card-content {
    padding: 1.5rem 1.375rem;
}

.blog-card-meta {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.625rem;
}

.blog-card-title {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
    font-weight: 400;
}

.blog-card-link {
    margin-top: 1.125rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 700;
}

/* ─── FOOTER ────────────────────────────────────────────────────────────── */
.site-footer {
    padding: 2.25rem 3rem;
    border-top: 1px solid var(--border-light);
    text-align: center;
}

.site-footer p {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-light);
    margin: 0;
}

/* ─── PAGE LAYOUTS ──────────────────────────────────────────────────────── */
.page-header {
    padding: 4rem 3rem 2.5rem;
    position: relative;
}

.page-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-light);
    opacity: 0.5;
    z-index: -1;
}

.page-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    font-weight: 400;
}

.page-description {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.65;
    margin: 0;
}

.page-content {
    padding: 2.5rem 3rem 5rem;
    max-width: 1000px;
}

/* Notes Grid */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.125rem;
}

.note-card {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 1.75rem 1.5rem;
    cursor: pointer;
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.note-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 40px rgba(123, 90, 140, 0.1);
}

.note-icon {
    font-size: 1.75rem;
    margin-bottom: 0.875rem;
}

.note-card h3 {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    font-weight: 400;
}

.note-format {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--accent-color);
    background: var(--purple-light);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.note-topics {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
}

.note-topic {
    font-family: var(--font-body);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: var(--rose-light);
    padding: 0.2rem 0.625rem;
    border-radius: 20px;
}

.note-topic:nth-child(2) {
    background: var(--purple-light);
}

.note-topic:nth-child(3) {
    background: var(--blue-light);
}

/* Course Cards */
.courses-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.course-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 2rem 2.25rem;
    border: 1px solid var(--border-light);
    transition: all 0.35s ease;
}

.course-card:hover {
    border-color: var(--purple-muted);
}

.course-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.875rem;
    flex-wrap: wrap;
}

.course-code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent-color);
    background: var(--purple-light);
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
}

.course-meta {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-light);
}

.course-title {
    font-family: var(--font-heading);
    font-size: 1.375rem;
    color: var(--text-color);
    margin: 0 0 0.625rem 0;
    font-weight: 400;
}

.course-description {
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 1.125rem 0;
}

.course-links {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.course-link {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: var(--bg-alt);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid var(--border-light);
    text-decoration: none;
}

.course-link:hover {
    background: var(--purple-light);
    border-color: var(--purple-muted);
}

/* Resume Page */
.resume-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
}

.resume-section {
    margin-bottom: 3rem;
}

.resume-section h2 {
    font-family: var(--font-heading);
    font-size: 1.625rem;
    color: var(--text-color);
    margin: 0 0 1.25rem 0;
    font-weight: 400;
}

.education-item {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 1.5rem 1.75rem;
    border: 1px solid var(--border-light);
    margin-bottom: 1rem;
}

.education-degree {
    font-family: var(--font-heading);
    font-size: 1.125rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
}

.education-school {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

.education-date {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-light);
}

.education-details {
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    line-height: 1.6;
}

.skills-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.skill-tag {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--accent-color);
    background: var(--purple-light);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    cursor: default;
    transition: all 0.25s ease;
    border: 1px solid transparent;
}

.skill-tag:hover {
    transform: scale(1.08);
    border-color: var(--purple-muted);
}

/* Gallery */
.gallery-masonry {
    columns: 3;
    column-gap: 1.125rem;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 1.125rem;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    border: 1px solid var(--border-light);
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 20px 48px rgba(123, 90, 140, 0.15);
}

.gallery-placeholder {
    background: var(--gradient-light);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.gallery-placeholder span {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.6;
}

.gallery-item img {
    width: 100%;
    display: block;
}

/* ─── LEGACY SUPPORT (for existing HTML structure) ──────────────────────── */
/* Keep old classes working during transition */
section {
    margin-bottom: 3rem;
}

section h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-weight: 400;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.content-list {
    list-style: none;
    padding: 0;
}

.publication-wrapper {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.2rem;
    align-items: flex-start;
}

.content-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-left: 3px solid var(--accent-color);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    width: 100%;
    max-width: 55rem;
    margin-bottom: 1rem;
}

.content-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 16px rgba(123, 90, 140, 0.1);
}

.publication-wrapper .content-card {
    flex-shrink: 0;
    margin-bottom: 0;
}

.publication-image {
    width: 300px;
    min-width: 300px;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.publication-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.content-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.15rem;
    font-weight: 500;
    padding-right: 80px;
}

.content-card h3 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.content-card h3 a:hover {
    color: var(--accent-color);
}

.content-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0.25rem 0;
}

.content-description {
    margin: 0.75rem 0 0 0;
    line-height: 1.65;
    color: var(--text-muted);
}

/* Old header styles - hidden in new design */
.site-header {
    display: none;
}

.header-left,
.header-controls,
.logo,
.menu-toggle,
.search-container,
.search-bar,
.theme-toggle,
.social-links,
.social-link {
    display: none;
}

/* ─── RESPONSIVE ────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
    }

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

    .close-sidebar {
        display: block;
    }

    .sidebar-logo {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    /* Main content */
    .main-wrapper {
        margin-left: 0;
    }

    /* Mobile header */
    .mobile-header {
        display: flex;
    }

    /* Add top padding for mobile header */
    .hero {
        padding-top: 6rem;
    }

    .page-header {
        padding-top: 5rem;
    }

    /* Hero adjustments */
    .hero-title {
        font-size: 2.75rem;
    }

    .hero-image-card {
        width: 280px;
        height: 350px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 5rem 1.5rem 3rem;
        min-height: auto;
        flex-direction: column;
        text-align: center;
    }

    .hero-tagline {
        justify-content: center;
    }

    .hero-cta {
        justify-content: center;
    }

    .hero-bio {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-image {
        order: -1;
        margin-bottom: 2rem;
    }

    .hero-image-card {
        width: 200px;
        height: 250px;
        margin: 0 auto;
    }

    .hero-title {
        font-size: 2.25rem;
    }

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

    .section {
        padding: 3rem 1.5rem;
    }

    .page-header {
        padding: 4rem 1.5rem 2rem;
    }

    .page-content {
        padding: 2rem 1.5rem 4rem;
    }

    .site-footer {
        padding: 2rem 1.5rem;
    }

    .publication-item {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .publication-tag {
        width: fit-content;
    }

    .publication-arrow {
        display: none;
    }

    .citation-btn-container {
        position: static;
        margin-top: 0.75rem;
    }

    .content-card h3 {
        padding-right: 0;
    }

    .publication-wrapper {
        flex-direction: column;
    }

    .publication-image {
        width: 100%;
        max-width: 100%;
    }

    .gallery-masonry {
        columns: 2;
    }

    .about-card {
        padding: 2rem 1.5rem;
    }
}

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

    .hero-cta {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
    }

    .gallery-masonry {
        columns: 1;
    }

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

/* ─── SCROLLBAR ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--purple-muted);
    border-radius: 3px;
}

::selection {
    background: var(--purple-light);
    color: var(--text-color);
}

/* ─── ANIMATIONS ────────────────────────────────────────────────────────── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* ─── SCROLL REVEAL ANIMATIONS ─────────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delay for publication lists */
.reveal-stagger > .reveal:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > .reveal:nth-child(2) { transition-delay: 80ms; }
.reveal-stagger > .reveal:nth-child(3) { transition-delay: 160ms; }
.reveal-stagger > .reveal:nth-child(4) { transition-delay: 240ms; }
.reveal-stagger > .reveal:nth-child(5) { transition-delay: 320ms; }
.reveal-stagger > .reveal:nth-child(6) { transition-delay: 400ms; }

/* ─── GRADIENT MESH BACKGROUND ─────────────────────────────────────────── */
.gradient-mesh {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 600px;
    height: 600px;
    background: var(--rose);
    top: -200px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: var(--purple);
    bottom: 20%;
    left: -150px;
    animation-delay: -7s;
}

.blob-3 {
    width: 450px;
    height: 450px;
    background: var(--blue);
    top: 50%;
    right: 10%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(20px, 30px) scale(1.02); }
}

/* Reduced opacity in dark mode */
[data-theme="dark"] .blob {
    opacity: 0.25;
}

/* Reduced motion accessibility */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .blob {
        animation: none;
    }
}

/* ─── NOTES GRID ──────────────────────────────────────────────────────────── */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.note-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.note-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px rgba(167, 139, 250, 0.15);
    transform: translateY(-2px);
}

.note-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

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

.note-description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.note-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.note-topic {
    background: var(--purple-light, rgba(167, 139, 250, 0.1));
    color: var(--accent-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ─── NOTES PAGE LAYOUT ───────────────────────────────────────────────────── */
.notes-layout {
    display: flex;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.notes-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 2rem;
    height: fit-content;
}

.notes-sidebar-nav {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid var(--border-light);
}

.notes-sidebar-nav h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 600;
}

.notes-sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.notes-sidebar-nav li a {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.notes-sidebar-nav li a:hover,
.notes-sidebar-nav li a.active {
    background: var(--purple-light, rgba(167, 139, 250, 0.1));
    color: var(--accent-color);
}

.notes-main-content {
    flex: 1;
    min-width: 0;
}

.notes-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s ease;
}

.notes-back-link:hover {
    color: var(--accent-color);
}

/* Week section styling */
.week-section {
    margin-bottom: 4rem;
    scroll-margin-top: 2rem;
}

.week-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-light);
}

.week-section h3 {
    font-size: 1.25rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.week-section h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.week-section p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.week-section ul,
.week-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.week-section li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.week-section blockquote {
    border-left: 3px solid var(--accent-color);
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

/* Code blocks in notes - Light Mode */
.week-section pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

.week-section pre code {
    color: #1a1a2e;
    background: transparent;
    padding: 0;
}

.week-section code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
}

.week-section p code,
.week-section li code {
    background: #f1f3f4;
    color: #d63384;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Code blocks in notes - Dark Mode */
[data-theme="dark"] .week-section pre {
    background: #1e1e2e;
    border-color: #313244;
}

[data-theme="dark"] .week-section pre code {
    color: #cdd6f4;
}

[data-theme="dark"] .week-section p code,
[data-theme="dark"] .week-section li code {
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

/* Tables in notes */
.week-section table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.week-section th,
.week-section td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.week-section th {
    background: var(--bg-card);
    font-weight: 600;
    color: var(--text-color);
}

.week-section tr:hover td {
    background: var(--purple-light, rgba(167, 139, 250, 0.05));
}

/* Learning objectives box */
.learning-objectives {
    background: var(--purple-light, rgba(167, 139, 250, 0.08));
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-left: 4px solid var(--accent-color);
}

.learning-objectives h3 {
    margin-top: 0;
    color: var(--accent-color);
}

/* Key takeaways box */
.key-takeaways {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--border-light);
}

.key-takeaways h3 {
    margin-top: 0;
}

/* Practice problems */
.practice-problems {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
    border: 1px solid var(--accent-color);
}

.practice-problems h3 {
    margin-top: 0;
    color: var(--accent-color);
}

/* ─── COLLAPSIBLE TOC ─────────────────────────────────────────────────────── */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-week {
    margin-bottom: 0.25rem;
}

.toc-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.6rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    font-family: inherit;
}

.toc-toggle:hover {
    background: var(--purple-light, rgba(167, 139, 250, 0.1));
}

.toc-arrow {
    font-size: 0.65rem;
    margin-right: 0.5rem;
    transition: transform 0.2s ease;
    color: var(--text-muted);
    flex-shrink: 0;
}

.toc-week.expanded .toc-arrow {
    transform: rotate(90deg);
}

.toc-toggle a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.3;
}

.toc-toggle a:hover,
.toc-toggle a.active {
    color: var(--accent-color);
}

/* Nested sections - hidden by default */
.toc-sections {
    list-style: none;
    padding-left: 1.25rem;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.toc-week.expanded .toc-sections {
    max-height: 2000px;
}

.toc-section {
    margin: 0.15rem 0;
}

.toc-section > a {
    display: block;
    padding: 0.35rem 0.6rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.toc-section > a:hover,
.toc-section > a.active {
    color: var(--accent-color);
    background: var(--purple-light, rgba(167, 139, 250, 0.08));
}

/* Subsections (h4 level) */
.toc-subsections {
    list-style: none;
    padding-left: 0.75rem;
    margin: 0.15rem 0;
}

.toc-subsections a {
    display: block;
    padding: 0.2rem 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.78rem;
    opacity: 0.8;
    transition: all 0.2s ease;
    line-height: 1.3;
}

.toc-subsections a:hover,
.toc-subsections a.active {
    color: var(--accent-color);
    opacity: 1;
}

/* Responsive: notes layout on mobile */
@media (max-width: 900px) {
    .notes-layout {
        flex-direction: column;
    }
    .notes-sidebar {
        width: 100%;
        position: static;
    }
    /* On mobile, show expanded by default */
    .toc-sections {
        max-height: none;
    }
    .toc-arrow {
        display: none;
    }
    .toc-toggle {
        padding: 0.5rem 0.6rem;
    }
    .toc-toggle a {
        font-size: 0.85rem;
    }
}
