/* ===== Biến màu & cơ bản ===== */
:root {
  --bg: #0b0d14;
  --bg-alt: #10131d;
  --surface: #161a27;
  --border: #252b3d;
  --text: #e8eaf2;
  --muted: #9aa1b8;
  --accent: #ff9a5a;   /* cam hoàng hôn */
  --accent-2: #ff5fa2; /* hồng */
  --accent-3: #6aa8ff; /* xanh biển */
  --radius: 16px;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

body {
  font-family: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.container { width: min(1100px, 100% - 32px); margin-inline: auto; }

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

/* ===== Nút ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 12px 24px; border-radius: 999px; font-weight: 600;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn--primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #14101a;
  box-shadow: 0 8px 24px -8px rgba(255, 110, 140, .6);
}
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px -8px rgba(255, 110, 140, .8); }
.btn--ghost { border: 1px solid var(--border); background: rgba(255,255,255,.03); }
.btn--ghost:hover { background: rgba(255,255,255,.08); transform: translateY(-2px); }

/* ===== Thanh điều hướng ===== */
.nav {
  position: fixed; inset: 0 0 auto 0; height: var(--nav-h); z-index: 50;
  background: rgba(11, 13, 20, .7);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.nav__logo { font-size: 1.5rem; font-weight: 800; letter-spacing: .5px; }
.nav__logo span { color: var(--accent); }
.nav__links { display: flex; gap: 32px; }
.nav__links a { color: var(--muted); font-weight: 500; position: relative; transition: color .2s; }
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--accent); transition: width .25s;
}
.nav__links a:hover, .nav__links a.active { color: var(--text); }
.nav__links a:hover::after, .nav__links a.active::after { width: 100%; }

.nav__toggle { display: none; background: none; border: 0; cursor: pointer; width: 40px; height: 40px; padding: 8px; }
.nav__toggle span { display: block; height: 2px; background: var(--text); margin: 5px 0; border-radius: 2px; transition: transform .3s, opacity .3s; }
.nav__toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle.open span:nth-child(2) { opacity: 0; }
.nav__toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center; position: relative;
  padding: calc(var(--nav-h) + 40px) 0 80px;
  background:
    radial-gradient(600px 400px at 85% 20%, rgba(255, 154, 90, .18), transparent 70%),
    radial-gradient(500px 400px at 10% 80%, rgba(106, 168, 255, .14), transparent 70%);
}
.hero__inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 56px; align-items: center; }
.hero__hello { color: var(--accent); font-weight: 600; letter-spacing: 1px; }
.hero__name { font-size: clamp(2.2rem, 6vw, 4rem); line-height: 1.15; font-weight: 800; margin: 8px 0 12px; }
.hero__role { font-size: clamp(1.05rem, 2.4vw, 1.35rem); color: var(--text); font-weight: 500; min-height: 1.7em; }
.hero__role::after { content: "|"; margin-left: 2px; color: var(--accent); animation: blink 1s steps(1) infinite; }
.hero__desc { color: var(--muted); margin: 16px 0 28px; max-width: 520px; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; }

.hero__avatar { display: flex; justify-content: center; }
.avatar-ring {
  width: min(360px, 80vw); aspect-ratio: 3 / 4; border-radius: 28px; padding: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2), var(--accent-3));
  box-shadow: 0 30px 60px -20px rgba(255, 120, 120, .45);
  animation: float 6s ease-in-out infinite;
}
.avatar-ring img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }

.scroll-hint {
  position: absolute; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid var(--muted); border-radius: 14px;
}
.scroll-hint span {
  position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
  background: var(--accent); border-radius: 2px; animation: scroll 1.6s infinite;
}

/* ===== Section chung ===== */
.section { padding: 96px 0; }
.section--alt { background: var(--bg-alt); }
.section__title { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 800; text-align: center; margin-bottom: 48px; }

