:root {
    --sidebar-w: 280px;
    --bg: #F3EFE8;
    --bg-warm: #EDE8DF;
    --sidebar-bg: #1C1C1A;
    --sidebar-text: #A8A8A0;
    --sidebar-accent: #EBE6DC;
    --text: #2E2E2C;
    --text-muted: #6B6860;
    --heading: #1A1A18;
    --accent: #B85C38;
    --accent-light: #F2E7DD;
    --border: #DDD8CE;
    --card-bg: #FAF8F4;
    --tag-bg: #EBE7DF;
    --link: #B85C38;
    --serif: 'DM Serif Display', Georgia, serif;
    --sans: 'Source Sans 3', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 2rem; }

body {
    font-family: var(--sans);
    color: var(--text);
    background: var(--bg);
    line-height: 1.75;
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: #fff; }
a { color: var(--link); }

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

/* ─── SIDEBAR ─── */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 100;
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-header {
    padding: 3.8rem 1.75rem 1.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    text-align: center;
}

.sidebar-photo {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center top;
    margin: 0 auto 1rem;
    display: block;
    border: 3px solid rgba(255,255,255,0.1);
    background: var(--sidebar-bg);
    aspect-ratio: 1 / 1;
}

.sidebar-name {
    font-family: var(--serif);
    font-size: 1.35rem;
    color: var(--sidebar-accent);
    line-height: 1.3;
}

.sidebar-title {
    font-size: 0.82rem;
    color: var(--sidebar-text);
    margin-top: 0.35rem;
    line-height: 1.55;
}

.sidebar-resume {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.85rem;
    padding: 0.45rem 1rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 6px;
    color: var(--sidebar-accent);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    transition: all 0.2s;
}

.sidebar-resume:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}

.sidebar-resume svg { width: 14px; height: 14px; flex-shrink: 0; }

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

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color 0.2s;
}

.sidebar-nav a::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--sidebar-text);
    opacity: 0.4;
    transition: all 0.25s;
    flex-shrink: 0;
}

.sidebar-nav a:hover,
.sidebar-nav a.active { color: var(--sidebar-accent); }

.sidebar-nav a:hover::before,
.sidebar-nav a.active::before {
    background: var(--accent);
    opacity: 1;
    transform: scale(1.5);
}

.sidebar-links {
    padding: 1.25rem 1.75rem 2rem;
    border-top: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.sidebar-links a {
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: color 0.2s;
}

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

/* ─── MAIN ─── */
.main { margin-left: var(--sidebar-w); min-height: 100vh; }

.content {
    max-width: 800px;
    padding: 3.5rem 3rem 5rem;
    margin: 0 auto;
}

section { margin-bottom: 4.5rem; }
section:last-child { margin-bottom: 2rem; }

.section-title {
    font-family: var(--serif);
    font-size: 1.9rem;
    color: var(--heading);
    margin-bottom: 1.75rem;
    letter-spacing: -0.02em;
    position: relative;
    padding-bottom: 0.75rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 36px; height: 2.5px;
    background: var(--accent);
    border-radius: 2px;
}

/* ─── HERO ─── */
.hero {
    margin-bottom: 4.5rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-family: var(--serif);
    font-size: 3rem;
    color: var(--heading);
    line-height: 1.12;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.hero-about {
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text);
    max-width: 660px;
}

.hero-about a {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

.hero-about a:hover { text-decoration-thickness: 2px; }

.research-link {
    color: var(--link);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    font-weight: 500;
}

.research-link:hover { text-decoration-thickness: 2px; }

/* ─── NEWS ─── */
.news-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem 0;
    font-size: 0.97rem;
    line-height: 1.65;
    border-bottom: 1px solid var(--border);
}

.news-item:last-child { border-bottom: none; }

.news-date {
    flex-shrink: 0;
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.8rem;
    padding-top: 0.15rem;
    min-width: 110px;
}

.news-emoji { flex-shrink: 0; font-size: 1.05rem; }
.news-text { color: var(--text); }
.news-text a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }

/* ─── EXPERIENCE ─── */
.exp-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.exp-item:first-child { padding-top: 0; }
.exp-item:last-child { border-bottom: none; }

