body {
  font-family: 'Inter', 'Poppins', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

.section-hidden {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card {
  perspective: 1000px;
}

.project-card:hover img {
  transform: scale(1.1);
}

.project-card img {
  transition: transform 1s ease;
}

#github-commits {
  max-height: 300px;
  overflow-y: auto;
}

#github-commits > div {
  transition: transform 0.5s ease, box-shadow 0.5s ease;
}

#github-commits > div:hover {
  transform: translateY(-10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  border: 1px solid transparent;
  border-image: linear-gradient(to right, #4f46e5, #7c3aed) 1;
}

#back-to-top{
  background: rgba(255,255,255,0.92);
  border: 1px solid rgba(17,24,39,0.18);
  color: rgba(17,24,39,0.92);
  backdrop-filter: blur(8px);

  /* Hide by default */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility 0s linear .18s;
}

#back-to-top.is-visible{
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition:
    opacity .18s ease,
    transform .18s ease,
    visibility 0s;
}

#back-to-top:hover{
  background: #fff;
}

.dark #back-to-top{
  background: rgba(17,24,39,0.90);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
}

.dark #back-to-top:hover{
  background: rgba(17,24,39,0.98);
}

#back-to-top svg{
  stroke: currentColor;
}

.animate-typing {
  animation: fadeIn 1s ease-out;
}

.animate-type {
  display: inline-block;
  overflow: hidden;
  white-space: nowrap;
  animation: typing 2s steps(40, end) forwards;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

.animate-slide-in {
  animation: slideIn 0.8s ease-out;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-slide-in-right {
  animation: slideInRight 0.8s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

.animate-zoom-in {
  animation: zoomIn 1s ease-out;
}

@keyframes zoomIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

.animate-pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.animate-progress {
  transition: width 1.5s ease-in-out;
}

.animate-pop-up {
  animation: popUp 0.5s ease-out;
}

@keyframes popUp {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(1); }
}

.sparkle {
  position: relative;
}

.sparkle::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #4f46e5, #7c3aed, #4f46e5, #7c3aed);
  background-size: 400%;
  filter: blur(5px);
  opacity: 0;
  animation: sparkle 3s infinite;
}

@keyframes sparkle {
  0% { background-position: 0% 50%; opacity: 0.3; }
  50% { background-position: 100% 50%; opacity: 0.5; }
  100% { background-position: 0% 50%; opacity: 0.3; }
}

.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(79, 70, 229, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

input:focus ~ .ripple::after,
textarea:focus ~ .ripple::after {
  width: 200px;
  height: 200px;
}

#navbar.scrolled {
  padding: 0.5rem 0;
  background: linear-gradient(to right, #ffffffee, #f3f4f6ee);
  backdrop-filter: blur(10px);
}

#navbar.scrolled.dark {
  background: linear-gradient(to right, #1f2937ee, #111827ee);
}

#particles-js {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  #nav-links {
    display: none;
  }
  #mobile-menu.active {
    display: block;
    transform: translateY(0);
  } 
  #home h1 {
    font-size: 3rem;
  }
  #home p {
    font-size: 1.5rem;
  }
  .project-card {
    margin-bottom: 2rem;
  }
  #about .w-64 {
    width: 12rem;
    height: 12rem;
  }
  #about p {
    max-width: 100%;
    padding: 0 1rem;
  }
  .skills-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-bottom: 1rem;
  }
  .skills-carousel > div {
    flex: 0 0 80%;
    scroll-snap-align: center;
  }
}

/* =========================
   HERO HOME (works in light & dark)
   ========================= */
