/* Bio & blog — static page, no build */
:root {
  --bg: #0c0e12;
  --bg-alt: #11141b;
  --surface: #161a24;
  --text: #e8eaef;
  --muted: #9aa3b2;
  --accent: #7cf0c6;
  --accent-dim: rgba(124, 240, 198, 0.15);
  /* Hiệu ứng hero — màu mạnh để thấy rõ trên nền tối */
  --hero-fx-a: rgba(124, 240, 198, 0.98);
  --hero-fx-b: rgba(124, 240, 198, 0.65);
  --hero-fx-c: rgba(72, 220, 180, 0.9);
  --hero-fx-edge: rgba(180, 255, 230, 0.55);
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --radius: 16px;
  --radius-sm: 10px;
  --font: system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1080px;
  /* Header sticky: chừa khoảng trống khi bấm menu #nhac, #gioi-thieu, … */
  --scroll-anchor-offset: 5.75rem;
}

[data-theme="light"] {
  --bg: #f6f4ef;
  --bg-alt: #ebe6dc;
  --surface: #ffffff;
  --text: #1a1d24;
  --muted: #5c6474;
  --accent: #0d6b52;
  --accent-dim: rgba(13, 107, 82, 0.12);
  --hero-fx-a: rgba(13, 107, 82, 0.92);
  --hero-fx-b: rgba(13, 107, 82, 0.5);
  --hero-fx-c: rgba(25, 130, 100, 0.85);
  --hero-fx-edge: rgba(20, 90, 70, 0.45);
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 20px 60px rgba(26, 29, 36, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

main > section[id] {
  scroll-margin-top: var(--scroll-anchor-offset);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  transition: background 0.35s ease, color 0.35s ease;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  background: var(--accent);
  color: var(--bg);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  z-index: 100;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 1rem;
}

code {
  font-size: 0.88em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
}

[data-theme="light"] code {
  color: var(--text);
}

.wrap {
  width: min(100% - 2.5rem, var(--max));
  margin-inline: auto;
}

/* Gợi ý thêm web vào màn hình chính (PWA) */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 285;
  padding: 0.5rem max(0.75rem, env(safe-area-inset-right)) max(0.75rem, env(safe-area-inset-bottom))
    max(0.75rem, env(safe-area-inset-left));
  pointer-events: none;
}

.pwa-install-banner__inner {
  pointer-events: auto;
  position: relative;
  max-width: min(100%, var(--max));
  margin: 0 auto;
  padding: 0.85rem 2.65rem 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.pwa-install-banner__title {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
}

.pwa-install-banner__text {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.pwa-install-banner__ios {
  margin: 0 0 0.65rem;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.pwa-install-banner__ios strong {
  color: var(--text);
}

.pwa-install-banner__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pwa-install-banner__btn {
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

.pwa-install-banner__close {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.pwa-install-banner__close:hover {
  color: var(--text);
  background: var(--accent-dim);
}

/* Thông báo nổi — live TikTok (góc dưới trái, tránh đè nút liên hệ bên phải) */
.live-float-notice {
  --lf-pink: #fe2c55;
  --lf-cyan: #25f4ee;
  position: fixed;
  left: max(0.85rem, env(safe-area-inset-left));
  bottom: max(6.5rem, calc(env(safe-area-inset-bottom, 0px) + 5.5rem));
  z-index: 280;
  max-width: min(21rem, calc(100vw - 1.75rem));
  font-family: var(--font);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.4));
  overflow: visible;
  isolation: isolate;
  pointer-events: none;
  opacity: 0;
  transform: translate3d(0, 1rem, 0) scale(0.98);
  transition:
    opacity 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.live-float-notice.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .live-float-notice {
    transition-duration: 0.01ms;
  }
}

.live-float-notice__glow {
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius) + 3px);
  background: conic-gradient(from 200deg, var(--lf-cyan), var(--lf-pink), #a855f7, var(--lf-cyan));
  opacity: 0.55;
  z-index: 0;
  animation: live-float-rotate 7s linear infinite;
}

@keyframes live-float-rotate {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-float-notice__glow {
    animation: none;
    opacity: 0.35;
  }
}

.live-float-notice__inner {
  position: relative;
  z-index: 1;
  padding: 0.85rem 0.7rem 0.75rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, #0a0c10);
  border: 1px solid color-mix(in srgb, var(--border) 80%, var(--lf-cyan) 12%);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="light"] .live-float-notice__inner {
  background: color-mix(in srgb, var(--surface) 94%, #f0f9ff);
  border-color: color-mix(in srgb, var(--border) 90%, #94a3b8);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.live-float-notice__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0 0.2rem 0.65rem 0.15rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.55rem;
}

.live-float-notice__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.live-float-notice__icon-wrap {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--lf-cyan) 25%, var(--surface)), color-mix(in srgb, var(--lf-pink) 20%, var(--surface)));
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] .live-float-notice__icon-wrap {
  color: #1a1d24;
}

.live-float-notice__icon {
  display: block;
  width: 1.45rem;
  height: 1.45rem;
}

.live-float-notice__titles {
  min-width: 0;
}

.live-float-notice__kicker {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
  line-height: 1.25;
}

.live-float-notice__live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.35rem;
  padding: 0.1rem 0.45rem 0.1rem 0.35rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #fff;
  background: linear-gradient(90deg, var(--lf-pink), #e11d48);
  border-radius: 999px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.live-float-notice__live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: live-dot-pulse 1.2s ease-in-out infinite;
}

@keyframes live-dot-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.55;
    transform: scale(0.9);
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-float-notice__live-dot {
    animation: none;
  }
}

.live-float-notice__tagline {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}

.live-float-notice__close {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.live-float-notice__close:hover {
  color: var(--text);
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.live-float-notice__close:active {
  transform: scale(0.96);
}

.live-float-notice__actions {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.live-float-notice__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.55rem 0.7rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: color-mix(in srgb, var(--bg) 50%, var(--surface));
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.live-float-notice__row:hover {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--accent);
}

.live-float-notice__row:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.live-float-notice__row:active {
  transform: scale(0.99);
}

.live-float-notice__row-text {
  min-width: 0;
}

.live-float-notice__row-go {
  flex-shrink: 0;
  font-size: 0.9rem;
  opacity: 0.65;
  transition: transform 0.2s ease, opacity 0.2s;
}

.live-float-notice__row:hover .live-float-notice__row-go {
  opacity: 1;
  transform: translate3d(3px, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .live-float-notice__row:hover .live-float-notice__row-go {
    transform: none;
  }
}

.live-float-notice__more {
  display: block;
  margin-top: 0.55rem;
  padding: 0.15rem 0.15rem 0.05rem;
  font-size: 0.78rem;
  text-align: center;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.live-float-notice__more:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 50%, transparent);
}

/* Mục TikTok trong trang */
.tiktok-live-card {
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  max-width: 36rem;
}

.tiktok-live-line {
  margin: 0 0 0.65rem;
  font-size: 1.02rem;
  line-height: 1.55;
  color: var(--text);
}

.tiktok-live-line:last-child {
  margin-bottom: 0;
}

.tiktok-live-label {
  color: var(--muted);
  margin-right: 0.35rem;
}

.tiktok-live-link {
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}

.tiktok-live-link:hover {
  border-bottom-color: var(--accent);
}

[data-theme="light"] .tiktok-live-card {
  box-shadow: 0 8px 28px rgba(26, 29, 36, 0.08);
}

/* Nút nhạc góc màn hình — phát / tạm dừng / dừng (trái, dưới thanh header) */
.music-corner {
  position: fixed;
  top: max(5.25rem, calc(env(safe-area-inset-top, 0px) + 4.5rem));
  left: max(0.85rem, env(safe-area-inset-left));
  right: auto;
  z-index: 280;
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.music-corner__btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.music-corner__btn:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.music-corner__btn:active {
  transform: scale(0.96);
}

.music-corner__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.music-corner__btn--stop {
  width: 40px;
  height: 40px;
  color: var(--muted);
}

.music-corner__btn--stop:hover {
  color: var(--text);
}

.music-corner__ico {
  display: block;
}

.music-corner__ico--pause {
  display: none;
}

.music-corner__btn--toggle.is-playing .music-corner__ico--play {
  display: none;
}

.music-corner__btn--toggle.is-playing .music-corner__ico--pause {
  display: block;
}

[data-theme="light"] .music-corner__btn {
  box-shadow: 0 6px 20px rgba(26, 29, 36, 0.1);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.site-brand:hover .site-brand__name,
.site-brand:focus-visible .site-brand__name {
  color: var(--accent);
}

.site-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 12px;
}

.site-brand__name {
  font-weight: 700;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  white-space: nowrap;
}

.logo {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
}

.logo img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: block;
}

.nav-list {
  display: flex;
  gap: 1.75rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-list a:hover {
  color: var(--text);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  box-shadow: 0 -6px 0 var(--text), 0 6px 0 var(--text);
}

@media (max-width: 720px) {
  .nav-toggle {
    display: flex;
  }

  .nav-list {
    position: absolute;
    right: 1.25rem;
    top: calc(100% + 8px);
    flex-direction: column;
    gap: 0;
    min-width: 200px;
    padding: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 0.2s, transform 0.2s;
  }

  .nav-list.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-list li a {
    display: block;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
  }

  .nav-list li a:hover {
    background: var(--accent-dim);
  }
}

/* Hero */
.hero {
  position: relative;
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(4rem, 10vw, 7rem);
  overflow: hidden;
}

/* Glow nền — đặt trước lá hoa trong DOM + z-index thấp hơn để lá nổi rõ */
.hero-glow {
  position: absolute;
  inset: -20% 20% auto;
  z-index: 1;
  height: 60%;
  background: radial-gradient(ellipse at center, var(--accent-dim), transparent 70%);
  pointer-events: none;
  animation: hero-glow-drift 18s ease-in-out infinite alternate;
}

/* Mưa sao băng — THUẦN CSS (không dùng var() trong @keyframes — tránh trình duyệt không chạy) */
.meteor-shower {
  position: absolute;
  inset: 0;
  z-index: 13;
  pointer-events: none;
  overflow: hidden;
}

.meteor {
  display: block;
  position: absolute;
  width: 4px;
  margin: 0;
  border-radius: 4px;
  transform-origin: 50% 0;
  will-change: transform, opacity;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 220, 160, 0.5) 15%,
    rgba(255, 150, 60, 1) 42%,
    rgba(255, 90, 30, 0.95) 68%,
    rgba(255, 60, 15, 0) 100%
  );
  box-shadow:
    0 0 14px rgba(255, 160, 70, 0.95),
    0 0 28px rgba(255, 100, 40, 0.45);
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.meteor--t1 {
  animation-name: meteor-run-1;
  animation-duration: 1.05s;
}

.meteor--t2 {
  animation-name: meteor-run-2;
  animation-duration: 1.35s;
}

.meteor--t3 {
  animation-name: meteor-run-3;
  animation-duration: 0.95s;
}

.meteor--t4 {
  animation-name: meteor-run-4;
  animation-duration: 1.2s;
}

.meteor--t5 {
  animation-name: meteor-run-5;
  animation-duration: 1.5s;
}

.meteor--t6 {
  animation-name: meteor-run-6;
  animation-duration: 1.1s;
}

@keyframes meteor-run-1 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-39deg) scaleY(0.35);
  }
  7% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-58vw, 92vh, 0) rotate(-39deg) scaleY(1.12);
  }
}

