/* =========================================================
   Đăng Khoa Bio VIP — video bg + adaptive avatar frame
   Accent colors auto-sync from avatar image via CSS vars
   ========================================================= */

:root {
  --bg: #050508;
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --text-faint: rgba(255, 255, 255, 0.45);

  /* Defaults — overwritten by JS from avatar palette */
  --accent: #ef4444;
  --accent-2: #f97316;
  --accent-3: #dc2626;
  --accent-rgb: 239, 68, 68;
  --accent-2-rgb: 249, 115, 22;
  --accent-glow: rgba(239, 68, 68, 0.5);

  --glass: rgba(10, 10, 16, 0.48);
  --glass-border: rgba(255, 255, 255, 0.12);
  --radius: 20px;
  --font: "Onest", "Outfit", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --max-stack: 420px;
  --hud-pad: max(16px, env(safe-area-inset-top, 0px));
  --hud-side: max(16px, env(safe-area-inset-left, 0px));

  /* Enter text — filled from bg-anime palette */
  --enter-color: #e8e8f0;
  --enter-glow: rgba(232, 232, 240, 0.45);
}

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

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100svh;
  -webkit-font-smoothing: antialiased;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

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

.hidden {
  display: none !important;
}

/* ========== VIDEO BACKGROUND ========== */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg);
}

.bg-video,
.bg-fallback,
.bg-fallback-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  transition: transform 8s linear, opacity 0.8s ease;
}

.bg-fallback {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.bg-fallback-img {
  display: none;
  z-index: 0;
  pointer-events: none;
  /* GIF animates when used as <img> */
}

.bg-fallback-img.is-on {
  display: block;
}

/* Animated gif / still image as primary bg (no video) */
.bg-fallback.is-primary {
  z-index: 1;
}

.bg-fallback.is-primary .bg-fallback-img.is-on {
  opacity: 1;
}

.bg-video {
  z-index: 1;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.bg-video.is-ready {
  opacity: 1;
}

.bg-video.is-off {
  display: none !important;
  opacity: 0;
}

body.is-entered .bg-video:not(.is-off),
body.is-entered .bg-fallback.is-primary .bg-fallback-img {
  transform: scale(1);
}

.bg-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, transparent 15%, rgba(0, 0, 0, 0.58) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.4) 0%, transparent 28%, transparent 58%, rgba(0, 0, 0, 0.7) 100%);
  pointer-events: none;
}

.bg-grain {
  position: absolute;
  inset: 0;
  z-index: 3;
  opacity: 0.06;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.bg-tint {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: linear-gradient(
    145deg,
    rgba(var(--accent-rgb), 0.16) 0%,
    transparent 48%,
    rgba(var(--accent-2-rgb), 0.08) 100%
  );
  pointer-events: none;
  mix-blend-mode: soft-light;
  transition: background 0.8s ease;
}

.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  width: 100%;
  height: 100%;
}

/* ========== GLASS ========== */
.glass {
  background: var(--glass);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow:
    0 18px 48px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.glass-soft {
  background: rgba(8, 8, 12, 0.55);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

/* ========== CORNER HUD (views · sound) ========== */
.hud {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s var(--ease);
}

.hud:not(.is-hidden) {
  opacity: 1;
}

.hud.is-hidden {
  visibility: hidden;
}

.hud-corner {
  position: absolute;
  pointer-events: auto;
}

.hud-tl {
  top: var(--hud-pad);
  left: max(16px, env(safe-area-inset-left, 0px));
}

.hud-tr {
  top: var(--hud-pad);
  right: max(16px, env(safe-area-inset-right, 0px));
}

.view-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.view-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px #4ade80;
  flex-shrink: 0;
}

.view-label {
  color: var(--text-faint);
  font-weight: 400;
}



/* ========== ENTER SCREEN (clean — no border) ========== */
.enter-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.7s var(--ease), visibility 0.7s;
}

.enter-screen.is-gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.enter-inner {
  text-align: center;
  padding: 24px;
}

.enter-btn {
  padding: 12px 8px;
  font-size: clamp(1.35rem, 4.2vw, 1.85rem);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--enter-color);
  text-shadow:
    0 0 28px var(--enter-glow),
    0 2px 18px rgba(0, 0, 0, 0.55);
  transition: transform 0.3s var(--ease), opacity 0.3s, filter 0.3s;
  border: none;
  outline: none;
  background: transparent;
  box-shadow: none;
}

.enter-btn:hover,
.enter-btn:focus-visible {
  transform: scale(1.04);
  filter: brightness(1.12);
}

