/* =========================================================
   THIỆP MỜI TỐT NGHIỆP – ĐẠI HỌC TÔN ĐỨC THẮNG
   Pure HTML + CSS
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --navy-900: #061533;
  --navy-800: #0a1f44;
  --navy-700: #102a5c;
  --tdt-blue: #1a56b8;
  --tdt-blue-light: #3d7be0;
  --tdt-red: #e0283e;
  --gold: #d4af37;
  --gold-light: #f3d98b;
  --gold-dark: #a8841f;
  --cream: #fbf7ee;
  --paper: #fffdf8;
  --ink: #1c2540;
  --muted: #5d6680;

  --font-display: "Playfair Display", "Times New Roman", serif;
  --font-script: "Dancing Script", cursive;
  --font-body: "Be Vietnam Pro", system-ui, -apple-system, sans-serif;

  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow-soft: 0 20px 50px -20px rgba(6, 21, 51, 0.35);
  --shadow-gold: 0 0 0 1px rgba(212, 175, 55, 0.5), 0 25px 60px -25px rgba(212, 175, 55, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  overflow-x: hidden;
}

/* Khoá cuộn khi phong bì còn đóng */
body:not(.is-opened):has(#open-invite:not(:checked)) { overflow: hidden; height: 100vh; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

.container { width: min(1120px, 92%); margin-inline: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* =========================================================
   1. PHONG BÌ MỞ ĐẦU (CSS checkbox hack)
   ========================================================= */
#open-invite { position: fixed; opacity: 0; pointer-events: none; }

.envelope-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(61, 123, 224, 0.4), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.22), transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(13, 44, 107, 0.5), transparent 70%),
    linear-gradient(160deg, #050d1e, #0a1f44 50%, #0d2c6b 100%);
  transition: opacity 0.8s var(--ease) 1.3s, visibility 0s linear 2.1s;
  overflow: hidden;
}

/* Hạt lấp lánh vàng lung linh quanh phong bì */
.envelope-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.envelope-sparkles i {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 10%, var(--gold-light) 45%, var(--gold) 80%, transparent 100%);
  box-shadow: 0 0 10px var(--gold-light), 0 0 20px rgba(212, 175, 55, 0.7);
  animation: sparkleTwinkle var(--dur, 3s) ease-in-out var(--del, 0s) infinite alternate;
}
.envelope-sparkles i:nth-child(1)  { left: 12%; top: 18%; width: 6px; height: 6px; --dur: 2.8s; --del: 0s; }
.envelope-sparkles i:nth-child(2)  { left: 24%; top: 78%; width: 8px; height: 8px; --dur: 3.4s; --del: 1.1s; }
.envelope-sparkles i:nth-child(3)  { left: 16%; top: 48%; width: 5px; height: 5px; --dur: 2.3s; --del: 0.4s; }
.envelope-sparkles i:nth-child(4)  { left: 84%; top: 22%; width: 7px; height: 7px; --dur: 3.1s; --del: 1.7s; }
.envelope-sparkles i:nth-child(5)  { left: 86%; top: 68%; width: 9px; height: 9px; --dur: 2.5s; --del: 0.2s; }
.envelope-sparkles i:nth-child(6)  { left: 74%; top: 82%; width: 5px; height: 5px; --dur: 3.7s; --del: 2.0s; }
.envelope-sparkles i:nth-child(7)  { left: 32%; top: 12%; width: 6px; height: 6px; --dur: 2.9s; --del: 1.4s; }
.envelope-sparkles i:nth-child(8)  { left: 68%; top: 14%; width: 8px; height: 8px; --dur: 3.0s; --del: 0.7s; }
.envelope-sparkles i:nth-child(9)  { left: 48%; top: 7%;  width: 5px; height: 5px; --dur: 3.3s; --del: 2.3s; }
.envelope-sparkles i:nth-child(10) { left: 52%; top: 93%; width: 6px; height: 6px; --dur: 2.6s; --del: 0.9s; }
.envelope-sparkles i:nth-child(11) { left: 6%;  top: 62%; width: 7px; height: 7px; --dur: 3.2s; --del: 0.6s; }
.envelope-sparkles i:nth-child(12) { left: 93%; top: 38%; width: 6px; height: 6px; --dur: 3.5s; --del: 1.8s; }

@keyframes sparkleTwinkle {
  0%   { transform: scale(0.3) translateY(0); opacity: 0.25; }
  50%  { transform: scale(1.25) translateY(-8px); opacity: 1; }
  100% { transform: scale(0.4) translateY(-16px); opacity: 0.3; }
}