@keyframes meteor-run-2 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-44deg) scaleY(0.3);
  }
  8% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-72vw, 85vh, 0) rotate(-44deg) scaleY(1.08);
  }
}

@keyframes meteor-run-3 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-33deg) scaleY(0.4);
  }
  6% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-48vw, 98vh, 0) rotate(-33deg) scaleY(1.15);
  }
}

@keyframes meteor-run-4 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-48deg) scaleY(0.28);
  }
  7% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-65vw, 78vh, 0) rotate(-48deg) scaleY(1.05);
  }
}

@keyframes meteor-run-5 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-36deg) scaleY(0.38);
  }
  9% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-52vw, 105vh, 0) rotate(-36deg) scaleY(1.18);
  }
}

@keyframes meteor-run-6 {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) rotate(-41deg) scaleY(0.32);
  }
  7% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(-68vw, 88vh, 0) rotate(-41deg) scaleY(1.1);
  }
}

/* Lá hoa — dưới sao băng; contain giúp composite nhẹ khi nhiều hạt */
.hero-nature {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  overflow: hidden;
  contain: layout paint;
}

/* Vệt chạm — trên cùng hero */
.hero-ripples {
  position: absolute;
  inset: 0;
  z-index: 14;
  pointer-events: none;
  overflow: hidden;
}

