/* ============================================================
   MINH TÚ ✦ MIKU PORTFOLIO — stylesheet
   Bảng màu Hatsune Miku: teal #39C5BB • hồng #FF7BAC • magenta #E12885
   ============================================================ */

:root {
  --teal: #39c5bb;
  --teal-bright: #5ffbf1;
  --teal-soft: rgba(57, 197, 187, .18);
  --pink: #ff7bac;
  --magenta: #e12885;
  --bg-dark: #071019;
  --bg-deep: #0b1622;
  --ink: #eafcff;
  --ink-dim: #a8c9d4;
  --glass: rgba(10, 30, 45, .58);
  --glass-border: rgba(57, 197, 187, .35);
  --font-head: 'Baloo 2', 'Quicksand', 'Segoe UI', system-ui, sans-serif;
  --font-body: 'Quicksand', 'Segoe UI', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--ink);
  overflow-x: hidden;
  min-height: 100vh;
}

::selection { background: var(--teal); color: var(--bg-dark); }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: linear-gradient(var(--teal), var(--magenta)); border-radius: 8px; }

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

/* ---------- Nền ---------- */
.bg-layer {
  position: fixed; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transition: opacity 1.2s ease;
  z-index: -3; transform: scale(1.05);
  animation: bgDrift 30s ease-in-out infinite alternate;
}
.bg-layer.active { opacity: .5; }
@keyframes bgDrift { from { transform: scale(1.05) translateY(0); } to { transform: scale(1.12) translateY(-14px); } }

.bg-shade {
  position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(57,197,187,.12), transparent 50%),
    radial-gradient(ellipse at 80% 90%, rgba(225,40,133,.10), transparent 50%),
    linear-gradient(180deg, rgba(7,16,25,.78), rgba(7,16,25,.9));
}

#particles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }

/* lớp hiệu ứng phủ trên: hoa anh đào rơi + burst khi click */
#fx { position: fixed; inset: 0; z-index: 45; pointer-events: none; }

/* thanh tiến trình cuộn trang */
#scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 70;
  background: linear-gradient(90deg, var(--teal), var(--pink));
  box-shadow: 0 0 10px rgba(57, 197, 187, .8);
  transition: width .1s linear;
}

/* ---------- Con trỏ tùy chỉnh ---------- */
#cursor-dot, #cursor-ring {
  position: fixed; top: 0; left: 0; pointer-events: none; z-index: 999;
  border-radius: 50%; transform: translate(-50%, -50%);
}
#cursor-dot { width: 8px; height: 8px; background: var(--teal-bright); box-shadow: 0 0 12px var(--teal-bright); }
#cursor-ring { width: 36px; height: 36px; border: 2px solid rgba(95,251,241,.6); transition: width .25s, height .25s, border-color .25s; }
#cursor-ring.big { width: 58px; height: 58px; border-color: var(--pink); }
@media (hover: none) { #cursor-dot, #cursor-ring { display: none; } }

/* ---------- Màn hình khởi động MIKU OS ---------- */
#loader { position: fixed; inset: 0; z-index: 200; overflow: hidden; }
#loader.done { visibility: hidden; }

/* hai cánh màn sân khấu */
.curtain {
  position: absolute; top: 0; bottom: 0; width: 50.6%;
  transition: transform 1.1s cubic-bezier(.77, 0, .18, 1);
}
.curtain.l {
  left: 0; background: linear-gradient(90deg, #050b12, #0b1622);
  border-right: 2px solid var(--teal);
  box-shadow: inset -30px 0 60px rgba(57, 197, 187, .12);
}
.curtain.r {
  right: 0; background: linear-gradient(-90deg, #050b12, #0b1622);
  border-left: 2px solid var(--pink);
  box-shadow: inset 30px 0 60px rgba(225, 40, 133, .12);
}
#loader.opening .curtain.l { transform: translateX(-101%); }
#loader.opening .curtain.r { transform: translateX(101%); }

.loader-box {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 15px; text-align: center;
  transition: opacity .45s ease, transform .45s ease;
}
#loader.opening .loader-box { opacity: 0; transform: scale(.9); }

/* scanline holographic */
.loader-box::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
  animation: scanMove 5s linear infinite;
}
@keyframes scanMove { to { background-position: 0 120px; } }

.loader-logo {
  font-family: var(--font-head); font-size: 2.5rem; font-weight: 800;
  color: var(--teal-bright); letter-spacing: 7px;
  text-shadow: 0 0 24px rgba(95, 251, 241, .8);
  animation: logoFlicker 2.4s ease-in-out infinite;
}
.loader-logo span { color: var(--pink); text-shadow: 0 0 24px rgba(255, 123, 172, .8); }
.loader-logo em { font-style: normal; font-size: .9rem; color: var(--ink-dim); letter-spacing: 2px; margin-left: 10px; }
@keyframes logoFlicker {
  0%, 100% { opacity: 1; } 92% { opacity: 1; } 93% { opacity: .55; } 94% { opacity: 1; } 96% { opacity: .7; } 97% { opacity: 1; }
}

.boot-line { min-height: 1.6em; font-weight: 600; color: var(--teal-bright); letter-spacing: 1px; }
.load-bar {
  width: min(340px, 76vw); height: 12px; border-radius: 999px;
  background: rgba(255,255,255,.08); border: 1px solid var(--glass-border);
  overflow: hidden;
}
#load-fill {
  display: block; height: 100%; width: 0; position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--teal), var(--pink));
  box-shadow: 0 0 18px rgba(57, 197, 187, .9);
  transition: width .12s linear;
}
/* sọc sáng chạy trong thanh loading */
#load-fill::after {
  content: ''; position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.3) 0 6px, transparent 6px 12px);
  animation: stripeMove .7s linear infinite;
}
@keyframes stripeMove { to { transform: translateX(17px); } }
.load-pct {
  font-family: var(--font-head); font-size: 2.2rem; font-weight: 800; color: var(--ink);
  letter-spacing: 2px; text-shadow: 0 0 18px rgba(57, 197, 187, .6);
}
.load-pct span { color: var(--teal-bright); }
.skip-hint { font-size: .75rem; color: var(--ink-dim); letter-spacing: 2px; opacity: .7; }