.enter-btn:focus-visible {
  outline: none;
}

.enter-label {
  display: inline-block;
  animation: enter-soft 2.4s ease-in-out infinite;
}

@keyframes enter-soft {
  0%, 100% { opacity: 0.92; }
  50% { opacity: 0.55; }
}

/* ========== APP / PROFILE ========== */
.app {
  position: relative;
  z-index: 10;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px 18px 36px;
  opacity: 0;
  transform: scale(0.96) translateY(12px);
  transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
  pointer-events: none;
}

.app.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.app.is-locked {
  visibility: hidden;
}

.profile-stack {
  width: min(100%, var(--max-stack));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  will-change: transform;
}

/* Avatar + adaptive ring */
.avatar-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  animation: rise 0.85s var(--ease) 0.15s both;
}

.avatar-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    var(--accent),
    var(--accent-2),
    var(--accent-3),
    var(--accent)
  );
  animation: spin 5.5s linear infinite;
  opacity: 0.95;
  transition: background 0.6s ease;
  box-shadow: 0 0 24px var(--accent-glow);
}

.avatar-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bg);
}

.avatar-glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 68%);
  filter: blur(10px);
  animation: breathe 3s ease-in-out infinite;
  transition: background 0.6s ease;
  pointer-events: none;
}

.avatar {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #12080c;
  display: grid;
  place-items: center;
  border: 3px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 10px 36px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(var(--accent-rgb), 0.25);
  overflow: hidden;
  z-index: 1;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0;
  transition: opacity 0.45s ease;
}

.avatar-img.is-loaded {
  opacity: 1;
}

.avatar.has-img .avatar-fallback {
  display: none;
}

.avatar-fallback {
  font-family: "Outfit", sans-serif;
  font-weight: 800;
  font-size: 2rem;
  letter-spacing: -0.04em;
  background: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0.65));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  position: absolute;
}

.status-badge {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #22c55e;
  border: 3px solid rgba(10, 10, 16, 0.92);
  z-index: 2;
}

