/* ══════════════════════════════════════════
   Quoc-Huy Trinh — shared site styles
═══════════════════════════════════════════ */

:root {
    --primary: #1900FF;
    --primary-dark: #1200cc;
    --primary-soft: rgba(25, 0, 255, 0.08);
    --text: #1a1a1a;
    --text-light: #555;
    --bg: #ffffff;
    --bg-alt: #f8f9fa;
    --border: #e5e7eb;
    --nav-height: 60px;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.65;
}

/* ── NAV ── */
nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 2rem;
}

.nav-brand {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    margin-right: auto;
}

.nav-links {
    display: flex;
    gap: 0.35rem;
    list-style: none;
    align-items: center;
}

.nav-links a {
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
    background: var(--primary-soft);
}

/* ── LAYOUT ── */
main {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
}

section {
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--border);
}

section:last-child { border-bottom: none; }

.section-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.section-title .icon {
    color: #374151;
    font-size: 1.1rem;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary), transparent);
    margin-left: 0.6rem;
    border-radius: 2px;
}

/* ── SUB-PAGE HEADER ── */
.page-head {
    padding: 2.2rem 0 1.2rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}

.page-head h1 {
    font-size: 1.8rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.page-head h1 i { color: #374151; font-size: 1.3rem; }

.page-head p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-light);
    text-decoration: none;
    margin-bottom: 0.9rem;
    transition: color 0.15s;
}

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

/* ── ABOUT ── */
.about-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2.5rem;
    align-items: start;
}

.about-photo-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.profile-photo {
    width: 170px;
    height: 170px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary);
    box-shadow: 0 4px 16px rgba(25,0,255,0.18);
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: 100%;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.18s;
}

.social-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.social-link i { width: 14px; text-align: center; }

.about-bio h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.about-bio .subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.about-bio p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.research-interests { margin-top: 1rem; }

.research-interests h3 {
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 0.7rem;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.interest-tag {
    background: var(--primary-soft);
    color: var(--primary);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid rgba(25,0,255,0.15);
}

.phd-notice {
    margin-top: 1.1rem;
    padding: 0.7rem 1rem;
    background: linear-gradient(135deg, rgba(25,0,255,0.05), rgba(25,0,255,0.09));
    border-left: 3px solid var(--primary);
    border-radius: 0 8px 8px 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── NEWS ── */
.news-item {
    display: flex;
    gap: 0.9rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bg-alt);
    align-items: baseline;
    font-size: 0.88rem;
}

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

.news-date {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    min-width: 72px;
    flex-shrink: 0;
}

.news-item a { color: var(--primary); text-decoration: none; }
.news-item a:hover { text-decoration: underline; }

.news-badges {
    margin-top: 0.4rem;
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

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

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

.edu-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #374151;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.edu-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.edu-content {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.edu-main { flex: 1; }

.edu-content h3 { font-size: 0.92rem; font-weight: 600; margin-bottom: 0.25rem; }

.edu-details {
    font-size: 0.82rem;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: 0.15rem;
}

.edu-details .edu-major { font-weight: 500; color: var(--text); }
.edu-details .edu-minor { color: var(--text-light); }
.edu-details .edu-gpa   { color: var(--text-light); }
.edu-details .edu-thesis { color: var(--text); margin-top: 0.1rem; }
.edu-details .edu-thesis em { color: var(--text-light); font-style: italic; }

.edu-supervisor {
    text-align: right;
    font-size: 0.78rem;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

.edu-supervisor span {
    display: block;
    font-style: italic;
    margin-bottom: 0.1rem;
}

/* ── PUBLICATIONS TIMELINE ── */
.pub-timeline {
    position: relative;
    padding-left: 28px;
}

.pub-timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), rgba(25,0,255,0.15) 95%, transparent);
    border-radius: 2px;
}

.year-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.year-group:last-child { margin-bottom: 0; }

.year-label {
    position: relative;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.7rem;
    padding-bottom: 0.35rem;
}

.year-label::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid #fff;
    box-shadow: 0 0 0 2px var(--primary);
    z-index: 1;
}

.pub-item {
    position: relative;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--bg-alt);
}

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

.pub-item::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 1.15rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--primary);
    box-sizing: border-box;
    z-index: 1;
    transition: all 0.15s ease;
}

.pub-item:hover::before {
    background: var(--primary);
    transform: scale(1.25);
}

.pub-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text);
    line-height: 1.45;
}

.pub-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
}