.exp-logo {
    width: 50px; height: 50px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 5px;
    aspect-ratio: 1 / 1;
}

.exp-body { flex: 1; min-width: 0; }

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.exp-role { font-weight: 600; color: var(--heading); font-size: 1.05rem; }

.exp-date {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.exp-org {
    font-size: 0.95rem;
    color: var(--accent);
    margin-bottom: 0.7rem;
    font-weight: 500;
}

.exp-bullets { list-style: none; padding: 0; }

.exp-bullets li {
    position: relative;
    padding-left: 1.1rem;
    margin-bottom: 0.45rem;
    font-size: 0.97rem;
    line-height: 1.7;
}

.exp-bullets li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 600;
}

/* ─── PUBLICATIONS ─── */
.pub-item {
    padding: 1.15rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 0.9rem;
    align-items: flex-start;
}

.pub-item:last-child { border-bottom: none; }

.pub-number {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    min-width: 24px;
    padding-top: 3px;
    text-align: right;
    flex-shrink: 0;
    font-weight: 500;
}

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

.pub-title {
    font-weight: 600;
    color: var(--heading);
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 0.3rem;
}

.pub-authors {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.2rem;
    line-height: 1.5;
}

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

.pub-venue {
    font-size: 0.88rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.55rem;
}

.pub-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }

.pub-links a {
    font-family: var(--mono);
    font-size: 0.76rem;
    color: var(--link);
    text-decoration: none;
    padding: 0.25rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.pub-links a:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

/* ─── THESIS ─── */
.thesis-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem 1.75rem;
}

.thesis-degree {
    font-family: var(--mono);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.thesis-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--heading);
    margin-bottom: 0.35rem;
    line-height: 1.5;
}

.thesis-meta {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 0.7rem;
    line-height: 1.55;
}

/* ─── EDUCATION ─── */
.edu-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.edu-item:first-child { padding-top: 0; }
.edu-item:last-child { border-bottom: none; }

.edu-logo {
    width: 50px; height: 50px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 2px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    padding: 5px;
    aspect-ratio: 1 / 1;
}

.edu-body { flex: 1; min-width: 0; }

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.edu-school { font-weight: 600; color: var(--heading); font-size: 1.05rem; }
.edu-date { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; }
.edu-degree { font-size: 0.97rem; color: var(--text); margin-top: 0.15rem; }
.edu-note { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.15rem; }

/* ─── SKILLS ─── */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1.5rem;
}

.skill-group h4 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
    font-weight: 600;
}

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

.skill-tag {
    font-size: 0.88rem;
    padding: 0.3rem 0.7rem;
    background: var(--tag-bg);
    border-radius: 5px;
    color: var(--text);
    border: 1px solid var(--border);
}

/* ─── CHAT ─── */
.chat-widget {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    height: 420px;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: var(--tag-bg);
}

.chat-header-dot { width: 8px; height: 8px; border-radius: 50%; background: #4CAF50; }
.chat-header-label { font-size: 0.88rem; font-weight: 600; color: var(--heading); }
.chat-header-sub { font-size: 0.76rem; color: var(--text-muted); margin-left: auto; font-family: var(--mono); }

.chat-messages {
    flex: 1; overflow-y: auto; padding: 1.25rem;
    display: flex; flex-direction: column; gap: 1rem;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.chat-msg { max-width: 82%; animation: msgIn 0.3s ease-out; }

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

.chat-msg.bot { align-self: flex-start; }
.chat-msg.user { align-self: flex-end; }

.chat-bubble { padding: 0.7rem 1.1rem; border-radius: 12px; font-size: 0.93rem; line-height: 1.55; }
.chat-msg.bot .chat-bubble { background: var(--tag-bg); color: var(--text); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: var(--sidebar-bg); color: #fff; border-bottom-right-radius: 4px; }

.chat-typing { display: flex; gap: 4px; padding: 0.85rem 1rem; align-items: center; }
.chat-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: typeBounce 1.2s infinite ease-in-out; }
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typeBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

.chat-input-area { padding: 0.85rem 1.25rem; border-top: 1px solid var(--border); display: flex; gap: 0.65rem; align-items: flex-end; }

.chat-input {
    flex: 1; border: 1px solid var(--border); border-radius: 8px;
    padding: 0.6rem 0.9rem; font-family: var(--sans); font-size: 0.93rem;
    color: var(--heading); background: var(--bg); resize: none;
    max-height: 100px; min-height: 40px; line-height: 1.5; transition: border-color 0.2s;
}

.chat-input:focus { outline: none; border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-muted); }

.chat-send {
    width: 40px; height: 40px; border-radius: 8px; border: none;
    background: var(--sidebar-bg); color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: background 0.2s, opacity 0.2s;
}

.chat-send:disabled { opacity: 0.35; cursor: default; }
.chat-send:not(:disabled):hover { background: var(--accent); }
.chat-send svg { width: 16px; height: 16px; }

/* ─── CONTACT ─── */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.contact-card {
    display: flex; align-items: center; gap: 0.85rem;
    padding: 1.1rem 1.3rem; background: var(--card-bg);
    border: 1px solid var(--border); border-radius: 8px;
    text-decoration: none; color: var(--text); transition: all 0.2s;
}

.contact-card:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.05); }