/* chữ 39 lóe sáng khi tải xong */
.loader-flash {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-head); font-size: clamp(5rem, 18vw, 9rem); font-weight: 800;
  color: #fff; text-shadow: 0 0 40px var(--teal), 0 0 90px var(--pink);
  opacity: 0; transform: scale(.6); pointer-events: none;
}
.loader-flash.show { animation: flash39 .6s ease forwards; }
@keyframes flash39 {
  0% { opacity: 0; transform: scale(.6); }
  40% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 1; transform: scale(1); }
}
.eq-loader { display: flex; gap: 6px; justify-content: center; align-items: flex-end; height: 60px; }
.eq-loader i {
  width: 10px; border-radius: 6px;
  background: linear-gradient(var(--teal-bright), var(--magenta));
  animation: eqBar 1s ease-in-out infinite;
}
.eq-loader i:nth-child(1) { animation-delay: 0s; }
.eq-loader i:nth-child(2) { animation-delay: .15s; }
.eq-loader i:nth-child(3) { animation-delay: .3s; }
.eq-loader i:nth-child(4) { animation-delay: .45s; }
.eq-loader i:nth-child(5) { animation-delay: .6s; }
@keyframes eqBar { 0%,100% { height: 14px; } 50% { height: 58px; } }

/* ---------- Chuyển trang ---------- */
#page-transition {
  position: fixed; inset: 0; z-index: 150;
  background: linear-gradient(120deg, var(--teal), var(--magenta));
  display: flex; align-items: center; justify-content: center;
  transform: translateY(102%);
  pointer-events: none;
}
#page-transition span { font-size: 6rem; color: #fff; text-shadow: 0 0 30px rgba(255,255,255,.8); }
#page-transition.cover-in  { animation: coverIn .45s cubic-bezier(.7,0,.3,1) forwards; }
#page-transition.cover-out { animation: coverOut .45s cubic-bezier(.7,0,.3,1) forwards; }
@keyframes coverIn  { from { transform: translateY(102%); } to { transform: translateY(0); } }
@keyframes coverOut { from { transform: translateY(0); }   to { transform: translateY(-102%); } }

/* ---------- Navbar ---------- */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 6%;
  background: rgba(7, 16, 25, .6);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-border);
}
.logo { font-family: var(--font-head); font-size: 1.35rem; font-weight: 800; display: flex; align-items: center; gap: 8px; }
.logo span { color: var(--teal-bright); text-shadow: 0 0 14px rgba(95,251,241,.7); }
.logo em { color: var(--pink); font-style: normal; font-weight: 600; }

