/* =========================================================
   CV — Võ Lê Nhứt Nguyên · devnguyen.xyz/cv
   Static, no build step. Light + dark + print.
   ========================================================= */

:root {
  --bg:            #f8f8f6;
  --bg-soft:       #f1f1ed;
  --surface:       #ffffff;
  --surface-2:     #fbfbf9;
  --text:          #0e1418;
  --text-2:        #39454f;
  --muted:         #66727e;
  --line:          #e5e5e0;
  --line-strong:   #d4d6d0;
  --accent:        #0f7a62;
  --accent-2:      #1789a8;
  --accent-ink:    #0a5b49;
  --accent-soft:   rgba(15, 122, 98, 0.09);
  --shadow-sm:     0 1px 2px rgba(14, 20, 24, .05), 0 2px 8px rgba(14, 20, 24, .04);
  --shadow-md:     0 14px 34px -14px rgba(14, 20, 24, .16), 0 2px 6px rgba(14, 20, 24, .04);
  --shadow-lg:     0 34px 74px -34px rgba(14, 20, 24, .32);

  --font-sans: "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", SFMono-Regular, Menlo, Consolas, monospace;

  --radius:    18px;
  --radius-sm: 11px;
  --topbar-h:  64px;
  --ease:      cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #090d11;
  --bg-soft:     #0c1116;
  --surface:     #10161d;
  --surface-2:   #0d131a;
  --text:        #e9eef5;
  --text-2:      #c1ccd7;
  --muted:       #8a98a7;
  --line:        #1d2731;
  --line-strong: #29343f;
  --accent:      #4adfc0;
  --accent-2:    #6ec8f2;
  --accent-ink:  #86f2d8;
  --accent-soft: rgba(74, 223, 192, .10);
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .45);
  --shadow-md:   0 18px 40px -18px rgba(0, 0, 0, .78), 0 1px 0 rgba(255, 255, 255, .03) inset;
  --shadow-lg:   0 44px 84px -44px rgba(0, 0, 0, .9);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color .35s var(--ease), color .35s var(--ease);
}

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.025em; font-weight: 600; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; }
li { list-style: none; }
a { color: inherit; text-decoration: none; }
strong { font-weight: 600; color: var(--text); }
img, svg { display: block; }