.hero-home{
  /* nền xanh đen giống ảnh dark */
  background:
    radial-gradient(900px circle at 50% 30%, rgba(99,102,241,.18), transparent 55%),
    linear-gradient(180deg, #0b1220 0%, #07101c 45%, #050814 100%);
}

.hero-home #particles-js{
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-content{
  position: relative;
  z-index: 1;
}

/* =========================
   BUTTONS
   ========================= */
.hero-actions{
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 26px;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}

.btn:hover{
  transform: translateY(-1px);
}

/* primary: nổi bật nhưng vẫn hợp nền */
.btn-primary{
  background: rgba(59,130,246,.18);
  border: 1px solid rgba(59,130,246,.40);
  color: #eaf2ff;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.btn-primary:hover{
  background: rgba(59,130,246,.28);
  border-color: rgba(59,130,246,.55);
}

/* secondary: kiểu glass */
.btn-secondary{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.22);
  color: #ffffff;
}
.btn-secondary:hover{
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.32);
}


/* =========================
   CV DROPDOWN (match hero glass buttons)
   ========================= */
#cvDropdown{ position: relative; }

.cv-menu{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 160px;
  padding: 8px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 45px rgba(0,0,0,.35);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  z-index: 60;

  opacity: 0;
  transform: translateY(8px) scale(.98);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, visibility 0s linear .18s;
}

.cv-menu.cv-menu--open{
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
  transition: opacity .18s ease, transform .18s ease, visibility 0s;
}

.cv-item{
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255,255,255,.92) !important;
  transition: background .18s ease, transform .18s ease;
}

.cv-item:hover{
  background: rgba(255,255,255,.10);
  transform: translateY(-1px);
}

.cv-item__title{
  font-weight: 650;
  font-size: 14px;
  line-height: 1.15;
}

.cv-item__meta{
  font-size: 12px;
  opacity: .75;
}

.cv-menu .cv-item + .cv-item{
  margin-top: 6px;
}

@media (max-width: 420px){
  .cv-menu{
    left: 0;
    right: auto;
    min-width: 220px;
  }
}

/* Fix chữ có đuôi (g, y, p, q) bị cắt do typing effect */
#home h1 {
  line-height: 1 !important;
  padding-bottom: 0.1em;
}

/* Nếu text đang bị clip bởi span typing */
#home .animate-type {
  line-height: 1 !important;
  padding-bottom: 0.1em;   
  box-sizing: content-box; 
}

.progress-track{
  margin-top: 14px;
  height: 8px;
  width: 100%;
  border-radius: 999px;
  background: rgba(255,255,255,.10); /* nền mờ */
  overflow: hidden;
}

.progress-fill{
  height: 100%;
  width: 0; /* sẽ set bằng inline style trong HTML */
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #6366f1); /* sky -> indigo */
  box-shadow: 0 0 18px rgba(56,189,248,.25);
  transition: width .8s ease;
}

.project-thumb {
  width: 100%;
  height: 190px; /* 170–220 tuỳ bạn */
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tag-pill{
  display:inline-flex;
  align-items:center;
  padding:.22rem .6rem;
  border-radius:999px;
  font-size:12px;
  line-height:1.2;
  white-space: nowrap;

  /* LIGHT mode (mặc định) */
  color: rgba(17,24,39,0.85);              /* text-gray-900 */
  background: rgba(99,102,241,0.10);       /* indigo nhẹ */
  border: 1px solid rgba(99,102,241,0.25);
}

/* DARK mode */
.dark .tag-pill{
  color: rgba(255,255,255,0.90);
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.16);
}

.project-tags{
  display:flex;
  flex-wrap:wrap;          /* tags xuống dòng theo cụm */
  gap:8px;
  margin-bottom: 18px;
}

/* ===== LIGHT MODE (default): card trắng, viền đen, chữ đen ===== */
.skills-card--dark{
  background: #ffffff;
  border: 1.5px solid rgba(17,24,39,0.85); /* viền đen */
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08);
}

.skills-title{
  font-size: 18px;
  font-weight: 800;
  color: rgba(17,24,39,0.92);
  margin-bottom: 16px;
}

.skills-note{
  margin-top: 14px;
  font-size: 14px;
  color: rgba(17,24,39,0.65);
}

/* Grid icon */
.skill-grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 12px;
  align-content: start;
}

