/* =============================================================
   Duc Nguyen - portfolio
   tokens -> base -> layout -> components -> responsive
   ============================================================= */

/* ---------- tokens: light (mac dinh) ---------- */
:root {
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Space Grotesk", var(--font-sans);

  --bg: #ffffff;
  --bg-subtle: #f5f7fa;
  --surface: #ffffff;
  --surface-hover: #f9fafc;
  --text: #0d1526;
  --text-muted: #5a6478;
  --text-faint: #8b95a8;
  --border: #e4e8f0;
  --border-strong: #cfd6e4;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: #eff4ff;
  --accent-text: #ffffff;

  --shadow-sm: 0 1px 2px rgba(13, 21, 38, .06);
  --shadow-md: 0 4px 16px -4px rgba(13, 21, 38, .1);
  --shadow-lg: 0 18px 40px -12px rgba(13, 21, 38, .18);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --maxw: 1120px;
  --gutter: clamp(20px, 5vw, 40px);
  --header-h: 68px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  color-scheme: light;
}

/* ---------- tokens: dark ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e17;
    --bg-subtle: #0f1522;
    --surface: #121a29;
    --surface-hover: #17202f;
    --text: #e9eef7;
    --text-muted: #97a3b8;
    --text-faint: #6d798e;
    --border: #1f2937;
    --border-strong: #2c3949;

    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #142136;
    --accent-text: #07101f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .5);
    --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .65);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0a0e17;
  --bg-subtle: #0f1522;
  --surface: #121a29;
  --surface-hover: #17202f;
  --text: #e9eef7;
  --text-muted: #97a3b8;
  --text-faint: #6d798e;
  --border: #1f2937;
  --border-strong: #2c3949;

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: #142136;
  --accent-text: #07101f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, .5);
  --shadow-lg: 0 18px 40px -12px rgba(0, 0, 0, .65);
  color-scheme: dark;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.02em;
}

p {
  margin: 0;
}

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

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

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--accent-text);
  transition: top .2s var(--ease);
}

.skip-link:focus {
  top: 12px;
  color: var(--accent-text);
}

/* ---------- layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(64px, 9vw, 112px);
}

.section--tight {
  padding-block: clamp(48px, 6vw, 72px);
}

.section--subtle {
  background: var(--bg-subtle);
}

.section-head {
  margin-bottom: clamp(32px, 5vw, 52px);
  max-width: 60ch;
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(1.7rem, 3.6vw, 2.4rem);
}

.section-sub {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 1.02rem;
}

.grid {
  display: grid;
  gap: 26px;
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .grid--2 {
    grid-template-columns: 1fr;
  }
}

/* 4 cot -> 2 -> 1. Dat cung de khong bi mo coi 1 the o hang cuoi. */
.grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}

.header.is-stuck {
  border-bottom-color: var(--border);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-right: auto;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.brand:hover {
  color: var(--text);
}

.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  /* Cung gradient voi favicon.svg de nhan dien thong nhat */
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  color: var(--accent-text);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav__link {
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .93rem;
  font-weight: 500;
  transition: color .18s var(--ease), background .18s var(--ease);
}

.nav__link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.nav__link[aria-current="page"] {
  color: var(--text);
  font-weight: 600;
}

.header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color .18s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}

.icon-btn:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.nav-toggle {
  display: none;
}

/* icon theme: mat trang khi dang light, mat troi khi dang dark */
.icon-moon {
  display: block;
}

.icon-sun {
  display: none;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-moon {
    display: none;
  }

  :root:not([data-theme="light"]) .icon-sun {
    display: block;
  }
}

:root[data-theme="dark"] .icon-moon {
  display: none;
}

:root[data-theme="dark"] .icon-sun {
  display: block;
}

:root[data-theme="light"] .icon-moon {
  display: block;
}

:root[data-theme="light"] .icon-sun {
  display: none;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .16s var(--ease), background .18s var(--ease),
    border-color .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  box-shadow: var(--shadow-md);
}

.btn--ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.btn--block {
  width: 100%;
}

