/* ==========================================================================
   portfolio.css — Giao diện trang cá nhân chuyên nghiệp
   Bảng màu & biến được điều khiển từ public/data/portfolio.js (mục "theme").
   ========================================================================== */

/* --------------------------------- Tokens -------------------------------- */
:root {
  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --radius: 18px;

  --bg: #070910;
  --bg-alt: #0b0d16;
  --surface: rgba(255, 255, 255, 0.032);
  --surface-strong: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --muted: #98a1b8;
  --shadow: 0 18px 45px -22px rgba(0, 0, 0, 0.85);
  --shadow-lg: 0 34px 70px -30px rgba(0, 0, 0, 0.9);
  --grid-line: rgba(255, 255, 255, 0.035);

  --container: 1160px;
  --header-h: 68px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-alt: #ffffff;
  --surface: rgba(15, 23, 42, 0.026);
  --surface-strong: rgba(15, 23, 42, 0.05);
  --border: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.18);
  --text: #0f172a;
  --muted: #5a6579;
  --shadow: 0 18px 40px -26px rgba(15, 23, 42, 0.45);
  --shadow-lg: 0 32px 60px -32px rgba(15, 23, 42, 0.4);
  --grid-line: rgba(15, 23, 42, 0.035);
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background 0.4s var(--ease), color 0.4s var(--ease);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(58rem 34rem at 12% -8%, color-mix(in srgb, var(--accent) 26%, transparent), transparent 62%),
    radial-gradient(46rem 30rem at 92% 4%, color-mix(in srgb, var(--accent-2) 20%, transparent), transparent 60%),
    radial-gradient(40rem 30rem at 50% 108%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 65%);
  opacity: 0.85;
  pointer-events: none;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 62px 62px;
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 78%);
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 78%);
  pointer-events: none;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

/* Nhiều khối dùng display:flex/grid nên phải ghi đè [hidden] của trình duyệt */
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: -0.022em;
  font-weight: 700;
}

p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

/* ------------------------------- Typography ------------------------------ */
.container {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
}

.gradient-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* --------------------------------- Buttons -------------------------------- */
.btn {
  --btn-bg: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.82rem 1.4rem;
  border: 1px solid transparent;
  border-radius: calc(var(--radius) * 0.62);
  background: var(--btn-bg);
  color: #fff;
  font-weight: 600;
  font-size: 0.945rem;
  letter-spacing: 0.005em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease),
              background 0.25s var(--ease), border-color 0.25s var(--ease), color 0.25s var(--ease);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.28), transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.65s var(--ease);
}
.btn:hover::after { transform: translateX(120%); }

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px -18px color-mix(in srgb, var(--accent) 90%, transparent);
}
.btn:active { transform: translateY(0); }

.btn--primary { background: linear-gradient(120deg, var(--accent), var(--accent-2)); }

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  backdrop-filter: blur(12px);
}
.btn--ghost:hover {
  background: var(--surface-strong);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.btn--sm { padding: 0.55rem 0.95rem; font-size: 0.86rem; border-radius: 10px; }

/* ---------------------------------- Header -------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 90;
  height: var(--header-h);
  display: flex;
  align-items: center;
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease), backdrop-filter 0.35s;
}

.header.is-stuck {
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom-color: var(--border);
}

.header__inner {
  width: min(100% - 2.5rem, var(--container));
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.brand__mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
  box-shadow: 0 8px 20px -10px var(--accent);
  flex: none;
}

.brand__text { font-size: 1rem; }
.brand__role {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.nav__link {
  position: relative;
  padding: 0.5rem 0.8rem;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.22s var(--ease), background 0.22s var(--ease);
}
.nav__link:hover { color: var(--text); background: var(--surface); }
.nav__link.is-active { color: var(--text); }
.nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 0.8rem;
  right: 0.8rem;
  bottom: 0.15rem;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.header__actions { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.4rem; }

.icon-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.22s, background 0.22s, border-color 0.22s, transform 0.22s var(--ease);
}
.icon-btn:hover { color: var(--text); background: var(--surface-strong); border-color: var(--border-strong); transform: translateY(-1px); }

.nav-toggle { display: none; }

/* ---------------------------------- Hero ---------------------------------- */
.hero {
  padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5rem);
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.4rem 0.9rem 0.4rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
}

.badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16);
  animation: pulse 2.2s infinite;
  flex: none;
}
.badge.is-busy .badge__dot { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.55; transform: scale(0.82); }
}

.hero__greeting {
  margin: 1.5rem 0 0.35rem;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 500;
  color: var(--muted);
  min-height: 1.4em;
}

.hero__name {
  margin: 0 0 0.4rem;
  font-size: clamp(2.4rem, 6.4vw, 4.3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.hero__role {
  font-size: clamp(1.05rem, 2.6vw, 1.5rem);
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 1.15rem;
}

.hero__tagline {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: var(--muted);
  max-width: 56ch;
  margin-bottom: 1.9rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1.9rem; }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  font-size: 0.885rem;
  color: var(--muted);
}
.hero__meta span { display: inline-flex; align-items: center; gap: 0.45rem; }
.hero__meta svg { width: 15px; height: 15px; opacity: 0.75; }

/* Avatar */
.hero__visual { position: relative; display: grid; place-items: center; }

.avatar {
  position: relative;
  width: clamp(190px, 26vw, 268px);
  aspect-ratio: 1;
  border-radius: 30% 70% 66% 34% / 36% 32% 68% 64%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: morph 14s var(--ease) infinite;
}

.avatar img { width: 100%; height: 100%; object-fit: cover; }

.avatar__initials {
  color: #fff;
  font-size: clamp(2.6rem, 7vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

@keyframes morph {
  0%, 100% { border-radius: 30% 70% 66% 34% / 36% 32% 68% 64%; }
  33% { border-radius: 58% 42% 38% 62% / 52% 44% 56% 48%; }
  66% { border-radius: 42% 58% 62% 38% / 40% 62% 38% 60%; }
}

.hero__visual::before,
.hero__visual::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
  inset: -8%;
  animation: spin 26s linear infinite;
  pointer-events: none;
}
.hero__visual::after { inset: -20%; border-style: dashed; animation-duration: 40s; animation-direction: reverse; opacity: 0.55; }

@keyframes spin { to { transform: rotate(360deg); } }

.social-row { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: 1.9rem; }

.social {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  transition: all 0.25s var(--ease);
}
.social svg { width: 18px; height: 18px; }
.social:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 12px 26px -14px var(--accent);
}

/* -------------------------------- Sections -------------------------------- */
.section { padding: clamp(3.2rem, 7vw, 5.6rem) 0; }
.section--alt { background: color-mix(in srgb, var(--bg-alt) 55%, transparent); border-block: 1px solid var(--border); }

.section__head { margin-bottom: clamp(2rem, 4vw, 3.2rem); }

.section__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section__eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.section__title { font-size: clamp(1.7rem, 3.6vw, 2.5rem); margin-bottom: 0.6rem; }
.section__desc { color: var(--muted); max-width: 62ch; }
.section__head--center { text-align: center; }
.section__head--center .section__eyebrow::before { display: none; }
.section__head--center .section__desc { margin-inline: auto; }

/* Cards dùng chung */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  backdrop-filter: blur(10px);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease),
              background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

/* ---------------------------------- About --------------------------------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: clamp(1.6rem, 4vw, 3rem);
  align-items: start;
}

.about__summary { color: var(--muted); font-size: 1.03rem; margin-bottom: 1.6rem; }

.about__list { display: grid; gap: 0.7rem; }
.about__list li { display: flex; gap: 0.7rem; align-items: flex-start; color: var(--muted); }
.about__list svg { width: 20px; height: 20px; flex: none; color: var(--accent); margin-top: 2px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }

.stat {
  padding: 1.35rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 0.85);
  background: var(--surface);
  text-align: center;
  transition: transform 0.28s var(--ease), border-color 0.28s var(--ease);
}
.stat:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.stat__value {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label { font-size: 0.82rem; color: var(--muted); margin-top: 0.15rem; }

/* -------------------------------- Services -------------------------------- */
.grid { display: grid; gap: 1.1rem; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.service { position: relative; overflow: hidden; }
.service:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: var(--shadow); }