.envelope-wrap {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.envelope-hint {
  color: var(--gold-light);
  font-family: var(--font-display);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 28px;
  animation: fadeUp 1s var(--ease) both;
  text-shadow: 0 0 12px rgba(243, 217, 139, 0.4);
}

.envelope {
  --w: min(440px, 86vw);
  position: relative;
  width: var(--w);
  aspect-ratio: 1.55;
  margin-inline: auto;
  cursor: pointer;
  perspective: 1200px;
  animation: floaty 4s ease-in-out infinite;
  display: block;
  transform-style: preserve-3d;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* Tia sáng vàng quét ngang phong bì */
.envelope::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(115deg, transparent 20%, rgba(255, 255, 255, 0.18) 45%, rgba(243, 217, 139, 0.45) 50%, rgba(255, 255, 255, 0.18) 55%, transparent 70%);
  background-size: 250% 100%;
  animation: shimmerSweep 4s ease-in-out infinite;
  pointer-events: none;
  z-index: 6;
}
@keyframes shimmerSweep {
  0%   { background-position: 200% 0; opacity: 0; }
  25%  { opacity: 0.9; }
  55%  { background-position: -120% 0; opacity: 0; }
  100% { background-position: -120% 0; opacity: 0; }
}

/* Ánh hào quang bừng nở sau phong bì khi mở */
.envelope::before {
  content: "";
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle, rgba(243, 217, 139, 0.55), rgba(212, 175, 55, 0.2) 45%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.6s var(--ease), transform 0.8s var(--ease);
  pointer-events: none;
  z-index: 0;
}

/* Lớp lưng phong bì */
.envelope__back {
  position: absolute; inset: 0;
  background: linear-gradient(145deg, #0f357a, #081d44);
  border-radius: 12px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.65);
  z-index: 1;
}

/* Lá thư bên trong */
.envelope__letter {
  position: absolute;
  left: 6%; right: 6%; top: 8%; bottom: 8%;
  background: var(--paper);
  border-radius: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.4);
  will-change: transform, box-shadow;
  transition: transform 0.6s var(--ease) 0.2s, box-shadow 0.6s var(--ease) 0.2s;
}
.envelope__letter span {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--tdt-blue);
  line-height: 1.2;
}

/* Mặt trước (túi đựng thư) che phủ lá thư */
.envelope__front {
  position: absolute; inset: 0;
  border-radius: 12px;
  overflow: hidden;
  z-index: 3;
  pointer-events: none;
}
/* vạt trái + phải + dưới kết hợp */
.envelope__front::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(160deg, #184ca1, #0f3577);
  clip-path: polygon(0 100%, 0 25%, 50% 65%, 100% 25%, 100% 100%);
}
.envelope__front::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, #0f3577, #1a4f9f);
  clip-path: polygon(0 100%, 50% 55%, 100% 100%);
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Nắp gập trên cùng */
.envelope__flap {
  position: absolute; left: 0; right: 0; top: 0; height: 62%;
  background: linear-gradient(180deg, #2260c7, #164696);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  z-index: 4;
  will-change: transform;
  transform-style: preserve-3d;
  transition: transform 0.6s var(--ease), z-index 0s linear 0.25s;
}

/* Con dấu sáp */
.envelope__seal {
  position: absolute; left: 50%; top: 62%;
  transform: translate(-50%, -50%);
  width: 68px; height: 68px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff5468, var(--tdt-red) 55%, #9e1225);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 20px rgba(212, 175, 55, 0.4), inset 0 -4px 8px rgba(0, 0, 0, 0.25);
  z-index: 5;
  display: grid; place-items: center;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  transition: transform 0.35s var(--ease), opacity 0.35s, box-shadow 0.35s;
  animation: sealBreath 2.8s ease-in-out infinite;
}
.envelope__seal::after {
  content: ""; position: absolute; inset: 6px;
  border: 1.5px dashed rgba(255, 255, 255, 0.6);
  border-radius: 50%;
}

@keyframes sealBreath {
  0%, 100% { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 15px rgba(212, 175, 55, 0.35); }
  50%      { box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5), 0 0 35px rgba(243, 217, 139, 0.85), 0 0 50px rgba(224, 40, 62, 0.5); }
}

.envelope:hover .envelope__seal {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 40px rgba(243, 217, 139, 0.9);
}

.envelope-btn {
  display: inline-flex; align-items: center; gap: 10px;
  margin-top: 40px;
  padding: 14px 34px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  color: var(--gold-light);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  background: rgba(212, 175, 55, 0.08);
  transition: background 0.3s, color 0.3s, transform 0.3s var(--ease), opacity 0.3s, box-shadow 0.3s;
  animation: pulseGold 2.4s infinite;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.envelope-btn:hover {
  background: var(--gold);
  color: var(--navy-900);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.5);
}

.envelope-wrap {
  text-align: center;
  padding: 24px;
  transition: transform 0.8s var(--ease), opacity 0.8s var(--ease), filter 0.8s var(--ease);
}

/* =========================================================
   CINEMATIC OPENING TRANSITION (KHI BẤM MỞ THIỆP)
   ========================================================= */

