/* ==========================================================================
   Lê Văn Hùng — Video Editor Portfolio (3D Interactive Edition)
   Main Stylesheet (css/style.css)
   ========================================================================== */

:root {
  --ink: #080D18;
  --panel: #0F1830;
  --panel-2: #131E3D;
  --line: #22304F;
  --blue: #2F6FED;
  --blue-deep: #1B3E9E;
  --cyan: #4DD8FF;
  --text: #E9EEFB;
  --muted: #8695B7;
  --mono: 'JetBrains Mono', monospace;
  --display: 'Space Grotesk', sans-serif;
  --body: 'Inter', sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 90px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  max-width: 100%;
  overflow-x: clip;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.6;
  max-width: 100%;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ===== 3D WEBGL BACKGROUND CANVAS ===== */
#bg3dCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  display: block;
}

/* Subtle vignette overlay to blend 3D space with UI */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 50% 25%, transparent 30%, rgba(8, 13, 24, 0.68) 100%),
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 100% 100%, 64px 64px, 64px 64px;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
  transform: translateZ(0);
}

/* ===== PROGRESS PLAYHEAD ===== */
.nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(34, 48, 79, 0.65);
  z-index: 101;
  overflow: hidden;
}

.nav-progress-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 12px var(--cyan);
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
}

/* ===== TIMELINE NAV (Signature Element) ===== */
.timeline-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 13, 24, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(77, 216, 255, 0.16);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.55);
  width: 100%;
}

.timeline-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.timeline-track {
  display: flex;
  align-items: stretch;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 110px 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.lang-switch {
  position: fixed;
  top: 13px;
  right: max(16px, calc((100vw - 1200px) / 2 + 16px));
  z-index: 102;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(77, 216, 255, 0.3);
  background: rgba(15, 24, 48, 0.9);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s var(--ease-out), background 0.2s ease;
  box-shadow: 0 4px 14px rgba(2, 6, 23, 0.4);
}

.lang-switch:hover {
  border-color: var(--cyan);
  background: rgba(77, 216, 255, 0.12);
  box-shadow: 0 0 18px rgba(77, 216, 255, 0.28);
  transform: translateY(-1px);
}

.lang-switch .lang-opt {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  line-height: 1;
}

.lang-switch .lang-opt.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 0 10px rgba(77, 216, 255, 0.45);
}

.timeline-track::-webkit-scrollbar {
  display: none;
}

.tl-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 20px;
  border-right: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  transition: background 0.25s var(--ease-out), transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.tl-item:hover {
  background: rgba(77, 216, 255, 0.08);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(77, 216, 255, 0.16);
}

.tl-item .tc {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.5px;
  transition: color 0.2s ease;
}

.tl-item .lbl {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.tl-item.active .lbl {
  color: var(--text);
  text-shadow: 0 0 12px rgba(77, 216, 255, 0.45);
}

.tl-item.active .tc {
  color: #fff;
}

.tl-item.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  box-shadow: 0 0 14px rgba(77, 216, 255, 0.8);
}

.tl-item .tick {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 1px;
  height: 6px;
  background: var(--muted);
  opacity: 0.4;
}

.tl-item-extra {
  color: var(--cyan);
}