/* tile icon: nền trắng nhẹ + viền đen mờ */
.skill-icon{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:6px;
  height: 86px;
  padding:10px 8px;
  border-radius:14px;

  background: rgba(17,24,39,0.03);
  border: 1px solid rgba(17,24,39,0.18);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.skill-icon:hover{
  transform: translateY(-2px);
  background: rgba(17,24,39,0.05);
  border-color: rgba(17,24,39,0.26);
}

.skill-icon i{
  font-size: 34px;
  line-height: 1;
}

.skill-icon span{
  font-size: 12px;
  font-weight: 700;
  color: rgba(17,24,39,0.88); /* chữ đen */
  text-align:center;
  line-height: 1.1;
}

/* DevOps: căn giữa + đủ rộng 1 hàng */
.devops-row{
  display:flex;
  justify-content:center;
}

.devops-card{
  width: 100%;
  max-width: 980px;
}


/* ===== DARK MODE: giống Projects (card tối, chữ trắng) ===== */
.dark .skills-card--dark{
  background: rgba(31, 41, 55, 0.65);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 10px 25px rgba(0,0,0,0.18);
}

.dark .skills-title{
  color: rgba(255,255,255,0.95);
}

.dark .skills-note{
  color: rgba(255,255,255,0.70);
}

.dark .skill-icon{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
}

.dark .skill-icon:hover{
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.20);
}

.dark .skill-icon span{
  color: rgba(255,255,255,0.88);
}

/* =========================
   Skills: 5 icons / row like your screenshot
   ========================= */
.skill-grid--5{
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
@media (max-width: 767px){
  .skill-grid--5{
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* DevOps card: centered under 2 cards, width like 1 column */
.devops-card{
  width: 100%;
  max-width: 640px; /* gần bằng 1 cột ở layout md */
}

#lang-toggle {
  min-width: 44px;
  text-align: center;
}

/* Language toggle pill (EN/VI) */
.lang-pill{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 9999px;
  border: 1px solid rgba(209,213,219,0.9); /* gray-300 */
  background: transparent;
  color: rgb(55,65,81); /* gray-700 */
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}

.lang-pill:hover{
  background: rgba(0,0,0,0.05);
}

.dark .lang-pill{
  border-color: rgba(75,85,99,0.9); /* gray-600 */
  color: rgb(229,231,235); /* gray-200 */
}

.dark .lang-pill:hover{
  background: rgba(255,255,255,0.10);
}

.lang-pill:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.35); /* indigo focus ring */
}

/* Certificates hover */
.cert-card{
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.12);
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
  will-change: transform;
}

.dark .cert-card{
  border-color: rgba(255,255,255,0.22);
}

.cert-card:hover{
  transform: translateY(-10px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.28);
  border-color: rgba(99,102,241,0.65);
}

/* Gradient border on hover */
.cert-card::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
  opacity: 0;
  pointer-events: none;
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: opacity .35s ease;
}

.cert-card:hover::before{
  opacity: 1;
}

.dark .cert-card:hover{
  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}

/* =========================
   Unified hover like Certificates
   Apply to: Projects cards, Skills cards, GitHub cards
   ========================= */
.project-card,
.skills-card--dark,
#github .p-5.rounded-2xl{
  position: relative;
  transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
  will-change: transform;
}

/* default border in light */
.project-card,
.skills-card--dark,
#github .p-5.rounded-2xl{
  border-color: rgba(15, 23, 42, 0.12) !important;
}

/* default border in dark */
.dark .project-card,
.dark .skills-card--dark,
.dark #github .p-5.rounded-2xl{
  border-color: rgba(255,255,255,0.22) !important;
}

.project-card:hover,
.skills-card--dark:hover,
#github .p-5.rounded-2xl:hover{
  transform: translateY(-10px);
  box-shadow: 0 18px 45px rgba(0,0,0,0.28);
  border-color: rgba(99,102,241,0.65) !important; /* indigo-ish */
}

/* gradient border on hover (same vibe as cert-card) */
.project-card::before,
.skills-card--dark::before,
#github .p-5.rounded-2xl::before{
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 16px;
  padding: 1px;
  background: linear-gradient(90deg, #4f46e5, #7c3aed, #06b6d4);
  opacity: 0;
  pointer-events: none;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  transition: opacity .35s ease;
}