/* 1. Nút bấm và gợi ý lùi nhẹ và mờ đi */
.is-opened .envelope-hint,
.is-opened .envelope-btn,
#open-invite:checked ~ .envelope-screen .envelope-hint,
#open-invite:checked ~ .envelope-screen .envelope-btn {
  opacity: 0;
  transform: translateY(18px) scale(0.92);
  pointer-events: none;
  transition: opacity 0.35s ease-out, transform 0.35s ease-out;
}

/* 2. Ánh hào quang bừng nở sau phong bì */
.is-opened .envelope::before,
#open-invite:checked ~ .envelope-screen .envelope::before {
  opacity: 1;
  transform: scale(1.4);
}

/* 3. Con dấu sáp bừng sáng kim loại rồi tan dần */
.is-opened .envelope__seal,
#open-invite:checked ~ .envelope-screen .envelope__seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(1.25);
  box-shadow: 0 0 45px rgba(243, 217, 139, 0.9), 0 0 80px rgba(224, 40, 62, 0.6);
  filter: blur(1px);
  transition: opacity 0.45s ease-out 0.1s, transform 0.45s var(--ease), box-shadow 0.4s ease-out;
}

/* 4. Nắp phong bì mở 3D chân thực */
.is-opened .envelope__flap,
#open-invite:checked ~ .envelope-screen .envelope__flap {
  transform: rotateX(180deg);
  z-index: 1;
  transition: transform 0.8s cubic-bezier(0.34, 1.25, 0.64, 1) 0.15s, z-index 0s linear 0.42s;
}

/* 5. Lá thư trồi lên cao, đón chào người nhận */
.is-opened .envelope__letter,
#open-invite:checked ~ .envelope-screen .envelope__letter {
  transform: translateY(-120px) scale(1.06);
  box-shadow: 0 30px 60px -10px rgba(0, 0, 0, 0.55), 0 0 50px rgba(212, 175, 55, 0.45);
  border-color: var(--gold);
  transition: transform 0.9s cubic-bezier(0.2, 0.9, 0.3, 1) 0.35s,
              box-shadow 0.9s var(--ease) 0.35s,
              border-color 0.6s var(--ease) 0.35s;
}
.is-opened .envelope__letter span,
#open-invite:checked ~ .envelope-screen .envelope__letter span {
  text-shadow: 0 0 20px rgba(26, 86, 184, 0.4);
}

.is-opened .envelope,
#open-invite:checked ~ .envelope-screen .envelope {
  animation: none;
}
.is-opened .envelope::after,
#open-invite:checked ~ .envelope-screen .envelope::after {
  opacity: 0;
  animation: none;
}

/* 6. Toàn bộ phong bì lướt tới nhẹ và tan vào màn hình */
.is-opened .envelope-wrap,
#open-invite:checked ~ .envelope-screen .envelope-wrap {
  transform: scale(1.08);
  opacity: 0;
  filter: blur(8px);
  transition: transform 0.8s var(--ease) 1.25s,
              opacity 0.75s var(--ease) 1.25s,
              filter 0.75s var(--ease) 1.25s;
}

.is-opened .envelope-screen,
#open-invite:checked ~ .envelope-screen {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.8s var(--ease) 1.3s, visibility 0s linear 2.1s;
}

/* 7. Landing page xuất hiện bừng sáng từ chiều sâu */
.page {
  opacity: 0;
  transform: scale(0.96);
  filter: blur(8px);
  transition: opacity 1s cubic-bezier(0.16, 1, 0.3, 1) 1.35s,
              transform 1s cubic-bezier(0.16, 1, 0.3, 1) 1.35s,
              filter 0.9s cubic-bezier(0.16, 1, 0.3, 1) 1.35s;
}
.is-opened .page,
#open-invite:checked ~ .page {
  opacity: 1;
  transform: scale(1);
  filter: blur(0);
}
.is-opened .page .hero .reveal,
#open-invite:checked ~ .page .hero .reveal {
  animation-play-state: running;
}

/* =========================================================
   2. HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 90px 0 70px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(61, 123, 224, 0.45), transparent 50%),
    radial-gradient(ellipse at 90% 90%, rgba(224, 40, 62, 0.18), transparent 45%),
    linear-gradient(165deg, var(--navy-900) 0%, var(--navy-800) 45%, #0d2c6b 100%);
}

/* lưới chấm mờ */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(rgba(243, 217, 139, 0.18) 1px, transparent 1px);
  background-size: 26px 26px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}