@keyframes hero-glow-drift {
  0% {
    opacity: 0.65;
    transform: translate3d(-4%, 0, 0) scale(1);
  }
  100% {
    opacity: 1;
    transform: translate3d(5%, 2%, 0) scale(1.08);
  }
}

/*
 * Lá rơi — KHÔNG dùng var() trong @keyframes (một số trình duyệt không nội suy translate → lá đứng yên, chỉ scale nhấp nhô).
 * Mỗi lá gán class .petal-f--1 … .petal-f--8 (đường rơi cố định).
 */
@keyframes leaf-fall-1 {
  0% {
    transform: translate3d(2vw, -26vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-30vw, 132vh, 0) rotate(280deg);
    opacity: 0.72;
  }
}

@keyframes leaf-fall-2 {
  0% {
    transform: translate3d(-4vw, -30vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-42vw, 128vh, 0) rotate(-260deg);
    opacity: 0.68;
  }
}

@keyframes leaf-fall-3 {
  0% {
    transform: translate3d(10vw, -22vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-36vw, 135vh, 0) rotate(310deg);
    opacity: 0.7;
  }
}

@keyframes leaf-fall-4 {
  0% {
    transform: translate3d(-8vw, -28vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-22vw, 130vh, 0) rotate(190deg);
    opacity: 0.65;
  }
}