svg[viewBox] { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

::selection { background: var(--accent); color: #fff; }

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

.wrap { width: min(1140px, 100% - 44px); margin-inline: auto; }

.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 200;
  padding: 10px 16px; border-radius: 8px; background: var(--accent); color: #fff;
  font-size: 14px; transition: top .2s;
}
.skip-link:focus { top: 12px; }

/* ---------- progress bar ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 120;
  background: transparent; pointer-events: none;
}
.progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .1s linear;
}

/* ---------- topbar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background-color .3s;
}
.topbar.is-stuck { border-bottom-color: var(--line); }

.topbar-inner {
  width: min(1140px, 100% - 44px); margin-inline: auto;
  height: 100%; display: flex; align-items: center; gap: 22px;
}

.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-ink);
  font-size: 12.5px; font-weight: 700; letter-spacing: .04em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; }
.brand-text em { font-style: normal; font-size: 10.5px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  position: relative; padding: 7px 12px; border-radius: 999px;
  font-size: 13.5px; color: var(--muted); font-weight: 500;
  transition: color .2s, background-color .2s, box-shadow .2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: var(--accent-soft); }
.nav-link.is-active {
  color: var(--accent-ink); background: var(--accent-soft); font-weight: 600;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent);
}

.topbar-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* language switch (VI / EN) */
.lang {
  display: inline-flex; align-items: center; gap: 1px; padding: 2px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
}
.lang a {
  padding: 5px 8px; border-radius: 7px; color: var(--muted);
  transition: color .2s, background-color .2s;
}
.lang a:hover { color: var(--text); }
.lang a.is-on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 500; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--text-2);
  cursor: pointer; transition: transform .2s var(--ease), border-color .2s, color .2s;
}
.icon-btn:hover { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-1px); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn .i-moon, .icon-btn .i-auto { display: none; }
/* icon reflects the *preference* (auto / light / dark) */
html[data-theme-pref="auto"] .icon-btn .i-sun,
html[data-theme-pref="auto"] .icon-btn .i-moon { display: none; }
html[data-theme-pref="auto"] .icon-btn .i-auto { display: block; }
html[data-theme-pref="dark"] .icon-btn .i-sun { display: none; }
html[data-theme-pref="dark"] .icon-btn .i-moon { display: block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 11px;
  font-family: inherit; font-size: 14px; font-weight: 500; letter-spacing: -0.01em;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .25s, background-color .2s, border-color .2s, color .2s;
  white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn-sm { padding: 8px 13px; font-size: 13px; border-radius: 9px; }
.btn-sm svg { width: 14px; height: 14px; }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent-2) 70%, var(--accent)));
  color: #fff;
  box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--accent) 80%, transparent);
}
html[data-theme="dark"] .btn-primary { color: #06201a; }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--accent) 85%, transparent); }

.btn-ghost {
  background: var(--surface); color: var(--text-2);
  border-color: var(--line-strong);
}
.btn-ghost:hover {
  color: var(--text); transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong));
  box-shadow: var(--shadow-sm);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  padding: calc(var(--topbar-h) + 68px) 0 84px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -20% -10% auto -10%; height: 640px; z-index: -2;
  background:
    radial-gradient(50% 50% at 22% 22%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(45% 45% at 82% 8%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
  filter: blur(4px);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 62%);
  -webkit-mask-image: radial-gradient(120% 80% at 50% 0%, #000 0%, transparent 62%);
  opacity: .55;
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, .85fr);
  gap: 56px;
  align-items: start;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .13em;
  text-transform: uppercase; color: var(--muted);
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero h1 {
  margin: 22px 0 0;
  font-size: clamp(2.6rem, 5.6vw, 4.15rem);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 1.02;
  background: linear-gradient(115deg, var(--text) 32%, var(--accent-ink) 78%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
html[data-theme="dark"] .hero h1 {
  background: linear-gradient(115deg, var(--text) 30%, var(--accent) 82%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text;
}

.hero-role {
  margin-top: 14px;
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--accent-ink); font-weight: 500;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
}
.hero-role .sep { color: var(--line-strong); }

.hero-lead {
  margin-top: 20px; max-width: 58ch;
  font-size: 16.5px; line-height: 1.78; color: var(--text-2);
}

.hero-meta {
  margin-top: 26px; display: flex; flex-wrap: wrap; gap: 8px 10px;
}
.hero-meta li {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
  transition: border-color .2s, transform .2s var(--ease);
}
.hero-meta li:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); transform: translateY(-1px); }
.hero-meta svg { width: 14px; height: 14px; color: var(--accent); flex-shrink: 0; }
.hero-meta a:hover { color: var(--accent-ink); }

.hero-cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }

.hero-stats {
  margin-top: 38px; display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--line); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
}
.hero-stats > div { background: var(--surface); padding: 14px 16px; }
.hero-stats dt {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.hero-stats dd {
  margin-top: 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

/* ---------- ID card ---------- */
.idcard {
  transition: background-color .35s var(--ease), border-color .35s var(--ease);
  position: relative;
  padding: 26px;
  border-radius: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.idcard::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2), transparent);
}
.idcard::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft), transparent 65%);
  pointer-events: none;
}

.idcard-top { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 74px; height: 74px; flex-shrink: 0;
  border-radius: 18px; padding: 1px;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--accent) 90%, transparent);
}
.avatar svg {
  width: 100%; height: 100%; border-radius: 17px;
  background: var(--surface-2);
  stroke: none;
}
.avatar .av-s1 { stop-color: var(--accent); }
.avatar .av-s2 { stop-color: var(--accent-2); }
.idcard-name { font-size: 16.5px; font-weight: 600; letter-spacing: -0.02em; }
.idcard-role { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.badge-open {
  margin-top: 9px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 11.5px; font-weight: 500; color: var(--accent-ink);
  background: var(--accent-soft); border-radius: 999px; padding: 4px 10px;
}
.pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 70%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.facts { margin-top: 22px; display: grid; gap: 1px; background: var(--line); border-radius: 12px; overflow: hidden; }
.facts li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  background: var(--surface-2); padding: 10px 13px;
}
.facts span {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .07em;
  text-transform: uppercase; color: var(--muted); flex-shrink: 0;
}
.facts strong { font-size: 13px; font-weight: 500; text-align: right; color: var(--text-2); }
.facts a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }
.facts a:hover { color: var(--accent-ink); }