.btn[disabled] {
  opacity: .55;
  cursor: not-allowed;
}

.btn svg {
  width: 17px;
  height: 17px;
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  padding-block: clamp(56px, 8vw, 96px) clamp(48px, 7vw, 80px);
}

.hero::before {
  content: "";
  position: absolute;
  top: -180px;
  right: -120px;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  filter: blur(18px);
  pointer-events: none;
}

.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: .84rem;
  font-weight: 500;
}

.badge__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 22%, transparent);
}

.hero__title {
  margin-top: 22px;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  letter-spacing: -.035em;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__text {
  margin-top: 20px;
  max-width: 52ch;
  color: var(--text-muted);
  font-size: 1.08rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(24px, 5vw, 48px);
  margin-top: 42px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.hero__stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: -.02em;
}

.hero__stat span {
  color: var(--text-faint);
  font-size: .86rem;
}

.hero__portrait {
  position: relative;
  justify-self: center;
  width: min(320px, 100%);
}

.hero__portrait img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.hero__portrait::after {
  content: "";
  position: absolute;
  inset: 14px -14px -14px 14px;
  z-index: -1;
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  opacity: .35;
}

/* ---------- project cards ---------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg-subtle);
}

.card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

.card:hover .card__media img {
  transform: scale(1.05);
}

.card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
}

.card__title {
  font-size: 1.12rem;
}

.card__title a {
  color: var(--text);
}

.card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.card__title a:hover {
  color: var(--accent);
}

.card__text {
  flex: 1;
  color: var(--text-muted);
  font-size: .93rem;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 2px;
}

.tag {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-faint);
  font-size: .74rem;
  font-weight: 500;
  letter-spacing: .02em;
}

.card__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: .88rem;
  font-weight: 600;
}

.card__link svg {
  width: 14px;
  height: 14px;
  transition: transform .2s var(--ease);
}

.card:hover .card__link svg {
  transform: translate(2px, -2px);
}

/* ---------- skills ---------- */
.skill {
  padding: 28px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.skill__icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}

.skill__icon svg {
  width: 23px;
  height: 23px;
}

.skill h3 {
  margin-bottom: 9px;
  font-size: 1.1rem;
}

.skill p {
  color: var(--text-muted);
  font-size: .93rem;
}

/* ---------- CTA band ---------- */
.cta {
  padding: clamp(38px, 6vw, 60px);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 55%, #7c3aed));
  color: #fff;
  text-align: center;
}

.cta h2 {
  color: #fff;
  font-size: clamp(1.6rem, 3.6vw, 2.2rem);
}

.cta p {
  max-width: 46ch;
  margin-top: 14px;
  margin-inline: auto;
  color: rgba(255, 255, 255, .9);
}

.cta .btn {
  margin-top: 28px;
  background: #fff;
  color: #1a2233;
}

.cta .btn:hover {
  background: rgba(255, 255, 255, .88);
  color: #1a2233;
}

/* ---------- page header (trang trong) ---------- */
.page-head {
  padding-block: clamp(48px, 7vw, 76px) clamp(28px, 4vw, 44px);
}

.page-head h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
}

.page-head p {
  max-width: 56ch;
  margin-top: 16px;
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* ---------- footer ---------- */
.footer {
  padding-block: 44px 36px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
}

.footer__nav a {
  color: var(--text-muted);
  font-size: .92rem;
}

.footer__nav a:hover {
  color: var(--text);
}

.socials {
  display: flex;
  gap: 8px;
}

.socials a {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: color .18s var(--ease), border-color .18s var(--ease);
}

.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.socials svg {
  width: 17px;
  height: 17px;
}

.footer__legal {
  width: 100%;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--text-faint);
  font-size: .86rem;
}