.contact-icon { width: 38px; height: 38px; border-radius: 8px; background: var(--tag-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.contact-icon svg { width: 18px; height: 18px; color: var(--accent); }
.contact-label { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.contact-value { font-size: 0.93rem; color: var(--heading); font-weight: 500; }

/* ─── FOOTER ─── */
.footer { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-muted); text-align: center; }

/* ─── MOBILE ─── */
.mobile-header {
    display: none; position: fixed; top: 0; left: 0; right: 0;
    height: 56px; background: var(--sidebar-bg); z-index: 200;
    align-items: center; padding: 0 1.25rem; gap: 0.85rem;
}

.hamburger { width: 36px; height: 36px; border: none; background: none; cursor: pointer; display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 6px; }
.hamburger span { display: block; width: 100%; height: 2px; background: var(--sidebar-accent); border-radius: 1px; }
.mobile-name { font-family: var(--serif); color: var(--sidebar-accent); font-size: 1.05rem; }
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.overlay.open { display: block; }

@media (max-width: 860px) {
    :root:not([data-theme="dark"]) { --text: #111111; --text-muted: #333333; --heading: #000000; --link: #8F3F22; }
    .sidebar { transform: translateX(-100%); transition: transform 0.3s ease; }
    .sidebar.open { transform: translateX(0); }
    .mobile-header { display: flex; }
    .main { margin-left: 0; }
    .content { padding: 76px 1.25rem 3rem; }
    .hero h1 { font-size: 2.2rem; }
    .exp-header, .edu-header { flex-direction: column; }
    .contact-grid { grid-template-columns: 1fr; }
    .skills-grid { grid-template-columns: 1fr 1fr; }
    .exp-logo, .edu-logo { width: 40px; height: 40px; padding: 4px; }
}

@media (max-width: 480px) {
    .skills-grid { grid-template-columns: 1fr; }
    .news-item { flex-wrap: wrap; }
    .news-date { min-width: auto; }
}

/* ─── PROJECT PAGES ─── */
.project-hero { margin-bottom: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.project-hero .breadcrumb { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.project-hero .breadcrumb a { color: var(--link); text-decoration: none; }
.project-hero .breadcrumb a:hover { text-decoration: underline; }

.project-hero h1 {
    font-family: var(--serif);
    font-size: 2.3rem;
    color: var(--heading);
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.project-hero p { font-size: 1.05rem; color: var(--text); line-height: 1.8; max-width: 660px; }

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2.5rem;
}

.project-card-body { padding: 1.75rem; }
.project-card-body h3 { font-family: var(--serif); font-size: 1.3rem; color: var(--heading); margin-bottom: 0.65rem; }
.project-card-body p { font-size: 0.97rem; line-height: 1.75; color: var(--text); margin-bottom: 1rem; }
.project-card-body h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; margin-bottom: 0.5rem; margin-top: 1.25rem; }

.project-pub { padding: 0.75rem 0; border-top: 1px solid var(--border); }
.project-pub .pub-title { font-size: 0.95rem; }
.project-pub .pub-authors { font-size: 0.88rem; }
.project-pub .pub-venue { font-size: 0.82rem; }

/* ─── IMAGE CAROUSEL ─── */
.img-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-warm);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.img-carousel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: var(--bg-warm);
    padding: 0.5rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.img-carousel img.active {
    opacity: 1;
    pointer-events: auto;
}

.img-carousel-indicator {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 2;
}

.img-carousel-dot {
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--text-muted);
    opacity: 0.3;
    transition: opacity 0.25s, transform 0.25s;
}

.img-carousel-dot.active {
    opacity: 0.9;
    transform: scale(1.3);
    background: var(--accent);
}

.img-carousel-hint {
    position: absolute;
    top: 10px;
    right: 12px;
    font-family: var(--mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(250,248,244,0.8);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    pointer-events: none;
    z-index: 2;
}

.placeholder-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--tag-bg) 0%, var(--border) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.placeholder-img svg { width: 32px; height: 32px; opacity: 0.4; }

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--link);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: 2rem;
    transition: gap 0.2s;
}

