/*
===========================================================
styles.css
Shared styling for all three pages:
    index.html, research-projects.html, publications.html

Visual design adapted from AcadPro by Ripon Chandra Malo
(https://github.com/riponcm/acadpro), MIT License.
Copyright (c) Ripon Chandra Malo.

HOW TO CHANGE COLORS
--------------------
All colors are CSS variables in the :root block below.
Light mode lives in :root, dark mode in [data-theme="dark"],
and an optional white/blue mode in [data-theme="blue"].

To use the blue theme by default, add this to data.json:
    "settings": { "theme": "blue" }
(The site works without a "settings" block; it then uses light.)
===========================================================
*/


/* ---------- 1. THEME VARIABLES ---------- */

:root {
    /* --bg: #faf9f7;
    --surface: #f0eeea; */
    --bg: #ffffff;
    --surface: #f5f5f5;
    --card-border: rgba(0, 0, 0, 0.1);
    --glass: rgba(255, 255, 255, 0.92);
    --text: #1a1a2e;
    --muted: #6b6b7b;
    --accent: #2d5a7b;
    --accent-warm: #c8956c;
    --accent-sage: #5a7a6a;
    --card: #fff;
    /* --card-border: rgba(0, 0, 0, 0.06);
    --glass: rgba(250, 249, 247, 0.88); */
    --radius: 14px;
    --shadow: 0 2px 20px rgba(26, 26, 46, 0.06);
    --shadow-hover: 0 14px 44px rgba(26, 26, 46, 0.11);
    --container: 1080px;
    --serif: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
    --sans:  'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg: #0d0d18;
    --surface: #14142a;
    --text: #e8e6e1;
    --muted: #9a99a8;
    --accent: #7badc8;
    --accent-warm: #d4a574;
    --accent-sage: #7dab95;
    --card: #1a1a2e;
    --card-border: rgba(255, 255, 255, 0.07);
    --glass: rgba(13, 13, 24, 0.9);
    --shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    --shadow-hover: 0 14px 44px rgba(0, 0, 0, 0.45);
}

[data-theme="blue"] {
    --bg: #ffffff;
    --surface: #f3f7fb;
    --text: #333333;
    --muted: #657b91;
    --accent: #0078d4;
    --accent-warm: #0078d4;
    --accent-sage: #0078d4;
    --card: #ffffff;
    --card-border: rgba(0, 120, 212, 0.15);
    --glass: rgba(255, 255, 255, 0.95);
    --shadow: 0 0 0 transparent;
    --shadow-hover: 0 6px 16px rgba(0, 120, 212, 0.12);
    --serif: var(--sans);
}

[data-theme="blue"] h1,
[data-theme="blue"] h2,
[data-theme="blue"] h3,
[data-theme="blue"] h4 { color: var(--accent); }
[data-theme="blue"] nav a:hover { background: rgba(0, 120, 212, 0.08); color: var(--accent); }
[data-theme="blue"] .btn-primary { background: var(--accent); color: #fff; }
[data-theme="blue"] .btn-outline { color: var(--accent); border-color: var(--accent); }
[data-theme="blue"] .header { border-bottom: 1px solid rgba(0, 120, 212, 0.15); }


/* ---------- 2. RESET & BASE ---------- */

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

html { scroll-behavior: smooth; scroll-padding-top: 84px; }

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

/* Very faint paper grain over the whole page. */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.02;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 128px;
}

a { color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; }

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

.wrap {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1.5rem;
}


/* ---------- 3. HEADER & NAVIGATION ---------- */