.copy-mail {
  margin-top: 16px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border-radius: 11px; cursor: pointer;
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  color: var(--text-2); font-family: inherit; font-size: 13px; font-weight: 500;
  transition: color .2s, border-color .2s, background-color .2s;
}
.copy-mail:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--accent-soft); }
.copy-mail svg { width: 15px; height: 15px; }
.copy-mail.is-done { color: var(--accent-ink); border-style: solid; border-color: var(--accent); background: var(--accent-soft); }

/* =========================================================
   SECTIONS
   ========================================================= */
.section {
  position: relative; padding: 76px 0;
  scroll-margin-top: var(--topbar-h);
}
.section::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, var(--line-strong) 0%, var(--line) 34%, transparent 92%);
}
.section:first-of-type::before { display: none; }

.section-grid {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 52px;
  align-items: start;
}

.section-head { position: sticky; top: calc(var(--topbar-h) + 34px); }
.sec-num {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .14em;
  color: var(--accent); font-weight: 500;
  display: flex; align-items: center; gap: 10px;
}
.sec-num::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, var(--line-strong), transparent); }
.section-head h2 {
  margin-top: 10px; font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  letter-spacing: -0.035em; font-weight: 600;
}
.sec-cap {
  margin-top: 8px; font-size: 12.5px; line-height: 1.6; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: .02em;
}

.section-body > * + * { margin-top: 26px; }

.lead { font-size: 17.5px; line-height: 1.75; color: var(--text); letter-spacing: -0.012em; }
.section-body > p { color: var(--text-2); line-height: 1.8; }

.highlight-row {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  margin-top: 30px;
}
.hl {
  padding: 14px 16px; border-radius: 13px;
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.hl:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow-sm); }
.hl b { display: block; font-size: 13.5px; font-weight: 600; }
.hl span { display: block; margin-top: 3px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }

/* ---------- timeline ---------- */
.timeline { position: relative; padding-left: 30px; }
.timeline::before {
  content: ""; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1.5px;
  background: linear-gradient(to bottom, var(--accent), var(--line) 70%);
  border-radius: 2px;
}
.tl-item { position: relative; padding-bottom: 34px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -30px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.tl-item--now .tl-dot { background: var(--accent); }
.tl-period {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--accent-ink); font-weight: 500;
}
.tl-title { margin-top: 6px; font-size: 18.5px; font-weight: 600; letter-spacing: -0.02em; }
.tl-sub { margin-top: 3px; font-size: 13.5px; color: var(--muted); }
.tl-desc { margin-top: 10px; font-size: 14.5px; line-height: 1.75; color: var(--text-2); }

/* ---------- projects ---------- */
.projects { display: grid; gap: 16px; }
.project {
  position: relative; padding: 26px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: transform .3s var(--ease), border-color .3s, box-shadow .3s;
}
.project::before {
  content: ""; position: absolute; left: 0; top: 26px; bottom: 26px; width: 2px;
  border-radius: 2px; background: linear-gradient(to bottom, var(--accent), transparent);
  opacity: 0; transition: opacity .3s;
}
.project:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-md); }
.project:hover::before { opacity: 1; }

/* featured / highlighted projects */
.project--featured {
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 58%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
}
.project-flag {
  display: inline-flex; align-items: center; margin-left: 10px;
  vertical-align: middle; transform: translateY(-1px);
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  padding: 3px 8px; border-radius: 999px;
}