.back-link:hover { gap: 0.65rem; }


/* ─── SIDEBAR PROJECTS DROPDOWN ─── */
.sidebar-nav-group {
    margin: 0;
}

.sidebar-nav-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.2s;
    width: 100%;
    position: relative;
}

.sidebar-nav-toggle::before {
    content: '';
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--sidebar-text);
    opacity: 0.4;
    transition: all 0.25s;
    flex-shrink: 0;
}

.sidebar-nav-toggle:hover,
.sidebar-nav-group.open .sidebar-nav-toggle {
    color: var(--sidebar-accent);
}

.sidebar-nav-toggle:hover::before,
.sidebar-nav-group.open .sidebar-nav-toggle::before {
    background: var(--accent);
    opacity: 1;
    transform: scale(1.5);
}

.sidebar-nav-toggle .chevron {
    margin-left: auto;
    width: 12px; height: 12px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    opacity: 0.45;
}

.sidebar-nav-group.open .sidebar-nav-toggle .chevron {
    transform: rotate(180deg);
    opacity: 0.7;
}

.sidebar-nav-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.sidebar-nav-group.open .sidebar-nav-children {
    max-height: 180px;
}

.sidebar-nav-children a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0 0.3rem 1.6rem;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 400;
    transition: color 0.2s;
    opacity: 0.8;
}

.sidebar-nav-children a::before {
    content: none;
}
.sidebar-nav-children a:hover {
    color: var(--sidebar-accent);
    opacity: 1;
}
/* ─── HONORS & AWARDS ─── */
.award-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
}

.award-item:first-child { padding-top: 0; }
.award-item:last-child { border-bottom: none; }

.award-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-light);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent);
    margin-top: 2px;
    aspect-ratio: 1 / 1;
}

.award-icon svg {
    width: 20px;
    height: 20px;
}

.award-body { flex: 1; min-width: 0; }

.award-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}

.award-title {
    font-weight: 600;
    color: var(--heading);
    font-size: 1.02rem;
    line-height: 1.5;
}

.award-date {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.award-org {
    font-size: 0.93rem;
    color: var(--accent);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

.award-note {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.65;
}

@media (max-width: 600px) {
    .award-header { flex-direction: column; align-items: flex-start; gap: 0.15rem; }
    .award-icon { width: 36px; height: 36px; }
    .award-icon svg { width: 18px; height: 18px; }
}
/* ─── SPOTLIGHT ─── */
.spotlight-intro {
    font-size: 0.97rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.65;
    max-width: 660px;
}

.spotlight-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.spotlight-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bg-warm);
}

.spotlight-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.spotlight-slide.active {
    opacity: 1;
    pointer-events: auto;
}

.spotlight-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.spotlight-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(28, 28, 26, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(2px);
}

.spotlight-nav:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.05);
}

.spotlight-nav.prev { left: 12px; }
.spotlight-nav.next { right: 12px; }
.spotlight-nav svg { width: 16px; height: 16px; }

.spotlight-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 3;
    background: rgba(28, 28, 26, 0.35);
    padding: 5px 9px;
    border-radius: 999px;
    backdrop-filter: blur(2px);
}

.spotlight-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.spotlight-dot.active {
    background: var(--accent);
    transform: scale(1.35);
}