#nav-links { display: flex; gap: 6px; }
#nav-links a {
  position: relative; padding: 8px 16px; border-radius: 999px;
  font-weight: 600; color: var(--ink-dim); transition: color .3s;
}
#nav-links a::after {
  content: ''; position: absolute; left: 16px; right: 16px; bottom: 4px; height: 2px;
  background: linear-gradient(90deg, var(--teal), var(--pink));
  transform: scaleX(0); transform-origin: left; transition: transform .35s ease; border-radius: 2px;
}
#nav-links a:hover { color: var(--ink); }
#nav-links a:hover::after, #nav-links a.active::after { transform: scaleX(1); }
#nav-links a.active { color: var(--teal-bright); text-shadow: 0 0 10px rgba(95,251,241,.6); }

#nav-toggle { display: none; background: none; border: none; width: 40px; height: 34px; flex-direction: column; justify-content: center; gap: 6px; }
#nav-toggle span { display: block; height: 3px; border-radius: 3px; background: var(--teal-bright); box-shadow: 0 0 8px rgba(95,251,241,.7); transition: .3s; }
#nav-toggle.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
#nav-toggle.open span:nth-child(2) { opacity: 0; }
#nav-toggle.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

/* ---------- Các trang ---------- */
main { position: relative; z-index: 1; }
.page { display: none; min-height: 100vh; padding: 120px 7% 70px; position: relative; }
.page.active { display: block; animation: pageIn .7s ease both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

.page-title {
  font-family: var(--font-head); text-align: center;
  font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; margin-bottom: 10px;
}
.page-title span {
  background: linear-gradient(90deg, var(--teal-bright), var(--pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(57,197,187,.45));
}
.page-sub { text-align: center; color: var(--ink-dim); max-width: 640px; margin: 0 auto 44px; line-height: 1.7; }

/* ---------- Kính mờ (glass) ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
}
.card { padding: 30px; transition: transform .35s ease, box-shadow .35s ease, border-color .35s; position: relative; overflow: hidden; }
.card::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,.16) 50%, rgba(95,251,241,.12) 55%, transparent 62%);
  transform: translateX(-130%); transition: transform .9s ease;
}
.card:hover::after { transform: translateX(130%); }
.card:hover { transform: translateY(-6px); border-color: rgba(95,251,241,.6); box-shadow: 0 16px 50px rgba(57,197,187,.25); }
.card h3 { font-family: var(--font-head); font-size: 1.35rem; color: var(--teal-bright); margin-bottom: 14px; }
.card p { color: var(--ink-dim); line-height: 1.75; margin-bottom: 12px; }
.card b { color: var(--ink); }

.chip {
  display: inline-block; padding: 7px 15px; margin: 4px 6px 4px 0;
  border-radius: 999px; font-size: .85rem; font-weight: 600;
  background: var(--teal-soft); border: 1px solid var(--glass-border); color: var(--teal-bright);
}

/* ---------- Trang chủ ---------- */
.hero {
  min-height: calc(100vh - 190px);
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px; flex-wrap: wrap;
}
.hero-text { max-width: 620px; flex: 1 1 420px; }
.hello { color: var(--pink); letter-spacing: 4px; text-transform: uppercase; font-weight: 700; font-size: .85rem; margin-bottom: 10px; }
.glow-text {
  font-family: var(--font-head); font-weight: 800;
  font-size: clamp(2.6rem, 6.5vw, 4.6rem); line-height: 1.08; margin-bottom: 14px;
  background: linear-gradient(100deg, var(--teal-bright) 10%, #b8fff9 40%, var(--pink) 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: hueShift 6s ease-in-out infinite alternate;
  filter: drop-shadow(0 0 22px rgba(57,197,187,.5));
}
@keyframes hueShift { from { filter: drop-shadow(0 0 22px rgba(57,197,187,.5)) hue-rotate(0deg); } to { filter: drop-shadow(0 0 26px rgba(255,123,172,.55)) hue-rotate(-25deg); } }

.typeline { font-size: 1.2rem; font-weight: 600; color: var(--teal-bright); min-height: 1.8em; margin-bottom: 16px; }
.caret { display: inline-block; width: 2px; height: 1.2em; background: var(--pink); vertical-align: text-bottom; margin-left: 3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.hero-sub { color: var(--ink-dim); line-height: 1.75; margin-bottom: 26px; max-width: 540px; }

.hero-cta { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 999px;
  font-weight: 700; font-size: 1rem; border: none;
  transition: transform .3s ease, box-shadow .3s ease, background .3s;
}
.btn-primary {
  background: linear-gradient(90deg, var(--teal), var(--magenta));
  color: #fff; box-shadow: 0 6px 24px rgba(57,197,187,.4);
}
.btn-primary:hover { transform: translateY(-4px) scale(1.03); box-shadow: 0 12px 34px rgba(225,40,133,.5); }
.btn-ghost { border: 2px solid var(--teal); color: var(--teal-bright); }
.btn-ghost:hover { background: var(--teal-soft); transform: translateY(-4px); }

.scroll-hint {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 26px;
  color: var(--ink-dim); font-size: .85rem; letter-spacing: 2px; text-align: center;
  animation: bob 2s ease-in-out infinite;
}
.scroll-hint span { display: block; color: var(--teal-bright); font-size: 1.2rem; }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, 8px); } }

/* Avatar */
.hero-avatar { position: relative; width: min(380px, 78vw); aspect-ratio: 1; flex-shrink: 0; animation: float 6s ease-in-out infinite; }
.avatar-ring {
  position: absolute; inset: -14px; border-radius: 50%;
  background: conic-gradient(var(--teal), var(--pink), var(--teal-bright), var(--magenta), var(--teal));
  animation: spin 7s linear infinite; filter: blur(3px); opacity: .9;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hero-avatar img {
  position: relative; width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; border: 6px solid var(--bg-deep);
  box-shadow: 0 0 60px rgba(57,197,187,.5);
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-16px); } }