.project-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.project-period {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .05em;
  color: var(--muted); text-transform: uppercase;
}
.project-head h3 { margin-top: 7px; font-size: 20px; letter-spacing: -0.025em; }
.project-role {
  font-size: 11.5px; font-weight: 500; letter-spacing: .04em;
  padding: 5px 11px; border-radius: 999px;
  color: var(--accent-ink); background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  white-space: nowrap;
}
.project-desc { margin-top: 14px; font-size: 14.5px; line-height: 1.75; color: var(--text-2); }

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.chips li {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .01em;
  padding: 4px 10px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-2);
  transition: border-color .2s, color .2s, background-color .2s;
}
.chips-lg li { font-size: 12.5px; padding: 6px 12px; border-radius: 8px; }
.chips li:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-ink); }

.project-foot {
  margin-top: 20px; padding-top: 16px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.project-scale { font-size: 12.5px; color: var(--muted); }
.link-arrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent-ink); word-break: break-all;
  transition: gap .2s var(--ease);
}
.link-arrow svg { width: 13px; height: 13px; flex-shrink: 0; transition: transform .2s var(--ease); }
.link-arrow:hover { gap: 9px; }
.link-arrow:hover svg { transform: translate(2px, -2px); }

/* ---------- skills ---------- */
.stack { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stack-card {
  padding: 20px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.stack-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); box-shadow: var(--shadow-sm); }
.stack-card h3 {
  display: flex; align-items: center; gap: 9px;
  font-size: 13px; font-weight: 600; letter-spacing: .01em;
  color: var(--text);
}
.stack-card h3 svg { width: 15px; height: 15px; color: var(--accent); }
.stack-card .chips { margin-top: 14px; }

.ability {
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
}
.ability-head h3 {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); font-weight: 500;
}
.ability-list { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.ability-list li {
  position: relative; padding-left: 18px;
  font-size: 14.5px; color: var(--text-2);
}
.ability-list li::before {
  content: ""; position: absolute; left: 0; top: 10px;
  width: 6px; height: 6px; border-radius: 2px; background: var(--accent);
}

.soft { display: grid; gap: 14px; }
.soft-card {
  padding: 22px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .25s, box-shadow .25s;
}
.soft-card:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); box-shadow: var(--shadow-sm); }
.soft-icon {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.soft-icon svg { width: 17px; height: 17px; }
.soft-card h3 { margin-top: 14px; font-size: 16px; letter-spacing: -0.02em; }
.soft-card p { margin-top: 9px; font-size: 14px; line-height: 1.75; color: var(--text-2); }
.soft-note {
  padding: 14px 18px; border-radius: 12px;
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  font-size: 13.5px; color: var(--text-2);
}
.soft-note strong { color: var(--text); }

/* ---------- certs ---------- */
.certs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.certs li {
  background: var(--surface); padding: 16px 18px;
  display: flex; flex-direction: column; gap: 5px;
  transition: background-color .25s;
}
.certs li:hover { background: var(--surface-2); }
.cert-date {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .06em;
  color: var(--accent-ink); font-weight: 500;
}
.cert-name { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }

.interests { margin-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.interests-label {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.interests .chips { margin-top: 0; }

/* ---------- contact ---------- */
.section-contact { border-top: 1px solid var(--line); padding: 76px 0 88px; }
.contact-card {
  position: relative; padding: 48px 44px; border-radius: 24px;
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.contact-card h2 { margin-top: 12px; font-size: clamp(1.7rem, 3.2vw, 2.35rem); letter-spacing: -0.04em; }
.contact-lead { margin-top: 14px; max-width: 62ch; font-size: 15.5px; line-height: 1.75; color: var(--text-2); }
.contact-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding: 28px 0 40px; }
.foot-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
  font-family: var(--font-mono); letter-spacing: .02em;
}
.foot-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.foot-links a { transition: color .2s; }
.foot-links a:hover { color: var(--accent-ink); }

/* ---------- toast ---------- */
/* back to top */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 13px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text-2); box-shadow: var(--shadow-md);
  opacity: 0; transform: translateY(12px) scale(.94); pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease),
              color .2s, border-color .2s, background-color .2s;
}
.to-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover {
  color: var(--accent-ink); background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong));
}
.to-top svg { width: 18px; height: 18px; }

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 150;
  transform: translate(-50%, 18px);
  padding: 11px 18px; border-radius: 11px;
  background: var(--text); color: var(--bg);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- reveal on scroll (class .is-reveal is added by JS only,
   so a missing/failed script can never leave content invisible) ---------- */