.spotlight-caption {
    padding: 1rem 1.3rem 1.1rem;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.65;
    border-top: 1px solid var(--border);
    min-height: 56px;
}

.spotlight-caption-meta {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-right: 0.55rem;
}

@media (max-width: 600px) {
    .spotlight-nav { width: 32px; height: 32px; }
    .spotlight-caption { font-size: 0.9rem; padding: 0.85rem 1rem; }
}
/* ─── TYPOGRAPHY REFINEMENTS ─── */

/* Fluid heading scale — smoother than fixed mobile breakpoints */
.hero h1 {
    font-size: clamp(2.2rem, 4.2vw, 3.1rem);
    line-height: 1.12;
}

.hero-subtitle {
    font-size: clamp(1.05rem, 1.4vw, 1.18rem);
}

.hero-about {
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.85;
}

.section-title {
    font-size: clamp(1.7rem, 2.4vw, 2.05rem);
}

.project-hero h1 {
    font-size: clamp(1.85rem, 3.2vw, 2.4rem);
}

/* Slight bumps on dense content blocks for desktop comfort */
.news-text { font-size: 1rem; }
.exp-bullets li { font-size: 1rem; }
.pub-title { font-size: 1.05rem; }
.edu-degree { font-size: 1rem; }

/* Mobile dial-back so the bumps don't crowd small screens */
@media (max-width: 600px) {
    .news-text { font-size: 0.95rem; }
    .exp-bullets li { font-size: 0.95rem; }
    .pub-title { font-size: 1rem; }
}
/* ─── FIELD NOTES ─── */
.fn-intro {
    font-size: 0.97rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
    line-height: 1.65;
    max-width: 660px;
}

.fn-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
}

.fn-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: var(--bg-warm);
}

.fn-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.6s ease;
    pointer-events: none;
}

.fn-slide.active {
    opacity: 1;
    pointer-events: auto;
}

/* Blurred backdrop fills the empty space when image aspect ratio
   doesn't match the 3:2 frame — works for any upload. */
.fn-bg {
    position: absolute;
    inset: -8%;
    background-size: cover;
    background-position: center;
    filter: blur(28px) saturate(1.1) brightness(0.55);
    z-index: 0;
}

.fn-slide img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    z-index: 1;
}

.fn-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(28, 28, 26, 0.55);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background 0.2s, transform 0.2s;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.fn-nav:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.05);
}

.fn-nav.prev { left: 12px; }
.fn-nav.next { right: 12px; }
.fn-nav svg { width: 16px; height: 16px; }

.fn-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 7px;
    z-index: 3;
    background: rgba(28, 28, 26, 0.4);
    padding: 5px 9px;
    border-radius: 999px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

.fn-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    border: none;
    padding: 0;
    transition: background 0.25s, transform 0.25s;
}

.fn-dot.active {
    background: var(--accent);
    transform: scale(1.35);
}

.fn-caption {
    padding: 1rem 1.3rem 1.1rem;
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.65;
    border-top: 1px solid var(--border);
    min-height: 56px;
}

.fn-caption-meta {
    font-family: var(--mono);
    font-size: 0.74rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-right: 0.55rem;
}

@media (max-width: 600px) {
    .fn-nav { width: 32px; height: 32px; }
    .fn-caption { font-size: 0.9rem; padding: 0.85rem 1rem; }
}

/* ════════ ENHANCEMENTS (append-only, overrides by source order) ════════ */

/* Scroll progress bar */
.scroll-progress {
    position: fixed; top: 0; left: 0;
    height: 3px; width: 0;
    background: var(--accent);
    z-index: 300;
    transition: width 0.08s linear;
}

/* Hero entrance */
.hero h1        { animation: heroIn 0.7s ease both; }
.hero-subtitle  { animation: heroIn 0.7s 0.08s ease both; }
.hero-about     { animation: heroIn 0.7s 0.16s ease both; }
@keyframes heroIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* Reveal sections on scroll */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* Section-title underline draws in on reveal */
.reveal .section-title::after { width: 0; transition: width 0.5s 0.15s ease; }
.reveal.visible .section-title::after { width: 36px; }