.orbit-note {
  position: absolute; top: 50%; left: 50%; font-size: 1.6rem; pointer-events: none;
  text-shadow: 0 0 14px currentColor;
}
.orbit-note.n1 { color: var(--teal-bright); animation: orbit 9s linear infinite; }
.orbit-note.n2 { color: var(--pink); animation: orbit 12s linear infinite reverse; font-size: 1.3rem; }
.orbit-note.n3 { color: #b8fff9; animation: orbit 15s linear infinite; font-size: 1.1rem; }
.orbit-note.n4 { color: var(--magenta); animation: orbit 11s linear infinite reverse; }
@keyframes orbit {
  from { transform: rotate(0deg) translateX(calc(min(380px, 78vw) / 2 + 34px)) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(calc(min(380px, 78vw) / 2 + 34px)) rotate(-360deg); }
}

/* ---------- Giới thiệu ---------- */
.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 26px; max-width: 1150px; margin: 0 auto; }
.journey-card { grid-column: 1 / -1; }

.skill { margin-bottom: 18px; }
.skill-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 7px; font-size: .95rem; }
.skill-head span:last-child { color: var(--teal-bright); }
.bar { height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; border: 1px solid rgba(57,197,187,.25); }
.bar i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), var(--pink));
  box-shadow: 0 0 14px rgba(57,197,187,.7);
  transition: width 1.4s cubic-bezier(.25,.8,.3,1);
}

.journey { display: flex; align-items: stretch; gap: 18px; flex-wrap: wrap; }
.j-item { flex: 1 1 220px; text-align: center; padding: 20px 14px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px dashed var(--glass-border); }
.j-ico { font-size: 2.2rem; display: block; margin-bottom: 8px; filter: drop-shadow(0 0 12px rgba(57,197,187,.6)); }
.j-item h4 { font-family: var(--font-head); color: var(--pink); margin-bottom: 6px; }
.j-item p { font-size: .9rem; margin: 0; }
.j-arrow { align-self: center; font-size: 1.6rem; color: var(--teal-bright); animation: pulseNote 1.6s ease-in-out infinite; }
@keyframes pulseNote { 0%,100% { transform: scale(1); opacity: .7; } 50% { transform: scale(1.25); opacity: 1; } }