.project-card:hover::before,
.skills-card--dark:hover::before,
#github .p-5.rounded-2xl:hover::before{
  opacity: 1;
}

.dark .project-card:hover,
.dark .skills-card--dark:hover,
.dark #github .p-5.rounded-2xl:hover{
  box-shadow: 0 18px 55px rgba(0,0,0,0.45);
}

/* Focus ring rõ ràng cho keyboard */
:focus-visible{
  outline: 2px solid rgba(99,102,241,.9);
  outline-offset: 3px;
}

/* Tôn trọng Reduced Motion */
@media (prefers-reduced-motion: reduce){
  html:focus-within{
    scroll-behavior: auto;
  }
  *, *::before, *::after{
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .animate-typing, .animate-slide-in, .animate-slide-in-right, .animate-zoom-in, .animate-pulse, .animate-type{
    animation: none !important;
  }
}

/* =========================
   Contact: Connect cards (spicy, not bland)
   - Works with current HTML (.connect-panel .contact-link-card ...)
   ========================= */

/* Panel wrapper (optional but makes it premium) */
.connect-panel{
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}

.connect-panel::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg, rgba(99,102,241,.95), rgba(124,58,237,.9), rgba(6,182,212,.9));
  opacity: .55;
  pointer-events:none;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

/* Base card */
.contact-link-card{
  /* default accent */
  --accent1: #6366f1; /* indigo */
  --accent2: #06b6d4; /* cyan */

  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 14px 16px;
  border-radius: 18px;
  text-decoration: none;
  color: inherit;

  /* glass */
  background: rgba(255,255,255,0.72);
  border: 1px solid rgba(15,23,42,0.16);
  box-shadow:
    0 10px 28px rgba(0,0,0,0.12),
    0 0 0 1px rgba(255,255,255,0.35) inset;

  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
  overflow: hidden;
}

/* Gradient border layer */
.contact-link-card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  opacity: 0;
  pointer-events:none;

  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  transition: opacity .22s ease;
}

/* Shine streak (hover) */
.contact-link-card::after{
  content:"";
  position:absolute;
  inset:-40% -30%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.40) 50%, transparent 65%);
  transform: translateX(-40%) rotate(10deg);
  opacity: 0;
  pointer-events:none;
  transition: opacity .22s ease, transform .45s ease;
}

.contact-link-card:hover{
  transform: translateY(-3px);
  border-color: rgba(99,102,241,.35);
  box-shadow:
    0 18px 50px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.45) inset;
  background: rgba(255,255,255,0.78);
}

.contact-link-card:hover::before{ opacity: 1; }
.contact-link-card:hover::after{
  opacity: .9;
  transform: translateX(35%) rotate(10deg);
}

/* Dark mode */
.dark .contact-link-card{
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    0 14px 45px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.06) inset;
}

.dark .contact-link-card:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(99,102,241,.35);
  box-shadow:
    0 18px 65px rgba(0,0,0,0.55),
    0 0 0 1px rgba(255,255,255,0.08) inset;
}

/* Icon bubble: có “độ chơi” + glow theo accent */
.contact-link-icon{
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;

  color: var(--accent1);
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,0.65), rgba(255,255,255,0.0) 60%),
    linear-gradient(135deg, rgba(99,102,241,0.20), rgba(6,182,212,0.14));
  border: 1px solid rgba(99,102,241,0.22);

  box-shadow:
    0 10px 22px rgba(0,0,0,0.18),
    0 0 0 1px rgba(255,255,255,0.35) inset;

  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.contact-link-card:hover .contact-link-icon{
  transform: translateY(-1px) scale(1.02);
  border-color: rgba(99,102,241,0.45);
  box-shadow:
    0 14px 30px rgba(0,0,0,0.22),
    0 0 18px rgba(99,102,241,0.25);
}