.header {
    position: sticky;
    top: 0;
    z-index: 60;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    background: var(--glass);
    border-bottom: 1px solid var(--card-border);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.logo {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -0.5px;
    flex-shrink: 0;
}

.brand-text { min-width: 0; }
.brand-text .name { font-family: var(--serif); font-size: 1.05rem; line-height: 1.25; }
.brand-text .tagline {
    font-size: 0.76rem;
    color: var(--muted);
    font-weight: 500;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

nav {
    margin-left: auto;
    display: flex;
    gap: 0.1rem;
    align-items: center;
    flex-wrap: wrap;
}

nav a {
    color: var(--muted);
    text-decoration: none;
    padding: 0.4rem 0.55rem;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all var(--transition);
    white-space: nowrap;
}

nav a:hover { color: var(--text); background: var(--surface); }
nav a.active { color: var(--accent); background: var(--surface); }

.theme-btn {
    background: var(--surface);
    border: 1px solid var(--card-border);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--transition);
    margin-left: 0.2rem;
    color: var(--muted);
}
.theme-btn:hover { border-color: var(--accent); color: var(--accent); }
.theme-btn svg { width: 18px; height: 18px; }


/* ---------- 4. HERO (home page) ---------- */

.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
    padding: 3rem 0 2rem;
}

@media (min-width: 860px) {
    .hero { grid-template-columns: 1fr 260px; }
    .hero.no-visual { grid-template-columns: 1fr; }
}

.kicker {
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent-warm);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.hero-text h1 {
    font-family: var(--serif);
    font-size: clamp(2rem, 4vw, 2.7rem);
    line-height: 1.15;
    margin-bottom: 0.8rem;
}

.hero-tagline {
    color: var(--accent-sage);
    font-weight: 600;
    font-size: 0.92rem;
    margin-bottom: 0.9rem;
}

.hero-text .lead {
    color: var(--muted);
    max-width: 56ch;
    margin-bottom: 1.3rem;
    font-size: 0.95rem;
}
.hero-text .lead strong { color: var(--text); font-weight: 600; }

.hero-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }

.hero-role {
    margin-top: 0.8rem;
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.hero-role svg { width: 14px; height: 14px; opacity: 0.5; flex-shrink: 0; }

/* Sub-page intro (Research & Projects, Publications) */
.page-hero { padding: 3rem 0 0.5rem; }
.page-hero h1 {
    font-family: var(--serif);
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    line-height: 1.15;
    margin-bottom: 0.6rem;
}
.page-hero p { color: var(--muted); max-width: 64ch; }


/* ---------- 5. BUTTONS ---------- */

.btn-primary,
.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all var(--transition);
    cursor: pointer;
    font-family: var(--sans);
}

.btn-primary { background: var(--text); color: var(--bg); border: none; }
.btn-primary:hover { opacity: 0.85; transform: translateY(-1px); }

.btn-outline { background: transparent; border: 1.5px solid var(--card-border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-primary svg, .btn-outline svg { width: 15px; height: 15px; }

.action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: transparent;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--sans);
}
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn svg { width: 15px; height: 15px; }
.action-btn.static { cursor: default; opacity: 0.7; }
.action-btn.static:hover { border-color: var(--card-border); color: var(--muted); }


/* ---------- 6. HERO PHOTO CAROUSEL ---------- */

.featured-card {
    background: none;
    border: none;
    padding: 0;
    box-shadow: none;
    justify-self: center;
}

.photo-carousel {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border-radius: 50%;
    width: 220px;
    height: 220px;
    background: var(--surface);
    border: 4px solid var(--card);
    box-shadow: 0 8px 30px rgba(26, 26, 46, 0.15);
}

.photo-track { display: flex; height: 100%; transition: transform 700ms cubic-bezier(0.22, 0.9, 0.3, 1); }
.photo-slide { min-width: 100%; height: 100%; position: relative; overflow: hidden; }
.photo-slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 12%; transition: transform 8s ease; }
.photo-slide.active img { transform: scale(1.06); }
.photo-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0, 0, 0, 0.12) 100%);
    pointer-events: none;
}