/* confetti / lấp lánh */
.sparkles { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sparkles i {
  position: absolute; top: -20px;
  width: 8px; height: 14px;
  background: var(--gold);
  opacity: 0.8;
  border-radius: 2px;
  animation: fall linear infinite;
}
.sparkles i:nth-child(1)  { left: 5%;  animation-duration: 11s; animation-delay: 0s; }
.sparkles i:nth-child(2)  { left: 14%; animation-duration: 14s; animation-delay: 3s; background: var(--tdt-blue-light); width: 6px; }
.sparkles i:nth-child(3)  { left: 23%; animation-duration: 9s;  animation-delay: 1s; background: #fff; height: 8px; }
.sparkles i:nth-child(4)  { left: 34%; animation-duration: 13s; animation-delay: 5s; }
.sparkles i:nth-child(5)  { left: 46%; animation-duration: 10s; animation-delay: 2s; background: var(--tdt-red); width: 6px; }
.sparkles i:nth-child(6)  { left: 57%; animation-duration: 15s; animation-delay: 4s; background: var(--gold-light); }
.sparkles i:nth-child(7)  { left: 66%; animation-duration: 12s; animation-delay: 0.5s; background: #fff; height: 8px; }
.sparkles i:nth-child(8)  { left: 75%; animation-duration: 10s; animation-delay: 6s; }
.sparkles i:nth-child(9)  { left: 84%; animation-duration: 13s; animation-delay: 2.5s; background: var(--tdt-blue-light); }
.sparkles i:nth-child(10) { left: 93%; animation-duration: 11s; animation-delay: 7s; background: var(--tdt-red); width: 6px; }

.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: clamp(40px, 6vw, 90px);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 0.78rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold-light);
}
.eyebrow::before,
.eyebrow::after { content: ""; width: 34px; height: 1px; background: currentColor; opacity: 0.7; }

.hero__school {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(0.95rem, 1.6vw, 1.1rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.hero__title {
  margin-top: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6.5vw, 5rem);
  line-height: 1.05;
  background: linear-gradient(100deg, var(--gold-light) 0%, var(--gold) 35%, #fff4cf 50%, var(--gold) 65%, var(--gold-light) 100%);
  background-size: 250% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
}

.hero__name {
  margin-top: 18px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.1;
  color: #fff;
  text-shadow: 0 6px 30px rgba(61, 123, 224, 0.6);
}

.hero__degree {
  margin-top: 10px;
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: rgba(255, 255, 255, 0.85);
}
.hero__degree strong { color: var(--gold-light); font-weight: 600; }

.hero__date {
  margin-top: 30px;
  display: inline-flex; align-items: stretch;
  border: 1px solid rgba(212, 175, 55, 0.5);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(255, 255, 255, 0.05);
}
.hero__date > div { padding: 12px 20px; text-align: center; }
.hero__date > div + div { border-left: 1px solid rgba(212, 175, 55, 0.35); }
.hero__date small {
  display: block; font-size: 0.68rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: rgba(255, 255, 255, 0.6);
}
.hero__date b { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold-light); }

.hero__actions { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.3s var(--ease), box-shadow 0.3s, background 0.3s, color 0.3s;
}
.btn svg { width: 18px; height: 18px; flex: none; }
.btn--gold {
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 60%, var(--gold-dark));
  color: var(--navy-900);
  box-shadow: 0 12px 30px -10px rgba(212, 175, 55, 0.7);
}
.btn--gold:hover { transform: translateY(-3px); box-shadow: 0 18px 40px -12px rgba(212, 175, 55, 0.9); }
.btn--ghost { border: 1px solid rgba(255, 255, 255, 0.35); color: #fff; }
.btn--ghost:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-3px); }
.btn--blue { background: var(--tdt-blue); color: #fff; box-shadow: 0 12px 30px -12px rgba(26, 86, 184, 0.8); }
.btn--blue:hover { background: var(--navy-700); transform: translateY(-3px); }
.btn--outline { border: 1.5px solid var(--tdt-blue); color: var(--tdt-blue); }
.btn--outline:hover { background: var(--tdt-blue); color: #fff; transform: translateY(-3px); }

/* Ảnh chân dung khung vòm */
.hero__photo { position: relative; justify-self: center; width: min(420px, 100%); }

.arch {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 999px 999px var(--radius-lg) var(--radius-lg);
  padding: 10px;
  background: linear-gradient(160deg, var(--gold-light), var(--gold) 40%, var(--gold-dark) 70%, var(--gold-light));
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.7), 0 0 60px -10px rgba(212, 175, 55, 0.35);
}
.arch img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 20%;
  border-radius: 999px 999px calc(var(--radius-lg) - 8px) calc(var(--radius-lg) - 8px);
}
.arch::after {
  content: ""; position: absolute; inset: -18px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-radius: 999px 999px 36px 36px;
  pointer-events: none;
}

.cap-badge {
  position: absolute; left: -26px; bottom: 60px;
  width: 96px; height: 96px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper);
  box-shadow: var(--shadow-gold);
  animation: floaty 5s ease-in-out infinite;
}
.cap-badge svg { width: 54px; height: 54px; }

.year-badge {
  position: absolute; right: -14px; top: 70px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--tdt-red);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.1em;
  box-shadow: 0 14px 30px -10px rgba(224, 40, 62, 0.8);
  animation: floaty 4.5s ease-in-out infinite reverse;
}