.dark .contact-link-icon{
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,0.14), rgba(255,255,255,0.0) 60%),
    linear-gradient(135deg, rgba(99,102,241,0.18), rgba(6,182,212,0.12));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    0 12px 30px rgba(0,0,0,0.45),
    0 0 0 1px rgba(255,255,255,0.06) inset;
}

/* Text */
.contact-link-title{
  font-weight: 900;
  font-size: 15px;
  letter-spacing: .01em;
}

.contact-link-sub{
  font-size: 12px;
  opacity: .72;
  margin-top: 4px;
  letter-spacing: .02em;
}

/* Make the whole card feel "clickable" on keyboard too */
.contact-link-card:focus-visible{
  outline: none;
  box-shadow:
    0 0 0 3px rgba(99,102,241,.35),
    0 18px 55px rgba(0,0,0,0.18);
}

/* =========================
   Accent per platform (no HTML changes)
   ========================= */
.contact-link-card[href^="mailto:"]{
  --accent1: #a855f7; /* purple */
  --accent2: #6366f1; /* indigo */
}

.contact-link-card[href*="github.com"]{
  --accent1: #94a3b8; /* slate */
  --accent2: #6366f1; /* indigo */
}

.contact-link-card[href*="linkedin.com"]{
  --accent1: #38bdf8; /* sky */
  --accent2: #6366f1; /* indigo */
}

.contact-link-card[href*="facebook.com"]{
  --accent1: #3b82f6; /* blue */
  --accent2: #06b6d4; /* cyan */
}

.contact-link-card[href*="youtube.com"]{
  --accent1: #ef4444; /* red */
  --accent2: #f97316; /* orange */
}

.contact-link-card[href*="instagram.com"]{
  --accent1: #ec4899; /* pink */
  --accent2: #f97316; /* orange */
}

/* Reduced motion friendly */
@media (prefers-reduced-motion: reduce){
  .contact-link-card,
  .contact-link-card::before,
  .contact-link-card::after,
  .contact-link-icon{
    transition: none !important;
  }
}

/* Tăng khoảng cách giữa các contact cards */
.connect-panel .grid{
  gap: 18px !important;          /* thử 18–22px */
}

@media (min-width: 640px){
  .connect-panel .grid{
    column-gap: 18px !important; /* khoảng cách ngang */
    row-gap: 16px !important;    /* khoảng cách dọc */
  }
}

footer{
  padding-top: 18px;
  padding-bottom: 18px;
}

footer p{
  line-height: 1.7;
}

footer p:first-child{
  opacity: .82;      /* tagline */
}

footer p:last-child{
  opacity: .95;      /* copyright */
}

/* =========================
   CV — clean cards (override old CV polish)
   ========================= */

#cv::before{ content: none !important; }            /* kill old glow layer */
#cv > .pointer-events-none{ display:none !important;}/* if blobs still exist */

#cv .cv-card{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 22px !important;
  border-radius: 22px !important;

  background: rgba(255,255,255,.86) !important;
  border: 1px solid rgba(15,23,42,.10) !important;
  box-shadow: 0 16px 42px rgba(0,0,0,.08) !important;

  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  min-height: 230px;
}

.dark #cv .cv-card{
  background: rgba(255,255,255,.04) !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  box-shadow: 0 22px 60px rgba(0,0,0,.38) !important;
}

#cv .cv-card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 22px;
  padding: 1px;
  background: linear-gradient(90deg, rgba(99,102,241,.85), rgba(124,58,237,.75), rgba(6,182,212,.70));
  opacity: 0;
  pointer-events:none;

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  transition: opacity .25s ease;
}

#cv .cv-card:hover{
  transform: translateY(-8px);
  box-shadow: 0 22px 70px rgba(0,0,0,.14) !important;
  border-color: rgba(99,102,241,.45) !important;
}
.dark #cv .cv-card:hover{
  box-shadow: 0 26px 80px rgba(0,0,0,.50) !important;
}
#cv .cv-card:hover::before{ opacity: 1; }

#cv .cv-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
}

#cv .cv-icon{
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1px solid rgba(255,255,255,.10);
}