.service__icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 1.1rem;
}
.service__icon svg { width: 23px; height: 23px; }
.service h3 { font-size: 1.1rem; margin-bottom: 0.45rem; }
.service p { color: var(--muted); font-size: 0.935rem; }

/* --------------------------------- Skills --------------------------------- */
.skills { display: grid; gap: 1.6rem; }

.skill-group__title {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}
.skill-group__title::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.skill {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr) 46px;
  gap: 0.6rem 1.1rem;
  align-items: center;
  margin-bottom: 0.95rem;
}
.skill__name { font-weight: 600; font-size: 0.94rem; }
.skill__bar { height: 8px; border-radius: 999px; background: var(--surface-strong); overflow: hidden; }
.skill__fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 1.1s var(--ease);
}
.skill__value { font-size: 0.82rem; font-weight: 600; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* -------------------------------- Timeline -------------------------------- */
.timeline { position: relative; display: grid; gap: 1.3rem; padding-left: 2.1rem; }
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
  opacity: 0.55;
}

.timeline__item { position: relative; }
.timeline__item::before {
  content: "";
  position: absolute;
  left: -2.1rem;
  top: 22px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
}

.timeline__item:hover { transform: translateX(4px); transition: transform 0.3s var(--ease); }

.job__top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem 0.9rem; margin-bottom: 0.3rem; }
.job__role { font-size: 1.12rem; }
.job__company { color: var(--accent); font-weight: 600; font-size: 0.95rem; }
.job__period { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.job__sub { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.8rem; display: flex; flex-wrap: wrap; gap: 0.4rem 0.9rem; }
.job__summary { color: var(--muted); font-size: 0.94rem; margin-bottom: 0.7rem; }
.job__points { display: grid; gap: 0.45rem; }
.job__points li { display: flex; gap: 0.6rem; color: var(--muted); font-size: 0.925rem; }
.job__points svg { width: 16px; height: 16px; color: var(--accent); flex: none; margin-top: 4px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.755rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.chip--live { color: #22c55e; border-color: rgba(34, 197, 94, 0.4); background: rgba(34, 197, 94, 0.1); }

/* -------------------------------- Projects -------------------------------- */
.project { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.project:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: var(--shadow); }

.project__cover {
  position: relative;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 32%, transparent), color-mix(in srgb, var(--accent-2) 26%, transparent));
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.project__cover img { width: 100%; height: 100%; object-fit: cover; }

.project__year {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}
.project__featured {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.project__placeholder { display: grid; place-items: center; color: rgba(255, 255, 255, 0.9); }
.project__placeholder svg { width: 46px; height: 46px; opacity: 0.85; }

.project__body { padding: 1.3rem 1.4rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.project__title { font-size: 1.12rem; margin-bottom: 0.5rem; }
.project__desc { color: var(--muted); font-size: 0.92rem; margin-bottom: 1rem; }
.project__tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.1rem; }
.project__links { display: flex; flex-wrap: wrap; gap: 0.55rem; margin-top: auto; }

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.845rem;
  font-weight: 600;
  color: var(--muted);
  transition: all 0.24s var(--ease);
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { color: #fff; background: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

/* -------------------------------- Education ------------------------------- */
.edu { display: flex; gap: 1.2rem; align-items: flex-start; }
.edu__icon {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}
.edu__icon svg { width: 22px; height: 22px; }
.edu__degree { font-size: 1.02rem; margin-bottom: 0.15rem; }
.edu__school { color: var(--accent); font-weight: 600; font-size: 0.92rem; }
.edu__period { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.edu__note { font-size: 0.88rem; color: var(--muted); margin-top: 0.5rem; }

/* --------------------------------- Contact -------------------------------- */
.contact__panel {
  position: relative;
  overflow: hidden;
  padding: clamp(2rem, 5vw, 3.4rem);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.25);
  background:
    radial-gradient(38rem 20rem at 88% -20%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 62%),
    var(--surface);
  text-align: center;
  backdrop-filter: blur(12px);
}

.contact__title { font-size: clamp(1.6rem, 4vw, 2.3rem); margin-bottom: 0.7rem; }
.contact__desc { color: var(--muted); max-width: 52ch; margin: 0 auto 1.9rem; }
.contact__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center; }

.contact__links { display: grid; gap: 0.7rem; margin-top: 2.2rem; text-align: left; }

.contact__link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.85rem 1.05rem;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
  transition: all 0.25s var(--ease);
}
.contact__link:hover { border-color: var(--border-strong); background: var(--surface-strong); transform: translateX(4px); }
.contact__link svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.contact__link span { font-size: 0.92rem; overflow-wrap: anywhere; }
.contact__link small { display: block; font-size: 0.74rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ---------------------------------- Footer -------------------------------- */
.footer { padding: 2.4rem 0; border-top: 1px solid var(--border); }
.footer__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; font-size: 0.87rem; color: var(--muted); }

/* -------------------------------- Utilities -------------------------------- */
.scroll-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 80;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(14px);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: all 0.32s var(--ease);
}
.scroll-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.scroll-top:hover { color: #fff; background: var(--accent); border-color: var(--accent); }

.notice {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  padding: 0.85rem 1.05rem;
  margin-bottom: 2rem;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 13px;
  background: rgba(245, 158, 11, 0.09);
  color: #fcd34d;
  font-size: 0.88rem;
}
html[data-theme="light"] .notice { color: #92400e; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice code { font-size: 0.84em; padding: 0.1em 0.4em; border-radius: 5px; background: rgba(0, 0, 0, 0.28); }

.empty { color: var(--muted); font-style: italic; font-size: 0.94rem; padding: 1.2rem 0; }

/* Reveal animation */
[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

.caret {
  display: inline-block;
  width: 3px;
  height: 1em;
  margin-left: 2px;
  background: var(--accent);
  vertical-align: -0.14em;
  animation: blink 1.05s steps(2, start) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

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

/* -------------------------------- Responsive ------------------------------- */
@media (max-width: 940px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__visual { order: -1; }
  /* Vòng trang trí đặt tuyệt đối sẽ tràn ngang khi hero thành 1 cột -> ẩn để
     không tạo thanh cuộn ngang / bị trình duyệt mobile thu nhỏ trang. */
  .hero__visual::before,
  .hero__visual::after { display: none; }
  .hero__actions, .social-row { justify-content: center; }
  .hero__tagline { margin-inline: auto; }
  .hero__meta { justify-content: center; }
  .about__grid { grid-template-columns: 1fr; }
}

@media (max-width: 940px) {
  :root { --header-h: 60px; }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    padding: 0.9rem;
    background: color-mix(in srgb, var(--bg) 96%, transparent);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.34s var(--ease);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .nav.is-open { transform: translateY(0); }
  .nav__link { padding: 0.7rem 0.9rem; }
  .nav__link.is-active::after { display: none; }
  .nav-toggle { display: grid; margin-left: auto; }
  .header__actions { margin-left: 0; }
  .header__actions .btn { display: none; }

  .hero__visual::before { inset: -4%; }
  .hero__visual::after { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .skill { grid-template-columns: minmax(0, 1fr) 44px; }
  .skill__bar { grid-column: 1 / -1; }
  .job__period { margin-left: 0; width: 100%; }
  .timeline { padding-left: 1.6rem; }
  .timeline__item::before { left: -1.6rem; }
  .footer__inner { flex-direction: column; text-align: center; }
}

@media (max-width: 420px) {
  .hero__actions .btn { width: 100%; }
  .contact__actions .btn { width: 100%; }
}

/* Điện thoại nằm ngang: đưa chữ về cạnh avatar để không phải cuộn mới thấy tên. */
@media (max-width: 940px) and (max-height: 520px) and (orientation: landscape) {
  .hero { padding: 1.6rem 0 2rem; }
  .hero__grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1.5rem;
    text-align: left;
  }
  .hero__visual { order: 0; }
  .hero__actions, .social-row, .hero__meta { justify-content: flex-start; }
  .hero__tagline { margin-inline: 0; }
  .hero__name { font-size: clamp(1.75rem, 4vw, 2.5rem); }
  .avatar { width: clamp(140px, 24vw, 200px); }
}

@media print {
  .header, .scroll-top, .hero__actions, .social-row { display: none !important; }
  body { background: #fff; color: #000; }
  body::before, body::after { display: none; }
  .card, .stat, .timeline__item { break-inside: avoid; border-color: #ddd; }
}