.scroll-cue {
  position: absolute; left: 50%; bottom: 22px; translate: -50% 0;
  width: 26px; height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
}
.scroll-cue::after {
  content: ""; position: absolute; left: 50%; top: 8px; translate: -50% 0;
  width: 4px; height: 8px; border-radius: 4px; background: var(--gold-light);
  animation: scrollDot 1.8s ease-in-out infinite;
}

/* reveal trong hero (chạy sau khi mở phong bì) */
.reveal { animation: fadeUp 1s var(--ease) both; animation-play-state: paused; }
.reveal.d1 { animation-delay: 1.3s; }
.reveal.d2 { animation-delay: 1.45s; }
.reveal.d3 { animation-delay: 1.6s; }
.reveal.d4 { animation-delay: 1.75s; }
.reveal.d5 { animation-delay: 1.9s; }
.reveal.d6 { animation-delay: 2.05s; }

/* =========================================================
   3. SECTIONS CHUNG
   ========================================================= */
.section { padding: clamp(70px, 10vw, 120px) 0; position: relative; }

.section-head { text-align: center; max-width: 680px; margin: 0 auto clamp(40px, 6vw, 64px); }
.section-head .eyebrow { color: var(--gold-dark); }
.section-title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.15;
  color: var(--navy-800);
}
.section-title em { font-family: var(--font-script); font-style: normal; color: var(--tdt-blue); font-size: 1.15em; }
.section-sub { margin-top: 14px; color: var(--muted); }

/* Hiệu ứng xuất hiện khi cuộn: xem phần "EFFECTS" cuối file (điều khiển bởi js/effects.js) */

/* =========================================================
   4. LỜI MỜI
   ========================================================= */
.invite { background: var(--cream); }
.invite::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 0% 0%, rgba(26, 86, 184, 0.08), transparent 35%),
    radial-gradient(circle at 100% 100%, rgba(212, 175, 55, 0.12), transparent 35%);
  pointer-events: none;
}

.letter {
  position: relative;
  max-width: 820px;
  margin-inline: auto;
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(40px, 7vw, 80px) clamp(24px, 7vw, 90px);
  text-align: center;
  box-shadow: var(--shadow-soft);
}
.letter::before {
  content: ""; position: absolute; inset: 14px;
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: calc(var(--radius-lg) - 8px);
  pointer-events: none;
}
.letter::after {
  content: ""; position: absolute; inset: 20px;
  border: 1px dashed rgba(26, 86, 184, 0.18);
  border-radius: calc(var(--radius-lg) - 12px);
  pointer-events: none;
}

.corner {
  position: absolute; width: 46px; height: 46px;
  border: 2px solid var(--gold);
}
.corner--tl { top: 26px; left: 26px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.corner--tr { top: 26px; right: 26px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.corner--bl { bottom: 26px; left: 26px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.corner--br { bottom: 26px; right: 26px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }

.letter__icon { width: 64px; height: 64px; margin: 0 auto 16px; }

.letter__kicker {
  font-size: 0.8rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-dark);
}

.letter__guest {
  margin: 14px 0 6px;
  font-family: var(--font-script);
  font-weight: 700;
  font-size: clamp(2.4rem, 7vw, 3.6rem);
  line-height: 1.15;
  color: var(--tdt-blue);
}

.letter__guest-line {
  width: 160px; height: 2px; margin: 0 auto 24px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.letter p { color: #3b4460; font-size: clamp(1rem, 1.7vw, 1.08rem); }
.letter p + p { margin-top: 14px; }
.letter .quote {
  margin-top: 28px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--navy-700);
}
.letter__sign {
  margin-top: 30px;
  font-family: var(--font-script);
  font-size: 2rem;
  color: var(--navy-800);
}

/* =========================================================
   5. THÔNG TIN BUỔI LỄ
   ========================================================= */
.details {
  background:
    radial-gradient(circle at 85% 15%, rgba(61, 123, 224, 0.35), transparent 45%),
    linear-gradient(170deg, var(--navy-800), var(--navy-900));
  color: #fff;
  overflow: hidden;
}
.details .section-title { color: #fff; }
.details .section-title em { color: var(--gold-light); }
.details .section-head .eyebrow { color: var(--gold-light); }
.details .section-sub { color: rgba(255, 255, 255, 0.7); }

.info-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }

.info-card {
  position: relative;
  padding: 36px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  transition: transform 0.4s var(--ease), border-color 0.4s, box-shadow 0.4s;
}
.info-card:hover {
  transform: translateY(-8px);
  border-color: rgba(212, 175, 55, 0.6);
  box-shadow: 0 30px 60px -30px rgba(212, 175, 55, 0.5);
}

.info-card__icon {
  width: 64px; height: 64px; margin: 0 auto 18px;
  border-radius: 20px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: var(--navy-900);
  box-shadow: 0 12px 30px -12px rgba(212, 175, 55, 0.8);
}
.info-card__icon svg { width: 30px; height: 30px; }

.info-card h3 {
  font-size: 0.78rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65); font-weight: 500;
}
.info-card .big {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  color: var(--gold-light);
  line-height: 1.2;
}
.info-card p { margin-top: 8px; color: rgba(255, 255, 255, 0.82); }

.details__actions { margin-top: 44px; display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; }

/* Lịch nhỏ */
.calendar {
  margin: 60px auto 0;
  max-width: 440px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.6);
}
.calendar__head {
  background: linear-gradient(135deg, var(--tdt-blue), var(--navy-700));
  color: #fff; text-align: center; padding: 16px;
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: 0.08em;
}
.calendar__grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
  gap: 4px; padding: 18px; text-align: center; font-size: 0.92rem;
}
.calendar__grid span { padding: 8px 0; border-radius: 10px; }
.calendar__grid .dow { font-weight: 700; font-size: 0.72rem; color: var(--muted); letter-spacing: 0.05em; }
.calendar__grid .sun { color: var(--tdt-red); }
.calendar__grid .event {
  position: relative;
  background: var(--tdt-red);
  color: #fff; font-weight: 700;
  box-shadow: 0 8px 18px -6px rgba(224, 40, 62, 0.8);
  animation: heartbeat 1.6s ease-in-out infinite;
}