@keyframes leaf-fall-5 {
  0% {
    transform: translate3d(6vw, -32vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-48vw, 125vh, 0) rotate(-300deg);
    opacity: 0.7;
  }
}

@keyframes leaf-fall-6 {
  0% {
    transform: translate3d(-12vw, -24vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-18vw, 133vh, 0) rotate(240deg);
    opacity: 0.68;
  }
}

@keyframes leaf-fall-7 {
  0% {
    transform: translate3d(14vw, -20vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-52vw, 129vh, 0) rotate(350deg);
    opacity: 0.66;
  }
}

@keyframes leaf-fall-8 {
  0% {
    transform: translate3d(0, -34vh, 0) rotate(0deg);
    opacity: 0;
  }
  5% {
    opacity: 1;
  }
  100% {
    transform: translate3d(-38vw, 127vh, 0) rotate(-210deg);
    opacity: 0.7;
  }
}

/* inline span không transform được ổn định — bắt buộc block-level; không dùng will-change hàng loạt (nặng GPU) */
.hero-petal {
  display: inline-block;
  position: absolute;
  top: -18vh;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  pointer-events: none;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.petal-f--1 {
  animation-name: leaf-fall-1;
}

.petal-f--2 {
  animation-name: leaf-fall-2;
}

.petal-f--3 {
  animation-name: leaf-fall-3;
}

.petal-f--4 {
  animation-name: leaf-fall-4;
}

.petal-f--5 {
  animation-name: leaf-fall-5;
}

.petal-f--6 {
  animation-name: leaf-fall-6;
}

.petal-f--7 {
  animation-name: leaf-fall-7;
}

.petal-f--8 {
  animation-name: leaf-fall-8;
}

.hero-petal--leaf {
  width: 28px;
  height: 17px;
  border-radius: 3px 72% 3px 72%;
  border: 1px solid var(--hero-fx-edge);
  background: linear-gradient(145deg, var(--hero-fx-a), var(--hero-fx-c));
  box-shadow:
    0 0 20px var(--hero-fx-b),
    0 0 40px rgba(124, 240, 198, 0.22);
}

.hero-petal--petal {
  width: 20px;
  height: 20px;
  border-radius: 50% 50% 50% 0;
  border: 1px solid var(--hero-fx-edge);
  background: radial-gradient(circle at 32% 28%, var(--hero-fx-a), var(--hero-fx-c));
  box-shadow:
    0 0 22px var(--hero-fx-b),
    0 0 36px rgba(124, 240, 198, 0.2);
}

.hero-petal--spark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #e8fff6, var(--hero-fx-a));
  box-shadow:
    0 0 14px var(--hero-fx-a),
    0 0 28px var(--hero-fx-b);
}

@keyframes hero-burst-fly {
  0% {
    transform: translate(-50%, -50%) translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) translate(var(--bx, 0px), var(--by, 0px)) scale(0.15);
    opacity: 0;
  }
}

@keyframes hero-burst-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.35);
    opacity: 0.55;
  }
  100% {
    transform: translate(-50%, -50%) scale(2.4);
    opacity: 0;
  }
}

.hero-burst {
  position: absolute;
  left: 0;
  top: 0;
  width: 9px;
  height: 9px;
  margin-left: 0;
  margin-top: 0;
  border-radius: 50%;
  background: var(--hero-fx-a);
  box-shadow: 0 0 12px var(--hero-fx-b);
  animation: hero-burst-fly 0.58s cubic-bezier(0.22, 0.82, 0.38, 1) forwards;
  pointer-events: none;
}