/* Interactive rows — experience / education / publications */
.exp-item, .edu-item, .pub-item {
    padding-left: 0.9rem;
    border-left: 2px solid transparent;
    border-radius: 0 8px 8px 0;
    transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}
.exp-item:hover, .edu-item:hover, .pub-item:hover {
    border-left-color: var(--accent);
    background: var(--accent-light);
    transform: translateX(3px);
}

/* News rows respond too */
.news-item { transition: background 0.2s ease; border-radius: 6px; padding-left: 0.6rem; margin-left: -0.6rem; }
.news-item:hover { background: var(--accent-light); }

/* Skill tags lift */
.skill-tag {
    cursor: default;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.skill-tag:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    color: var(--accent);
    transform: translateY(-2px);
}

@media (prefers-reduced-motion: reduce) {
    .reveal, .hero h1, .hero-subtitle, .hero-about { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ════════ FLUID TYPE (append-only) ════════ */
.hero h1         { font-size: clamp(2rem, 1.3rem + 3.2vw, 3.25rem); line-height: 1.1; }
.hero-subtitle   { font-size: clamp(1rem, 0.95rem + 0.4vw, 1.15rem); }
.section-title   { font-size: clamp(1.5rem, 1.25rem + 1.1vw, 1.95rem); }
.project-hero h1 { font-size: clamp(1.75rem, 1.4rem + 1.7vw, 2.4rem); }
.hero-about,
.project-hero p  { font-size: clamp(1rem, 0.97rem + 0.2vw, 1.08rem); }
.sidebar-name    { font-size: clamp(1.2rem, 1.1rem + 0.4vw, 1.4rem); }
.skill-tag, .news-text, .exp-bullets li, .pub-title { font-size: clamp(0.92rem, 0.9rem + 0.15vw, 1rem); }

/* ════════ CHAT SUGGESTION CHIPS ════════ */
.chat-suggestions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-self: flex-start; max-width: 100%; }
.chat-chip {
    font-family: var(--sans); font-size: 0.82rem;
    padding: 0.4rem 1.25rem; border: 1px solid var(--border);
    background: var(--bg); color: var(--accent);
    border-radius: 999px; cursor: pointer;
    transition: background 0.18s, border-color 0.18s, transform 0.18s;
}
.chat-chip:hover { background: var(--accent-light); border-color: var(--accent); transform: translateY(-1px); }

/* ════════ DARK THEME ════════ */
:root[data-theme="dark"] {
    --bg: #15140F;
    --bg-warm: #1D1B16;
    --sidebar-bg: #0E0D0B;
    --sidebar-text: #9A968C;
    --sidebar-accent: #EDE8DC;
    --text: #DAD5C8;
    --text-muted: #989384;
    --heading: #F2EEE4;
    --accent: #D67E54;
    --accent-light: #2A2018;
    --border: #332F27;
    --card-bg: #1C1A15;
    --tag-bg: #242019;
    --link: #E89066;
}
:root[data-theme="dark"] .img-carousel-hint { background: rgba(20,19,15,0.8); }

/* Smooth flip (only active during the toggle) */
:root.theme-transition * {
    transition: background-color .35s ease, border-color .35s ease, color .35s ease, fill .35s ease !important;
}

/* Toggle button */
.theme-toggle {
    position: fixed; top: 1.1rem; right: 1.25rem; z-index: 250;
    width: 40px; height: 40px; border-radius: 50%;
    border: 1px solid var(--border); background: var(--card-bg);
    color: var(--text); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.10);
    transition: transform .25s ease, border-color .2s, color .2s;
}
.theme-toggle:hover { transform: rotate(-18deg); border-color: var(--accent); color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (max-width: 860px) { .theme-toggle { top: 9px; right: 12px; width: 38px; height: 38px; } }

/* ════════ AMBIENT FLOW FIELD ════════ */
.flow-field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.main { position: relative; z-index: 1; }

/* ════════ SOFTER LIGHT BACKGROUND (append-only) ════════ */
/* Warmer, calmer page tone so the flow field reads and it's gentler on the eyes.
   Dark mode is unaffected — its [data-theme="dark"] rule has higher specificity. */
:root { --bg: #E8DFCD; }
