/* =====================================================
   Long Nguyễn — Resume · Microsoft Fluent-inspired
   Dark + Light themes via CSS custom properties
   ===================================================== */

/* ---------- Theme tokens ---------- */
:root {
    --accent:          #0078d4;
    --accent-light:    #38bdf8;
    --accent-gradient: linear-gradient(135deg, #0078d4, #38bdf8);
    --radius:          14px;
    --radius-sm:       10px;
    --nav-height:      68px;
    --transition:      0.25s cubic-bezier(.4, 0, .2, 1);
    --font:            'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

:root[data-theme="dark"] {
    --bg:           #0b1220;
    --bg-alt:       #0e1628;
    --bg-card:      rgba(255, 255, 255, 0.035);
    --bg-card-hover:rgba(255, 255, 255, 0.06);
    --bg-nav:       rgba(11, 18, 32, 0.85);
    --text:         #eef2f8;
    --text-body:    #c3cbd9;
    --text-muted:   #8b96a8;
    --border:       rgba(255, 255, 255, 0.07);
    --border-hover: rgba(56, 189, 248, 0.35);
    --shadow:       0 12px 40px rgba(0, 0, 0, 0.45);
    --shadow-sm:    0 4px 16px rgba(0, 0, 0, 0.3);
    --glow:         0 8px 32px rgba(0, 120, 212, 0.35);
    --hero-grad-1:  rgba(0, 120, 212, 0.16);
    --hero-grad-2:  rgba(56, 189, 248, 0.10);
    --tag-bg:       rgba(56, 189, 248, 0.09);
    --tag-text:     #7dd3fc;
    --quote-bg:     rgba(0, 120, 212, 0.08);
}

:root[data-theme="light"] {
    --bg:           #f7f9fc;
    --bg-alt:       #eef2f8;
    --bg-card:      #ffffff;
    --bg-card-hover:#ffffff;
    --bg-nav:       rgba(247, 249, 252, 0.85);
    --text:         #0f1c2e;
    --text-body:    #37465c;
    --text-muted:   #64748b;
    --border:       rgba(15, 28, 46, 0.08);
    --border-hover: rgba(0, 120, 212, 0.4);
    --shadow:       0 12px 40px rgba(15, 28, 46, 0.10);
    --shadow-sm:    0 4px 16px rgba(15, 28, 46, 0.06);
    --glow:         0 8px 28px rgba(0, 120, 212, 0.25);
    --hero-grad-1:  rgba(0, 120, 212, 0.10);
    --hero-grad-2:  rgba(56, 189, 248, 0.08);
    --tag-bg:       rgba(0, 120, 212, 0.08);
    --tag-text:     #0369a1;
    --quote-bg:     rgba(0, 120, 212, 0.05);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-height); }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-body);
    font-size: 0.975rem;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    transition: background var(--transition), color var(--transition);
    overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

::selection { background: rgba(0, 120, 212, 0.35); color: #fff; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #0078d4, #38bdf8); border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: #0078d4 transparent; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem; font-weight: 600;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
}
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: var(--glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(0, 120, 212, 0.5); }
.btn-outline {
    border-color: var(--border);
    color: var(--text);
    background: var(--bg-card);
}
.btn-outline:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.btn-sm { padding: 0.5rem 1.1rem; font-size: 0.82rem; }

/* ---------- Navbar ---------- */
.navbar {
    position: fixed; inset: 0 0 auto 0;
    height: var(--nav-height);
    background: var(--bg-nav);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    z-index: 100;
    transition: transform 0.35s ease, background var(--transition);
}
.navbar.nav-hidden { transform: translateY(-100%); }
.nav-inner {
    max-width: 1120px; margin: 0 auto; height: 100%;
    padding: 0 1.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.nav-logo { font-size: 1.35rem; font-weight: 800; color: var(--text); letter-spacing: -0.5px; }
.logo-dot { color: var(--accent-light); }
.nav-links { display: flex; gap: 1.75rem; }
.nav-link {
    position: relative;
    font-size: 0.875rem; font-weight: 500;
    color: var(--text-muted);
    padding: 0.25rem 0;
    transition: color var(--transition);
}
.nav-link::after {
    content: ''; position: absolute; left: 0; bottom: -2px;
    width: 0; height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
    width: 38px; height: 38px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--border-hover); transform: rotate(15deg); }