.hero-burst--leaf {
  width: 11px;
  height: 7px;
  border-radius: 2px 70% 2px 70%;
  background: linear-gradient(125deg, var(--hero-fx-a), var(--hero-fx-c));
}

.hero-burst-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 44px;
  height: 44px;
  margin-left: 0;
  margin-top: 0;
  border-radius: 50%;
  border: 2px solid var(--hero-fx-a);
  background: transparent;
  animation: hero-burst-ring 0.65s ease-out forwards;
  pointer-events: none;
}

.hero-grid {
  position: relative;
  z-index: 11;
  display: grid;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 880px) {
  .hero-grid {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
  }
}

.eyebrow {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.hero-title {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1.25rem;
  font-family: var(--font);
  font-size: clamp(1.85rem, 5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 24px rgba(12, 14, 18, 0.85), 0 2px 12px rgba(12, 14, 18, 0.75);
}

[data-theme="light"] .hero-title {
  text-shadow: 0 0 20px rgba(246, 244, 239, 0.9), 0 1px 8px rgba(246, 244, 239, 0.85);
}

.hero-line {
  display: block;
}

.hero-line:first-child {
  text-align: left;
}

.hero-line--accent {
  margin-top: 0.35rem;
  text-align: center;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  font-weight: 600;
  color: var(--accent);
}

.hero-lead {
  margin: 0 0 2rem;
  max-width: 36ch;
  color: var(--muted);
  font-size: 1.05rem;
  position: relative;
  z-index: 1;
  text-shadow: 0 0 18px rgba(12, 14, 18, 0.75);
}

[data-theme="light"] .hero-lead {
  text-shadow: 0 0 14px rgba(246, 244, 239, 0.85);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Lượt xem + like (api/stats.php) */
.site-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.35rem;
}

.site-stats__pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--muted);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
}

.site-stats__num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.site-stats__ic {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  opacity: 0.88;
}

.site-stats__like {
  cursor: pointer;
  font: inherit;
  margin: 0;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.08s ease, color 0.2s ease;
}

.site-stats__like:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--accent-dim);
}

.site-stats__like:active:not(:disabled) {
  transform: scale(0.98);
}

.site-stats__like.is-liked {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  color: var(--accent);
  background: var(--accent-dim);
}

.site-stats__like.is-liked .site-stats__heart {
  opacity: 1;
}

.site-stats__like:disabled {
  cursor: default;
}

[data-theme="light"] .site-stats__pill {
  box-shadow: 0 4px 20px rgba(26, 29, 36, 0.08);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s, background 0.2s, border-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
}

.btn--primary:hover {
  filter: brightness(1.05);
}

.btn--ghost {
  border-color: var(--border);
  color: var(--text);
  background: transparent;
}

.btn--ghost:hover {
  background: var(--surface);
}

.hero-card {
  border-radius: calc(var(--radius) + 4px);
  padding: 1px;
  background: linear-gradient(135deg, var(--accent), transparent 55%, var(--border));
}

.hero-card-inner {
  padding: 1.75rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: hero-card-float 7s ease-in-out infinite alternate;
}

@keyframes hero-card-float {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-6px);
  }
}

.hero-avatar {
  display: block;
  width: 180px;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 1rem;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--bg-alt);
}

.hero-card-tag {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.hero-card-note {
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

/* Cuộn tới — fade nhẹ (chỉ khi has-js từ <head>, trang không JS vẫn đọc được) */
html.has-js .reveal-on-scroll {
  opacity: 0;
  transform: translate3d(0, 1.1rem, 0);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

html.has-js .reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@media (prefers-reduced-motion: reduce) {
  .meteor-shower {
    display: none !important;
  }

  /* Lá: vẫn cho rơi rất chậm (không tắt animation → tránh hàng lá đứng im) */
  .hero-nature .hero-petal {
    animation-duration: 32s !important;
    animation-timing-function: linear !important;
  }

  .hero-petal-fallback {
    opacity: 0.42;
    top: -10vh !important;
  }

  .hero-ripples {
    display: none;
  }

  .hero-glow {
    animation: none;
    opacity: 0.85;
  }

  .hero-card-inner {
    animation: none;
  }

  html.has-js .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .photo-show__slide {
    transition: opacity 0.3s ease !important;
    transform: none !important;
    filter: none !important;
  }

  .photo-show--fx-zoom .photo-show__slide:not(.is-active),
  .photo-show--fx-rise .photo-show__slide:not(.is-active),
  .photo-show--fx-slide .photo-show__slide:not(.is-active),
  .photo-show--fx-flip .photo-show__slide:not(.is-active),
  .photo-show--fx-wipe .photo-show__slide:not(.is-active),
  .photo-show--fx-spin .photo-show__slide:not(.is-active) {
    transform: none !important;
    filter: none !important;
  }

  .photo-show--single .photo-show__slide img {
    animation: none;
  }

  .photo-show__confetti {
    display: none !important;
  }
}

/* Sections */
.section {
  padding: clamp(3.5rem, 7vw, 5.5rem) 0;
}

.section-gallery .section-head {
  margin-bottom: 1.75rem;
}

.photo-show {
  position: relative;
  max-width: 36rem;
  margin-inline: auto;
  border-radius: var(--radius);
  overflow: visible;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.photo-show:focus {
  outline: none;
}

.photo-show:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 65%, var(--border));
  outline-offset: 3px;
}

.photo-show__viewport {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-alt);
  border-radius: inherit;
  overflow: hidden;
}

.photo-show__confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

.photo-show__slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  will-change: opacity, transform, filter;
}

