/* Bố cục theo trang mẫu: mỗi mục một màn hình (cuộn bám mục trên desktop), chấm chuyển mục bên phải,
   nút Hỏi đáp dọc ở mép phải. Màu lấy từ ảnh profile: nền xanh da trời, áo xanh coban, điểm cam. */
:root {
    --bg: #06121e;
    --bg-2: #0a1a2a;
    --surface: #0d1f33;
    --surface-2: #132a43;
    --line: #1e3a56;
    --fg: #e8f4fa;
    --muted: #9fbccb;
    --faint: #6d8a9c;
    --sky: #8fd0ee;
    --accent: #4d9dff;
    --accent-strong: #2a73e8;
    --accent-soft: rgba(77, 157, 255, 0.14);
    --warm: #ffa64d;
    --warm-soft: rgba(255, 166, 77, 0.14);
    --ok: #4fd1a5;

    --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
    --wrap: 1160px;
    --radius: 18px;
    --nav-h: 64px;
    color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
    font: 400 16px/1.65 var(--font);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--accent-strong); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.glow {
    position: fixed;
    width: 620px;
    height: 620px;
    border-radius: 50%;
    top: -240px;
    left: -200px;
    background: radial-gradient(circle, rgba(77, 157, 255, 0.16), rgba(255, 166, 77, 0.04) 45%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
main { position: relative; z-index: 1; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* ── Nav ─────────────────────────────────────────── */
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: env(safe-area-inset-top, 0px);
    z-index: 21;
    background: rgba(6, 18, 30, 0.85);
}
.nav {
    position: fixed;
    top: env(safe-area-inset-top, 0px);
    left: 0;
    right: 0;
    z-index: 20;
    height: var(--nav-h);
    background: rgba(6, 18, 30, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(30, 58, 86, 0.6);
}
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { font: 800 21px/1 var(--font); letter-spacing: -0.02em; color: var(--accent); }
.logo span { color: var(--warm); }
.menu { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.menu a { display: block; padding: 8px 14px; border-radius: 10px; color: var(--muted); font-size: 15px; font-weight: 500; transition: color 0.15s, text-shadow 0.15s; }
.menu a:hover { color: var(--fg); }
.menu a.active { color: var(--fg); text-shadow: 0 0 18px rgba(77, 157, 255, 0.9); }
.menu .cta a { background: var(--accent-strong); color: #fff; margin-left: 10px; padding: 8px 18px; text-shadow: none; }
.menu .cta a:hover { background: var(--accent); }
.burger {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--fg);
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.burger svg { width: 20px; height: 20px; }

/* Chấm chuyển mục */
.dots {
    position: fixed;
    right: max(18px, env(safe-area-inset-right, 0px));
    top: 50%;
    transform: translateY(-50%);
    z-index: 15;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.dots a { width: 9px; height: 9px; border-radius: 99px; background: rgba(159, 188, 203, 0.28); transition: height 0.25s, background 0.25s; }
.dots a:hover { background: rgba(159, 188, 203, 0.6); }
.dots a.active { height: 24px; background: linear-gradient(var(--accent), var(--warm)); }

/* ── Khung mục ───────────────────────────────────── */
.slide {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-block: calc(var(--nav-h) + 40px) 56px;
}
@media (min-width: 1024px) and (min-height: 700px) {
    html { scroll-snap-type: y mandatory; }
    .slide { scroll-snap-align: start; height: 100vh; min-height: 0; }
}

.head { text-align: center; margin-bottom: 52px; display: grid; justify-items: center; gap: 10px; }
.eyebrow { margin: 0; font: 700 13px/1 var(--font); letter-spacing: 0.22em; text-transform: uppercase; color: var(--warm); }
h1, h2, h3 { margin: 0; font-family: var(--font); text-wrap: balance; }
h2 { font-size: clamp(30px, 4.4vw, 46px); line-height: 1.12; font-weight: 800; letter-spacing: -0.02em; }
.bar { width: 60px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--warm)); margin-top: 8px; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 26px;
    border-radius: 12px;
    font: 700 15.5px/1 var(--font);
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
}
.btn svg { width: 17px; height: 17px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #fff; box-shadow: 0 14px 36px -12px rgba(42, 115, 232, 0.85); }
.btn-ghost { background: rgba(13, 31, 51, 0.8); color: var(--fg); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-sm { padding: 9px 16px; font-size: 14px; }

/* ── Trang chủ ───────────────────────────────────── */
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 56px; align-items: center; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    border: 1px solid rgba(77, 157, 255, 0.35);
    background: var(--accent-soft);
    color: var(--sky);
    font: 700 13px/1 var(--font);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.pill svg { width: 13px; height: 13px; color: var(--warm); }
.hero h1 { margin-top: 22px; font-size: clamp(42px, 6.2vw, 68px); line-height: 1.06; font-weight: 800; letter-spacing: -0.03em; }
.grad { background: linear-gradient(100deg, var(--sky) 0%, var(--accent) 70%, var(--accent-strong) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.role { margin: 14px 0 0; font: 700 clamp(19px, 2.2vw, 24px)/1.3 var(--font); color: var(--muted); min-height: 1.3em; }
.caret { display: inline-block; width: 2px; height: 1em; background: var(--accent); vertical-align: -3px; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lead { margin: 22px 0 0; color: var(--muted); max-width: 60ch; font-size: 16.5px; line-height: 1.8; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.stat-pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }
.stat-pills span {
    padding: 9px 16px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(13, 31, 51, 0.8);
    color: var(--muted);
    font-size: 14px;
}
.stat-pills b { color: var(--fg); font-weight: 800; margin-right: 4px; font-variant-numeric: tabular-nums; }

.hero-photo { justify-self: end; width: min(320px, 100%); position: relative; }
.hero-photo::before {
    content: "";
    position: absolute;
    inset: -18px;
    border-radius: 44px;
    background: radial-gradient(circle at 50% 30%, rgba(77, 157, 255, 0.35), rgba(255, 166, 77, 0.15) 50%, transparent 72%);
    filter: blur(20px);
    z-index: -1;
}
.hero-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 34px;
    border: 1px solid rgba(143, 208, 238, 0.35);
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

/* ── Kỹ năng ─────────────────────────────────────── */
.skill-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.skill-card {
    background: rgba(13, 31, 51, 0.82);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 30px 28px 32px;
    transition: transform 0.2s, border-color 0.2s;
}
.skill-card:hover { transform: translateY(-4px); border-color: rgba(77, 157, 255, 0.55); }
.skill-card h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font: 800 14px/1.35 var(--font);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 22px;
}
.skill-card h3 svg { width: 19px; height: 19px; flex: none; color: var(--warm); }
.tags { display: flex; flex-wrap: wrap; gap: 9px; }
.tags span {
    padding: 7px 14px;
    border-radius: 9px;
    background: var(--accent-soft);
    border: 1px solid rgba(77, 157, 255, 0.22);
    color: #cfe3f4;
    font-size: 14px;
    font-weight: 500;
}

/* ── Carousel (kinh nghiệm, dự án) ───────────────── */
.carousel { position: relative; }
.track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 2 * 24px) / 3);
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 6px 2px 10px;
    scrollbar-width: none;
}
.track::-webkit-scrollbar { display: none; }
.track > * { scroll-snap-align: start; min-width: 0; }
.nav-btn {
    position: absolute;
    top: calc(50% - 22px);
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: rgba(10, 26, 42, 0.92);
    color: var(--fg);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: opacity 0.2s, border-color 0.2s;
}
.nav-btn:hover { border-color: var(--accent); }
.nav-btn svg { width: 18px; height: 18px; }
.nav-btn.prev { left: -58px; }
.nav-btn.next { right: -58px; }
.nav-btn:disabled { opacity: 0.3; cursor: default; }
.progress { margin-top: 26px; height: 4px; border-radius: 4px; background: rgba(30, 58, 86, 0.7); overflow: hidden; }
.progress span { display: block; height: 100%; width: 40%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--warm)); transition: width 0.3s, margin-left 0.3s; }

.card {
    background: rgba(13, 31, 51, 0.88);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: transform 0.2s, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: rgba(77, 157, 255, 0.55); }

.exp-card { padding: 30px 28px; }
.exp-card .when { font: 500 17px/1.3 var(--font); color: var(--fg); }
.exp-card h3 { font: 500 16px/1.4 var(--font); color: var(--muted); margin-top: 2px; }
.exp-card .org { color: var(--sky); font-size: 15px; }
.exp-card p { margin: 18px 0 0; font-size: 15.5px; line-height: 1.6; }
.exp-card ul { margin: 14px 0 0; padding-left: 18px; display: grid; gap: 9px; font-size: 14.5px; color: #c9dbe7; }
.exp-card li::marker { color: var(--accent); }
.exp-card em { font-style: normal; font-weight: 700; color: var(--warm); }

.proj-card { overflow: hidden; display: flex; flex-direction: column; }
.proj-card .band {
    height: 104px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, rgba(42, 115, 232, 0.35), rgba(13, 31, 51, 0.4) 60%, rgba(255, 166, 77, 0.22));
    border-bottom: 1px solid var(--line);
}
.proj-card .band svg { width: 38px; height: 38px; color: var(--sky); }
.proj-card .body { padding: 22px 24px 24px; display: flex; flex-direction: column; flex: 1; }
.proj-card h3 { font-size: 18px; font-weight: 700; }
.proj-card p { margin: 8px 0 18px; color: var(--muted); font-size: 15px; line-height: 1.65; flex: 1; }
.proj-card .tags span { padding: 4px 10px; font-size: 13px; background: var(--warm-soft); border-color: rgba(255, 166, 77, 0.28); color: #ffd7ae; }
.links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 14px; color: var(--muted); }
.links a { display: inline-flex; align-items: center; gap: 6px; }
.links a:hover { color: var(--sky); }
.links svg { width: 15px; height: 15px; }

/* ── Liên hệ ─────────────────────────────────────── */
.contact { position: relative; }
.contact .wrap { text-align: center; }
.contact-lead { max-width: 64ch; margin: -18px auto 0; color: var(--muted); font-size: 16.5px; line-height: 1.8; }
.contact-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-top: 40px; }
.c-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(13, 31, 51, 0.88);
    text-align: left;
    min-width: 0;
}
.c-card .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: #fff; flex: none; }
.c-card .ico svg { width: 20px; height: 20px; }
.c-card small { display: block; color: var(--muted); font-size: 13px; }
.c-card b { display: block; font-size: 17px; overflow-wrap: anywhere; }
.copy {
    margin-left: 6px;
    font: 600 13px var(--font);
    padding: 7px 12px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--fg);
    cursor: pointer;
}
.copy:hover { border-color: var(--warm); }
.socials { display: flex; justify-content: center; gap: 14px; margin-top: 32px; }
.socials a {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    border: 1px solid var(--line);
    background: rgba(13, 31, 51, 0.88);
    color: var(--muted);
    display: grid;
    place-items: center;
    transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.socials a:hover { color: var(--fg); border-color: var(--accent); transform: translateY(-3px); }
.socials svg { width: 20px; height: 20px; }
.socials .zalo { font: 800 12px/1 var(--font); letter-spacing: 0.02em; }
.contact footer {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px max(20px, env(safe-area-inset-right, 0px)) calc(22px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px));
    border-top: 1px solid rgba(30, 58, 86, 0.6);
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}
.contact footer b { color: var(--accent); }