:root[data-theme="dark"] .icon-moon { display: none; }
:root[data-theme="light"] .icon-sun { display: none; }

.hamburger { display: none; flex-direction: column; gap: 5px; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--transition); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex; align-items: center; justify-content: center;
    text-align: center;
    padding: calc(var(--nav-height) + 2rem) 0 4rem;
    overflow: hidden;
}
.hero-bg {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 60% 50% at 20% 20%, var(--hero-grad-1), transparent 65%),
        radial-gradient(ellipse 55% 45% at 80% 75%, var(--hero-grad-2), transparent 65%);
}
.hero-content { position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 0.6rem;
    padding: 0.45rem 1.1rem;
    border-radius: 999px;
    border: 1px solid var(--border-hover);
    background: var(--bg-card);
    font-size: 0.82rem; font-weight: 600;
    color: var(--text);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}
.badge-pulse {
    width: 8px; height: 8px; border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70%  { box-shadow: 0 0 0 9px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.hero-name {
    font-size: clamp(2.75rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: -2px;
    line-height: 1.05;
    color: var(--text);
}
.hero-title {
    font-size: clamp(1.25rem, 3vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-top: 0.75rem;
    color: var(--text);
}
.grad-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.hero-subtitle {
    max-width: 640px;
    margin: 1.5rem auto 0;
    font-size: 1.05rem;
    color: var(--text-muted);
}
.hero-meta {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 0.6rem 0.9rem;
    margin-top: 1.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}
.meta-dot { color: var(--accent-light); }
.hero-cta { display: flex; justify-content: center; gap: 1rem; margin-top: 2.5rem; }

.scroll-indicator {
    position: absolute; bottom: 2rem; left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    animation: bounce 2s infinite;
    z-index: 1;
}
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, 8px); }
    60% { transform: translate(-50%, 4px); }
}

/* ---------- Sections ---------- */
.section { padding: 6rem 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
    font-size: 2rem; font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--text);
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.9rem;
}
.section-title::after {
    content: ''; position: absolute; left: 0; bottom: 0;
    width: 60px; height: 4px;
    border-radius: 2px;
    background: var(--accent-gradient);
}
.section-intro { max-width: 640px; color: var(--text-muted); margin-bottom: 2.5rem; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 3rem; margin-top: 2rem; align-items: start; }
.about-text p { margin-bottom: 1.25rem; }
.about-text strong { color: var(--text); }
.about-highlight {
    border-left: 3px solid var(--accent);
    background: var(--quote-bg);
    padding: 1.1rem 1.4rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-style: italic;
    color: var(--text);
    margin-top: 1.5rem;
}
.about-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.stat-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.stat-number {
    display: block;
    font-size: 1.9rem; font-weight: 800;
    letter-spacing: -1px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.stat-number em { font-style: normal; font-size: 1.1rem; }
.stat-label { display: block; font-size: 0.8rem; color: var(--text-muted); margin-top: 0.35rem; line-height: 1.5; }

/* ---------- Timeline ---------- */
.timeline { position: relative; max-width: 760px; margin: 2.5rem auto 0; padding-left: 2.25rem; }
.timeline::before {
    content: ''; position: absolute; left: 8px; top: 6px; bottom: 6px;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-light));
    opacity: 0.35;
    border-radius: 2px;
}
.timeline-item { position: relative; padding-bottom: 2rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-marker {
    position: absolute; left: -2.25rem; top: 6px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--bg);
    border: 3px solid var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 120, 212, 0.15);
}
.marker-future { border-color: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.15); }
.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.timeline-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.card-future { border-color: rgba(34, 197, 94, 0.35); }
.timeline-year {
    display: inline-block;
    font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.5px; text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 0.4rem;
}
.timeline-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 0.4rem; }
.timeline-card p { font-size: 0.9rem; color: var(--text-muted); }