#cv .cv-icon__svg{ width: 22px; height: 22px; }

#cv .cv-pill{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(255,255,255,.90);
  /* light mode defaults */
  color: rgba(17,24,39,.85);
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(15,23,42,.12);
}

/* keep dark mode style */
.dark #cv .cv-pill{
  color: rgba(255,255,255,.90);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
}

#cv .cv-title{
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: rgb(17,24,39);
}
.dark #cv .cv-title{ color: rgba(255,255,255,.94); }

#cv .cv-desc{
  font-size: 14px;
  line-height: 1.55;
  color: rgba(55,65,81,.92);
}
.dark #cv .cv-desc{ color: rgba(229,231,235,.86); }

#cv .cv-actions{
  margin-top: auto;
  display:flex;
  gap: 12px;
}

#cv .cv-action{
  flex: 1;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  text-decoration:none;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
}

#cv .cv-action:hover{ transform: translateY(-1px); }

#cv .cv-action--primary{
  background: rgba(79,70,229,1);
  border: 1px solid rgba(79,70,229,1);
  color: #fff;
}
#cv .cv-action--primary:hover{ opacity: .92; }

#cv .cv-action--ghost{
  background: transparent;
  border: 1px solid rgba(17,24,39,.16);
  color: rgba(17,24,39,.92);
}
#cv .cv-action--ghost:hover{ background: rgba(17,24,39,.04); }

.dark #cv .cv-action--ghost{
  border: 1px solid rgba(255,255,255,.18);
  color: rgba(255,255,255,.92);
}
.dark #cv .cv-action--ghost:hover{ background: rgba(255,255,255,.08); }

/* variant accents */
#cv .cv-card--ai .cv-icon{
  background: rgba(99,102,241,.14);
  color: rgba(99,102,241,1);
}
#cv .cv-card--latex .cv-icon{
  background: rgba(16,185,129,.12);
  color: rgba(16,185,129,1);
}
#cv .cv-card--general .cv-icon{
  background: rgba(56,189,248,.12);
  color: rgba(56,189,248,1);
}

/* small screens */
@media (max-width: 420px){
  #cv .cv-actions{ flex-direction: column; }
}

/* Profile flip (hover to show profile2.jpg) */
.profile-flip{
  perspective: 1000px;
}

.profile-flip__inner{
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(.2,.8,.2,1);
}

.profile-flip:hover .profile-flip__inner{
  transform: rotateY(180deg);
}

.profile-flip__face{
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0); /* avoid flicker on some browsers */
}

.profile-flip__back{
  transform: rotateY(180deg);
}

.tw-caret{
  display:inline-block;
  width: 2px;          /* độ dày */
  height: 1em;         /* QUAN TRỌNG: có height thì mới thấy */
  margin-left: 6px;
  vertical-align: -0.15em;
  background: rgba(255,255,255,.85); /* dùng background thay vì border-right cho chắc */
  animation: twBlink 1s step-end infinite;
}

@keyframes twBlink{ 50%{ opacity: 0; } }

/* light mode */
html:not(.dark) .tw-caret{
  background: rgba(17,24,39,.65);
}

/* About social icons — clean + premium */
.about-social{
  margin-top: 28px;
  display:flex;
  justify-content:center;
  gap: 14px;
  flex-wrap: wrap;
}

.social-btn{
  --c1: #6366f1; /* default accent */
  --c2: #06b6d4;

  width: 52px;
  height: 52px;
  border-radius: 9999px;
  display: grid;
  place-items: center;

  color: var(--c1);
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 12px 30px rgba(0,0,0,.10);
  position: relative;
  overflow: hidden;

  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

.dark .social-btn{
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.16);
  box-shadow: 0 16px 42px rgba(0,0,0,.45);
}

.social-btn svg{
  width: 22px;
  height: 22px;
}

.social-btn::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(90deg, var(--c1), var(--c2));
  opacity: 0;
  pointer-events:none;

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  transition: opacity .22s ease;
}