.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 3;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    padding: 0.75rem 1rem 1.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.photo-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 5;
}
.photo-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    padding: 0;
}
.photo-dot.active { background: #fff; width: 22px; border-radius: 4px; }

.carousel-nav { display: flex; justify-content: center; gap: 0.3rem; padding: 0.5rem 0.1rem 0; }
.car-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--card-border);
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all var(--transition);
}
.car-btn:hover { border-color: var(--accent); color: var(--accent); }
.car-btn svg { width: 14px; height: 14px; }


/* ---------- 7. SECTIONS & GRIDS ---------- */

.section { padding: 2.5rem 0 0; }
.section-header { margin-bottom: 1.5rem; }
.section-header h2 { font-family: var(--serif); font-size: 1.6rem; margin-bottom: 0.3rem; }
.section-header p { color: var(--muted); font-size: 0.9rem; }

.grid { display: grid; gap: 1rem; }
@media (min-width: 700px) {
    .g2 { grid-template-columns: repeat(2, 1fr); }
    .g3 { grid-template-columns: repeat(3, 1fr); }
}

.empty-state {
    padding: 1.6rem;
    border: 1px dashed var(--card-border);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}


/* ---------- 8. TABS (research, experience/education) ---------- */

.tabs-container {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.tabs-header { display: flex; border-bottom: 1px solid var(--card-border); background: var(--surface); }

.tab-btn {
    flex: 1;
    padding: 0.85rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    position: relative;
    transition: color var(--transition);
}
.tab-btn.active { color: var(--text); }
.tab-btn:hover { color: var(--text); }
.tab-btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition);
}
.tab-btn.active::after { transform: scaleX(1); }

.tab-panel { display: none; padding: 1.2rem 1.4rem; }
.tab-panel.active { display: block; }


/* ---------- 9. EXPERIENCE / EDUCATION TIMELINE ---------- */

.timeline-item { display: flex; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--card-border); }
.timeline-item:last-child { border-bottom: none; }

.tl-logo {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--surface);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--card-border);
}
.tl-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.tl-logo svg { width: 24px; height: 24px; color: var(--accent); }

.tl-content { flex: 1; min-width: 0; }
.tl-content h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.1rem; }
.tl-org { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.tl-desc { font-size: 0.84rem; color: var(--muted); margin-top: 0.25rem; }
.tl-year { font-size: 0.78rem; font-weight: 700; color: var(--muted); white-space: nowrap; padding-top: 0.1rem; }

@media (max-width: 560px) {
    .timeline-item { flex-wrap: wrap; }
    .tl-year { width: 100%; padding-left: calc(48px + 1rem); }
}


/* ---------- 10. CARDS (projects) ---------- */

.card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); }

.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; }
.card-top h3 { font-family: var(--serif); font-size: 1.05rem; line-height: 1.25; }
.card-top .sub { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }

.tag {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    background: var(--surface);
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}

.card-media { border-radius: 10px; overflow: hidden; height: 130px; background: var(--surface); width: 100%; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-desc { font-size: 0.88rem; color: var(--muted); flex: 1; }
.card-actions { display: flex; gap: 0.4rem; margin-top: auto; align-items: center; flex-wrap: wrap; }

.project-open {
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    color: inherit;
    cursor: pointer;
    width: 100%;
}
.project-open h3 { transition: color var(--transition); }
.project-open:hover h3 { color: var(--accent); }


/* ---------- 11. SHARE DROPDOWN ---------- */

.share-wrap { position: relative; display: inline-flex; }

.share-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    padding: 0.4rem;
    opacity: 0;
    pointer-events: none;
    transform: translateY(6px);
    transition: all 0.25s ease;
    z-index: 50;
}
.share-wrap.open .share-dropdown { opacity: 1; pointer-events: auto; transform: translateY(0); }

.share-option {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: background var(--transition);
    text-decoration: none;
}
.share-option:hover { background: var(--surface); }
.share-option svg { width: 16px; height: 16px; flex-shrink: 0; }
.share-option.copy-done { color: var(--accent-sage); }