/* ---------- Skills ---------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.skill-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.skill-icon { font-size: 1.6rem; margin-bottom: 0.75rem; }
.skill-card h3 { font-size: 1.02rem; font-weight: 700; color: var(--text); margin-bottom: 0.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tags span {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem; font-weight: 500;
    background: var(--tag-bg);
    color: var(--tag-text);
    border: 1px solid transparent;
    transition: border-color var(--transition);
}
.tags span:hover { border-color: var(--border-hover); }
.lang-bar {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}
.lang-bar strong { color: var(--text); }

/* ---------- Certifications ---------- */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.cert-card {
    display: flex; gap: 1.1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.cert-card:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.cert-icon {
    flex-shrink: 0;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    border-radius: var(--radius-sm);
    background: var(--tag-bg);
}
.cert-body h3 { font-size: 0.98rem; font-weight: 700; color: var(--text); line-height: 1.4; }
.cert-status {
    display: inline-block;
    margin: 0.5rem 0;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.4px; text-transform: uppercase;
}
.status-progress { background: rgba(34, 197, 94, 0.12); color: #22c55e; }
.status-planned  { background: rgba(56, 189, 248, 0.12); color: var(--accent-light); }
.cert-body p { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Projects ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    display: flex; flex-direction: column;
}
.project-card:hover { transform: translateY(-5px); border-color: var(--border-hover); box-shadow: var(--shadow); }
.project-media {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--bg-alt);
}
.project-media img {
    width: 100%; height: 100%;
    object-fit: cover; object-position: top;
    transition: transform 0.5s ease;
}
.project-card:hover .project-media img { transform: scale(1.05); }
.project-media .media-placeholder {
    width: 100%; height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem;
    background: linear-gradient(135deg, rgba(0,120,212,0.25), rgba(99,102,241,0.3));
    font-size: 3rem;
}
.media-placeholder small { font-size: 0.8rem; font-weight: 600; color: var(--text); opacity: 0.8; }
.project-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: rgba(6, 12, 24, 0.62);
    color: #fff; font-weight: 700; font-size: 0.95rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.project-card:hover .project-overlay { opacity: 1; }
.project-body { padding: 1.4rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: 0.7rem; flex: 1; }
.project-flag {
    align-self: flex-start;
    font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.6px;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: var(--accent-gradient);
    color: #fff;
}
.project-body h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.project-body > p { font-size: 0.875rem; color: var(--text-muted); flex: 1; }

/* ---------- Experience ---------- */
.exp-list { display: flex; flex-direction: column; gap: 1.25rem; margin-top: 2rem; }
.exp-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.exp-card:hover { border-color: var(--border-hover); transform: translateY(-2px); }
.exp-head {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 1rem; flex-wrap: wrap;
    margin-bottom: 1rem;
}
.exp-head h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.exp-company { font-size: 0.875rem; color: var(--accent-light); font-weight: 600; }
.exp-period {
    font-size: 0.78rem; font-weight: 700;
    padding: 0.3rem 0.85rem;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    white-space: nowrap;
}
.exp-card ul { display: flex; flex-direction: column; gap: 0.5rem; }
.exp-card li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.9rem;
    color: var(--text-body);
}
.exp-card li::before {
    content: '▸';
    position: absolute; left: 0;
    color: var(--accent-light);
}

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.25rem; margin-top: 2rem; }
.contact-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.9rem 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.contact-card:hover { transform: translateY(-4px); border-color: var(--border-hover); box-shadow: var(--shadow); }
.contact-icon { font-size: 1.7rem; }
.contact-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--text-muted); }
.contact-value { font-size: 0.88rem; font-weight: 600; color: var(--text); word-break: break-word; }