/* ---------- Sở thích ---------- */
.hobby-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; max-width: 1150px; margin: 0 auto 34px; }
.hobby-card { text-align: center; position: relative; overflow: hidden; }
.hobby-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, var(--teal-soft), transparent 65%);
  opacity: 0; transition: opacity .4s;
}
.hobby-card:hover::before { opacity: 1; }
.h-ico {
  font-size: 3rem; width: 92px; height: 92px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--teal-soft); border: 2px solid var(--glass-border);
  transition: transform .4s ease; filter: drop-shadow(0 0 16px rgba(57,197,187,.5));
}
.hobby-card:hover .h-ico { transform: scale(1.15) rotate(-8deg); }
.hobby-card h3 { font-family: var(--font-head); color: var(--teal-bright); margin-bottom: 10px; font-size: 1.3rem; }
.hobby-card p { font-size: .92rem; }
.tag {
  display: inline-block; margin-top: 6px; padding: 4px 14px; border-radius: 999px;
  background: linear-gradient(90deg, var(--magenta), var(--pink)); color: #fff;
  font-size: .78rem; font-weight: 700; letter-spacing: 1px;
}

/* Đàn piano */
.piano-box { max-width: 760px; margin: 0 auto 34px; text-align: center; }
.piano-hint { color: var(--ink-dim); margin-bottom: 22px; }
#piano {
  position: relative; display: flex; height: 190px;
  max-width: 620px; margin: 0 auto; user-select: none; touch-action: manipulation;
}
.key.white {
  flex: 1; border: 1px solid #0a1420; border-radius: 0 0 9px 9px;
  background: linear-gradient(#ffffff, #d9ecef);
  box-shadow: inset 0 -6px 10px rgba(0,0,0,.12);
  transition: transform .06s, background .12s;
}
.key.white:hover { background: linear-gradient(#fff, #c9f5f1); }
.key.white.pressed, .key.white:active {
  transform: translateY(3px);
  background: linear-gradient(#b8fff9, var(--teal));
  box-shadow: 0 0 22px rgba(57,197,187,.8);
}
.key.black {
  position: absolute; top: 0; width: 7.2%; height: 58%; z-index: 2;
  border: none; border-radius: 0 0 7px 7px;
  background: linear-gradient(#2b3a48, #0b1420);
  box-shadow: 0 4px 8px rgba(0,0,0,.6);
  transition: transform .06s, background .12s;
}
.key.black.pressed, .key.black:active {
  transform: translateY(3px);
  background: linear-gradient(var(--magenta), #22101c);
  box-shadow: 0 0 20px rgba(225,40,133,.8);
}
.float-note {
  position: absolute; z-index: 5; pointer-events: none;
  color: var(--teal-bright); text-shadow: 0 0 12px currentColor;
  animation: noteUp 1s ease-out forwards; font-size: 1.3rem;
}
@keyframes noteUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -90px) rotate(20deg); } }

/* Góc anime */
.anime-strip { display: flex; gap: 28px; align-items: center; max-width: 1000px; margin: 0 auto; padding: 26px; flex-wrap: wrap; }
.anime-strip img { flex: 1 1 300px; border-radius: 16px; border: 1px solid var(--glass-border); box-shadow: 0 0 30px rgba(57,197,187,.25); }
.anime-text { flex: 1 1 300px; }
.anime-text h3 { font-family: var(--font-head); color: var(--pink); font-size: 1.4rem; margin-bottom: 12px; }
.anime-text p { color: var(--ink-dim); line-height: 1.7; margin-bottom: 14px; }

/* ---------- Thư viện ---------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 24px; max-width: 1150px; margin: 0 auto; }
.g-item {
  position: relative; overflow: hidden; border-radius: 18px; cursor: zoom-in;
  border: 1px solid var(--glass-border); box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.g-item img { width: 100%; height: 250px; object-fit: cover; transition: transform .6s ease, filter .6s; }
.g-item:hover img { transform: scale(1.09) rotate(.5deg); filter: brightness(1.1); }
.g-item figcaption {
  position: absolute; inset: auto 0 0 0; padding: 40px 16px 14px;
  background: linear-gradient(transparent, rgba(7,16,25,.92));
  font-weight: 600; color: var(--teal-bright);
  transform: translateY(100%); transition: transform .4s ease;
}
.g-item:hover figcaption { transform: translateY(0); }

/* ---------- Dự án (CV fullstack) ---------- */
.page-sub code {
  background: var(--teal-soft); padding: 2px 9px; border-radius: 6px;
  color: var(--teal-bright); font-family: monospace; font-size: .9em;
}
.project-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; max-width: 1150px; margin: 0 auto; }
.project-card { display: flex; flex-direction: column; }
.p-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.p-ico { font-size: 2.5rem; filter: drop-shadow(0 0 14px rgba(57, 197, 187, .6)); }
.p-year {
  font-size: .78rem; font-weight: 700; color: var(--pink);
  background: rgba(225, 40, 133, .14); border: 1px solid rgba(225, 40, 133, .4);
  padding: 4px 13px; border-radius: 999px;
}
.project-card h3 { margin-bottom: 8px; }
.project-card p { font-size: .92rem; flex: 1; }
.p-tech { margin: 10px 0 16px; }
.p-tech .chip { font-size: .75rem; padding: 5px 12px; }
.p-links { display: flex; gap: 10px; flex-wrap: wrap; }
.p-btn {
  padding: 9px 19px; border-radius: 999px; font-weight: 700; font-size: .85rem;
  background: linear-gradient(90deg, var(--teal), var(--magenta)); color: #fff;
  transition: transform .3s, box-shadow .3s;
}
.p-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(57, 197, 187, .45); }
.p-btn.demo { background: transparent; border: 2px solid var(--teal); color: var(--teal-bright); }
.p-btn.demo:hover { background: var(--teal-soft); box-shadow: 0 8px 22px rgba(225, 40, 133, .35); }

/* nhóm kỹ năng */
.skill-group { margin-bottom: 20px; }
.skill-group:last-child { margin-bottom: 0; }
.skill-group h4 { color: var(--pink); font-family: var(--font-head); margin-bottom: 10px; font-size: 1.05rem; }

/* timeline */
.timeline-card { grid-column: 1 / -1; }
.timeline {
  position: relative; margin-left: 8px; padding-left: 28px;
  border-left: 2px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 24px;
}
.t-item { position: relative; }
.t-dot {
  position: absolute; left: -35px; top: 6px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--teal-bright); box-shadow: 0 0 12px var(--teal-bright);
}
.t-year { font-size: .78rem; font-weight: 700; letter-spacing: 1px; color: var(--pink); }
.t-body h4 { margin: 5px 0 6px; font-family: var(--font-head); color: var(--teal-bright); font-size: 1.1rem; }
.t-body p { font-size: .92rem; margin: 0; }