/* ---------- 12. AWARDS ---------- */

.compact-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 1rem 1.1rem;
    box-shadow: var(--shadow);
    display: flex;
    gap: 0.8rem;
    align-items: center;
    transition: all var(--transition);
    text-decoration: none;
    color: inherit;
    width: 100%;
    text-align: left;
}
a.compact-card:hover,
button.compact-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-3px); border-color: var(--accent); }
button.compact-card { cursor: pointer; font-family: var(--sans); font-size: inherit; }

.compact-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--accent-warm);
}
.compact-icon svg { width: 20px; height: 20px; }
.compact-body { flex: 1; min-width: 0; }
.compact-card h3 { font-size: 0.93rem; font-weight: 600; line-height: 1.35; }
.compact-card .sub { font-size: 0.82rem; color: var(--muted); }
.ext-arrow { color: var(--accent); flex-shrink: 0; }
.ext-arrow svg { width: 16px; height: 16px; }


/* ---------- 13. RESEARCH TABS CONTENT ---------- */

.research-intro { font-size: 0.92rem; color: var(--muted); line-height: 1.7; }
.research-intro strong { color: var(--text); font-weight: 600; }

.research-highlight-group + .research-highlight-group {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--card-border);
}
.research-highlight-group h4 { font-size: 1rem; font-family: var(--serif); margin-bottom: 0.35rem; }
.research-highlight-group p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.7rem; }

.research-highlight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }

.research-highlight-card {
    padding: 0.9rem 1rem;
    border-radius: 14px;
    background: var(--surface);
    border: 1px solid var(--card-border);
    min-height: 100%;
}
.research-highlight-card.simple { display: flex; align-items: flex-start; }
.research-highlight-card.simple span { font-size: 0.9rem; line-height: 1.55; color: var(--text); }

.research-skill-card { display: flex; gap: 0.85rem; align-items: flex-start; }
.research-skill-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--card-border);
    display: grid;
    place-items: center;
    color: var(--accent);
    flex-shrink: 0;
}
.research-skill-icon svg { width: 20px; height: 20px; }
.research-skill-content { flex: 1; min-width: 0; }
.research-skill-head { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.research-skill-head strong { font-size: 0.92rem; line-height: 1.35; }
.research-skill-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.35rem; line-height: 1.55; }