/* ---------- Footer ---------- */
.footer {
    border-top: 1px solid var(--border);
    padding: 2.25rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---------- Project modal ---------- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(4, 8, 16, 0.72);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex; align-items: center; justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.modal-backdrop[hidden] { display: none; }
.modal-backdrop.show { opacity: 1; }
.modal {
    position: relative;
    width: min(760px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transform: translateY(16px) scale(0.98);
    transition: transform 0.25s ease;
}
.modal-backdrop.show .modal { transform: translateY(0) scale(1); }
.modal-close {
    position: absolute; top: 0.9rem; right: 0.9rem;
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    z-index: 2;
    transition: all var(--transition);
}
.modal-close:hover { border-color: var(--border-hover); transform: rotate(90deg); }
.modal-media {
    display: flex; gap: 0.75rem;
    padding: 1rem 1rem 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
}
.modal-media img {
    height: 280px;
    width: calc(50% - 0.375rem);
    min-width: 260px;
    flex-shrink: 0;
    object-fit: cover; object-position: top;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    scroll-snap-align: start;
}
.modal-media img:only-child { width: 100%; }
.modal-media:empty { display: none; }
.modal-body { padding: 1.9rem 2.1rem 2.3rem; }
.modal-body h3 { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.4px; color: var(--text); margin-bottom: 0.9rem; }
.modal-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.4rem; }
.modal-tags span {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem; font-weight: 500;
    background: var(--tag-bg);
    color: var(--tag-text);
}
.modal-section { margin-bottom: 1.2rem; }
.modal-section h4 {
    font-size: 0.78rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--accent-light);
    margin-bottom: 0.35rem;
}
.modal-section p { font-size: 0.92rem; color: var(--text-body); }
body.modal-open { overflow: hidden; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease-out, transform 0.6s ease-out; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .section { padding: 4rem 0; }
    #downloadPdf { display: none; }
    .hamburger { display: flex; }
    .nav-links {
        position: fixed;
        top: var(--nav-height); left: 0; right: 0;
        flex-direction: column; gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        max-height: 0; overflow: hidden;
        transition: max-height 0.35s ease;
    }
    .nav-links.open { max-height: 400px; }
    .nav-links li { border-top: 1px solid var(--border); }
    .nav-link { display: block; padding: 0.9rem 1.5rem; }
    .nav-link::after { display: none; }
    .timeline { padding-left: 2rem; }
    .exp-card { padding: 1.4rem 1.5rem; }
    .modal-body { padding: 1.5rem 1.4rem 1.9rem; }
}

@media (max-width: 480px) {
    .hero-cta { flex-direction: column; align-items: stretch; padding: 0 1rem; }
    .hero-name { letter-spacing: -1px; }
    .contact-grid { grid-template-columns: 1fr; }
    .about-stats { gap: 0.75rem; }
}

/* =====================================================
   V2 additions: cursor, roles, roadmap, typewriter, i18n
   ===================================================== */

/* ---------- Custom cursor ---------- */
body.custom-cursor, body.custom-cursor * { cursor: none !important; }
.cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    display: none;
}
body.custom-cursor .cursor-dot, body.custom-cursor .cursor-ring { display: block; }
.cursor-dot {
    width: 7px; height: 7px;
    margin: -3.5px 0 0 -3.5px;
    background: var(--accent-light);
}
.cursor-ring {
    width: 34px; height: 34px;
    margin: -17px 0 0 -17px;
    border: 1.5px solid var(--accent);
    opacity: 0.7;
    transition: width 0.25s ease, height 0.25s ease, margin 0.25s ease, opacity 0.25s ease, border-color 0.25s ease;
}
.cursor-ring.cursor-hover {
    width: 54px; height: 54px;
    margin: -27px 0 0 -27px;
    opacity: 0.9;
    border-color: var(--accent-light);
    background: rgba(56, 189, 248, 0.08);
}
.cursor-ring.cursor-down {
    width: 24px; height: 24px;
    margin: -12px 0 0 -12px;
}
.click-ripple {
    position: fixed;
    width: 12px; height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    border: 2px solid var(--accent-light);
    pointer-events: none;
    z-index: 9998;
    animation: ripple 0.6s ease-out forwards;
}
@keyframes ripple {
    from { opacity: 0.8; transform: scale(1); }
    to   { opacity: 0;   transform: scale(6); }
}