.status-ping {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid #22c55e;
  animation: ping 1.8s ease-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

@keyframes ping {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Identity */
.identity {
  animation: rise 0.85s var(--ease) 0.25s both;
}

.name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.display-name {
  font-family: "Outfit", sans-serif;
  font-size: clamp(1.85rem, 5vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.name-glow {
  text-shadow:
    0 0 18px rgba(255, 255, 255, 0.4),
    0 0 42px var(--accent-glow),
    0 0 72px rgba(var(--accent-rgb), 0.3);
}

.badges {
  display: flex;
  gap: 6px;
}

.badge {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 0 14px var(--accent-glow);
}

.badge-prem {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.badge-ver {
  background: linear-gradient(135deg, #38bdf8, #6366f1);
  font-size: 0.7rem;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.45);
}

.username {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-faint);
}

.typewriter {
  margin-top: 10px;
  min-height: 1.4em;
  font-size: 0.95rem;
  color: var(--text-dim);
}

.typewriter .cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blink 0.8s step-end infinite;
  box-shadow: 0 0 8px var(--accent-glow);
}

@keyframes blink {
  50% { opacity: 0; }
}

/* Bio card */
.bio-card {
  width: 100%;
  padding: 18px 20px;
  animation: rise 0.85s var(--ease) 0.35s both;
  border: 1px solid rgba(var(--accent-rgb), 0.22);
  border-radius: var(--radius);
}

.bio-text {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.meta-pill {
  font-size: 0.8rem;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
}

.meta-vn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.flag-vn {
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}



/* Socials */
.socials {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  justify-content: center;
  animation: rise 0.85s var(--ease) 0.42s both;
}

.social {
  width: 50px;
  height: 50px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, border-color 0.25s;
  position: relative;
}

.social:hover {
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 0 26px var(--accent-glow), 0 12px 26px rgba(0, 0, 0, 0.3);
  border-color: rgba(var(--accent-rgb), 0.55);
}

.social::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  font-size: 0.68rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}

.social:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== XEM THÊM (avatar accent, pill) ========== */
.btn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:
    0 8px 28px var(--accent-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border: none;
  cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s, filter 0.2s;
  animation: rise 0.85s var(--ease) 0.5s both;
}

.btn-more:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 36px var(--accent-glow);
  filter: brightness(1.06);
}

.btn-more:active {
  transform: scale(0.98);
}

.btn-more-ico {
  transition: transform 0.25s var(--ease);
}

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

/* ========== FULL BIO PANEL (~90% viewport) ========== */
.more-panel {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5vh 5vw;
  pointer-events: none;
  visibility: hidden;
  /* delay hide until slide/blur finishes */
  transition: visibility 0s linear 0.52s;
}

.more-panel.is-open,
.more-panel.is-closing {
  visibility: visible;
  transition: visibility 0s linear 0s;
}

.more-panel.is-open {
  pointer-events: auto;
}

.more-panel.is-closing {
  pointer-events: none;
}

.more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  opacity: 0;
  transition:
    opacity 0.48s var(--ease),
    backdrop-filter 0.5s var(--ease),
    -webkit-backdrop-filter 0.5s var(--ease);
}

.more-panel.is-open .more-backdrop {
  opacity: 1;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.more-panel.is-closing .more-backdrop {
  opacity: 0;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}

.more-sheet {
  position: relative;
  z-index: 1;
  width: 90vw;
  height: 90vh;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: rgba(10, 10, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  /* closed / closing rest pose: slide down + soft blur */
  transform: translateY(14%) scale(0.96);
  opacity: 0;
  filter: blur(10px);
  will-change: transform, opacity, filter;
  transition:
    transform 0.52s var(--ease),
    opacity 0.45s var(--ease),
    filter 0.48s var(--ease);
  overflow: hidden;
}

.more-panel.is-open .more-sheet {
  transform: translateY(0) scale(1);
  opacity: 1;
  filter: blur(0);
}

.more-panel.is-closing .more-sheet {
  transform: translateY(16%) scale(0.95);
  opacity: 0;
  filter: blur(12px);
}

.more-head {
  display: grid;
  /* fixed 42px right column — volume never pushes Hide / title */
  grid-template-columns: auto minmax(0, 1fr) 42px;
  align-items: center;
  gap: 12px 16px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  overflow: visible;
}

.more-head-title {
  min-width: 0;
  text-align: center;
}

.more-kicker {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.more-head h2 {
  font-family: "Outfit", sans-serif;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Ẩn — left of panel header */
.btn-hide {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
  justify-self: start;
}

.btn-hide:hover {
  background: rgba(var(--accent-rgb), 0.25);
  border-color: rgba(var(--accent-rgb), 0.45);
  transform: translateY(-1px);
}

.btn-hide.wide {
  width: 100%;
  justify-content: center;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  box-shadow: 0 8px 24px var(--accent-glow);
}

/* Volume: layout box always 42×42 — expand overlays left (no push) */
.vol-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  flex-shrink: 0;
  z-index: 30;
  /* layout footprint NEVER grows → no squish, no push title */
}

.vol-wrap--panel {
  justify-self: end;
}

/* Shell floats; expands to the left from the mute button */
.vol-shell {
  position: absolute;
  right: 0;
  top: 0;
  height: 42px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}

.vol-wrap--panel .vol-shell {
  background: rgba(12, 12, 18, 0.88);
}

.vol-track {
  display: flex;
  align-items: center;
  width: 0;
  min-width: 0;
  height: 100%;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  pointer-events: none;
  transition:
    width 0.32s var(--ease),
    opacity 0.25s var(--ease),
    padding 0.32s var(--ease);
}

.vol-wrap:hover .vol-shell,
.vol-wrap:focus-within .vol-shell,
.vol-wrap.is-open .vol-shell {
  border-color: rgba(var(--accent-rgb), 0.55);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45), 0 0 18px var(--accent-glow);
  background: rgba(10, 8, 14, 0.92);
}

.vol-wrap:hover .vol-track,
.vol-wrap:focus-within .vol-track,
.vol-wrap.is-open .vol-track {
  width: 120px;
  opacity: 1;
  padding: 0 6px 0 16px;
  pointer-events: auto;
}

.vol-slider {
  width: 100%;
  min-width: 100px;
  height: 4px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--accent);
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
}

.vol-slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
}

.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
}

.vol-slider::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: none;
}

.vol-slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  cursor: pointer;
}

/* Perfect circle mute */
.btn-mute {
  box-sizing: border-box;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  padding: 0;
  margin: 0;
  line-height: 0;
}

.mute-svg {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  overflow: visible;
}

.vol-wrap:hover .btn-mute,
.vol-wrap:focus-within .btn-mute,
.vol-wrap.is-open .btn-mute,
.btn-mute:hover {
  background: rgba(var(--accent-rgb), 0.28);
  color: #fff;
}

/* Bật tiếng: có sóng, không gạch */
body.is-sound .btn-mute .mute-waves {
  opacity: 1;
}
body.is-sound .btn-mute .mute-slash {
  opacity: 0;
  transform: scale(0.6);
}

