:root {
  color-scheme: light;
  --blue: #0866ff;
  --blue-hover: #0759d3;
  --link: #155fca;
  --ink: #1c1e21;
  --muted: #58616f;
  --line: #dce1e8;
  --canvas: #f0f2f5;
  --paper: #fff;
  --pale-blue: #edf4ff;
  --card-radius: 10px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.65 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--blue-hover); }
a:focus-visible, button:focus-visible, main:focus-visible {
  outline: 3px solid var(--blue-hover);
  outline-offset: 4px;
}
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 20; }
.skip:focus { top: 10px; padding: 10px 16px; border-radius: 6px; background: #fff; box-shadow: 0 2px 16px #1c1e2126; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1100px;
  margin: auto;
  padding: 16px 0;
}
.home { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: #3e4653; font-size: 14px; font-weight: 650; text-decoration: none; }
.home svg { width: 18px; height: 18px; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: #e4e6eb;
  color: #303641;
  font: 650 14px/1.45 'Segoe UI', Arial, sans-serif;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}
.btn:hover { background: #d8dce3; color: #20262e; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-hover); color: #fff; }
.btn.secondary { background: #e8edf4; color: #303641; }
.btn.secondary:hover { background: #dce4ef; color: #20262e; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

.resume { max-width: 1100px; margin: 0 auto 32px; }
.resume-header { overflow: hidden; border: 1px solid var(--line); border-bottom: 0; border-radius: var(--card-radius) var(--card-radius) 0 0; background: var(--paper); }
.profile-cover {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  height: 180px;
  overflow: hidden;
  padding: 20px 36px;
  isolation: isolate;
  background: linear-gradient(110deg, #e2edff 0%, #b6d0f6 38%, #6e9fe4 72%, #3573cc 100%);
}
.profile-cover::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: linear-gradient(90deg, #e1ecfc 0%, transparent 60%), repeating-linear-gradient(0deg, transparent 0 31px, #fff2 31px 32px), repeating-linear-gradient(90deg, transparent 0 55px, #fff2 55px 56px);
  mask-image: linear-gradient(90deg, transparent 0%, #000 60%);
}
.profile-cover::after {
  position: absolute;
  z-index: -1;
  content: '';
  width: 440px;
  height: 200px;
  top: -40px;
  right: 12%;
  border: 1px solid #ffffff45;
  border-radius: 28px;
  transform: rotate(-24deg);
  box-shadow: 0 0 0 30px #ffffff0c, 0 0 0 60px #ffffff0a;
}
.cover-mark { color: #fff; font-size: 52px; font-weight: 800; line-height: 1.1; letter-spacing: -2px; opacity: .95; }
.cover-caption { margin: 8px 0 0; color: #fff; font-size: 12px; font-weight: 650; line-height: 1.5; letter-spacing: 2.5px; text-transform: uppercase; }
.profile-intro {
  position: relative;
  display: grid;
  grid-template-columns: 144px minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 0 28px 25px;
}
.portrait {
  position: relative;
  align-self: start;
  width: 144px;
  height: 144px;
  margin: -50px 0 0;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #dce6f2;
  box-shadow: 0 2px 6px #1c1e2114;
}
.portrait img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 38%; }
.identity { min-width: 0; padding: 19px 0 0; }
.eyebrow { margin: 0 0 5px; color: var(--link); font-size: 11px; font-weight: 700; line-height: 1.5; letter-spacing: 1.3px; text-transform: uppercase; }
.name { margin: 0; color: var(--ink); font-size: 34px; font-weight: 750; line-height: 1.2; letter-spacing: -.8px; }
.role { margin: 7px 0 0; color: #313b49; font-size: 17px; font-weight: 600; line-height: 1.5; }
.specialty { margin: 5px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 26px; }
.profile-actions .btn { font-size: 13px; padding: 10px 13px; }
.identity .profile-actions { justify-content: flex-start; padding-top: 16px; }
.profile-nav {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-height: 58px;
  margin: 0 0 20px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-top-color: #e7eaf0;
  border-radius: 0 0 var(--card-radius) var(--card-radius);
  background: var(--paper);
  box-shadow: 0 1px 2px #00000005;
}
.profile-nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 54px; padding: 12px 18px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 14px; font-weight: 650; text-decoration: none; text-align: center; }
.profile-nav a:first-child { border-bottom-color: var(--blue); color: var(--link); }
.profile-nav a:hover { background: #f0f3f8; color: var(--link); }

.resume-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); align-items: start; gap: 20px; }
.sidebar, .main-content { min-width: 0; }
.sidebar { display: grid; gap: 16px; }
.side-section, .section { padding: 22px; border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--paper); box-shadow: 0 1px 2px #00000005; }
.side-heading, .section-heading { display: flex; align-items: center; gap: 9px; margin: 0 0 17px; color: var(--ink); }
.side-heading { font-size: 17px; font-weight: 700; line-height: 1.4; }
.side-heading svg, .section-heading svg, .contact-item > svg { width: 20px; height: 20px; flex: 0 0 auto; color: var(--link); }
.contact-list { display: grid; gap: 15px; }
.contact-item { display: grid; grid-template-columns: 19px minmax(0, 1fr); align-items: start; gap: 11px; min-width: 0; }
.contact-item > svg { width: 18px; height: 18px; margin-top: 4px; color: #606b7b; }
.contact-copy { min-width: 0; }
.contact-label { display: block; margin-bottom: 1px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.contact-value { display: inline-block; color: #263447; font-size: 14px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; text-decoration: none; }
.contact-value:hover, .contact-actions a:hover { text-decoration: underline; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0 10px; }
.contact-actions a { color: #263447; font-size: 14px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; text-decoration: none; }
.contact-actions .zalo-link { color: var(--link); font-size: 12px; }
.skill-group + .skill-group { margin-top: 17px; padding-top: 17px; border-top: 1px solid #edf0f5; }
.skill-group h3 { margin: 0 0 5px; color: #343f4d; font-size: 14px; font-weight: 650; line-height: 1.5; }
.skill-group p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.8; }
.ai-note { border-color: #cfdff4; background: linear-gradient(145deg, #fff 30%, #edf4ff); }
.ai-label { display: inline-block; margin: 0 0 8px; padding: 3px 9px; border-radius: 5px; background: #e5efff; color: #1453a8; font-size: 12px; font-weight: 650; line-height: 1.65; }
.ai-note p { margin: 0; color: #455469; font-size: 14px; line-height: 1.75; }
.main-content { display: grid; gap: 16px; }
.section { padding: 24px; }
.section-heading { padding-bottom: 15px; border-bottom: 1px solid #e8ecf1; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 20px; font-weight: 700; line-height: 1.4; letter-spacing: -.2px; }
.section-heading svg { width: 21px; height: 21px; }
.summary { margin: 0; color: #404b5a; font-size: 15px; line-height: 1.85; }
.experience-list { list-style: none; margin: 0; padding: 0; }
.job { position: relative; padding-left: 20px; border-left: 2px solid #dce8fa; }
.job::before { position: absolute; content: ''; top: 5px; left: -5px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 1px #a8c7f7; }
.job + .job { margin-top: 23px; }
.job-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; }
.job-heading h3 { margin: 0; color: #263447; font-size: 15.5px; font-weight: 700; line-height: 1.5; }
.years { color: var(--muted); font-size: 12px; font-weight: 600; line-height: 1.6; white-space: nowrap; font-variant-numeric: tabular-nums; }
.company { margin: 4px 0 10px; color: var(--link); font-size: 13px; font-weight: 600; line-height: 1.6; }
.job-points, .project-points { margin: 0; padding-left: 18px; color: #404b5a; font-size: 14px; line-height: 1.8; }
.job-points li, .project-points li { padding-left: 2px; }
.job-points li + li, .project-points li + li { margin-top: 6px; }
.job-points li::marker, .project-points li::marker { color: #6a8fc5; font-size: .8em; }
.description { margin: 0; color: #46515f; font-size: 14px; line-height: 1.8; }
.compact .company { margin-bottom: 5px; }
.project + .project { margin-top: 23px; padding-top: 23px; border-top: 1px solid #e8ecf1; }
.project-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 14px; }
.project-heading h3 { margin: 0; color: #263447; font-size: 18px; font-weight: 750; line-height: 1.4; }
.project-link { color: var(--link); font-size: 13px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; text-decoration: none; }
.project-link:hover { text-decoration: underline; }
.project-type { margin: 5px 0 10px; color: var(--muted); font-size: 13px; font-weight: 600; line-height: 1.6; }
.project-stack { display: block; margin: 0 0 12px; padding: 8px 10px; border: 1px solid #e0eafa; border-radius: 5px; background: #f3f7ff; color: #285182; font-size: 12px; font-weight: 600; line-height: 1.7; overflow-wrap: anywhere; }
.project-notes { margin: 12px 0 0; color: #566474; font-size: 13px; line-height: 1.75; }
.project--featured { padding: 17px 18px; border: 1px solid #d9e6f7; border-left: 4px solid var(--link); border-radius: 9px; background: linear-gradient(135deg, #fff 0%, #f7faff 100%); box-shadow: 0 7px 20px #1f5ea40a; }
.project--featured + .project--featured { margin-top: 14px; padding-top: 17px; border-top: 1px solid #d9e6f7; }
.project--featured .project-heading h3 { color: #142f55; }
.resume-footer { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 5px 18px; padding: 18px 2px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.resume-footer a { color: var(--muted); font-weight: 600; text-decoration: none; }
.resume-footer a:hover { color: var(--link); text-decoration: underline; }

@media screen and (max-width: 1140px) {
  .toolbar, .resume { margin-right: 20px; margin-left: 20px; }
  .profile-intro { grid-template-columns: 144px minmax(0, 1fr); }
  .profile-intro > .profile-actions { grid-column: 2; justify-content: flex-start; padding-top: 0; margin-top: -5px; }
}
@media screen and (max-width: 900px) and (min-width: 701px) {
  .resume-layout { grid-template-columns: 270px minmax(0, 1fr); gap: 16px; }
  .side-section { padding: 19px; }
  .section { padding: 21px; }
  .profile-intro { padding-right: 24px; padding-left: 24px; gap: 20px; }
  .name { font-size: 32px; }
  .specialty { font-size: 13px; }
}
@media screen and (max-width: 700px) {
  .toolbar { margin: 0; padding: 10px 14px; gap: 10px; }
  .home { font-size: 13px; }
  .tools { gap: 6px; }
  .toolbar .btn { padding: 9px 11px; font-size: 12px; }
  .toolbar .btn svg { width: 16px; height: 16px; }
  .resume { margin: 0 12px 20px; }
  .profile-cover { height: 142px; padding: 18px 22px; justify-content: flex-start; }
  .cover-mark { font-size: 35px; letter-spacing: -1px; }
  .cover-caption { max-width: 170px; margin-top: 5px; font-size: 9px; letter-spacing: 1.4px; text-align: right; }
  .profile-intro { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0 20px 23px; text-align: center; }
  .portrait { align-self: center; width: 112px; height: 112px; margin-top: -47px; border-width: 4px; }
  .identity { width: 100%; padding-top: 12px; }
  .eyebrow { margin-bottom: 5px; font-size: 10px; letter-spacing: 1px; }
  .name { font-size: 31px; line-height: 1.22; letter-spacing: -.7px; text-wrap: balance; }
  .role { margin-top: 7px; font-size: 15px; line-height: 1.5; }
  .specialty { max-width: 350px; margin: 7px auto 0; font-size: 12px; line-height: 1.8; text-wrap: balance; }
  .profile-intro > .profile-actions, .identity .profile-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; width: 100%; max-width: 360px; margin: 17px auto 0; padding: 0; gap: 8px; }
  .profile-actions .btn { padding: 10px 9px; font-size: 13px; }
  .profile-nav { justify-content: stretch; gap: 0; min-height: 52px; margin-bottom: 14px; padding: 0 10px; }
  .profile-nav a { flex: 1 1 0; min-height: 51px; padding: 11px 7px; font-size: 13px; }
  .resume-layout { display: flex; flex-direction: column; gap: 14px; }
  .main-content { order: 0; width: 100%; gap: 14px; }
  .sidebar { order: 1; width: 100%; gap: 14px; }
  .section, .side-section { padding: 20px; }
  .section-heading { gap: 9px; margin-bottom: 16px; padding-bottom: 13px; }
  .section-heading h2 { font-size: 19px; }
  .summary { font-size: 15px; line-height: 1.85; }
  .job { padding-left: 17px; }
  .job-heading { gap: 3px 10px; }
  .job-heading h3 { font-size: 15px; }
  .job-points, .project-points, .description { font-size: 14px; line-height: 1.85; }
  .company { margin-bottom: 9px; }
  .project-heading { gap: 2px 10px; }
  .project-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; }
  .project-type { margin-top: 2px; }
  .project-stack { font-size: 12px; line-height: 1.75; }
  .project--featured { padding: 16px; }
  .contact-list { gap: 13px; }
  .contact-value, .contact-actions a { display: inline-flex; align-items: center; min-height: 36px; }
  .contact-actions { gap: 0 14px; }
  .side-section:has(.skill-group) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
  .side-section:has(.skill-group) .side-heading { grid-column: 1 / -1; margin-bottom: 2px; }
  .skill-group + .skill-group { margin: 0; padding: 0; border: 0; }
  .skill-group h3 { font-size: 13px; }
  .skill-group p { font-size: 13px; line-height: 1.85; }
  .resume-footer { padding: 16px 4px; font-size: 11px; }
}
@media screen and (max-width: 360px) {
  .toolbar { padding-right: 10px; padding-left: 10px; gap: 7px; }
  .home { gap: 5px; font-size: 12px; }
  .home svg { width: 15px; height: 15px; }
  .tools { gap: 4px; }
  .toolbar .btn { padding: 9px 8px; gap: 5px; font-size: 11px; }
  .toolbar .btn svg { width: 14px; height: 14px; }
  .resume { margin-right: 8px; margin-left: 8px; }
  .profile-intro { padding-right: 15px; padding-left: 15px; }
  .name { font-size: 28px; }
  .role { font-size: 14px; }
  .profile-actions .btn { font-size: 12px; }
  .profile-nav { padding: 0 5px; }
  .profile-nav a { padding-right: 5px; padding-left: 5px; font-size: 12px; }
  .section, .side-section { padding: 18px; }
  .section-heading h2 { font-size: 18px; }
  .project-heading h3 { font-size: 18px; }
}

@page { size: A4; margin: 8mm; }
@media print {
  html { scroll-behavior: auto; }
  body { background: #fff; color: var(--ink); font-size: 9pt; line-height: 1.45; }
  .toolbar, .skip, .profile-nav, .profile-actions, .resume-footer { display: none !important; }
  .resume { width: 100%; max-width: none; margin: 0; }
  .resume-header { overflow: visible; border: 0; border-bottom: .6mm solid var(--blue); border-radius: 0; }
  .profile-cover { height: 13mm; padding: 2mm 4mm; border-radius: 2mm 2mm 0 0; }
  .profile-cover::after { width: 80mm; height: 28mm; top: -10mm; right: 20mm; border-radius: 5mm; box-shadow: 0 0 0 5mm #ffffff0c; }
  .cover-mark { font-size: 16pt; letter-spacing: -.5px; }
  .cover-caption { margin: .5mm 0 0; font-size: 6pt; line-height: 1.2; letter-spacing: 1px; }
  .profile-intro { display: grid; grid-template-columns: 30mm minmax(0, 1fr); align-items: center; gap: 4mm; padding: 0 5mm 4mm; }
  .portrait { align-self: start; width: 27mm; height: 27mm; margin: -6mm 0 0; border: 1mm solid #fff; box-shadow: none; }
  .identity { padding: 2.4mm 0 0; }
  .eyebrow { margin: 0 0 .7mm; font-size: 6.7pt; line-height: 1.35; letter-spacing: .7px; }
  .name { margin: 0; font-size: 23pt; line-height: 1.15; letter-spacing: -.65px; }
  .role { margin: 1.3mm 0 0; font-size: 10.3pt; line-height: 1.45; }
  .specialty { margin: 1mm 0 0; font-size: 8pt; line-height: 1.45; }
  .resume-layout { display: grid; grid-template-columns: 51mm minmax(0, 1fr); align-items: start; gap: 4.5mm; padding-top: 4.2mm; }
  .sidebar, .main-content { display: block; }
  .side-section, .section { border: 0; border-radius: 0; padding: 0; background: #fff; box-shadow: none; }
  .side-section + .side-section { margin-top: 5mm; }
  .side-section { padding: 3mm; border: .2mm solid #d9e4f2; border-radius: 1.5mm; background: #f6f9ff; }
  .side-heading { gap: 1.6mm; margin-bottom: 2.6mm; font-size: 9pt; line-height: 1.4; }
  .side-heading svg { width: 3.5mm; height: 3.5mm; }
  .contact-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5mm; }
  .contact-item { grid-template-columns: 3mm minmax(0, 1fr); gap: 1.7mm; }
  .contact-item > svg { width: 3mm; height: 3mm; margin-top: .7mm; }
  .contact-label { margin-bottom: 0; font-size: 7pt; line-height: 1.4; }
  .contact-value, .contact-actions a { display: inline; min-height: 0; padding: 0; font-size: 7.9pt; line-height: 1.55; }
  .contact-actions { gap: 0 2mm; }
  .contact-actions .zalo-link { font-size: 7.2pt; }
  .skill-group + .skill-group { margin-top: 3mm; padding-top: 3mm; border-top: .2mm solid #dce5f2; }
  .skill-group h3 { margin-bottom: 1mm; font-size: 8pt; line-height: 1.4; }
  .skill-group p { font-size: 8pt; line-height: 1.55; }
  .ai-note { background: #f0f6ff; border-color: #cfdff4; }
  .ai-label { margin-bottom: 1.6mm; padding: .5mm 1.4mm; border-radius: .8mm; font-size: 6.9pt; line-height: 1.55; }
  .ai-note p { font-size: 8pt; line-height: 1.6; }
  .section + .section { margin-top: 4.4mm; }
  .section-heading { gap: 2mm; margin-bottom: 2.7mm; padding-bottom: 1.8mm; border-bottom: .25mm solid #dce5f1; break-after: avoid; }
  .section-heading svg { width: 3.8mm; height: 3.8mm; }
  .section-heading h2 { font-size: 10.5pt; line-height: 1.4; letter-spacing: 0; }
  .summary { font-size: 8.8pt; line-height: 1.55; }
  .job { padding-left: 3mm; border-left-width: .35mm; }
  .job::before { top: 1.3mm; left: -1mm; width: 1.7mm; height: 1.7mm; border-width: .35mm; box-shadow: 0 0 0 .2mm #a8c7f7; }
  .job + .job { margin-top: 3.2mm; }
  .job-heading { display: flex; align-items: baseline; flex-direction: row; gap: .7mm 2mm; }
  .job-heading h3 { font-size: 9pt; line-height: 1.45; }
  .years { font-size: 7.4pt; line-height: 1.5; }
  .company { margin: .8mm 0 1.6mm; font-size: 8pt; line-height: 1.45; }
  .compact .company { margin-bottom: 1mm; }
  .job-points, .project-points { padding-left: 3.5mm; font-size: 8.6pt; line-height: 1.5; }
  .job-points li, .project-points li { padding-left: .3mm; }
  .job-points li + li, .project-points li + li { margin-top: .8mm; }
  .description { font-size: 8.6pt; line-height: 1.5; }
  .project + .project { margin-top: 3.3mm; padding-top: 3.3mm; border-top: .2mm solid #e2e8f0; }
  .project-heading { gap: .5mm 2mm; }
  .project-heading h3 { font-size: 10pt; line-height: 1.4; }
  .project-link { display: inline; min-height: 0; font-size: 7.6pt; line-height: 1.5; }
  .project-type { margin: .8mm 0 1.5mm; font-size: 7.7pt; line-height: 1.4; }
  .project-stack { margin: 0 0 1.7mm; padding: 1mm 1.6mm; border-width: .2mm; border-radius: .7mm; font-size: 7.1pt; line-height: 1.45; }
  .project-notes { margin-top: 1.5mm; font-size: 7.5pt; line-height: 1.5; }
  .job, .project, .side-section { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  p, li { orphans: 2; widows: 2; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}