/* ---------- reveal on scroll ---------- */
/* Chi an khi JS chay (html.js). Khong co JS -> noi dung hien binh thuong. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}

.js .reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero__inner {
    grid-template-columns: 1fr;
  }

  .hero__portrait {
    order: -1;
    justify-self: start;
    width: min(220px, 60%);
  }

}

@media (max-width: 760px) {
  .nav-toggle {
    display: grid;
  }

  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 14px var(--gutter) 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s;
  }

  .nav.is-open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }

  .nav__link {
    padding: 12px 14px;
    font-size: 1rem;
  }


  .footer__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

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

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

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* =============================================================
   Full-page slides — chi ap dung cho trang chu (html.slides)
   ============================================================= */
html.slides {
  /* Da bo scroll-snap: card stack dung position:sticky, moi section tu giu
     lai mot khung nhin nen khong can snap. Bo snap cung loai bo han cac loi
     "nhay coc" / "khong cuon len duoc" truoc day. */
  scroll-padding-top: var(--header-h);
}

/* ---------- vertical card stack ----------
   Moi section sticky o duoi header. Section sau truot len de len section
   truoc nhu mot chong the bai. Section truoc bi che thi thu nho + mo di.
   ------------------------------------------------------------------ */
.slides .slide {
  position: sticky;
  top: var(--header-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100svh - var(--header-h));
  padding-block: clamp(24px, 4.5vh, 56px);
  /* Bat buoc co nen dac, neu khong se nhin xuyen xuong section duoi */
  background: var(--bg);
}

.slides .slide.section--subtle {
  background: var(--bg-subtle);
}

/* Cac the tu thu 2 tro di bo goc tren + do bong -> nhin ra la mot the
   dang truot de len the truoc */
.slides .slide + .slide {
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 44px -14px rgba(0, 0, 0, .3);
}

/* JS dat transform len .wrap (con ben trong), TUYET DOI khong len .slide:
   .slide la phan tu sticky, transform tren no se pha vi tri sticky. */
.slides .slide > .wrap {
  will-change: transform, opacity;
}

.slides .footer {
  position: relative;
  z-index: 1;
}

/* ---------- cham dieu huong ---------- */
.dots {
  position: fixed;
  right: 20px;
  top: 50%;
  z-index: 90;
  display: none;
  grid-auto-flow: row;
  gap: 14px;
  transform: translateY(-50%);
}

html.slides .dots {
  display: grid;
}

.dots button {
  position: relative;
  width: 10px;
  height: 10px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}

.dots button:hover {
  border-color: var(--accent);
}

.dots button[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.4);
}

/* nhan ten section khi hover */
.dots button::after {
  content: attr(data-label);
  position: absolute;
  right: 22px;
  top: 50%;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font-size: .74rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-50%) translateX(6px);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}

.dots button:hover::after,
.dots button:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---------- animation vao slide ---------- */
.js .slide-in > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

.js .slide-in.is-in > * {
  opacity: 1;
  transform: none;
}

/* hero: vao ngay khi tai trang */
.js .hero__inner > div > *,
.js .hero__portrait {
  animation: rise .8s var(--ease) both;
}