/* ── Nút & khung Hỏi đáp ─────────────────────────── */
.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--fg);
    cursor: pointer;
    display: inline-grid;
    place-items: center;
    flex: none;
}
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 18px; height: 18px; }

.chat-tab {
    position: fixed;
    right: 0;
    bottom: calc(40px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 10px calc(16px) 10px;
    padding-right: calc(10px + env(safe-area-inset-right, 0px));
    border: 0;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, var(--accent), var(--accent-strong));
    color: #fff;
    cursor: pointer;
    box-shadow: 0 14px 40px -12px rgba(42, 115, 232, 0.9);
}
.chat-tab svg { width: 20px; height: 20px; }
.chat-tab span { writing-mode: vertical-rl; font: 800 12px/1 var(--font); letter-spacing: 0.18em; text-transform: uppercase; }
.chat-tab[aria-expanded="true"] { background: linear-gradient(180deg, var(--warm), #e9862c); }

.chat-panel {
    position: fixed;
    right: calc(64px + env(safe-area-inset-right, 0px));
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    z-index: 31;
    width: min(380px, calc(100vw - 96px));
    height: min(560px, calc(100vh - 120px));
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 90px -20px rgba(0, 0, 0, 0.8);
}
.chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.chat-head img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.chat-head div { flex: 1; min-width: 0; }
.chat-head b { display: block; font-size: 14.5px; }
.chat-head small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.chat-head small i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.msg-b { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }
.msg-b.bot { background: var(--surface-2); border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.msg-b.me { background: var(--accent-strong); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.msg-b b { color: var(--sky); }
.msg-b.me b { color: #fff; }
.msg-b a { color: var(--warm); text-decoration: underline; }
.chat-suggest { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.chat-suggest button {
    font: 500 12.5px/1 var(--font);
    padding: 8px 10px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--fg);
    cursor: pointer;
}
.chat-suggest button:hover { border-color: var(--accent); }
.chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-input input {
    flex: 1;
    min-width: 0;
    font: 14px var(--font);
    color: var(--fg);
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 9px 12px;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input .send { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

/* ── Xem trước CV ────────────────────────────────── */
.modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(3, 10, 18, 0.8);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
}
.modal-box {
    width: min(860px, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 40px 120px -30px rgba(0, 0, 0, 0.85);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; }
.modal-actions { display: flex; align-items: center; gap: 10px; }
.modal-body { overflow: auto; padding: 16px; background: var(--bg-2); }
.modal-body img { display: block; width: 100%; height: auto; border-radius: 6px; background: #fff; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 1300px) {
    .nav-btn.prev { left: -6px; }
    .nav-btn.next { right: -6px; }
}
@media (max-width: 1023px) {
    .hero .wrap { grid-template-columns: minmax(0, 1fr); gap: 40px; }
    .hero-photo { justify-self: start; width: min(240px, 62%); order: -1; }
    .hero-photo img { border-radius: 26px; }
    .skill-cards { grid-template-columns: minmax(0, 1fr); }
    .track { grid-auto-columns: calc((100% - 24px) / 2); }
    .dots { display: none; }
    .contact { padding-bottom: 110px; }
}
@media (max-width: 760px) {
    .burger { display: inline-flex; }
    .menu {
        position: absolute;
        top: var(--nav-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 10px max(20px, env(safe-area-inset-right, 0px)) 16px max(20px, env(safe-area-inset-left, 0px));
        background: rgba(6, 18, 30, 0.97);
        border-bottom: 1px solid var(--line);
        display: none;
    }
    .menu.open { display: flex; }
    .menu a { padding: 12px; }
    .menu .cta a { margin: 6px 0 0; text-align: center; }
    .slide { padding-block: calc(var(--nav-h) + 28px) 48px; }
    .head { margin-bottom: 36px; }
    .track { grid-auto-columns: 88%; }
    .nav-btn { display: none; }
    .c-card { width: 100%; }
    .chat-tab { padding: 12px 8px; }
    .chat-tab span { display: none; }
    .chat-panel { right: max(12px, env(safe-area-inset-right, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); width: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

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