/* Tắt tiếng: ẩn sóng, hiện gạch chéo rõ */
body:not(.is-sound) .btn-mute {
  color: #fff;
}
body:not(.is-sound) .btn-mute .mute-waves {
  opacity: 0;
}
body:not(.is-sound) .btn-mute .mute-slash {
  opacity: 1;
  stroke: #fff;
  stroke-width: 2.25;
}

.mute-waves,
.mute-slash {
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform-origin: center;
}

.more-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 20px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--accent-rgb), 0.4) transparent;
}

.more-sec {
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.more-sec:last-child {
  border-bottom: none;
}

.more-sec h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec-ico {
  color: var(--accent);
  font-size: 0.7rem;
}

.more-sec p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-dim);
}

.more-sec strong {
  color: var(--text);
}

.job-card {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}

.job-card.muted {
  opacity: 0.92;
}

.job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.job-top strong {
  font-size: 0.95rem;
}

.job-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.25);
  color: #fff;
  border: 1px solid rgba(var(--accent-rgb), 0.4);
}

.job-year {
  font-size: 0.75rem;
  color: var(--text-faint);
}

.job-co {
  font-size: 0.8rem !important;
  color: var(--text-faint) !important;
  margin-bottom: 8px;
}

.job-list {
  list-style: none;
  display: grid;
  gap: 4px;
}

.job-list li {
  font-size: 0.84rem;
  color: var(--text-dim);
  padding-left: 14px;
  position: relative;
}

.job-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* Timeline (Journey + Education) — year | rail | content, no text overlap */
.timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  margin: 0;
  padding: 0 0 20px;
}

/* Vertical rail */
.timeline::before {
  content: "";
  position: absolute;
  left: calc(76px + 11px);
  top: 12px;
  bottom: 18px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(
    180deg,
    rgba(var(--accent-rgb), 0.2) 0%,
    var(--accent) 40%,
    var(--accent-2) 100%
  );
  box-shadow: 0 0 12px var(--accent-glow);
  pointer-events: none;
  z-index: 0;
}

/* Arrow down at end of timeline */
.timeline::after {
  content: "";
  position: absolute;
  left: calc(76px + 4px);
  bottom: 2px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 11px solid var(--accent-2);
  filter: drop-shadow(0 0 8px var(--accent-glow));
  pointer-events: none;
  z-index: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 76px 24px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  position: relative;
  z-index: 1;
  padding: 0 0 18px;
  min-width: 0;
}

.timeline-item:last-child {
  padding-bottom: 8px;
}

.timeline-year {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
  text-align: right;
  line-height: 1.3;
  padding-top: 2px;
  word-break: break-word;
  hyphens: auto;
}

.timeline-node {
  width: 12px;
  height: 12px;
  margin: 4px auto 0;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid rgba(10, 10, 16, 0.95);
  box-shadow: 0 0 10px var(--accent-glow);
  flex-shrink: 0;
  z-index: 2;
}

.timeline-body {
  min-width: 0;
  text-align: left;
  padding-top: 0;
}

.timeline-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.timeline-body strong {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 4px;
  line-height: 1.35;
  word-wrap: break-word;
}

.timeline-body p {
  font-size: 0.84rem !important;
  margin: 0;
  line-height: 1.5;
  color: var(--text-dim);
  word-wrap: break-word;
}

/* legacy aliases */
.journey,
.edu-timeline {
  /* use .timeline */
}

/* Projects carousel */
.proj-carousel {
  position: relative;
  max-width: 420px;
  margin: 0 auto;
}

.proj-viewport {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.12);
}

.proj-track {
  display: flex;
  transition: transform 0.45s var(--ease);
  will-change: transform;
}

.proj-slide {
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
}

.proj-card {
  padding: 0 0 16px;
  border-radius: 0;
  background: transparent;
  border: none;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.proj-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  z-index: 2;
}

.proj-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: var(--img-size, 512px);
  margin: 0 auto;
  overflow: hidden;
  background: #0a0a0f;
  border-bottom: 1px solid rgba(var(--accent-rgb), 0.18);
}

.proj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.proj-body {
  padding: 14px 16px 0;
}

.proj-card h4 {
  font-size: 1.05rem;
  margin: 0 0 8px;
  color: #fff;
}

.proj-card p {
  font-size: 0.84rem !important;
  margin-bottom: 10px;
  line-height: 1.45;
  color: var(--text-dim);
}