.photo-show__slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.photo-show__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Nút ‹ › */
.photo-show__nav {
  position: absolute;
  top: 50%;
  z-index: 8;
  width: 2.65rem;
  height: 2.65rem;
  margin: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 1.65rem;
  line-height: 1;
  font-weight: 300;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.photo-show__nav:hover {
  background: color-mix(in srgb, var(--accent-dim) 85%, var(--surface));
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  color: var(--accent);
}

.photo-show__nav:active {
  transform: translateY(-50%) scale(0.96);
}

.photo-show__nav--prev {
  left: 0.5rem;
}

.photo-show__nav--next {
  right: 0.5rem;
}

@media (min-width: 540px) {
  .photo-show__nav--prev {
    left: 0.85rem;
  }

  .photo-show__nav--next {
    right: 0.85rem;
  }
}

/* Kiểu chuyển (JS luân phiên class photo-show--fx-*) — thời lượng ngắn = cảm giác nhanh hơn */
.photo-show--fx-fade .photo-show__slide {
  transition: opacity 0.42s ease-in-out;
}

.photo-show--fx-fade .photo-show__slide:not(.is-active) {
  opacity: 0;
}

.photo-show--fx-zoom .photo-show__slide {
  transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.photo-show--fx-zoom .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: scale(1.08);
}

.photo-show--fx-zoom .photo-show__slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.photo-show--fx-rise .photo-show__slide {
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), filter 0.4s ease;
}

.photo-show--fx-rise .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(5px);
}

.photo-show--fx-rise .photo-show__slide.is-active {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

.photo-show--fx-slide .photo-show__slide {
  transition: opacity 0.38s ease, transform 0.38s cubic-bezier(0.33, 1, 0.68, 1);
}

.photo-show--fx-slide .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: translateX(28px);
}

.photo-show--fx-slide .photo-show__slide.is-active {
  opacity: 1;
  transform: translateX(0);
}

.photo-show--fx-flip .photo-show__viewport {
  perspective: 960px;
}

.photo-show--fx-flip .photo-show__slide {
  transition: opacity 0.45s ease, transform 0.45s ease;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.photo-show--fx-flip .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: rotateY(-88deg);
}

.photo-show--fx-flip .photo-show__slide.is-active {
  opacity: 1;
  transform: rotateY(0);
}

.photo-show--fx-wipe .photo-show__slide {
  transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.photo-show--fx-wipe .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: translateX(-105%);
}

.photo-show--fx-wipe .photo-show__slide.is-active {
  opacity: 1;
  transform: translateX(0);
}

.photo-show--fx-spin .photo-show__slide {
  transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.photo-show--fx-spin .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: scale(0.88) rotate(-8deg);
}

