/* ============================================
   TRAN VAN MANH — PORTFOLIO
   Design: Clean technical / editorial dark-accent
   Font: DM Sans + Space Mono
============================================ */

:root {
    --bg: #f8f7f4;
    --bg-alt: #f0eeea;
    --surface: #ffffff;
    --text: #1a1a1a;
    --text-muted: #666;
    --accent: #13375c;       /* Deep teal-blue */
    --accent-light: #12a86a;
    --accent-glow: rgba(10, 102, 64, 0.12);
    --border: #e0ddd8;
    --mono: 'Space Mono', monospace;
    --sans: 'DM Sans', sans-serif;
    --nav-h: 60px;
    --radius: 10px;
    --shadow: 0 4px 24px rgba(0,0,0,0.07);
    --shadow-hover: 0 10px 40px rgba(0,0,0,0.13);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-size: 16px;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--accent-light); text-decoration: underline; }

.container { width: 90%; max-width: 1080px; margin: 0 auto; }

/* ─── NAVBAR ────────────────────────────────── */
#navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-h);
    background: rgba(248, 247, 244, 0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: box-shadow .3s;
}
#navbar.scrolled { box-shadow: 0 2px 20px rgba(0,0,0,0.08); }
.nav-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 5%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 2rem;
}
.nav-logo {
    font-family: var(--mono);
    font-weight: 700;
    font-size: 1.16rem;
    color: var(--accent);
    letter-spacing: 2px;
    flex-shrink: 0;
}
.nav-links {
    list-style: none;
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}
.nav-links a {
    color: var(--text);
    font-size: 0.91rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all .2s;
    text-decoration: none;
}
.nav-links a:hover, .nav-links a.active {
    background: var(--accent-glow);
    color: var(--accent);
}
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.26rem;
    cursor: pointer;
    color: var(--text);
    margin-left: auto;
}

/* ─── BUTTONS ───────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.94rem;
    transition: all .25s;
    cursor: pointer;
    text-decoration: none;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(10,102,64,.3);
}
.btn-primary:hover { background: var(--accent-light); transform: translateY(-2px); text-decoration: none; color: #fff; }
.btn-outline {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
}
.btn-outline:hover { background: var(--accent-glow); transform: translateY(-2px); text-decoration: none; }
.btn-sm { padding: 7px 16px; font-size: 0.88rem; }

/* ─── HERO ──────────────────────────────────── */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    padding: var(--nav-h) 20px 80px;
    overflow: hidden;
    background-image: url('image/background2.jpg');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}
.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(91, 117, 155, 0.48) 0%,
        rgba(82, 106, 139, 0.32) 50%,
        rgba(10, 18, 30, 0.46) 100%
    );
    z-index: 0;
}
.hero-bg::before { content: none; }
.hero-content { position: relative; z-index: 1; max-width: 680px; animation: fadeUp .9s ease both; }
.hero-avatar {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255,255,255,0.85);
    box-shadow: 0 0 0 6px rgba(255,255,255,0.12), 0 8px 32px rgba(0,0,0,0.4);
    margin-bottom: 1.5rem;
}
.hero-greeting {
    font-family: var(--mono);
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.hero-name {
    font-size: clamp(2.46rem, 6vw, 4.06rem);
    font-weight: 600;
    line-height: 1.1;
    color: #ffffff;
    margin-bottom: 0.75rem;
    text-shadow: 0 2px 16px rgba(0,0,0,0.35);
}
.hero-title {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.72);
    margin-bottom: 2rem;
    font-weight: 400;
    letter-spacing: 0.3px;
}
.hero-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.scroll-down {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 1.16rem;
    animation: bounce 2s infinite;
    z-index: 1;
}

/* ─── SECTIONS ──────────────────────────────── */
.section { padding: 90px 0; }
.section-alt { background: var(--bg-alt); }
.section-header {
    margin-bottom: 3rem;
}
.section-tag {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.78rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 0.6rem;
}
.section-header h2 {
    font-size: clamp(1.56rem, 3vw, 2.06rem);
    font-weight: 600;
    color: var(--text);
}