.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.proj-tags span {
  font-size: 0.65rem;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(var(--accent-rgb), 0.16);
  border: 1px solid rgba(var(--accent-rgb), 0.4);
  color: #fff;
}

.proj-link {
  display: inline-flex;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, letter-spacing 0.2s, color 0.2s;
}

.proj-link:hover {
  border-bottom-color: var(--accent-2);
  color: var(--accent-2);
  letter-spacing: 0.02em;
}

/* Prev / Next — avatar accent colors */
.proj-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(var(--accent-rgb), 0.55);
  background: rgba(10, 10, 16, 0.75);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 0 16px var(--accent-glow);
  transition: background 0.2s, transform 0.2s, border-color 0.2s;
}

.proj-nav:hover {
  background: rgba(var(--accent-rgb), 0.45);
  border-color: var(--accent);
  transform: translateY(-50%) scale(1.06);
}

.proj-nav:disabled {
  opacity: 0.35;
  pointer-events: none;
  box-shadow: none;
}

.proj-prev {
  left: -8px;
}

.proj-next {
  right: -8px;
}

.proj-nav svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
}

.proj-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.proj-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.22);
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.proj-dot.is-active {
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  transform: scale(1.15);
}

.proj-carousel.is-single .proj-nav,
.proj-carousel.is-single .proj-dots {
  display: none;
}

/* Stack */
.stack-rows {
  display: grid;
  gap: 10px;
}

.stack-rows > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  align-items: start;
  text-align: left;
}

.stack-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding-top: 2px;
}

.stack-val {
  font-size: 0.84rem;
  color: var(--text-dim);
  line-height: 1.45;
}

.more-cta .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 20px var(--accent-glow);
  transition: transform 0.2s, filter 0.2s;
}

.cta-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.cta-btn.ghost {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

.more-foot {
  padding: 12px 20px 20px;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 640px) {
  .app {
    padding: 64px 14px 28px;
  }

  .profile-stack {
    gap: 13px;
  }

  .avatar-wrap {
    width: 112px;
    height: 112px;
  }

  .social {
    width: 46px;
    height: 46px;
    border-radius: 13px;
  }

  .view-chip {
    padding: 8px 12px;
    font-size: 0.75rem;
  }

  .proj-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 64px 20px minmax(0, 1fr);
    column-gap: 8px;
  }

  .timeline::before {
    left: calc(64px + 9px);
  }

  .timeline::after {
    left: calc(64px + 2px);
  }

  .vol-wrap:hover .vol-track,
  .vol-wrap:focus-within .vol-track,
  .vol-wrap.is-open .vol-track {
    width: 100px;
  }

  .more-head {
    grid-template-columns: auto minmax(0, 1fr) 42px;
    overflow: visible;
  }

  .btn-mute,
  .vol-wrap {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .proj-prev {
    left: 6px;
  }

  .proj-next {
    right: 6px;
  }

  .stack-rows > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .more-panel {
    padding: 3vh 3vw;
  }

  .more-sheet {
    width: 94vw;
    height: 94vh;
    max-width: 94vw;
    max-height: 94vh;
    border-radius: 16px;
  }

  .more-head {
    padding: 12px 12px;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr) 42px;
    overflow: visible;
  }

  .btn-hide span {
    /* keep text; on very small still ok */
  }

  /* keep mute perfect circle — don't shrink unevenly */
  .btn-mute,
  .vol-wrap,
  .vol-shell {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
  }

  .vol-shell {
    height: 42px;
  }
}

@media (max-width: 380px) {
  .view-label {
    display: none;
  }
}

@media (min-height: 900px) {
  .profile-stack {
    gap: 20px;
  }
}

@media (max-height: 520px) and (orientation: landscape) {
  .app {
    padding: 12px 16px;
  }

  .profile-stack {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px 22px;
    max-width: 900px;
  }

  .avatar-wrap {
    width: 78px;
    height: 78px;
  }

  .identity {
    text-align: left;
  }

  .name-row {
    justify-content: flex-start;
  }

  .bio-card {
    max-width: 300px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-ring,
  .avatar-glow,
  .status-ping,
  .enter-label,
  .typewriter .cursor {
    animation: none !important;
  }

  .app,
  .avatar-wrap,
  .identity,
  .bio-card,
  .socials,
  .btn-more {
    animation: none !important;
    opacity: 1;
    transform: none;
  }

  .more-sheet,
  .more-backdrop {
    transition: none !important;
  }
}

body.more-open {
  overflow: hidden;
}

::selection {
  background: rgba(var(--accent-rgb), 0.45);
  color: #fff;
}