/* =========================================================
   6. HÀNH TRÌNH
   ========================================================= */
.journey { background: var(--cream); }

.timeline { position: relative; max-width: 900px; margin-inline: auto; }
.timeline::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
  width: 2px; translate: -50% 0;
  background: linear-gradient(var(--gold), var(--tdt-blue), var(--tdt-red));
}

.tl-item {
  position: relative;
  width: 50%;
  padding: 0 44px 44px;
}
.tl-item:nth-child(odd) { margin-right: auto; text-align: right; }
.tl-item:nth-child(even) { margin-left: auto; }

.tl-item::before {
  content: ""; position: absolute; top: 6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper);
  border: 4px solid var(--gold);
  box-shadow: 0 0 0 6px rgba(212, 175, 55, 0.18);
}
.tl-item:nth-child(odd)::before { right: -9px; }
.tl-item:nth-child(even)::before { left: -9px; }

.tl-card {
  display: inline-block;
  text-align: left;
  background: var(--paper);
  padding: 22px 26px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  transition: transform 0.35s var(--ease);
}
.tl-card:hover { transform: translateY(-5px); }
.tl-year { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--tdt-blue); }
.tl-card h3 { font-size: 1.05rem; color: var(--navy-800); margin-top: 2px; }
.tl-card p { color: var(--muted); font-size: 0.95rem; margin-top: 4px; }

/* =========================================================
   7. ALBUM ẢNH
   ========================================================= */
.gallery { background: linear-gradient(180deg, var(--cream), #eef3fc); }

.gallery-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 22px;
  height: clamp(520px, 70vw, 760px);
}
.gallery-grid figure {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.gallery-grid figure:first-child { grid-row: span 2; }
.gallery-grid img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease), filter 0.6s;
}
.gallery-grid figure:first-child img { object-position: center 35%; }
.gallery-grid figure:hover img { transform: scale(1.06); }

.gallery-grid figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 50px 24px 20px;
  color: #fff;
  background: linear-gradient(transparent, rgba(6, 21, 51, 0.85));
  font-size: 0.95rem;
}
.gallery-grid figcaption b {
  display: block; font-family: var(--font-display); font-size: 1.2rem; color: var(--gold-light);
}

/* =========================================================
   8. BẢN ĐỒ
   ========================================================= */
.map-wrap {
  display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 28px; align-items: stretch;
}
.map-info {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: clamp(28px, 4vw, 44px);
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column; gap: 18px;
}
.map-info h3 { font-family: var(--font-display); font-size: 1.6rem; color: var(--navy-800); line-height: 1.25; }
.map-row { display: flex; gap: 14px; align-items: flex-start; color: #3b4460; }
.map-row svg { width: 22px; height: 22px; color: var(--tdt-blue); flex: none; margin-top: 3px; }
.map-info .btn { align-self: flex-start; margin-top: auto; }

.map-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 380px;
  box-shadow: var(--shadow-soft);
  border: 6px solid var(--paper);
}
.map-frame iframe { width: 100%; height: 100%; min-height: 380px; border: 0; display: block; }

/* =========================================================
   9. FOOTER
   ========================================================= */