/* ---------- Language toggle ---------- */
.lang-toggle {
    display: inline-flex; align-items: center; gap: 4px;
    height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-family: var(--font);
    font-size: 0.78rem; font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color var(--transition);
}
.lang-toggle:hover { border-color: var(--border-hover); }
.lang-sep { opacity: 0.4; }
.lang-opt.active { color: var(--accent-light); }

/* ---------- Hero greeting + typewriter ---------- */
.hero-greeting {
    font-size: 0.85rem; font-weight: 700;
    letter-spacing: 2.5px; text-transform: uppercase;
    color: var(--accent-light);
    margin-bottom: 0.5rem;
}
.hero-typewriter {
    margin-top: 1.1rem;
    font-size: 1.05rem; font-weight: 600;
    color: var(--text-muted);
}
.typewriter-text { color: var(--text); margin-left: 0.35rem; }
.typewriter-caret {
    color: var(--accent-light);
    animation: blink 1s step-end infinite;
    font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- Roles grid ---------- */
.roles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}
.role-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.6rem 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.role-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.role-icon { font-size: 1.7rem; margin-bottom: 0.7rem; }
.role-card h3 { font-size: 0.98rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; line-height: 1.4; }
.role-card p { font-size: 0.84rem; color: var(--text-muted); line-height: 1.65; }

/* ---------- Learning roadmap ---------- */
.roadmap-title {
    margin-top: 3.5rem;
    font-size: 1.2rem; font-weight: 800;
    color: var(--text);
    text-align: center;
}
.roadmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1rem;
    margin-top: 1.75rem;
    position: relative;
}
.roadmap-step {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem 1.3rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.roadmap-step:hover { transform: translateY(-3px); border-color: var(--border-hover); }
.roadmap-num {
    position: absolute; top: -14px; left: 1.1rem;
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.8rem; font-weight: 800;
    box-shadow: var(--glow);
}
.roadmap-phase {
    font-size: 0.68rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.7px;
    color: var(--accent-light);
}
.roadmap-body h4 { font-size: 0.95rem; font-weight: 700; color: var(--text); margin: 0.15rem 0 0.7rem; }

/* ---------- Modal links ---------- */
.modal-links { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.4rem; }
.modal-links h4 {
    width: 100%;
    font-size: 0.78rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--accent-light);
    margin-bottom: 0.1rem;
}
.modal-links .btn { font-size: 0.78rem; }

/* ---------- Tilt cards: fast transform response after reveal ---------- */
.tilt.visible { transition: opacity 0.6s ease-out, transform 0.16s ease-out, border-color var(--transition), box-shadow var(--transition); }

/* ---------- Hero bg parallax smoothing ---------- */
.hero-bg { transition: transform 0.35s ease-out; will-change: transform; }

/* ---------- Magnetic buttons ---------- */
.magnetic { transition: transform 0.2s ease-out, box-shadow var(--transition), border-color var(--transition); will-change: transform; }

@media (max-width: 768px) {
    .roles-grid { grid-template-columns: 1fr 1fr; }
    .roadmap { grid-template-columns: 1fr 1fr; row-gap: 1.6rem; }
}
@media (max-width: 480px) {
    .roles-grid { grid-template-columns: 1fr; }
    .roadmap { grid-template-columns: 1fr; }
}

/* =====================================================
   V3 additions: cert badges, core tags, progress bar
   ===================================================== */

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
    position: fixed; top: 0; left: 0;
    height: 3px; width: 0;
    background: var(--accent-gradient);
    z-index: 200;
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(0, 120, 212, 0.6);
}

/* ---------- Skills legend + core tags ---------- */
.skills-legend { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.5rem; }
.tags .tag-core {
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    font-size: 0.76rem; font-weight: 700;
    background: var(--accent-gradient);
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 2px 10px rgba(0, 120, 212, 0.35);
}

/* ---------- Subsection titles ---------- */
.subsection-title {
    font-size: 1.05rem; font-weight: 800;
    color: var(--text);
    margin: 2.25rem 0 1.4rem;
    display: flex; align-items: center; gap: 0.6rem;
}
.subsection-title::after {
    content: ''; flex: 1; height: 1px;
    background: var(--border);
}