/* ===== 3D SCROLL REVEAL ===== */
.reveal {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.in-view {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Section Container */
section {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 100px 24px;
  scroll-margin-top: 90px;
}

/* ===== 3D TILT & GLARE SYSTEM (PC Only) ===== */
@media (min-width: 961px) and (pointer: fine) {
  .tilt-3d {
    position: relative;
    transform-style: preserve-3d;
    will-change: transform;
    transition: transform 0.18s cubic-bezier(0.03, 0.98, 0.52, 0.99), box-shadow 0.3s ease, border-color 0.3s ease;
  }

  .tilt-3d.is-resetting {
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease, border-color 0.3s ease;
  }

  .tilt-glare {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: radial-gradient(
      360px circle at var(--glare-x, 50%) var(--glare-y, 50%),
      rgba(77, 216, 255, 0.22),
      rgba(47, 111, 237, 0.08) 40%,
      transparent 80%
    );
    mix-blend-mode: screen;
  }

  .tilt-3d:hover .tilt-glare {
    opacity: 1;
  }

  .card-body {
    transform: translateZ(18px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

.section-head {
  margin-bottom: 36px;
}

.section-head .tc-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
  text-shadow: 0 0 12px rgba(77, 216, 255, 0.35);
}

.section-head h2 {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 600;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.section-head p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 8px;
  max-width: 520px;
}

/* ===== HERO 3D ===== */
.hero {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 44px;
  align-items: center;
  padding-top: 72px;
}

.avatar-wrap-3d {
  position: relative;
  width: 190px;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Floating 3D Orbital Rings around Avatar */
.avatar-wrap-3d::before,
.avatar-wrap-3d::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px dashed rgba(77, 216, 255, 0.35);
  pointer-events: none;
  animation: orbit-spin 18s linear infinite;
}

.avatar-wrap-3d::after {
  inset: -18px;
  border: 1px solid rgba(47, 111, 237, 0.25);
  border-top-color: var(--cyan);
  animation: orbit-spin-reverse 12s linear infinite;
}

@keyframes orbit-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes orbit-spin-reverse {
  0% { transform: rotate(360deg); }
  100% { transform: rotate(0deg); }
}

.avatar {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, var(--blue), var(--cyan), var(--blue-deep), var(--blue));
  padding: 4px;
  position: relative;
  box-shadow:
    0 20px 50px rgba(47, 111, 237, 0.35),
    0 0 30px rgba(77, 216, 255, 0.2);
}

.avatar::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--panel);
}

.avatar span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: 56px;
  font-weight: 700;
  color: var(--text);
  z-index: 1;
  text-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

.avatar img {
  position: absolute;
  inset: 4px;
  width: calc(100% - 8px);
  height: calc(100% - 8px);
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  display: none;
}

.avatar.has-image img {
  display: block;
}

.avatar.has-image span {
  display: none;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 12px 32px rgba(2, 6, 23, 0.65);
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--cyan), var(--blue), #8B5CF6);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: grad-flow 6s ease infinite;
}

@keyframes grad-flow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p.desc {
  color: var(--muted);
  font-size: 16px;
  max-width: 560px;
  margin-bottom: 24px;
}

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