/* ===== Giới thiệu ===== */
.about {
  max-width: 800px; margin-inline: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 36px;
}
.about p { color: var(--muted); margin-bottom: 16px; }
.about strong { color: var(--text); }
.about__facts { list-style: none; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 16px; margin-top: 24px; }
.about__facts li { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; min-width: 0; }
.about__facts span { display: block; font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.about__facts a { font-weight: 600; word-break: break-all; transition: color .2s; }
.about__facts a:hover { color: var(--accent); }

/* ===== Video ===== */
.video-wrap {
  position: relative; max-width: 900px; margin-inline: auto;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: #000;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.video-wrap video { width: 100%; height: auto; aspect-ratio: 1144 / 576; }
.sound-btn {
  position: absolute; top: 14px; right: 14px;
  padding: 8px 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: inherit; font-weight: 600; font-size: .9rem; color: #14101a;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.6);
  transition: opacity .3s, transform .2s;
}
.sound-btn:hover { transform: scale(1.05); }
.sound-btn.hidden { opacity: 0; pointer-events: none; }
.video-note { text-align: center; color: var(--muted); font-size: .9rem; margin-top: 14px; }

/* ===== Kỹ năng ===== */
.skills { display: grid; grid-template-columns: 1fr 1.2fr; gap: 32px; align-items: start; }
.skill-bars {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px;
}
.skill-bars h3, .card h3 { font-size: 1.15rem; margin-bottom: 20px; }
.bar { margin-bottom: 20px; }
.bar:last-child { margin-bottom: 0; }
.bar__head { display: flex; justify-content: space-between; font-weight: 500; margin-bottom: 8px; }
.bar__pct { color: var(--accent); }
.bar__track { height: 10px; background: var(--bg); border-radius: 999px; overflow: hidden; }
.bar__fill {
  height: 100%; width: 0; border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2), var(--accent));
  transition: width 1.4s cubic-bezier(.2, .8, .2, 1);
}

.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px; transition: transform .25s, border-color .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: 0 18px 40px -20px rgba(255, 154, 90, .5); }
.card__icon {
  width: 52px; height: 52px; display: grid; place-items: center; font-size: 1.6rem;
  border-radius: 14px; background: rgba(255, 154, 90, .12); margin-bottom: 16px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: .95rem; }

/* ===== Liên hệ ===== */
.contact__lead { text-align: center; color: var(--muted); margin: -28px 0 40px; }
.contact { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.contact__item {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px 16px; min-width: 0;
  transition: transform .25s, border-color .25s, background .25s;
}
.contact__item svg { width: 40px; height: 40px; fill: var(--accent); margin-bottom: 8px; transition: transform .25s; }
.contact__item:hover { transform: translateY(-6px); border-color: var(--accent-2); background: #1b2030; }
.contact__item:hover svg { transform: scale(1.12); }
.contact__label { font-weight: 700; }
.contact__value { color: var(--muted); font-size: .9rem; word-break: break-all; }

/* ===== Footer & nút lên đầu ===== */
.footer { padding: 28px 0; text-align: center; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--border); }

.to-top {
  position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; border-radius: 50%;
  border: 0; cursor: pointer; font-size: 1.2rem; font-weight: 700; color: #14101a;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .3s, transform .3s; z-index: 40;
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ===== Hiệu ứng xuất hiện ===== */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

@keyframes blink { 50% { opacity: 0; } }
@keyframes float { 50% { transform: translateY(-12px); } }
@keyframes scroll { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(14px); } }

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

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .skills { grid-template-columns: 1fr; }
  .contact { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: rgba(11, 13, 20, .97); border-bottom: 1px solid var(--border);
    max-height: 0; overflow: hidden; transition: max-height .35s ease;
  }
  .nav__links.open { max-height: 320px; }
  .nav__links a { padding: 16px; text-align: center; border-top: 1px solid var(--border); }
  .nav__links a::after { display: none; }

  .hero__inner { grid-template-columns: 1fr; text-align: center; gap: 40px; }
  .hero__avatar { order: -1; }
  .avatar-ring { width: min(260px, 70vw); }
  .hero__desc { margin-inline: auto; }
  .hero__actions { justify-content: center; }
  .scroll-hint { display: none; }

  .section { padding: 72px 0; }
  .about { padding: 24px; }
  .about__facts { grid-template-columns: 1fr; }
  .skill-bars { padding: 24px; }
}

@media (max-width: 520px) {
  .cards { grid-template-columns: 1fr; }
  .contact { grid-template-columns: 1fr; }
  .contact__item { flex-direction: row; text-align: left; padding: 18px 20px; gap: 14px; }
  .contact__item svg { margin: 0; width: 32px; height: 32px; flex-shrink: 0; }
  .contact__label { min-width: 84px; }
  .btn { width: 100%; }
  .sound-btn { top: 8px; right: 8px; padding: 6px 12px; font-size: .8rem; }
}