.photo-show--fx-spin .photo-show__slide.is-active {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.photo-show--fx-glow .photo-show__slide {
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.45s ease;
}

.photo-show--fx-glow .photo-show__slide:not(.is-active) {
  opacity: 0;
  transform: scale(1.04);
  filter: brightness(1.35) blur(4px);
}

.photo-show--fx-glow .photo-show__slide.is-active {
  opacity: 1;
  transform: scale(1);
  filter: brightness(1) blur(0);
}

/* Một ảnh duy nhất: zoom rất chậm để khối vẫn có chuyển động nhẹ */
.photo-show--single .photo-show__slide img {
  transform-origin: center;
  animation: photo-show-ken 22s ease-in-out infinite alternate;
}

@keyframes photo-show-ken {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

.section--alt {
  background: var(--bg-alt);
}

.section-title {
  font-family: var(--font);
  font-size: clamp(1.5rem, 3vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 1.5rem;
  letter-spacing: 0;
}

.section-head {
  margin-bottom: 2rem;
}

.section-head--row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.section-head--row .section-title {
  margin-bottom: 0.75rem;
}

.tiktok-edit-btn {
  flex-shrink: 0;
}

.section-sub {
  margin: 0;
  color: var(--muted);
  max-width: 52ch;
}

.prose p {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 60ch;
}

.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--muted);
  max-width: 60ch;
}

.prose li {
  margin-bottom: 0.4rem;
}

.prose li:last-child {
  margin-bottom: 0;
}

.prose a {
  color: var(--accent);
  word-break: break-word;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose .intro-sep {
  margin: 1.35rem 0;
  text-align: left;
  letter-spacing: 0.06em;
  opacity: 0.65;
}

.donate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 2.75rem);
  align-items: start;
  max-width: 52rem;
}

@media (max-width: 42rem) {
  .donate-grid {
    grid-template-columns: 1fr;
  }
}

.prose .donate-col p {
  max-width: none;
}

.prose .donate-qr {
  margin: 1.25rem 0 1.5rem;
  max-width: 240px;
}

.prose .donate-qr img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.prose .donate-qr figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.prose ul.intro-support {
  list-style: none;
  padding-left: 0;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
}

.pill-list li {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

/* Blog grid */
.blog-grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.blog-card {
  padding: 1.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.2s;
}

.blog-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
  transform: translateY(-2px);
}

.blog-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.blog-card-title {
  font-size: 1.2rem;
  margin: 0.5rem 0 0.65rem;
  font-weight: 600;
  line-height: 1.35;
}

.blog-card-title a {
  color: inherit;
  text-decoration: none;
}

.blog-card-title a:hover {
  color: var(--accent);
}

.blog-card-excerpt {
  margin: 0 0 1rem;
  flex: 1;
  color: var(--muted);
  font-size: 0.95rem;
}

.text-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
}

.text-link:hover {
  text-decoration: underline;
}

/* CTA */
.section--cta {
  padding-bottom: clamp(4rem, 10vw, 6rem);
}