/* ---------- Microsoft cert badge cards ---------- */
.mscert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
.mscert-card {
    display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.45rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem 1.4rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
}
.mscert-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow); }
.mscert-logo { line-height: 0; margin-bottom: 0.2rem; }
.mscert-code {
    font-size: 1.15rem; font-weight: 800; letter-spacing: -0.3px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.mscert-name { font-size: 0.8rem; font-weight: 600; color: var(--text); line-height: 1.35; min-height: 2.2em; }
.status-done { background: rgba(34, 197, 94, 0.12); color: #22c55e; }

/* ---------- Roadmap phase statuses ---------- */
.roadmap-step.step-done { border-color: rgba(34, 197, 94, 0.3); }
.roadmap-step.step-done .roadmap-num { background: linear-gradient(135deg, #16a34a, #22c55e); box-shadow: 0 4px 14px rgba(34, 197, 94, 0.4); }
.roadmap-step.step-current { border-color: var(--border-hover); }
.roadmap-step.step-current .roadmap-num { animation: pulse 2s infinite; }

/* =====================================================
   V4: contact CTA panel
   ===================================================== */
.contact-panel {
    position: relative;
    margin-top: 2rem;
    padding: 2.75rem 2.5rem 2.25rem;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border-hover);
    border-radius: 22px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.contact-glow {
    position: absolute; inset: 0; pointer-events: none;
    background:
        radial-gradient(ellipse 70% 60% at 50% -20%, var(--hero-grad-1), transparent 70%),
        radial-gradient(ellipse 50% 45% at 85% 110%, var(--hero-grad-2), transparent 70%);
}
.contact-panel > *:not(.contact-glow) { position: relative; z-index: 1; }
.contact-intro {
    max-width: 640px;
    margin: 0 auto;
    font-size: 1rem;
    color: var(--text-body);
}
.contact-roles-label {
    margin-top: 1.75rem;
    font-size: 0.72rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.2px;
    color: var(--accent-light);
}
.contact-roles {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}
.contact-role-chip {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem; font-weight: 600;
    color: var(--text);
    background: var(--tag-bg);
    border: 1px solid transparent;
    transition: all var(--transition);
}
.contact-role-chip:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 120, 212, 0.25);
}
.contact-cta {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0.9rem;
    margin-top: 1.9rem;
}
.contact-info {
    display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
    gap: 0.75rem 1.75rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text-muted);
}
.contact-info-item { display: inline-flex; align-items: center; gap: 0.45rem; }
.contact-email {
    background: none; border: none;
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    transition: color var(--transition);
}
.contact-email:hover { color: var(--text); }
.contact-email span:first-of-type { font-weight: 600; color: var(--text); }
.copy-hint {
    font-size: 0.68rem; font-weight: 700;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    transition: all var(--transition);
}
.copy-hint.copied { background: rgba(34, 197, 94, 0.15); color: #22c55e; }

@media (max-width: 600px) {
    .contact-panel { padding: 2rem 1.25rem 1.75rem; }
    .contact-cta { flex-direction: column; align-items: stretch; }
    .contact-info { flex-direction: column; gap: 0.6rem; }
}

/* ---------- Print (Download CV) ---------- */
@media print {
    :root[data-theme="dark"], :root[data-theme="light"] {
        --bg: #fff; --bg-alt: #fff; --bg-card: #fff;
        --text: #111; --text-body: #333; --text-muted: #555;
        --border: #ddd; --shadow: none; --shadow-sm: none; --glow: none;
    }
    .navbar, .scroll-indicator, .hero-bg, .modal-backdrop, .hero-cta, .footer { display: none !important; }
    .hero { min-height: auto; padding: 1rem 0; }
    .section { padding: 1.25rem 0; page-break-inside: avoid; }
    .reveal { opacity: 1 !important; transform: none !important; }
    .project-overlay { display: none; }
    body { font-size: 11pt; }
}