.footer {
  position: relative;
  padding: 90px 0 110px;
  text-align: center;
  color: #fff;
  background:
    radial-gradient(circle at 50% 0%, rgba(61, 123, 224, 0.35), transparent 55%),
    var(--navy-900);
  overflow: hidden;
}
.footer__thanks {
  font-family: var(--font-script);
  font-size: clamp(2.6rem, 7vw, 4.2rem);
  color: var(--gold-light);
  line-height: 1.15;
}
.footer p { margin-top: 12px; color: rgba(255, 255, 255, 0.75); max-width: 560px; margin-inline: auto; }
.footer__line {
  width: 120px; height: 1px; margin: 34px auto 20px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.footer small { color: rgba(255, 255, 255, 0.45); letter-spacing: 0.08em; }

/* Thanh điều hướng nổi luôn bám đáy màn hình khi cuộn */
.quick-nav {
  position: fixed;
  z-index: 95;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(24px);
  display: flex;
  gap: 4px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(6, 21, 51, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(212, 175, 55, 0.4);
  box-shadow: 0 14px 35px -10px rgba(0, 0, 0, 0.65), 0 0 18px rgba(212, 175, 55, 0.15);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease), visibility 0.5s;
  max-width: calc(100vw - 20px);
}

.is-opened .quick-nav,
#open-invite:checked ~ .quick-nav {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.6s var(--ease) 1.25s, transform 0.6s var(--ease) 1.25s, visibility 0s linear 1.25s;
}

.quick-nav a {
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.3s, color 0.3s;
}
.quick-nav a:hover { background: var(--gold); color: var(--navy-900); }

/* =========================================================
   KEYFRAMES
   ========================================================= */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes shine { to { background-position: -250% center; } }
@keyframes fall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.9; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}
@keyframes pulseGold {
  0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.5); }
  70%  { box-shadow: 0 0 0 16px rgba(212, 175, 55, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}
@keyframes scrollDot {
  0%   { opacity: 0; transform: translateY(0); }
  40%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}
@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.12); }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 960px) {
  .hero__grid { grid-template-columns: 1fr; text-align: center; }
  .hero__photo { order: -1; width: min(300px, 74vw); }
  .hero__actions { justify-content: center; }
  .eyebrow { justify-content: center; }
  .info-grid { grid-template-columns: 1fr; max-width: 520px; margin-inline: auto; }
  .map-wrap { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .hero { padding: 60px 0 90px; }
  .scroll-cue { display: none; }
  .is-opened .envelope__letter,
  #open-invite:checked ~ .envelope-screen .envelope__letter {
    transform: translateY(-80px) scale(1.04);
  }
  .cap-badge { width: 72px; height: 72px; left: -14px; bottom: 30px; }
  .cap-badge svg { width: 40px; height: 40px; }
  .year-badge { right: -8px; top: 40px; font-size: 0.85rem; padding: 8px 14px; }
  .hero__date > div { padding: 10px 14px; }
  .hero__date b { font-size: 1.3rem; }
  .btn { padding: 13px 22px; font-size: 0.9rem; }

  .corner { width: 30px; height: 30px; }
  .corner--tl, .corner--tr { top: 20px; }
  .corner--bl, .corner--br { bottom: 20px; }
  .corner--tl, .corner--bl { left: 20px; }
  .corner--tr, .corner--br { right: 20px; }

  /* Timeline 1 cột */
  .timeline::before { left: 10px; }
  .tl-item, .tl-item:nth-child(odd), .tl-item:nth-child(even) {
    width: 100%; text-align: left; padding: 0 0 30px 40px; margin: 0;
  }
  .tl-item:nth-child(odd)::before, .tl-item:nth-child(even)::before { left: 1px; right: auto; }
  .tl-card { display: block; }

  /* Gallery xếp dọc */
  .gallery-grid { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .gallery-grid figure:first-child { grid-row: auto; }
  .gallery-grid figure { aspect-ratio: 4 / 5; }
  .gallery-grid figure:nth-child(3) { aspect-ratio: 4 / 3; }

  .quick-nav a { padding: 8px 11px; font-size: 0.76rem; }
  .footer { padding-bottom: 100px; }
}

@media (max-width: 380px) {
  .quick-nav a { padding: 8px 8px; font-size: 0.7rem; }
  .hero__date small { font-size: 0.6rem; }
}

/* =========================================================
   10. HIỆU ỨNG ĐỘNG (EFFECTS)
   ========================================================= */

/* Thanh tiến trình cuộn trang */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--tdt-red) 50%, var(--gold-light));
  transform-origin: left center;
  transform: scaleX(0);
  z-index: 999;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.6);
}

/* Canvas pháo giấy */
.confetti-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 10000;
}

/* Mũ tốt nghiệp bay trong hero */
.flying-caps {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.flying-caps span {
  position: absolute;
  bottom: -60px;
  width: var(--size, 32px);
  height: var(--size, 32px);
  color: rgba(212, 175, 55, 0.35);
  animation: floatUpCap var(--dur, 14s) linear var(--delay, 0s) infinite;
  display: block;
}
.flying-caps svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}
@keyframes floatUpCap {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  15% {
    opacity: 0.65;
  }
  85% {
    opacity: 0.65;
  }
  100% {
    transform: translateY(calc(-100vh - 120px)) translateX(var(--sway, 30px)) rotate(360deg);
    opacity: 0;
  }
}