.cta-inner {
  text-align: center;
  padding: clamp(2.5rem, 6vw, 4rem);
  border-radius: calc(var(--radius) + 8px);
  background: linear-gradient(160deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
}

.cta-title {
  font-family: var(--font);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.cta-text {
  margin: 0 auto 1.75rem;
  max-width: 42ch;
  color: var(--muted);
}

.social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.social a {
  padding: 0.65rem 1.2rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  background: var(--bg);
  transition: border-color 0.2s, color 0.2s;
}

.social a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.social a.social-copy {
  cursor: copy;
}

/* Nút liên hệ nổi — gọi / Zalo */
.fab-contact {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 300;
  font-family: var(--font);
}

.fab-contact__btn {
  position: relative;
  width: 58px;
  height: 58px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: linear-gradient(145deg, #0d6b52, #0a5544);
  color: #fff;
  box-shadow: 0 8px 28px rgba(13, 107, 82, 0.45), 0 2px 8px rgba(0, 0, 0, 0.2);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .fab-contact__btn {
  background: linear-gradient(145deg, var(--accent), #0a8f6e);
  box-shadow: 0 8px 28px rgba(13, 107, 82, 0.35), 0 2px 8px rgba(0, 0, 0, 0.12);
}

.fab-contact__btn:hover {
  transform: scale(1.06);
}

.fab-contact__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.fab-contact__btn::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  animation: fab-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
  pointer-events: none;
}

.fab-contact.is-open .fab-contact__btn::after {
  animation-duration: 1.4s;
}

@keyframes fab-ping {
  0% {
    transform: scale(1);
    opacity: 0.65;
  }
  70%,
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

.fab-contact__icon-wrap {
  position: relative;
  width: 28px;
  height: 28px;
}

.fab-contact__layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.fab-contact__layer svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.fab-contact__layer--phone {
  animation: fab-icon-swap-a 2.8s ease-in-out infinite;
}

.fab-contact__layer--zalo {
  animation: fab-icon-swap-b 2.8s ease-in-out infinite;
}

@keyframes fab-icon-swap-a {
  0%,
  42% {
    opacity: 1;
    transform: scale(1);
  }
  50%,
  92% {
    opacity: 0;
    transform: scale(0.88);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes fab-icon-swap-b {
  0%,
  42% {
    opacity: 0;
    transform: scale(0.88);
  }
  50%,
  92% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.88);
  }
}

@media (prefers-reduced-motion: reduce) {
  .fab-contact__btn::after {
    animation: none;
    opacity: 0.35;
  }

  .fab-contact__layer--phone,
  .fab-contact__layer--zalo {
    animation: none;
  }

  .fab-contact__layer--phone {
    opacity: 1;
  }

  .fab-contact__layer--zalo {
    opacity: 0;
  }
}

.fab-contact__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  min-width: 200px;
  padding: 0.5rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transform-origin: bottom right;
  animation: fab-panel-in 0.22s ease-out;
}

@keyframes fab-panel-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.fab-contact__panel[hidden] {
  display: none !important;
}

.fab-contact__link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fab-contact__link:hover {
  background: var(--accent-dim);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.fab-contact__link svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
}

.fab-contact__link:not(.fab-contact__link--zalo) svg path {
  fill: currentColor;
}

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 200;
  transform: translate(-50%, 120%);
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 70%, var(--text));
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.copy-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-footer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: 1.1rem;
  transition: border-color 0.2s;
}

.theme-toggle:hover {
  border-color: var(--accent);
}

.theme-toggle-sun {
  display: none;
}

[data-theme="light"] .theme-toggle-moon {
  display: none;
}

[data-theme="light"] .theme-toggle-sun {
  display: inline;
}

/* Music player + scrubber */
.section-music {
  padding: clamp(2rem, 5vw, 3.5rem) 0;
}

.music-wrap {
  max-width: 34rem;
  margin-inline: auto;
}

.music-card {
  margin-inline: auto;
  padding: clamp(1.1rem, 3vw, 1.5rem) clamp(1rem, 3vw, 1.35rem);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.music-card audio {
  display: none;
}

.music-layout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
  text-align: left;
}

.music-main {
  flex: 1;
  min-width: 0;
}

.music-play {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 65%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: color 0.2s, transform 0.15s, border-color 0.2s, background 0.2s;
}

.music-play:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.music-play:active {
  transform: scale(0.96);
}

.music-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Một ô cố định: chỉ hiện play HOẶC pause (không xếp 2 icon cạnh nhau) */
.music-play-slot {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
}

.music-play-slot .music-icon {
  grid-area: 1 / 1;
  display: block;
  width: 22px;
  height: 22px;
}

.music-play .music-icon--pause {
  display: none;
}

.music-play.is-playing .music-icon--play {
  display: none;
}

.music-play.is-playing .music-icon--pause {
  display: block;
}

.music-empty-hint {
  margin: 0;
  text-align: center;
  max-width: 40rem;
  margin-inline: auto;
}

.music-track {
  margin: 0 0 0.5rem;
  font-size: clamp(0.9rem, 2.4vw, 1rem);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.music-playlist-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0 0 0.65rem;
  padding: 0.2rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 40%, var(--surface));
}

.music-playlist-nav[hidden] {
  display: none !important;
}

.music-pl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 300;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.music-pl-btn:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.music-pl-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.music-pl-pos {
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 2.75ch;
  text-align: center;
}

.music-scrub-label {
  display: block;
  width: 100%;
  margin: 0 0 0.35rem;
  cursor: pointer;
}

.music-scrub {
  display: block;
  width: 100%;
  height: 1.35rem;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.music-scrub:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.music-time-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--muted) 92%, transparent);
}

@media (max-width: 520px) {
  .music-layout {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .music-main {
    width: 100%;
  }

  .music-track {
    text-align: center;
  }

  .music-playlist-nav {
    margin-inline: auto;
  }
}

/* Post pages (posts/*.html) — nút về trang chủ luôn nổi khi cuộn */
article.post-wrap {
  width: min(100% - 2.5rem, 680px);
  margin-inline: auto;
  padding: calc(3rem + 2.75rem) 0 5rem;
}

.post-back {
  position: fixed;
  z-index: 100;
  top: max(1rem, env(safe-area-inset-top, 0px) + 0.5rem);
  left: max(1.25rem, calc(50vw - min(100vw - 2.5rem, 680px) / 2));
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.15rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  border: 1px solid var(--border);
  border-radius: 9999px;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.post-back:hover {
  text-decoration: none;
  background: var(--surface);
  transform: translateY(-1px);
}

.post-back:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