/* venue badges */
.vbadge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    font-size: 0.73rem;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.15s, transform 0.1s;
    line-height: 1.4;
}

.vbadge:hover { opacity: 0.82; transform: translateY(-1px); }

.vbadge img {
    width: 13px;
    height: 13px;
    object-fit: contain;
    border-radius: 2px;
}

.vbadge i { font-size: 10px; }

.b-ieee     { background: #00629B; color: #fff; }
.b-arxiv    { background: #B31B1B; color: #fff; }
.b-cvpr     { background: #1e4e8c; color: #fff; }
.b-eccv     { background: #1b6b5a; color: #fff; }
.b-miccai   { background: #6d28d9; color: #fff; }
.b-bmvc     { background: #2d2d2d; color: #fff; }
.b-acm      { background: #0085CA; color: #fff; }
.b-springer { background: #E87722; color: #fff; }
.b-elsevier { background: #FF6C00; color: #fff; }
.b-journal  { background: #2e7d32; color: #fff; }
.b-spie     { background: #7B1FA2; color: #fff; }
.b-other    { background: #546e7a; color: #fff; }
.b-award    { background: #f59e0b; color: #1a1a1a; }
.b-web      { background: #4a90d9; color: #fff; }
.b-hf       { background: #FFD21E; color: #1a1a1a; }
.b-code     { background: #24292f; color: #fff; }

.pub-authors {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 0.35rem;
    line-height: 1.4;
}

.me-first {
    color: var(--primary);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.me {
    font-weight: 700;
    color: var(--text);
}

.pub-note {
    font-size: 0.76rem;
    color: #888;
    font-style: italic;
}

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

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

.exp-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #9ca3af;
    margin-top: 6px;
    flex-shrink: 0;
}

.exp-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.exp-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.exp-content h3 { font-size: 0.9rem; font-weight: 600; }
.exp-content p  { font-size: 0.83rem; color: var(--text-light); margin-top: 0.1rem; }
.exp-content a  { color: var(--primary); text-decoration: none; }
.exp-content a:hover { text-decoration: underline; }

.exp-period {
    font-size: 0.78rem;
    color: var(--text-light);
    font-weight: 400;
}

/* ── SERVICE ── */
.service-subsection {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
}

.service-subsection:first-child { margin-top: 0; }

.service-item {
    padding: 0.4rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--bg-alt);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

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

.service-item::before {
    content: '›';
    color: #9ca3af;
    font-weight: 700;
    font-size: 1rem;
}

/* ── AWARDS ── */
.awards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 1.75rem;
}

.awards-grid.two-col { grid-template-columns: repeat(2, 1fr); }

.award-item {
    display: flex;
    gap: 0.9rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--bg-alt);
    align-items: baseline;
    font-size: 0.88rem;
}

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

.award-year {
    font-size: 0.78rem;
    font-weight: 700;
    color: #d97706;
    min-width: 38px;
    flex-shrink: 0;
}

/* ── OPEN SOURCE / REPO CARDS ── */
.repo-card {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text);
    transition: border-color 0.18s, box-shadow 0.18s;
    margin-bottom: 0.75rem;
}

.repo-card:hover {
    border-color: #9ca3af;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.repo-card-icon {
    font-size: 1.4rem;
    color: #1a1a1a;
    flex-shrink: 0;
    margin-top: 2px;
}

.repo-card-body h3 {
    font-size: 0.92rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.repo-card-body p {
    font-size: 0.83rem;
    color: var(--text-light);
}

/* ── PROJECT CARDS (works page) ──
   Each card carries its own theme via a t-* class that sets --accent.   */
.work-card {
    --accent: var(--primary);
    --accent-soft: rgba(25, 0, 255, 0.09);
    --accent-line: rgba(25, 0, 255, 0.26);

    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.25rem 1.1rem 1.55rem;
    margin-bottom: 1rem;
    transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
    background: #fff;
}

/* left accent rail */
.work-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--accent), var(--accent) 45%, transparent);
}

/* soft themed glow in the top-right corner */
.work-card::after {
    content: '';
    position: absolute;
    top: -55px;
    right: -55px;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-soft), transparent 68%);
    pointer-events: none;
}

.work-card:hover {
    border-color: var(--accent-line);
    box-shadow: 0 4px 18px var(--accent-soft);
    transform: translateY(-1px);
}

.work-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    position: relative;
}

.work-icon {
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: var(--accent);
    flex-shrink: 0;
}

.work-titles {
    display: flex;
    align-items: baseline;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.work-head h3 {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.01em;
}

.work-head .work-venue {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    background: var(--accent-soft);
    border: 1px solid var(--accent-line);
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    white-space: nowrap;
}

.work-sub {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.35rem;
    line-height: 1.4;
    position: relative;
}

.work-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.7rem;
    position: relative;
}

.work-links {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    position: relative;
}

/* per-project themes */
.t-prsmed   { --accent: #0d9488; --accent-soft: rgba(13,148,136,0.11);  --accent-line: rgba(13,148,136,0.30); }
.t-firebolt { --accent: #ea580c; --accent-soft: rgba(234,88,12,0.11);   --accent-line: rgba(234,88,12,0.30); }
.t-spatial  { --accent: #7c3aed; --accent-soft: rgba(124,58,237,0.11);  --accent-line: rgba(124,58,237,0.30); }
.t-radjepa  { --accent: #0369a1; --accent-soft: rgba(3,105,161,0.11);   --accent-line: rgba(3,105,161,0.30); }
.t-attrib   { --accent: #b45309; --accent-soft: rgba(180,83,9,0.11);    --accent-line: rgba(180,83,9,0.30); }
.t-music    { --accent: #db2777; --accent-soft: rgba(219,39,119,0.11);  --accent-line: rgba(219,39,119,0.30); }

/* Hugging Face resource rows */
.hf-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.2rem;
    border-bottom: 1px solid var(--bg-alt);
    text-decoration: none;
    color: var(--text);
    transition: background 0.15s;
    border-radius: 6px;
}

.hf-row:last-child { border-bottom: none; }

.hf-row:hover { background: var(--bg-alt); }

.hf-emoji {
    font-size: 1.05rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.hf-name {
    font-size: 0.87rem;
    font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hf-desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-left: auto;
    text-align: right;
}

.hf-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.9rem;
    border-radius: 8px;
    background: #FFD21E;
    color: #1a1a1a;
    font-size: 0.83rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(0,0,0,0.08);
    transition: transform 0.12s, box-shadow 0.15s;
}

.hf-cta:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.12); }

/* ── FOOTER ── */
footer {
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    padding: 1.6rem 1.4rem 1.4rem;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-light);
}

/* ── ABOUT PAGE PROSE ── */
.about-para {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.85rem;
}

.about-para:last-child { margin-bottom: 0; }

/* ── PAGE LINK BUTTONS ── */
.page-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    border: 1px solid rgba(25,0,255,0.22);
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s;
}

.page-link-btn:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    transform: translateY(-1px);
}

.page-link-btn .arrow { font-size: 0.7rem; opacity: 0.7; }

/* ── VISITOR MAP ── */
.visitor-map {
    max-width: 320px;
    margin: 0 auto 1.1rem;
}

.visitor-map h4 {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 0.55rem;
}

.visitor-map-frame {
    display: flex;
    justify-content: center;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.visitor-map-frame img,
.visitor-map-frame canvas,
.visitor-map-frame > div {
    max-width: 100%;
    height: auto;
}

/* ── WAVE ANIMATION ── */
@keyframes wave {
    0%,100% { transform: rotate(0deg); }
    20%      { transform: rotate(20deg); }
    40%      { transform: rotate(-8deg); }
    60%      { transform: rotate(16deg); }
    80%      { transform: rotate(-4deg); }
}

/* ── RESPONSIVE ── */
@media (max-width: 680px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-photo-col { flex-direction: row; align-items: flex-start; flex-wrap: wrap; }
    .profile-photo { width: 120px; height: 120px; }
    .social-links { flex-direction: row; flex-wrap: wrap; }
    .social-link { flex: 1 1 120px; }
    nav { padding: 0 1rem; gap: 0.75rem; }
    .nav-brand { font-size: 0.95rem; }
    .nav-links { gap: 0.1rem; }
    .nav-links a { font-size: 0.78rem; padding: 0.3rem 0.4rem; }
    .awards-grid, .awards-grid.two-col { grid-template-columns: 1fr; }
    .pub-timeline { padding-left: 22px; }
    .pub-timeline::before { left: 6px; }
    .pub-item::before { left: -19px; width: 7px; height: 7px; }
    .year-label::before { left: -20px; width: 12px; height: 12px; }
    .hf-desc { display: none; }
    .edu-content { flex-direction: column; }
    .edu-supervisor { text-align: left; }
}