.social-btn::after{
  content:"";
  position:absolute;
  inset:-40% -30%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%);
  transform: translateX(-50%) rotate(10deg);
  opacity: 0;
  transition: opacity .22s ease, transform .45s ease;
  pointer-events:none;
}

.social-btn:hover{
  transform: translateY(-3px);
  border-color: rgba(99,102,241,.35);
  box-shadow: 0 18px 55px rgba(0,0,0,.16);
}

.dark .social-btn:hover{
  box-shadow: 0 22px 70px rgba(0,0,0,.55);
}

.social-btn:hover::before{ opacity: 1; }
.social-btn:hover::after{
  opacity: .9;
  transform: translateX(35%) rotate(10deg);
}

.social-btn:focus-visible{
  outline: none;
  box-shadow: 0 0 0 3px rgba(99,102,241,.35), 0 18px 55px rgba(0,0,0,.16);
}

/* brand accents */
.social-btn.is-fb{ --c1:#3b82f6; --c2:#06b6d4; }
.social-btn.is-ig{ --c1:#ec4899; --c2:#f97316; }
.social-btn.is-gh{ --c1:#94a3b8; --c2:#6366f1; }
.social-btn.is-in{ --c1:#38bdf8; --c2:#6366f1; }
.social-btn.is-yt{ --c1:#ef4444; --c2:#f97316; }
.social-btn.is-mail{ --c1:#a855f7; --c2:#6366f1; }

/* ===== About: make it standout (kicker, headline, chips, stats) ===== */
.about-right{
  max-width: 720px;
}

.about-kicker{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  color: rgba(229,231,235,.95);
  font-weight: 700;
  letter-spacing: .02em;
}


html:not(.dark) .about-kicker{
  background: rgba(15,23,42,.05);
  border: 1px solid rgba(15,23,42,.10);
  color: rgba(17,24,39,.88);
}

/* About kicker hover (premium) */
#about .about-kicker{
  position: relative;
  overflow: hidden;
  cursor: default;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}

/* gradient border on hover (like glass frame) */
#about .about-kicker::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius: 999px;
  padding: 1px;
  background: linear-gradient(90deg, rgba(99,102,241,1), rgba(6,182,212,1));
  opacity: 0;
  pointer-events:none;

  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;

  transition: opacity .22s ease;
}

/* soft sheen sweep */
#about .about-kicker::after{
  content:"";
  position:absolute;
  inset:-40% -30%;
  background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%);
  transform: translateX(-55%) rotate(10deg);
  opacity: 0;
  transition: opacity .22s ease, transform .45s ease;
  pointer-events:none;
}

#about .about-kicker:hover{
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.28);
  background: rgba(255,255,255,.08);
  box-shadow: 0 18px 55px rgba(0,0,0,.30);
}

html:not(.dark) #about .about-kicker:hover{
  background: rgba(15,23,42,.06);
  box-shadow: 0 18px 55px rgba(0,0,0,.10);
}

#about .about-kicker:hover::before{ opacity: 1; }
#about .about-kicker:hover::after{
  opacity: .9;
  transform: translateX(40%) rotate(10deg);
}

/* dot pulse on hover */
#about .about-kicker:hover .about-dot{
  animation: aboutDotPulse 1.1s ease-in-out infinite;
}

/* About dot = active green */
.about-dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;

  /* green gradient */
  background: linear-gradient(90deg, rgba(34,197,94,1), rgba(16,185,129,1));

  /* green glow */
  box-shadow: 0 0 0 6px rgba(34,197,94,.16);
}

/* pulse uses green glow */
@keyframes aboutDotPulse{
  0%,100%{
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(34,197,94,.16);
  }
  50%{
    transform: scale(1.12);
    box-shadow: 0 0 0 10px rgba(34,197,94,.22);
  }
}

.about-headline{
  margin-top: 14px;
  font-size: clamp(22px, 2.2vw, 30px);
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: rgba(255,255,255,.96);
}

html:not(.dark) .about-headline{
  color: rgba(17,24,39,.95);
}

/* About headline: justify (desktop) */
#about .about-headline{
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
}