/* ---------- Liên hệ ---------- */
.social-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto 30px; }
.social-btn {
  display: flex; align-items: center; gap: 15px; padding: 18px 22px;
  border-radius: 16px; font-weight: 700;
  transition: transform .3s, border-color .3s, box-shadow .3s;
}
.social-btn svg { width: 27px; height: 27px; fill: currentColor; flex-shrink: 0; transition: transform .3s; }
.social-btn svg[stroke] { fill: none; stroke: currentColor; }
.social-btn small { display: block; font-weight: 500; color: var(--ink-dim); font-size: .8rem; }
.social-btn:hover { transform: translateY(-5px); border-color: var(--net); box-shadow: 0 10px 34px rgba(57,197,187,.35); color: var(--net); }
.social-btn:hover svg { transform: scale(1.2) rotate(-8deg); }
.social-btn.facebook  { --net: #1877f2; }
.social-btn.instagram { --net: #ff4d8d; }
.social-btn.discord   { --net: #5865f2; }
.social-btn.github    { --net: #b8fff9; }
.social-btn.email     { --net: var(--pink); }
.social-btn.tiktok    { --net: #69c9d0; }

.mail-card { max-width: 640px; margin: 0 auto; text-align: center; display: flex; align-items: center; gap: 18px; justify-content: center; flex-wrap: wrap; }
.mail-ico { font-size: 2.4rem; filter: drop-shadow(0 0 14px rgba(255,123,172,.7)); animation: pulseNote 2s infinite; }
.mail-card a { color: var(--teal-bright); font-weight: 700; border-bottom: 2px dashed var(--teal); }
.mail-card a:hover { color: var(--pink); border-color: var(--pink); }

/* ---------- Footer ---------- */
footer { position: relative; z-index: 1; text-align: center; padding: 34px 20px 90px; border-top: 1px solid var(--glass-border); background: rgba(7,16,25,.55); backdrop-filter: blur(10px); }
footer b { color: var(--teal-bright); }
.foot-sub { color: var(--ink-dim); font-size: .85rem; margin-top: 6px; }

/* ---------- Trình phát nhạc ---------- */
#music-player { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
#music-toggle {
  position: relative; width: 60px; height: 60px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--teal), var(--magenta));
  color: #fff; font-size: 1.5rem;
  box-shadow: 0 6px 26px rgba(57,197,187,.5);
  transition: transform .3s, box-shadow .3s;
}
#music-toggle:hover { transform: scale(1.1); box-shadow: 0 10px 34px rgba(225,40,133,.6); }
#music-toggle .eq { display: none; gap: 3px; align-items: flex-end; height: 22px; }
#music-toggle .eq i { width: 4px; border-radius: 3px; background: #fff; animation: eqBarSm .9s ease-in-out infinite; }
@keyframes eqBarSm { 0%,100% { height: 7px; } 50% { height: 21px; } }
#music-toggle .eq i:nth-child(2) { animation-delay: .2s; }
#music-toggle .eq i:nth-child(3) { animation-delay: .4s; }
#music-toggle .eq i:nth-child(4) { animation-delay: .1s; }
#music-toggle.playing .eq { display: flex; }
#music-toggle.playing .music-icon { display: none; }
#music-toggle.hint { animation: hintPulse 1.4s ease-in-out infinite; }
@keyframes hintPulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(95,251,241,.7); }
  50% { box-shadow: 0 0 0 16px rgba(95,251,241,0); }
}
#music-settings {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--glass-border);
  background: var(--glass); color: var(--teal-bright); font-size: 1rem;
  backdrop-filter: blur(10px); transition: transform .4s;
}
#music-settings:hover { transform: rotate(90deg); }
#music-panel {
  position: absolute; bottom: 74px; right: 0; width: 260px; padding: 18px;
  opacity: 0; pointer-events: none; transform: translateY(12px);
  transition: opacity .35s, transform .35s;
}
#music-panel.open { opacity: 1; pointer-events: auto; transform: none; }
#viz { width: 100%; height: 46px; border-radius: 8px; background: rgba(255,255,255,.05); margin-bottom: 12px; display: block; }
#track-label { font-weight: 700; color: var(--teal-bright); margin-bottom: 12px; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-controls { display: flex; align-items: center; gap: 10px; }
.music-controls input[type="range"] { flex: 1; accent-color: var(--teal); cursor: pointer; }
#btn-upload { background: var(--teal-soft); border: 1px solid var(--glass-border); border-radius: 10px; padding: 6px 10px; font-size: .95rem; transition: .3s; }
#btn-upload:hover { background: var(--teal); }
.panel-hint { margin-top: 10px; font-size: .72rem; color: var(--ink-dim); line-height: 1.5; }