.reveal.is-reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-reveal.in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1000px) {
  :root { --topbar-h: 104px; }
  html { scroll-padding-top: 116px; }
  .hero-grid { grid-template-columns: 1fr; gap: 34px; }
  .idcard { max-width: 640px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .section-grid { grid-template-columns: 1fr; gap: 28px; }
  .section-head { position: static; display: grid; grid-template-columns: auto 1fr; gap: 0 14px; align-items: baseline; }
  .sec-num { grid-column: 1; }
  .sec-num::after { display: none; }
  .section-head h2 { margin-top: 0; grid-column: 2; }
  .sec-cap { grid-column: 2; margin-top: 2px; }

  /* topbar becomes two rows: brand/actions + horizontally scrollable section pills */
  .topbar { height: auto; }
  .topbar-inner { height: auto; flex-wrap: wrap; row-gap: 0; padding: 9px 0 0; }
  .brand { padding-bottom: 9px; }
  .topbar-actions { padding-bottom: 9px; }
  .nav {
    order: 3; flex-basis: 100%; margin: 0;
    display: flex; gap: 2px; overflow-x: auto;
    padding: 0 0 7px;
    scrollbar-width: none; -ms-overflow-style: none;
    mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-link { font-size: 12.5px; padding: 6px 10px; }
  .nav-link.is-active::after { left: 10px; right: 10px; bottom: 0; }
}

@media (max-width: 720px) {
  :root { --topbar-h: 100px; }
  html { scroll-padding-top: 112px; }
  .wrap { width: calc(100% - 32px); }
  .hero { padding: calc(var(--topbar-h) + 34px) 0 56px; }
  .hero h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .hero-role { font-size: 11px; gap: 8px; letter-spacing: .03em; }
  .hero-role .sep { display: none; }
  .hero-role span + span::before { content: "·"; margin-right: 8px; color: var(--muted); }
  .hero-meta { gap: 7px; }
  .hero-meta li { padding: 6px 11px; font-size: 12.5px; }
  .hero-role span { white-space: normal; }
  .facts { grid-template-columns: 1fr; }
  .hero-lead { font-size: 15.5px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .section { padding: 54px 0; }
  .highlight-row { grid-template-columns: 1fr; }
  .stack { grid-template-columns: 1fr; }
  .certs { grid-template-columns: 1fr; }
  .project { padding: 20px; }
  .contact-card { padding: 32px 22px; }
  .idcard { padding: 20px; }
  .brand-text em { display: none; }
  .foot-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .topbar-actions .btn-sm { display: none; }
  .nav-link { font-size: 12px; }
}

/* =========================================================
   PRINT — A4, giữ nội dung, bỏ trang trí
   ========================================================= */
@media print {
  @page { size: A4; margin: 11mm 11mm 10mm; }

  :root {
    --bg: #fff; --surface: #fff; --surface-2: #fff;
    --text: #000; --text-2: #1c1c1c; --muted: #4a4a4a;
    --line: #d8d8d8; --line-strong: #c2c2c2;
    --accent: #0b6b57; --accent-2: #0b6b57; --accent-ink: #0b6b57;
    --accent-soft: #eef6f4;
    --shadow-sm: none; --shadow-md: none; --shadow-lg: none;
  }

  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  body { font-size: 9.4pt; line-height: 1.4; background: #fff; color: #000; zoom: 0.90; }

  .topbar, .progress, .toast, .skip-link, .no-print, .to-top,
  .hero-cta, .copy-mail, .hero-stats, .site-foot .foot-links,
  .badge-open .pulse { display: none !important; }

  .wrap { width: 100%; }

  /* ---------- hero ---------- */
  .hero { padding: 0 0 3.5mm; }
  .hero::before, .hero::after { display: none; }
  .hero-grid { grid-template-columns: 1.5fr .82fr; gap: 6mm; }
  .eyebrow {
    font-size: 7pt; letter-spacing: .1em; padding: 0;
    border: none; background: none; color: var(--muted);
  }
  .eyebrow .dot { width: 1.4mm; height: 1.4mm; box-shadow: none; }
  .hero h1 {
    font-size: 21pt; margin-top: 2.5mm; line-height: 1.05;
    background: none; -webkit-background-clip: border-box; background-clip: border-box;
    color: #000; -webkit-text-fill-color: #000;
  }
  .hero-role { font-size: 7.5pt; margin-top: 2mm; gap: 2mm; }
  .hero-lead { font-size: 8.6pt; line-height: 1.45; margin-top: 2.2mm; max-width: none; }
  .hero-meta { margin-top: 3mm; gap: 1.5mm 5mm; }
  .hero-meta li { border: none; background: none; padding: 0; font-size: 8pt; }
  .hero-meta svg { width: 3mm; height: 3mm; }

  .idcard { padding: 3.5mm; border-radius: 3.5mm; box-shadow: none; }
  .idcard::before { height: 1mm; }
  .idcard::after { display: none; }
  .idcard-top { gap: 3mm; }
  .avatar { width: 12mm; height: 12mm; border-radius: 3mm; }
  .avatar svg { border-radius: 2.7mm; }
  .idcard-name { font-size: 10pt; }
  .idcard-role { font-size: 7.5pt; }
  .badge-open { font-size: 6.8pt; padding: .5mm 1.8mm; margin-top: 1.2mm; }
  .facts { margin-top: 3mm; grid-template-columns: 1fr; }
  .facts li { padding: .9mm 1.6mm; gap: 2mm; }
  .facts span { font-size: 6.2pt; letter-spacing: .04em; }
  .facts strong { font-size: 7.2pt; white-space: nowrap; }

  /* ---------- sections ---------- */
  .section { padding: 3.2mm 0; }
  .section::before { background: var(--line); }
  .section-grid { display: block; }
  .section-head {
    position: static; display: flex; align-items: baseline; gap: 2.5mm;
    margin-bottom: 2mm; padding-bottom: 1mm;
    border-bottom: .4pt solid var(--line);
  }
  .section-head h2 { font-size: 11.5pt; margin: 0; letter-spacing: -.02em; }
  .sec-num { font-size: 7.5pt; }
  .sec-num::after { display: none; }
  .sec-cap { margin: 0 0 0 auto; font-size: 7pt; }
  .section-body > * + * { margin-top: 2.5mm; }

  .lead { font-size: 9pt; line-height: 1.45; }
  .section-body > p { font-size: 8.7pt; line-height: 1.45; }
  .highlight-row { margin-top: 3mm; gap: 2mm; }
  .hl { padding: 1.5mm 2mm; border-radius: 2mm; }
  .hl b { font-size: 8pt; }
  .hl span { font-size: 7pt; margin-top: .2mm; }

  /* ---------- timeline ---------- */
  .timeline { padding-left: 5mm; }
  .timeline::before { left: 1mm; top: 2mm; bottom: 2mm; width: .5mm; }
  .tl-item { padding-bottom: 2.4mm; break-inside: avoid; page-break-inside: avoid; }
  .tl-dot { left: -5mm; top: 1.2mm; width: 2.2mm; height: 2.2mm; box-shadow: none; border-width: .55mm; }
  .tl-period { font-size: 7pt; }
  .tl-title { font-size: 10pt; margin-top: .8mm; }
  .tl-sub { font-size: 7.8pt; }
  .tl-desc { font-size: 8.2pt; line-height: 1.45; margin-top: .8mm; }

  /* ---------- projects ---------- */
  .projects { gap: 2.2mm; }
  .project {
    padding: 2.4mm 3mm; border-radius: 2.5mm; box-shadow: none;
    break-inside: avoid; page-break-inside: avoid;
  }
  .project::before { display: none; }
  .project-period { font-size: 6.8pt; }
  .project-head h3 { font-size: 10pt; margin-top: .6mm; }
  .project-role { font-size: 6.8pt; padding: .5mm 2mm; }
  .project--featured { background: none; }
  .project-flag { font-size: 6.2pt; padding: .3mm 1.4mm; margin-left: 2mm; letter-spacing: .06em; }
  .tl-item .chips { margin-top: 1.2mm; }
  .project-desc { font-size: 8.2pt; line-height: 1.45; margin-top: 1.2mm; }
  .chips { margin-top: 1.6mm; gap: 1.1mm; }
  .chips li { font-size: 7pt; padding: .35mm 1.3mm; border-radius: 1.2mm; border: .4pt solid var(--line-strong); }
  .chips-lg li { font-size: 7.4pt; padding: .5mm 1.6mm; }
  .project-foot { margin-top: 1.8mm; padding-top: 1.4mm; }
  .project-scale { font-size: 7pt; }
  .link-arrow { font-size: 7pt; }

  /* ---------- skills ---------- */
  .stack { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2mm; }
  .stack-card { padding: 2.4mm; border-radius: 2.5mm; break-inside: avoid; }
  .stack-card h3 { font-size: 7.8pt; gap: 1.5mm; }
  .stack-card h3 svg { width: 3mm; height: 3mm; }
  .stack-card .chips { margin-top: 1.6mm; }

  .ability { padding: 2.4mm 3mm; border-radius: 2.5mm; }
  .ability-head h3 { font-size: 7pt; }
  .ability-list { margin-top: 1.4mm; gap: 1mm 5mm; }
  .ability-list li { font-size: 8.3pt; padding-left: 3.2mm; }
  .ability-list li::before { top: 1.3mm; width: 1.4mm; height: 1.4mm; }

  .soft { gap: 1.8mm; }
  .soft-card {
    padding: 1.8mm 3mm; border-radius: 2.5mm;
    display: grid; grid-template-columns: 6mm minmax(0, 1fr); column-gap: 2.2mm;
    break-inside: avoid;
  }
  .soft-card > * { grid-column: 2; }
  .soft-card .soft-icon {
    grid-column: 1; grid-row: 1; width: 5mm; height: 5mm;
    border-radius: 1.4mm; align-self: start;
  }
  .soft-icon svg { width: 3mm; height: 3mm; }
  .soft-card h3 { margin: 0; font-size: 9pt; }
  .soft-card p { margin-top: .8mm; font-size: 8.2pt; line-height: 1.45; }
  .soft-note { padding: 1.8mm 3mm; border-radius: 2mm; border-left: .8mm solid var(--accent); font-size: 8pt; }

  /* ---------- certs ---------- */
  .certs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 2.5mm; break-inside: avoid; page-break-inside: avoid;
  }
  .certs li { padding: 1.1mm 2.4mm; gap: .2mm; }
  .cert-date { font-size: 6.8pt; }
  .cert-name { font-size: 7.8pt; line-height: 1.4; }
  .interests { margin-top: 2.5mm; gap: 2mm; }
  .interests-label { font-size: 6.8pt; }

  /* ---------- contact ---------- */
  .section-contact { padding: 3mm 0 0; }
  .contact-card {
    padding: 3.4mm 4mm; border-radius: 3mm; box-shadow: none;
    break-inside: avoid; page-break-inside: avoid;
  }
  .contact-card h2 { font-size: 12pt; margin-top: 1mm; }
  .contact-lead { font-size: 8.4pt; line-height: 1.5; margin-top: 1.5mm; max-width: none; }
  .contact-actions { margin-top: 2.5mm; gap: 2mm; }
  .btn {
    padding: 1mm 2.5mm; font-size: 7.4pt; border-radius: 1.5mm; box-shadow: none;
    border: .4pt solid var(--line-strong); background: none; color: #000;
  }
  .btn svg { width: 2.8mm; height: 2.8mm; }
  .btn-primary { background: none; color: var(--accent); border-color: var(--accent); }

  .site-foot { padding: 2.5mm 0 0; font-size: 6.8pt; }
  .reveal.is-reveal { opacity: 1 !important; transform: none !important; }

  /* keep links legible on paper */
  a { color: inherit; }
  .project, .stack-card, .soft-card, .hl, .ability, .tl-item,
  .contact-card, .certs, .soft-note { box-shadow: none !important; transform: none !important; }
}

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