/* Mobile: avoid ugly spacing */
@media (max-width: 640px){
  #about .about-headline{
    text-align: left;
    hyphens: none;
  }
}

.about-chips{
  margin-top: 14px;
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
}

.about-chip{
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  color: rgba(255,255,255,.92);
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
}

html:not(.dark) .about-chip{
  color: rgba(17,24,39,.88);
  background: rgba(15,23,42,.05);
  border: 1px solid rgba(15,23,42,.10);
}

.about-desc{
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.7;
  color: rgba(229,231,235,.86);
}

html:not(.dark) .about-desc{
  color: rgba(55,65,81,.92);
}

.about-stats{
  margin-top: 18px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 12px;
}

.about-stat{
  padding: 14px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.10);
  box-shadow: 0 14px 38px rgba(0,0,0,.22);
}

html:not(.dark) .about-stat{
  background: rgba(255,255,255,.75);
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 14px 38px rgba(0,0,0,.08);
}

.about-stat__num{
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
  color: rgba(255,255,255,.96);
}

html:not(.dark) .about-stat__num{
  color: rgba(17,24,39,.95);
}

.about-stat__label{
  margin-top: 4px;
  font-size: 13px;
  color: rgba(229,231,235,.80);
}

html:not(.dark) .about-stat__label{
  color: rgba(55,65,81,.78);
}

@media (max-width: 640px){
  .about-stats{ grid-template-columns: 1fr; }
}

/* About description: justify + readable */
#about .about-desc{
  text-align: justify;
  text-justify: inter-word;
  hyphens: auto;
  letter-spacing: 0.01em;
}

/* Mobile: justify đôi khi tạo khoảng trắng xấu -> về left */
@media (max-width: 640px){
  #about .about-desc{
    text-align: left;
    hyphens: none;
  }
}

/* About description hover: subtle lift + highlight */
#about .about-desc{
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255,255,255,.03);
  border: 1px solid rgba(255,255,255,.08);
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

#about .about-desc:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,.05);
  border-color: rgba(99,102,241,.28);
  box-shadow: 0 18px 55px rgba(0,0,0,.30);
}

/* Light mode */
html:not(.dark) #about .about-desc{
  background: rgba(15,23,42,.03);
  border: 1px solid rgba(15,23,42,.10);
}
html:not(.dark) #about .about-desc:hover{
  background: rgba(15,23,42,.04);
  border-color: rgba(99,102,241,.28);
  box-shadow: 0 18px 55px rgba(0,0,0,.10);
}

/* Chips hover: pop + gradient border */
#about .about-chip{
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}

#about .about-chip:hover{
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.35);
  background: rgba(255,255,255,.08);
}
html:not(.dark) #about .about-chip:hover{
  background: rgba(15,23,42,.06);
}

/* Stats hover: lift + glow */
#about .about-stat{
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}

#about .about-stat:hover{
  transform: translateY(-3px);
  border-color: rgba(99,102,241,.30);
  box-shadow: 0 24px 70px rgba(0,0,0,.45);
}

html:not(.dark) #about .about-stat:hover{
  box-shadow: 0 20px 55px rgba(0,0,0,.12);
}

/* Active: đổi màu + underline chữ luôn */
#nav-links a.active{
  color: rgb(99,102,241);              /* indigo-500 */
  text-decoration: underline;          /* underline sau khi click */
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

/* Dark mode: vẫn indigo */
.dark #nav-links a.active{
  color: rgb(99,102,241);
}

/* Hover: (tuỳ chọn) giữ underline dày hơn một chút khi hover */
#nav-links a:hover{
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 2px;
}

/* Nếu bạn vẫn muốn “underline bar” phía dưới hiện khi active */
#nav-links a.active > span.absolute{
  left: 0;
  right: 0;
  width: auto !important;
  opacity: 1 !important;
}

/* Scroll progress bar (added) */
#scroll-progress{
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: left;
  background: linear-gradient(90deg, #6366f1, #38bdf8);
  z-index: 9999;
}