/* ---------- Lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 180; display: none;
  align-items: center; justify-content: center; flex-direction: column; gap: 16px;
  background: rgba(4, 8, 14, .9); backdrop-filter: blur(8px);
}
#lightbox.open { display: flex; animation: pageIn .3s ease; }
#lightbox img { max-width: min(88vw, 980px); max-height: 76vh; border-radius: 16px; border: 2px solid var(--glass-border); box-shadow: 0 0 70px rgba(57,197,187,.4); }
#lightbox-cap { color: var(--teal-bright); font-weight: 600; text-align: center; padding: 0 20px; }
#lightbox-close {
  position: absolute; top: 22px; right: 26px; width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid var(--glass-border); background: var(--glass); color: var(--pink); font-size: 1.2rem;
  transition: .3s;
}
#lightbox-close:hover { background: var(--magenta); color: #fff; transform: rotate(90deg); }

/* ---------- Hiện dần khi cuộn ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .8s ease, transform .8s ease; }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  #nav-toggle { display: flex; }
  #nav-links {
    position: absolute; top: 100%; right: 0; left: 0;
    flex-direction: column; padding: 18px 6%;
    background: rgba(7,16,25,.95); backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-12px); opacity: 0; pointer-events: none; transition: .35s ease;
  }
  #nav-links.open { transform: none; opacity: 1; pointer-events: auto; }
  #nav-links a { padding: 12px 16px; }
  .hero { justify-content: center; text-align: center; }
  .hero-text { display: flex; flex-direction: column; align-items: center; }
  .hero-cta, .hero-stats { justify-content: center; display: flex; }
  .about-grid { grid-template-columns: 1fr; }
  .page { padding: 110px 5% 60px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .15s !important; }
}