/* ─── ABOUT ─────────────────────────────────── */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
    margin-bottom: 3.5rem;
}
.about-text p { margin-bottom: 1rem; color: var(--text); }
.personal-info { margin-top: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.info-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.94rem;
    color: var(--text-muted);
}
.info-item i { color: var(--accent); width: 16px; }

.expertise-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.exp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: all .25s;
}
.exp-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}
.exp-card i {
    font-size: 1.56rem;
    color: var(--accent);
    margin-bottom: 0.6rem;
    display: block;
}
.exp-card h4 { font-size: 0.94rem; font-weight: 600; margin-bottom: 0.3rem; }
.exp-card p { font-size: 0.86rem; color: var(--text-muted); line-height: 1.4; }

/* STATS */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.stat-item { text-align: center; }
.stat-num {
    display: block;
    font-family: var(--mono);
    font-size: 2.56rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.4rem;
}
.stat-label { font-size: 0.86rem; color: var(--text-muted); font-weight: 500; }

/* ─── RESUME ─────────────────────────────────── */
.resume-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}
.resume-col-title {
    font-size: 1.06rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
/* Timeline */
.timeline { position: relative; padding-left: 20px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 4px; top: 8px; bottom: 0;
    width: 2px;
    background: var(--border);
}
.tl-item { position: relative; padding-left: 20px; margin-bottom: 2rem; }
.tl-dot {
    position: absolute;
    left: -12px; top: 6px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-alt);
}
.tl-year {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--accent);
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.3rem;
}
.tl-body h4 { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.2rem; }
.tl-inst { font-size: 0.89rem; color: var(--text-muted); margin-bottom: 0.2rem; }
.tl-gpa { font-family: var(--mono); font-size: 0.84rem; color: var(--accent); margin-bottom: 0.3rem; }
.tl-thesis { font-size: 0.86rem; color: var(--text-muted); line-height: 1.5; }

/* Skills */
.skills-group { display: flex; flex-direction: column; gap: 1rem; }
.skill-label {
    font-size: 0.81rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.4rem;
}
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.skill-tags span {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.84rem;
    color: var(--text);
    transition: all .2s;
}
.skill-tags span:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
}