/* Đồng hồ đếm ngược (Countdown) */
.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 0 auto 40px;
  max-width: 520px;
}
.cd-box {
  flex: 1;
  min-width: 72px;
  padding: 16px 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-align: center;
  box-shadow: 0 10px 25px -10px rgba(0, 0, 0, 0.5);
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s;
}
.cd-box:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
  box-shadow: 0 15px 30px -10px rgba(212, 175, 55, 0.4);
}
.cd-box b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.1;
  color: var(--gold-light);
  font-weight: 700;
  text-shadow: 0 0 15px rgba(243, 217, 139, 0.4);
}
.cd-box b.tick {
  animation: tickPulse 0.35s ease-out;
}
.cd-box small {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
}
.cd-done {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-light);
  padding: 14px 24px;
  background: rgba(212, 175, 55, 0.15);
  border-radius: 999px;
  border: 1px solid var(--gold);
}
@keyframes tickPulse {
  0% { transform: scale(1.18); color: #fff; }
  100% { transform: scale(1); color: var(--gold-light); }
}

/* Hiệu ứng xuất hiện khi cuộn (Scroll Reveal) */
.on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s var(--ease) var(--d, 0s), transform 0.8s var(--ease) var(--d, 0s);
  will-change: opacity, transform;
}
.on-scroll.is-in {
  opacity: 1;
  transform: none;
}
.on-scroll[data-fx="zoom"] {
  transform: scale(0.92);
}
.on-scroll[data-fx="zoom"].is-in {
  transform: scale(1);
}
.on-scroll[data-fx="left"] {
  transform: translateX(-35px);
}
.on-scroll[data-fx="left"].is-in {
  transform: none;
}
.on-scroll[data-fx="right"] {
  transform: translateX(35px);
}
.on-scroll[data-fx="right"].is-in {
  transform: none;
}
.on-scroll[data-fx="flip"] {
  transform: perspective(900px) rotateX(15deg) translateY(20px);
}
.on-scroll[data-fx="flip"].is-in {
  transform: none;
}
/* Fallback nếu chưa tải JS hoặc tắt JS */
html:not(.fx) .on-scroll {
  opacity: 1;
  transform: none;
}

/* Lightbox xem ảnh to */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(6, 21, 51, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s var(--ease), visibility 0.35s;
}
.lightbox.open {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: min(92vw, 960px);
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7);
  border: 1.5px solid rgba(212, 175, 55, 0.4);
  transform: scale(0.92);
  transition: transform 0.35s var(--ease);
}
.lightbox.open img {
  transform: scale(1);
}
.lightbox p {
  margin-top: 18px;
  color: #fff;
  text-align: center;
  font-size: 0.95rem;
  max-width: 600px;
}
.lightbox p b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-light);
  margin-bottom: 4px;
}
.lightbox__close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s, transform 0.2s;
}
.lightbox__close:hover {
  background: var(--tdt-red);
  transform: rotate(90deg);
}

/* 3D Tilt */
.tilt {
  transform: perspective(1000px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.15s ease-out;
  transform-style: preserve-3d;
}

/* Mouse Sparkle Trail */
.trail {
  position: fixed;
  pointer-events: none;
  z-index: 9999;
  font-size: 14px;
  transform: translate(-50%, -50%);
  animation: trailAnim 0.85s ease-out forwards;
}
@keyframes trailAnim {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--tx, 0px)), -40px) scale(0.2);
    opacity: 0;
  }
}

/* Gợn sóng nút bấm (Button ripple) */
.btn {
  position: relative;
  overflow: hidden;
}
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  width: 20px;
  height: 20px;
  translate: -50% -50%;
  pointer-events: none;
  animation: rippleAnim 0.65s linear forwards;
}
@keyframes rippleAnim {
  to {
    transform: scale(25);
    opacity: 0;
  }
}

/* Quick Nav link active */
.quick-nav a.active {
  background: var(--gold);
  color: var(--navy-900);
  font-weight: 600;
}

@media (max-width: 600px) {
  .countdown {
    gap: 8px;
    margin-bottom: 28px;
  }
  .cd-box {
    min-width: 60px;
    padding: 10px 4px;
  }
  .cd-box b {
    font-size: 1.45rem;
  }
  .cd-box small {
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }
  .lightbox__close {
    top: 14px;
    right: 14px;
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
}

/* Tôn trọng cài đặt hệ thống nhưng vẫn bảo toàn hiệu ứng mở thiệp mượt mà */
@media (prefers-reduced-motion: reduce) {
  .envelope { animation: none; }
  .envelope-sparkles { opacity: 0.4; }
  .flying-caps { opacity: 0.3; }
  .trail { display: none; }
}