.chip {
  font-family: var(--mono);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(77, 216, 255, 0.18);
  background: rgba(15, 24, 48, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 100px;
  color: var(--text);
  max-width: 100%;
  transition: border-color 0.25s ease, background 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.chip:hover {
  border-color: var(--cyan);
  background: rgba(77, 216, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(77, 216, 255, 0.18);
}

.chip .dot {
  color: var(--cyan);
  flex-shrink: 0;
}

/* ===== SHOWREEL 3D ===== */
.reel {
  position: relative;
  aspect-ratio: 9 / 16;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(19, 30, 61, 0.9), rgba(15, 24, 48, 0.92));
  border: 1px solid rgba(77, 216, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow:
    0 30px 70px rgba(2, 6, 23, 0.7),
    0 0 40px rgba(47, 111, 237, 0.18);
}

.reel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 38px,
    rgba(77, 216, 255, 0.05) 38px,
    rgba(77, 216, 255, 0.05) 40px
  );
  pointer-events: none;
}

.play-btn {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(47, 111, 237, 0.24);
  border: 1px solid var(--cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s var(--ease-out), background 0.25s ease, box-shadow 0.25s ease;
  z-index: 3;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(47, 111, 237, 0.4);
}

.play-btn:hover {
  background: var(--blue);
  box-shadow: 0 0 36px rgba(77, 216, 255, 0.65);
  transform: scale(1.08);
}

.play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 4px;
}

.reel-tag {
  position: absolute;
  bottom: 16px;
  left: 16px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  background: rgba(8, 13, 24, 0.78);
  border: 1px solid rgba(77, 216, 255, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  z-index: 2;
  pointer-events: none;
}

.reel-tag.dur {
  left: auto;
  right: 16px;
}

.reel video,
.reel iframe,
.reel .reel-poster {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border: 0;
  background: #000;
}

.reel .player-shell {
  position: absolute;
  inset: 0;
  display: none;
  z-index: 1;
  overflow: hidden;
}

.reel.is-video .player-shell {
  display: block;
}

.reel.is-playing .play-btn,
.reel.is-playing .reel-tag {
  display: none;
}

/* ===== PORTFOLIO 3D CARDS ===== */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  font-family: var(--mono);
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9eb0d2;
  background: rgba(15, 24, 48, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
  flex: 0 0 auto;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tab img {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
}

.tab:hover {
  border-color: rgba(77, 216, 255, 0.5);
  color: var(--text);
  background: rgba(77, 216, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(77, 216, 255, 0.15);
}

.tab.active {
  border-color: var(--cyan);
  color: var(--text);
  background: linear-gradient(90deg, rgba(47, 111, 237, 0.3), rgba(77, 216, 255, 0.2));
  box-shadow: 0 0 20px rgba(77, 216, 255, 0.22), 0 0 0 1px rgba(77, 216, 255, 0.16) inset;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
}

.card-empty {
  grid-column: 1 / -1;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 32px;
  scroll-margin-top: 120px;
}

.page-btn {
  min-width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 24, 48, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.page-btn:hover:not(:disabled) {
  border-color: rgba(77, 216, 255, 0.45);
  background: rgba(77, 216, 255, 0.12);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(77, 216, 255, 0.18);
}

.page-btn.active {
  background: linear-gradient(90deg, rgba(47, 111, 237, 0.34), rgba(77, 216, 255, 0.2));
  border-color: var(--cyan);
  box-shadow: 0 0 18px rgba(77, 216, 255, 0.25), 0 0 0 1px rgba(77, 216, 255, 0.15) inset;
  color: #fff;
}

.page-btn.nav {
  min-width: auto;
  padding: 0 14px;
  font-size: 12px;
}

.page-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card {
  background: linear-gradient(180deg, rgba(19, 30, 61, 0.78), rgba(10, 16, 32, 0.94));
  border: 1px solid rgba(77, 216, 255, 0.14);
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 20px 45px rgba(2, 6, 23, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  position: relative;
  width: 100%;
  min-width: 0;
}

.card:hover {
  border-color: rgba(77, 216, 255, 0.48);
  box-shadow:
    0 30px 60px rgba(2, 6, 23, 0.75),
    0 0 32px rgba(47, 111, 237, 0.28);
}

.card-thumb {
  aspect-ratio: 9 / 16;
  max-height: 560px;
  width: 100%;
  background: linear-gradient(135deg, var(--panel-2), #0c1428);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  isolation: isolate;
}

.card-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.12) 65%, rgba(0, 0, 0, 0.42) 100%);
  pointer-events: none;
}

.card-thumb .mini-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.card-thumb .mini-play svg {
  width: 14px;
  height: 14px;
}

.card-thumb video,
.card-thumb iframe,
.card-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
  object-fit: cover;
  object-position: center center;
  transition: transform 0.4s var(--ease-out);
}

.card:hover .card-thumb img {
  transform: scale(1.04);
}

/* ===== CLICK-TO-PLAY VIDEO FACADE (Tiết kiệm RAM trên Mobile/iOS) ===== */
.video-facade {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060b16;
  cursor: pointer;
  overflow: hidden;
}

.video-facade .facade-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}

.video-facade .facade-play-btn {
  position: relative;
  z-index: 3;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(8, 13, 24, 0.72);
  border: 1.5px solid var(--cyan);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 22px rgba(77, 216, 255, 0.35);
  transition: transform 0.25s var(--ease-out), background 0.25s ease, box-shadow 0.25s ease;
}

.video-facade .facade-play-btn svg {
  width: 24px;
  height: 24px;
  margin-left: 3px;
}

.video-facade:hover .facade-play-btn {
  transform: scale(1.08);
  background: var(--blue);
  box-shadow: 0 0 32px rgba(77, 216, 255, 0.6);
}

.video-facade .facade-iframe-slot {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: none;
  overflow: hidden;
  background: #000;
}

.video-facade.is-active .facade-iframe-slot {
  display: block;
}

.video-facade.is-active .facade-thumb,
.video-facade.is-active .facade-play-btn {
  display: none;
}

/* Khi đang phát video: ẩn overlay badge & gradient để không che nút điều khiển của player */
.card.is-playing .card-thumb::after,
.card.is-playing .card-thumb .thumb-overlay {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Sửa lỗi thanh điều khiển Google Drive /preview bị phóng to và nằm giữa video trên điện thoại */
@media (max-width: 768px), (pointer: coarse) {
  .card-thumb iframe.drive-embed-iframe,
  .reel iframe.drive-embed-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 185%;
    height: 185%;
    transform: scale(0.54054);
    transform-origin: 0 0;
    transition: none;
  }
}

.card-thumb .thumb-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  z-index: 2;
  pointer-events: none;
}

.card-thumb .thumb-pill {
  font-family: var(--mono);
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(8, 13, 24, 0.82);
  border: 1px solid rgba(77, 216, 255, 0.24);
  color: var(--text);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.card-thumb .dur {
  font-family: var(--mono);
  font-size: 11px;
  background: rgba(8, 13, 24, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 6px;
  color: var(--cyan);
}

.card-body {
  padding: 16px 16px 18px;
  position: relative;
  z-index: 2;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.card-body .cat {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--cyan);
  letter-spacing: 0.5px;
}

.card-body .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.card-body .mini-label {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

.card-body h3 {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.card-body p {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===== SKILLS 3D PANEL ===== */
.skills-panel {
  background: rgba(15, 24, 48, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(77, 216, 255, 0.18);
  border-radius: 18px;
  padding: 32px;
  font-family: var(--mono);
  font-size: 13px;
  box-shadow:
    0 24px 60px rgba(2, 6, 23, 0.6),
    0 0 30px rgba(47, 111, 237, 0.12);
}

.terminal-head {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
}

.terminal-head span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}

.terminal-head span:nth-child(1) { background: #FF5F56; }
.terminal-head span:nth-child(2) { background: #FFBD2E; }
.terminal-head span:nth-child(3) { background: #27C93F; }

.skill-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.skill-line .name {
  width: 220px;
  color: var(--text);
  flex-shrink: 0;
}

.skill-line .bar-bg {
  flex: 1;
  height: 7px;
  background: rgba(34, 48, 79, 0.8);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}

.skill-line .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  border-radius: 4px;
  box-shadow: 0 0 12px rgba(77, 216, 255, 0.5);
}

.skill-line .pct {
  color: var(--cyan);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  border: 1px solid rgba(47, 111, 237, 0.45);
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(47, 111, 237, 0.12);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--ease-out), box-shadow 0.2s ease;
}

.tag:hover {
  border-color: var(--cyan);
  background: rgba(77, 216, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(77, 216, 255, 0.2);
}

/* ===== TOOL ICON MARQUEE (Smooth GPU CSS Animation) ===== */
.marquee-wrap {
  overflow: hidden;
  border: 1px solid rgba(77, 216, 255, 0.16);
  border-radius: 18px;
  background: rgba(15, 24, 48, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 0;
  margin-top: 28px;
  position: relative;
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.45);
  width: 100%;
}

.marquee-wrap::before,
.marquee-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 48px;
  z-index: 2;
  pointer-events: none;
}

.marquee-wrap::before {
  left: 0;
  background: linear-gradient(90deg, var(--panel), transparent);
}

.marquee-wrap::after {
  right: 0;
  background: linear-gradient(270deg, var(--panel), transparent);
}

.marquee-track {
  display: flex;
  gap: 16px;
  width: max-content;
  padding-left: 16px;
  animation: marquee-scroll 24s linear infinite;
  will-change: transform;
}

.marquee-wrap:hover .marquee-track {
  animation-play-state: paused;
}

@keyframes marquee-scroll {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.icon-badge {
  flex: 0 0 auto;
  width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 10px;
  background: rgba(19, 30, 61, 0.85);
  border: 1px solid rgba(77, 216, 255, 0.14);
  border-radius: 12px;
  transition: border-color 0.25s ease, transform 0.25s var(--ease-out), box-shadow 0.25s ease;
}

.icon-badge:hover {
  border-color: var(--cyan);
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(77, 216, 255, 0.2);
}

.icon-badge img {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.icon-badge .fallback {
  display: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: #fff;
}

.icon-badge .name {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
}

/* ===== EDUCATION 3D CARD ===== */
.edu-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 28px 32px;
  background: rgba(15, 24, 48, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(77, 216, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(2, 6, 23, 0.45);
}

.edu-row h3 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
}

.edu-row p {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}

.edu-row .tc {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(77, 216, 255, 0.08);
  border: 1px solid rgba(77, 216, 255, 0.22);
}

/* ===== CONTACT / FOOTER ===== */
.contact-cta {
  text-align: center;
  padding: 80px 24px;
  background: linear-gradient(180deg, rgba(15, 24, 48, 0.4), rgba(47, 111, 237, 0.12));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(77, 216, 255, 0.16);
  border-radius: 24px;
  margin-bottom: 60px;
  box-shadow: 0 28px 65px rgba(2, 6, 23, 0.6);
  width: calc(100% - 48px);
}

.contact-cta .tc-label {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--cyan);
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}

.contact-cta h2 {
  font-family: var(--display);
  font-size: 36px;
  margin-bottom: 16px;
}

.contact-cta p {
  color: var(--muted);
  margin-bottom: 32px;
}

.btn-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s var(--ease-out);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), #1e50c2);
  color: #fff;
  box-shadow: 0 10px 25px rgba(47, 111, 237, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 32px rgba(77, 216, 255, 0.45);
}

.btn-ghost {
  border: 1px solid rgba(77, 216, 255, 0.25);
  background: rgba(15, 24, 48, 0.6);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  background: rgba(77, 216, 255, 0.12);
  box-shadow: 0 10px 24px rgba(77, 216, 255, 0.18);
}

footer {
  text-align: center;
  padding: 24px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
  background: rgba(8, 13, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* ===== RESPONSIVE (TABLET & MOBILE) ===== */
@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .timeline-bar {
    padding-right: 0;
  }
  .timeline-track {
    padding: 0 12px;
    width: 100%;
  }
  .tl-item {
    padding: 12px 14px;
  }
  .lang-switch {
    position: absolute;
    top: 68px;
    right: 14px;
    z-index: 95;
    margin-left: 0;
    padding: 5px 9px;
    font-size: 11px;
    background: rgba(8, 13, 24, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding-top: 36px;
    gap: 28px;
  }
  .avatar-wrap-3d {
    margin: 0 auto;
    width: 164px;
    height: 164px;
  }
  .avatar {
    width: 156px;
    height: 156px;
  }
  .eyebrow {
    justify-content: center;
    font-size: 11px;
  }
  .hero p.desc {
    margin-left: auto;
    margin-right: auto;
    font-size: 15px;
  }
  .contact-row {
    justify-content: center;
  }
  .chip {
    font-size: 12px;
    padding: 7px 12px;
  }
  .section-head h2 {
    font-size: 26px;
  }
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
  .skills-panel {
    padding: 20px 16px;
  }
  .skill-line {
    flex-wrap: wrap;
    gap: 6px;
  }
  .skill-line .name {
    width: 100%;
  }
  .tabs {
    flex-wrap: wrap;
    overflow-x: visible;
    row-gap: 8px;
    column-gap: 8px;
  }
  .tab {
    font-size: 12px;
    padding: 8px 12px;
    white-space: normal;
    max-width: 100%;
  }
  #work {
    padding-top: 64px;
  }
  #work .section-head {
    margin-bottom: 24px;
  }
  section {
    padding: 56px 16px;
  }
  .edu-row {
    flex-direction: column;
    gap: 10px;
    padding: 20px;
  }
  .contact-cta {
    width: calc(100% - 32px);
    padding: 48px 20px;
    margin-bottom: 40px;
  }
  .contact-cta h2 {
    font-size: 28px;
  }
  /* Giảm tải bộ nhớ GPU (VRAM) trên iOS/mobile: tắt nền 3D & backdrop-filter nặng */
  #bg3dCanvas {
    display: none;
  }
  .timeline-nav,
  .lang-switch,
  .chip,
  .play-btn,
  .tab,
  .page-btn,
  .skills-panel,
  .marquee-wrap,
  .edu-row,
  .contact-cta,
  footer {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .timeline-nav,
  .lang-switch,
  footer {
    background: rgba(8, 13, 24, 0.96);
  }
  .chip,
  .tab,
  .page-btn,
  .skills-panel,
  .marquee-wrap,
  .edu-row {
    background: rgba(15, 24, 48, 0.94);
  }
}