/* ─── PROJECTS ──────────────────────────────── */
.filter-bar {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}
.filter-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 7px 18px;
    font-size: 0.88rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    color: var(--text);
    font-family: var(--sans);
}
.filter-btn:hover, .filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}
.projects-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
.proj-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    transition: all .3s;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.proj-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: rgba(10,102,64,.3);
    transform: translateY(-4px);
}
.proj-card.hidden { display: none; }
.proj-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.proj-tag {
    font-size: 0.76rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 3px 9px;
    border-radius: 20px;
}
.proj-year {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.proj-card h3 { font-size: 1.06rem; font-weight: 600; color: var(--text); }
.proj-card p { font-size: 0.91rem; color: var(--text-muted); line-height: 1.6; }
.proj-img-video-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    margin-bottom: 0.5rem;
}
.proj-img-video-row img {
    flex: 2;
    min-width: 0;
    border-radius: 6px;
    object-fit: contain;
}
.proj-img-video-row .local-video-wrap {
    flex: 2;
    min-width: 0;
}
.proj-videos {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.5rem;
}
.proj-videos iframe,
.proj-videos video {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 6px;
    background: #000;
    object-fit: contain;
}
.shorts-wrap iframe {
    aspect-ratio: 9/16;
}
.local-video-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.local-video-wrap video {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 6px;
    background: #000;
    object-fit: contain;
}
.video-caption {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}
.video-yt-link {
    font-size: 0.78rem;
    color: #ff4444;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
}
.print-thumb { display: none; }
.print-url   { display: none; }
.video-yt-link:hover {
    text-decoration: underline;
}
.proj-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    justify-items: center;
    align-items: center;
}
.proj-images img {
    width: 100%;
    border-radius: 6px;
    object-fit: cover;
    aspect-ratio: 4/3;
}
.proj-tasks {
    margin: 0.4rem 0 0.2rem 1.1rem;
    padding: 0;
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}
.proj-links {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.proj-links a {
    font-size: 0.84rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent);
    background: var(--accent-glow);
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    transition: all .2s;
}
.proj-links a:hover { background: var(--accent); color: #fff; text-decoration: none; }
.proj-location {
    font-size: 0.84rem;
    color: var(--text-muted) !important;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: auto;
}
.proj-location i { color: var(--accent); font-size: 0.76rem; }

/* ─── NEWS ──────────────────────────────────── */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 3rem;
}
.news-item {
    display: grid;
    grid-template-columns: 70px 1fr;
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    transition: all .25s;
}
.news-item:hover { box-shadow: var(--shadow); border-color: rgba(10,102,64,.25); }
.news-date {
    font-family: var(--mono);
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--accent);
    padding-top: 2px;
}
.news-body h4 { font-size: 0.98rem; font-weight: 600; margin-bottom: 0.3rem; }
.news-body p { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.news-body a { font-size: 0.86rem; font-weight: 600; }

/* Conferences */
.conf-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}
.conf-section h3 {
    font-size: 1.06rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.conf-list {
    padding-left: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.75rem;
}
.conf-list li {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
}
.conf-gallery {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}
.conf-img-wrap {
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    border-radius: calc(var(--radius) - 4px);
    border: 1px solid var(--border);
}
.conf-img-wrap img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.conf-img-wrap:hover img { transform: scale(1.04); }
.conf-img-wrap span {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    padding: 0.3rem 0.5rem 0.4rem;
    background: var(--surface);
}

/* Publications */
.pubs-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.pubs-section h3 {
    font-size: 1.06rem;
    font-weight: 600;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}
.pubs-list {
    padding-left: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}
.pubs-list li {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
}
.pubs-list li em { color: var(--text-muted); }

/* ─── CONTACT ───────────────────────────────── */
.contact-sub {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 1.01rem;
}
.contact-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}
.contact-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem 1rem;
    text-decoration: none;
    transition: all .25s;
    color: var(--text);
}
.contact-card i {
    font-size: 1.81rem;
    color: var(--accent);
}
.contact-card span { font-size: 0.88rem; font-weight: 500; text-align: center; }
.contact-card:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    box-shadow: var(--shadow-hover);
    transform: translateY(-4px);
    text-decoration: none;
}
.contact-card:hover i, .contact-card:hover span { color: #fff; }

/* ─── FOOTER ─────────────────────────────────── */
footer {
    background: var(--text);
    color: rgba(255,255,255,.5);
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.88rem;
}

/* ─── ANIMATIONS ─────────────────────────────── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(8px); }
}

/* Fade-in on scroll */
.fade-in {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .6s ease, transform .6s ease;
}
.fade-in.visible { opacity: 1; transform: none; }

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 900px) {
    .about-grid { grid-template-columns: 1fr; gap: 2rem; }
    .expertise-cards { grid-template-columns: 1fr 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .resume-grid { grid-template-columns: 1fr; }
    .projects-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr 1fr; }
    .conf-gallery { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: var(--nav-h); left: 0; right: 0; background: var(--bg); padding: 1rem; border-bottom: 1px solid var(--border); }
    .nav-links.open { display: flex; }
    .nav-toggle { display: block; }
    .expertise-cards { grid-template-columns: 1fr; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .proj-videos { grid-template-columns: 1fr; }
    .proj-images { grid-template-columns: repeat(2, 1fr); }
    .conf-gallery { grid-template-columns: repeat(2, 1fr); }
    .contact-grid { grid-template-columns: 1fr 1fr; }
    .news-item { grid-template-columns: 50px 1fr; gap: 1rem; }
    .hero-name { font-size: 2.26rem; }
}