.research-skill-level {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--card-border);
    background: var(--card);
    color: var(--muted);
    text-transform: capitalize;
}
.research-skill-level[data-level="expert"]       { border-color: rgba(15, 118, 110, 0.25); background: rgba(15, 118, 110, 0.08); color: #0f766e; }
.research-skill-level[data-level="advanced"]     { border-color: rgba(37, 99, 235, 0.25);  background: rgba(37, 99, 235, 0.08);  color: #2563eb; }
.research-skill-level[data-level="intermediate"] { border-color: rgba(180, 83, 9, 0.25);   background: rgba(180, 83, 9, 0.08);   color: #b45309; }
.research-skill-level[data-level="learning"]     { border-color: rgba(124, 58, 237, 0.25); background: rgba(124, 58, 237, 0.08); color: #7c3aed; }

[data-theme="dark"] .research-skill-level[data-level="expert"]       { color: #5eead4; }
[data-theme="dark"] .research-skill-level[data-level="advanced"]     { color: #93b4fb; }
[data-theme="dark"] .research-skill-level[data-level="intermediate"] { color: #fbbf6a; }
[data-theme="dark"] .research-skill-level[data-level="learning"]     { color: #c4a8fb; }

.metric-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem; }


/* ---------- 14. CONTACT ---------- */

.contact-stack { max-width: 760px; margin: 0 auto; }
.contact-banner { text-align: center; }
.contact-banner h3 { font-family: var(--serif); font-size: 1.3rem; margin-bottom: 0.8rem; color: var(--accent); }
.contact-lead { max-width: 620px; margin: 0 auto 1.2rem; color: var(--muted); line-height: 1.7; }

.contact-detail-actions {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
    gap: 1.2rem;
    align-items: stretch;
    max-width: 860px;
    margin: 0 auto;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    background: var(--surface);
    text-align: left;
}

.contact-top-list { list-style: none; display: grid; gap: 0.95rem; justify-items: start; }
.contact-top-item { display: flex; align-items: center; gap: 0.8rem; width: 100%; min-width: 0; }
.contact-value { font-size: 0.98rem; overflow-wrap: anywhere; }
.contact-value a { color: var(--accent); text-decoration: none; }
.contact-value a:hover { text-decoration: underline; }

.ci-icon {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    background: var(--card);
    border: 1px solid var(--card-border);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: var(--accent);
}
.ci-icon svg { width: 17px; height: 17px; }
.ci-label { display: block; font-size: 0.73rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

.contact-action-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    align-items: stretch;
    justify-content: center;
    border-left: 1px solid var(--card-border);
    padding-left: 1.2rem;
}
.contact-action-column .btn-primary,
.contact-action-column .btn-outline { min-width: 120px; justify-content: center; }

.contact-section-divider { height: 1px; background: var(--card-border); max-width: 640px; margin: 1.35rem auto 1rem; }
.contact-profiles-buttons { display: flex; justify-content: center; gap: 0.8rem; flex-wrap: wrap; margin-top: 0.85rem; }
.contact-profiles-buttons .action-btn { padding: 0.7rem 1rem; border-radius: 12px; font-size: 0.88rem; }

@media (max-width: 760px) {
    .contact-detail-actions { grid-template-columns: 1fr; padding: 1rem; }
    .contact-action-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        border-left: none;
        border-top: 1px solid var(--card-border);
        padding-left: 0;
        padding-top: 1rem;
    }
}


/* ---------- 15. PUBLICATIONS ---------- */

.pub-toolbar { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 1.2rem; align-items: center; }
.pub-filter-bar { display: flex; gap: 0.4rem; flex-wrap: wrap; align-items: center; }
.pub-sort-controls { margin-left: auto; display: flex; gap: 0.5rem; align-items: center; }
.pub-sort-label { font-size: 0.75rem; color: var(--muted); font-weight: 600; }

.pub-filter-btn {
    padding: 0.45rem 1.1rem;
    border-radius: 50px;
    border: 1.5px solid var(--card-border);
    background: var(--card);
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}
.pub-filter-btn.small { padding: 0.25rem 0.75rem; font-size: 0.78rem; }
.pub-filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.pub-filter-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }

.pub-count { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.8rem; }

.pub-list { display: flex; flex-direction: column; gap: 0.6rem; }

.pub-row {
    display: flex;
    gap: 1rem;
    padding: 1.1rem;
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all var(--transition);
    align-items: flex-start;
}
.pub-row:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }

.pub-row-num { font-family: var(--serif); font-size: 1.1rem; font-weight: 700; color: var(--accent); min-width: 22px; padding-top: 0.15rem; opacity: 0.5; }


.pub-row-body { flex: 1; min-width: 0; }
.pub-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.25rem; }
.pub-row-title { font-family: var(--serif); font-size: 1rem; font-weight: 600; line-height: 1.3; }
.pub-row-year {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.18rem 0.5rem;
    border-radius: 6px;
    background: var(--surface);
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}
.pub-row-authors { font-size: 0.84rem; color: var(--muted); margin-bottom: 0.15rem; }
.pub-row-authors strong { color: var(--accent); font-weight: 600; }
.pub-row-venue { font-size: 0.82rem; color: var(--accent-warm); font-weight: 500; font-style: italic; margin-bottom: 0.25rem; }
.pub-row-desc { font-size: 0.84rem; color: var(--muted); line-height: 1.5; margin-bottom: 0.5rem; }
.pub-row-actions { display: flex; gap: 0.35rem; flex-wrap: wrap; align-items: center; margin-top: 0.5rem; }

.load-more-wrap { text-align: center; margin-top: 1.5rem; }

.bib-modal { padding: 1.5rem; }
.bib-modal h3 { margin-bottom: 1rem; font-family: var(--serif); }
.bib-modal pre {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    overflow-x: auto;
    color: var(--muted);
    border: 1px solid var(--card-border);
    font-family: ui-monospace, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}
.bib-modal-actions { display: flex; justify-content: flex-end; margin-top: 1rem; }
.bib-modal-actions .action-btn { background: var(--accent); color: #fff; border: none; }
.bib-modal-actions .action-btn.done { background: var(--accent-sage); }


/* ---------- 16. MODAL (project details, video, images, BibTeX) ---------- */

.modal-overlay { position: fixed; inset: 0; z-index: 200; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal-overlay.open { display: flex; }
.modal-bg { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(4px); }
.modal-box {
    position: relative;
    max-width: 860px;
    width: 100%;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    background: var(--card);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
}
.modal-close {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a2e;
    cursor: pointer;
    display: grid;
    place-items: center;
}
.modal-close svg { width: 16px; height: 16px; }

.video-frame { position: relative; padding-top: 56.25%; background: #000; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.award-modal { padding: 1.4rem; }
.award-modal h3 { font-family: var(--serif); font-size: 1.5rem; margin-bottom: 0.35rem; }
.award-modal-desc { color: var(--muted); line-height: 1.7; }
.award-modal-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.1rem; }

.project-modal { padding: 1.25rem; }
.project-modal-head { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1rem; align-items: start; padding-right: 2rem; }
.project-modal-thumb { border: 1px solid var(--card-border); border-radius: 14px; overflow: hidden; background: var(--surface); height: 120px; }
.project-modal-thumb img { width: 100%; height: 100%; object-fit: cover; }
.project-modal-kicker { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; margin-bottom: 0.35rem; }
.project-modal h3 { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; margin-bottom: 0.25rem; }
.project-modal-sub { color: var(--muted); margin-bottom: 0.55rem; }
.project-modal-summary { color: var(--muted); line-height: 1.65; font-size: 0.92rem; }
.project-modal-meta { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.project-modal-meta-item { padding: 0.4rem 0.7rem; background: var(--surface); border: 1px solid var(--card-border); border-radius: 999px; font-size: 0.8rem; }

.project-tabs { margin-top: 1rem; border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; background: var(--card); }
.project-tabs-header { display: flex; background: var(--surface); border-bottom: 1px solid var(--card-border); }
.project-tab-btn {
    flex: 1;
    padding: 0.8rem 0.9rem;
    border: none;
    background: transparent;
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--muted);
    cursor: pointer;
    position: relative;
}
.project-tab-btn.active { color: var(--text); }
.project-tab-btn::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform var(--transition);
}
.project-tab-btn.active::after { transform: scaleX(1); }
.project-tab-panel { display: none; padding: 1rem 1.05rem; }
.project-tab-panel.active { display: block; }
.project-tab-panel p { color: var(--muted); line-height: 1.7; }

.project-modal-list { list-style: none; display: grid; gap: 0.55rem; margin-top: 0.9rem; }
.project-modal-list li { padding: 0.7rem 0.8rem; border-radius: 10px; background: var(--card); border: 1px solid var(--card-border); }
.project-results-grid { display: grid; gap: 0.75rem; }

.project-media-grid,
.project-modal-figures { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem; }

.project-media-card,
.project-figure {
    position: relative;
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    padding: 0;
    color: inherit;
}
.project-media-card img,
.project-figure img { width: 100%; height: 190px; object-fit: cover; }
.project-media-thumb { position: relative; height: 190px; background: #111; }
.project-media-thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.28)); }
.project-media-play {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    display: grid;
    place-items: center;
    z-index: 2;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}
.project-media-play svg { width: 24px; height: 24px; color: var(--accent); margin-left: 2px; }
.project-media-badge {
    position: absolute;
    left: 12px;
    top: 12px;
    z-index: 2;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    color: #1a1a2e;
    font-size: 0.74rem;
    font-weight: 700;
}
.project-media-caption,
.project-figure figcaption { display: block; padding: 0.8rem 0.9rem; color: var(--muted); font-size: 0.86rem; line-height: 1.55; }
.project-screenshots-wrap { margin-top: 0.95rem; }
.project-gallery-title { font-family: var(--serif); font-size: 1rem; margin-bottom: 0.7rem; }
.project-lightbox-image { width: 100%; display: block; max-height: 78vh; object-fit: contain; background: #111; }
.project-lightbox-caption { padding: 1rem 1.1rem; color: var(--muted); font-size: 0.9rem; }


/* ---------- 17. FOOTER & ERROR BOX ---------- */

.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--card-border);
    margin-top: 3rem;
}
.footer small { display: block; margin-top: 0.5rem; font-size: 0.75rem; opacity: 0.75; }
.footer a { color: var(--accent); text-decoration: none; }

.data-error {
    display: none;
    margin: 20px auto;
    padding: 15px;
    border-radius: 12px;
    background: #fff1f1;
    border: 1px solid #f0caca;
    color: #8a3333;
}


/* ---------- 18. SCROLL REVEAL ---------- */

.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.vis { opacity: 1; transform: none; }
.reveal:nth-child(2) { transition-delay: 0.07s; }
.reveal:nth-child(3) { transition-delay: 0.14s; }
.reveal:nth-child(4) { transition-delay: 0.21s; }


/* ---------- 19. RESPONSIVE ---------- */

@media (max-width: 1000px) {
    .brand-text .tagline { display: none; }
}

@media (max-width: 860px) {
    .header-inner { flex-wrap: wrap; row-gap: 0.4rem; }
    nav { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
    .theme-btn { margin-left: auto; flex-shrink: 0; }
}

@media (max-width: 760px) {
    .project-modal-head { grid-template-columns: 1fr; }
    .project-media-grid,
    .project-modal-figures { grid-template-columns: 1fr; }
    .project-tabs-header { flex-direction: column; }
    .research-highlight-grid { grid-template-columns: 1fr; }
    .research-skill-head { flex-direction: column; align-items: flex-start; }
    .pub-sort-controls { margin-left: 0; }
}

@media (max-width: 699px) {
    .photo-carousel { width: 180px; height: 180px; }
    .hero { padding: 2rem 0; }
    .pub-row { flex-direction: column; }
    .pub-row-head { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

@media print {
    .header, .theme-btn, .action-btn, .car-btn, .modal-overlay { display: none !important; }
    body { background: #fff; }
    .reveal { opacity: 1; transform: none; }
    .card, .compact-card, .pub-row { box-shadow: none; border: 1px solid #ddd; }
}
/* ===== COMPACT LAYOUT (delete this block to undo) ===== */
:root { --container: 820px; --radius: 10px; }
body { font-size: 14px; line-height: 1.5; }
.wrap { padding: 0 1rem; }
html { scroll-padding-top: 56px; }

/* header */
.header-inner { padding: 0.4rem 0; gap: 0.6rem; }
.logo { width: 32px; height: 32px; font-size: 13px; border-radius: 8px; }
.brand-text .name { font-size: 0.95rem; }
.brand-text .tagline { display: none; }
nav a { padding: 0.25rem 0.45rem; font-size: 0.8rem; }
.theme-btn { width: 30px; height: 30px; }

/* hero: text left, small round photo right */
.hero { padding: 1.5rem 0 0.5rem; gap: 1rem; }
@media (min-width: 560px) { .hero { grid-template-columns: 1fr 130px; } }
.kicker { display: none; }
.hero-text h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.hero-tagline { font-size: 0.8rem; margin-bottom: 0.4rem; }
.hero-text .lead { font-size: 0.85rem; margin-bottom: 0.7rem; max-width: none; }
.hero-role { margin-top: 0.4rem; font-size: 0.75rem; }
.btn-primary, .btn-outline { padding: 0.35rem 0.8rem; font-size: 0.8rem; }
.photo-carousel { width: 120px; height: 120px; border-width: 3px; }

/* sections */
.section { padding: 1.3rem 0 0; }
.section-header { margin-bottom: 0.7rem; }
.section-header h2 { font-size: 1.15rem; margin-bottom: 0; }
.section-header p { font-size: 0.8rem; }
.page-hero { padding: 1.5rem 0 0; }
.page-hero h1 { font-size: 1.5rem; margin-bottom: 0.3rem; }
.page-hero p { font-size: 0.85rem; }
.grid { gap: 0.6rem; }

/* cards (projects) */
.card { padding: 0.7rem; gap: 0.35rem; box-shadow: none; }
.card:hover { transform: none; }
.card-top h3 { font-size: 0.95rem; }
.card-media { height: 90px; }
.card-desc { font-size: 0.8rem; }
.action-btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

/* tabs + timeline */
.tab-btn { padding: 0.5rem 0.8rem; font-size: 0.82rem; }
.tab-panel { padding: 0.5rem 0.9rem; }
.timeline-item { padding: 0.6rem 0; gap: 0.7rem; }
.tl-logo { width: 34px; height: 34px; border-radius: 8px; }
.tl-logo svg { width: 18px; height: 18px; }
.tl-content h4 { font-size: 0.88rem; }
.tl-org, .tl-desc, .tl-year { font-size: 0.78rem; }

/* awards */
.compact-card { padding: 0.55rem 0.7rem; gap: 0.6rem; }
.compact-card:hover { transform: none; }
.compact-icon { width: 30px; height: 30px; }
.compact-icon svg { width: 16px; height: 16px; }
.compact-card h3 { font-size: 0.82rem; }

/* research tabs */
.research-highlight-card { padding: 0.6rem 0.75rem; }
.research-skill-icon { width: 32px; height: 32px; }
.research-skill-icon svg { width: 16px; height: 16px; }
.research-highlight-card.simple span { font-size: 0.82rem; }
.research-skill-head strong { font-size: 0.85rem; }
.research-skill-note { font-size: 0.75rem; }

/* publications */
.pub-list { gap: 0.4rem; }
.pub-row { padding: 0.65rem; gap: 0.7rem; box-shadow: none; }
.pub-row:hover { transform: none; }
.pub-row-title { font-size: 0.9rem; }
.pub-row-authors, .pub-row-venue { font-size: 0.76rem; }
.pub-row-desc { font-size: 0.78rem; }
.pub-row-actions { margin-top: 0.3rem; }
.pub-filter-btn { padding: 0.25rem 0.8rem; font-size: 0.78rem; }
@media (max-width: 699px) { .pub-row { flex-direction: row; } }

/* contact + footer */
.contact-stack { max-width: none; }
.contact-banner h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.contact-lead { font-size: 0.82rem; margin-bottom: 0.7rem; }
.contact-detail-actions { padding: 0.7rem 0.9rem; gap: 0.8rem; }
.ci-icon { width: 32px; height: 32px; }
.contact-value { font-size: 0.85rem; }
.contact-top-list { gap: 0.5rem; }
.contact-section-divider { margin: 0.8rem auto 0.6rem; }
.contact-profiles-buttons .action-btn { padding: 0.4rem 0.7rem; font-size: 0.78rem; }
.footer { padding: 1rem 0; margin-top: 1.5rem; font-size: 0.75rem; }