.js .hero__inner > div > *:nth-child(1) { animation-delay: .05s; }
.js .hero__inner > div > *:nth-child(2) { animation-delay: .13s; }
.js .hero__inner > div > *:nth-child(3) { animation-delay: .21s; }
.js .hero__inner > div > *:nth-child(4) { animation-delay: .29s; }
.js .hero__inner > div > *:nth-child(5) { animation-delay: .37s; }
.js .hero__portrait { animation-delay: .18s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

/* ---------- man hinh nho / thap: tat snap ---------- */
@media (max-width: 900px), (max-height: 720px) {
  /* Man hinh nho: bo stack, tra ve cuon thuong cho de doc */
  .slides .slide {
    position: static;
    display: block;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .slides .slide > .wrap {
    transform: none !important;
    opacity: 1 !important;
  }

  html.slides .dots {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {

  .js .slide-in > *,
  .js .hero__inner > div > *,
  .js .hero__portrait {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* =============================================================
   Chuyen canh kieu dien anh
   ============================================================= */
:root {
  --ease-film: cubic-bezier(.16, .84, .36, 1);
}

/* Khi JS dang tu cuon: tat snap va tat scroll-behavior de khong danh nhau
   voi vong lap requestAnimationFrame. */
html.is-moving {
  scroll-behavior: auto;
}

/* Noi dung slide: mo dan + day len + net dan (blur -> ro), cham va muot */
html.js.slides .slide-in > * {
  opacity: 0;
  transform: translateY(38px) scale(.98);
  filter: blur(10px);
  transition:
    opacity .95s var(--ease-film),
    transform .95s var(--ease-film),
    filter .95s var(--ease-film);
}

html.js.slides .slide-in.is-in > * {
  opacity: 1;
  transform: none;
  filter: blur(0);
}

/* Slide chua toi luot thi lui lai mot chut -> cam giac chuyen canh */
/* Chi bao tu chay: vach tien do duoi chan chan dieu huong */
.dots::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 2px;
  height: 0;
  background: var(--accent);
  border-radius: 2px;
  transform: translateX(-50%);
  opacity: 0;
}

html.is-autoplay .dots::after {
  height: 16px;
  opacity: .8;
  animation: tick 3s linear;
}

@keyframes tick {
  from { height: 0; }
  to { height: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  html.js.slides .slide-in > * {
    opacity: 1;
    transform: none;
    filter: none;
  }

  }

/* =============================================================
   Trang Experience: timeline + bang cap + khoi lien he
   ============================================================= */
.timeline {
  position: relative;
  display: grid;
  gap: 26px;
}

/* Duong doc noi cac moc */
.timeline::before {
  content: "";
  position: absolute;
  left: 11px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(var(--accent), color-mix(in srgb, var(--accent) 15%, transparent));
}

.job {
  position: relative;
  padding-left: 46px;
}

/* Cham tron tren duong timeline */
.job::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 26px;
  width: 16px;
  height: 16px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
}

.job__card {
  padding: 24px 26px 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

.job__card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.job__top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.job__org {
  font-family: var(--font-display);
  font-size: 1.16rem;
  font-weight: 600;
  letter-spacing: -.02em;
}

.job__date {
  padding: 4px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-faint);
  font-size: .76rem;
  font-weight: 600;
  white-space: nowrap;
}

.job__role {
  margin-top: 4px;
  color: var(--accent);
  font-size: .95rem;
  font-weight: 600;
}

.job__list {
  display: grid;
  gap: 9px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.job__list li {
  position: relative;
  padding-left: 22px;
  color: var(--text-muted);
  font-size: .94rem;
}

.job__list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
  opacity: .55;
}

.job .tags {
  margin-top: 18px;
}

/* ---------- bang cap / chung chi ---------- */
.creds {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
  gap: 18px;
}

.cred {
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.cred__year {
  color: var(--accent);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
}

.cred h3 {
  margin: 9px 0 6px;
  font-size: 1.02rem;
}

.cred p {
  color: var(--text-muted);
  font-size: .9rem;
}

/* ---------- khoi lien he cuoi trang ---------- */
.reach {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.reach h2 {
  font-size: 1.3rem;
}

.reach p {
  margin-top: 6px;
  color: var(--text-muted);
  font-size: .95rem;
}

.reach__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 620px) {
  .job {
    padding-left: 34px;
  }

  .job__card {
    padding: 20px 20px 22px;
  }

  .reach {
    padding: 24px;
  }

  .reach__links .btn {
    flex: 1 1 auto;
  }
}

/* ---------- bang ky nang (trang Experience) ---------- */
.skillset {
  display: grid;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.skillset__row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: baseline;
  padding: 18px 24px;
  border-top: 1px solid var(--border);
}

.skillset__row:first-child {
  border-top: 0;
}

.skillset__label {
  color: var(--text);
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 600;
}

.skillset__row .tags {
  margin: 0;
}

.skillset__row p {
  color: var(--text-muted);
  font-size: .93rem;
}

@media (max-width: 640px) {
  .skillset__row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 16px 18px;
  }
}

/* Vi tri hien tai / gan nhat noi bat hon */
.job--lead .job__card {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent);
}

.job--lead::before {
  background: var(--accent);
}

.job__badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
}
