/* ==========================================================
   Thiệp mời lễ tốt nghiệp — style
   Hướng thiết kế: "Cực quang & nhũ ánh kim". Nền là trời đêm có dải cực quang
   tím – xanh ngọc. Điểm nhấn là nhũ ánh kim (holographic), loại tem chống giả
   in trên văn bằng thật, nên hợp với con dấu hoa văn guilloche sinh trong main.js.
   Màu xanh bạc hà dành riêng cho nút bấm.
   ========================================================== */

:root {
  --night: #070B26;      /* nền trời */
  --night-2: #111A44;    /* bề mặt nổi */
  --navy: #16226A;       /* phong bì */
  --mint: #9BE6D2;       /* nút, điểm nhấn hành động */
  --mint-hi: #D2FFF2;
  --mint-ink: #1E7F6A;   /* chữ xanh ngọc trên nền giấy */
  --lilac: #C4BDFF;
  --ice: #E8EDFF;        /* chữ chính trên nền tối */
  --mist: #A6B0D8;       /* chữ phụ trên nền tối */
  --paper: #F5F7FF;      /* giấy lá thư, mẩu lời chúc */
  --ink: #0F1740;
  --muted: #59628A;
  --line: rgba(155, 230, 210, .38);
  --line-soft: rgba(201, 210, 255, .14);
  --error: #FFA39A;
  --holo: linear-gradient(100deg, #CDC6FF 0%, #E6EBFF 40%, #A9ECDA 75%, #8EDCC6 100%);

  --display: "Lora", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --hand: "Lora", Georgia, serif;

  /* thang chữ cổ điển: 14 · 16 · 18 · 21 · 24 · 36 · 48 · 72 */
  --fs-sm: .875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.3125rem;
  --fs-xl: 1.5rem;
  --fs-2xl: clamp(1.875rem, 5vw, 2.25rem);
  --fs-3xl: clamp(2.25rem, 7vw, 3rem);

  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(88px, 13vw, 144px);
  --ease: cubic-bezier(.22, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--night); }
body {
  margin: 0;
  background: var(--night);
  color: var(--ice);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; border-radius: 4px; }
.envelope__letter :focus-visible { outline-color: var(--mint-ink); }
section[tabindex="-1"]:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; background: var(--mint); color: var(--ink); padding: 8px 14px; z-index: 100; border-radius: 999px; }
.skip:focus { top: 12px; }
.wrap { width: min(1080px, 100% - 2 * var(--gutter)); margin-inline: auto; }
[hidden] { display: none !important; }

/* Nội dung chỉ hiện sau khi mở phong bì (chỉ khi có JS) */
.js .is-closed [data-content] { display: none; }

/* Placeholder chưa điền: gạch chân đứt nét */
.is-placeholder {
  text-decoration: underline dashed var(--mint);
  text-underline-offset: .25em;
  text-decoration-thickness: 1px;
  opacity: .85;
}

.holo-text, .card__name, .when__day, .chapter__year, .finale__line--holo {
  background-image: var(--holo);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.h2 {
  font-family: var(--display);
  font-weight: 400;
  font-size: var(--fs-3xl);
  line-height: 1.1;
  letter-spacing: -.01em;
  margin: 0 0 .7em;
  text-wrap: balance;
}

/* ---------- Trời cực quang ----------
   Ba dải màu nhoè, phủ mặt nạ sọc dọc để ra dáng "rèm" cực quang. */
.sky {
  position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(120% 70% at 50% -10%, #1C2766 0%, #0E1543 45%, transparent 75%),
    radial-gradient(90% 60% at 50% 115%, #0F2A4F 0%, transparent 70%),
    var(--night);
}
.sky__band {
  position: absolute; left: -25%; width: 150%;
  border-radius: 50%;
  filter: blur(56px);
  mix-blend-mode: screen;
}
.sky__band--1 {
  top: 2vh; height: 26vh; opacity: .34;
  background: linear-gradient(90deg, transparent 5%, #7A6BEF 22%, #5ED2B4 48%, #7C95F5 72%, transparent 95%);
  transform: rotate(-5deg);
}
.sky__band--2 {
  top: 22vh; height: 16vh; opacity: .22;
  background: linear-gradient(90deg, transparent 10%, #4FC6AE 30%, #9A8AF6 62%, transparent 90%);
  transform: rotate(4deg);
}
.sky__band--3 {
  bottom: -12vh; height: 30vh; opacity: .2;
  background: linear-gradient(90deg, transparent, #3E7BD6 30%, #4FC6AE 70%, transparent);
}
@media (prefers-reduced-motion: no-preference) {
  .sky__band--1 { animation: drift-a 28s ease-in-out infinite alternate; }
  .sky__band--2 { animation: drift-b 36s ease-in-out infinite alternate; }
  .sky__band--3 { animation: drift-c 40s ease-in-out infinite alternate; }
}
@keyframes drift-a { to { transform: translateX(6%) rotate(-2deg) scaleY(1.15); } }
@keyframes drift-b { to { transform: translateX(-7%) rotate(7deg) scaleY(.85); } }
@keyframes drift-c { to { transform: translateX(5%) scaleY(1.2); } }

/* ---------- Lớp hiệu ứng (pháo hoa, mũ bay) + con trỏ ---------- */
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.fx--back { z-index: 0; }
.fx--front { z-index: 90; }
.cover-scene, main { position: relative; z-index: 1; }

/* Ảnh nền trường trang đầu: rõ nét kiến trúc, phủ sắc đêm và mờ dần vào nền trời như trang cuối */
.has-bg { position: relative; overflow: clip; isolation: isolate; }
.section-bg {
  position: absolute; left: 0; right: 0; bottom: 0; height: 68%; z-index: -1; pointer-events: none;
  background-size: cover; background-position: center bottom;
  opacity: 0;
  filter: saturate(.4) brightness(.54) contrast(1.06) hue-rotate(-10deg);
  -webkit-mask-image:
    linear-gradient(to top, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .72) 48%, transparent 100%),
    radial-gradient(88% 96% at 50% 100%, #000 52%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to top, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .72) 48%, transparent 100%),
    radial-gradient(88% 96% at 50% 100%, #000 52%, transparent 100%);
  mask-composite: intersect;
  transition: opacity .6s ease;
}
.section-bg.has-photo { opacity: .72; }
.cursor {
  position: fixed; left: 0; top: 0; z-index: 95;
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  border: 1px solid rgba(210, 255, 242, .85); border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(7, 11, 38, .25), 0 0 18px rgba(155, 230, 210, .35);
  pointer-events: none; opacity: 0;
  transition: opacity .3s, width .25s var(--ease), height .25s var(--ease), margin .25s var(--ease), background-color .25s;
}
.cursor::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 4px; height: 4px; border-radius: 50%; background: var(--mint-hi);
}
.cursor.is-on { opacity: 1; }
.cursor.is-link { width: 54px; height: 54px; margin: -27px 0 0 -27px; background: rgba(155, 230, 210, .12); }
.cursor.is-text { opacity: .35; }
.cursor.is-down { width: 20px; height: 20px; margin: -10px 0 0 -10px; background: rgba(210, 255, 242, .35); }

/* ---------- Nút ---------- */
.btn {
  --bg: transparent; --fg: var(--ice); --bd: var(--line);
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: .6em;
  min-height: 48px; padding: .75em 1.6em;
  font: 500 var(--fs-base)/1.2 var(--sans);
  color: var(--fg); background: var(--bg);
  border: 1px solid var(--bd); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, box-shadow .25s, filter .2s;
}
.btn--mint {
  --bg: var(--mint); --fg: var(--ink); --bd: var(--mint);
  font-weight: 600;
  box-shadow: 0 0 0 0 rgba(155, 230, 210, 0);
}
.btn--mint:hover { filter: brightness(1.06); box-shadow: 0 0 28px -4px rgba(155, 230, 210, .7); }
.btn--mint::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .6) 50%, transparent 65%);
  transform: translateX(-120%);
}
.btn--ghost { --bd: rgba(155, 230, 210, .6); }
.btn--ghost:hover { --bg: rgba(155, 230, 210, .1); --bd: var(--mint); }
.btn--sm { min-height: 40px; padding: .5em 1.2em; font-size: .9375rem; }
.btn--block { width: 100%; }
.btn.is-disabled, .btn:disabled { opacity: .45; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) {
  .btn--mint:hover::after { transform: translateX(120%); transition: transform .8s var(--ease); }
}

/* ---------- Hoa văn guilloche ---------- */
[data-rosette] path, [data-rosette] circle { fill: none; }
[data-rosette] .g-outer path { stroke: currentColor; stroke-width: .7; opacity: .85; }
[data-rosette] .g-inner path { stroke: currentColor; stroke-width: .6; opacity: .65; }
[data-rosette] .g-lace path { stroke: currentColor; stroke-width: .8; }
[data-rosette] .g-hair { stroke: currentColor; stroke-width: .7; opacity: .55; }
[data-rosette] .g-text { font: 500 14px var(--sans); fill: currentColor; letter-spacing: .04em; }

/* ---------- Huy chương ánh kim (lõi con dấu, logo dự phòng) ---------- */
.medal, .seal__core {
  position: relative;
  border-radius: 50%;
  color: #0D1645;
  background:
    radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 36%),
    conic-gradient(from 210deg, #CDC6FF, #A9ECDA, #EEF2FF, #B4C3FF, #9BE6D2, #CDC6FF);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .55), 0 8px 20px rgba(0, 0, 0, .4), inset 0 -6px 14px rgba(40, 60, 140, .25);
}
.cap-icon { display: block; overflow: visible; }
.cap-icon .cap-skull { fill: currentColor; opacity: .78; }
.cap-icon .cap-board { fill: currentColor; stroke: rgba(255, 255, 255, .5); stroke-width: .8; stroke-linejoin: round; }
.cap-icon .cap-cord { stroke: #3B52C4; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cap-icon .cap-tuft { fill: #3B52C4; }
.cap-icon .cap-button { fill: #FFFFFF; }
.medal .cap-icon, .seal__core--cap .cap-icon {
  position: absolute; inset: 0; margin: auto; width: 64%; height: 64%;
}

/* ---------- Bước 1: hỏi tên ---------- */
.gate {
  position: fixed; inset: 0; z-index: 80;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: var(--gutter);
  overflow-y: auto;
  background: radial-gradient(70% 60% at 50% 42%, rgba(30, 44, 120, .25), rgba(4, 7, 24, .72));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.gate__box {
  position: relative;
  width: min(390px, 100%);
  padding: 30px clamp(22px, 6vw, 34px) 22px;
  text-align: center;
  background: linear-gradient(180deg, rgba(22, 32, 82, .94), rgba(13, 19, 54, .96));
  border: 1px solid rgba(155, 230, 210, .62);
  border-radius: 18px;
  box-shadow:
    0 0 60px -24px rgba(155, 230, 210, .28),
    0 48px 100px -36px rgba(0, 0, 0, .92);
}
.gate__box::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(201, 210, 255, .18);
  border-radius: 11px;
}

.gate__crest { position: relative; width: 96px; aspect-ratio: 1; margin: 0 auto 12px; color: var(--mint); }
.gate__crest::before {
  content: ""; position: absolute; inset: -16%; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, rgba(196, 189, 255, .26), rgba(155, 230, 210, .1) 46%, transparent 68%);
}
.gate__ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gate__ring .ring-hair { fill: none; stroke: currentColor; stroke-width: 1; opacity: .55; }
.gate__ring .ring-text { font: 500 11.5px var(--sans); fill: var(--mint-hi); letter-spacing: .05em; dominant-baseline: central; }
.gate__logo {
  position: absolute; inset: 0; margin: auto; width: 44%; aspect-ratio: 1;
  display: grid; place-items: center;
}
.gate__logo img {
  width: 100%; height: 100%; object-fit: contain;
  transform: translateY(-5%);
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .5));
}
.gate__kicker {
  margin: 0 0 8px;
  color: var(--mint); font-size: .7rem; font-weight: 500;
  letter-spacing: .28em; text-transform: uppercase;
  padding-left: .28em;
}
.gate__title {
  margin: 0 0 10px;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.75rem, 6vw, 2.15rem); line-height: 1.15;
  color: #F4F7FF;
}
.gate__hint { color: var(--mist); font-size: .875rem; line-height: 1.6; margin: 0 auto 20px; max-width: 30ch; text-wrap: pretty; }
.gate__hint b { color: var(--ice); font-weight: 600; white-space: nowrap; }
.gate__field {
  margin: 0 0 12px;
  border: 1px solid rgba(201, 210, 255, .28); border-radius: 10px;
  background: rgba(28, 39, 92, .56);
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.gate__field:focus-within {
  border-color: var(--mint);
  background: rgba(32, 45, 104, .72);
  box-shadow: 0 0 0 3px rgba(155, 230, 210, .16);
}
.gate__input {
  display: block; width: 100%;
  padding: 12px 16px;
  background: none; border: 0; outline: none;
  text-align: center;
  font-family: var(--sans); font-weight: 400;
  font-size: .95rem; line-height: 1.3;
  color: var(--ice); caret-color: var(--mint);
}
.gate__input::placeholder { color: rgba(166, 176, 216, .55); }
.gate__go { min-height: 46px; font-size: .95rem; }
.gate__skip {
  margin-top: 10px; background: none; border: 0; color: var(--mist); cursor: pointer;
  font: inherit; font-size: .875rem; padding: 6px 10px; text-decoration: underline; text-underline-offset: .25em;
}
.gate__skip:hover { color: var(--ice); }
@media (prefers-reduced-motion: no-preference) {
  .gate:not([hidden]) .gate__box { animation: gate-in .75s var(--ease) both; }
  .gate:not([hidden]) :is(.gate__kicker, .gate__title, .gate__hint, .gate__field, .gate__go, .gate__skip) { animation: rise .6s var(--ease) both; }
  .gate:not([hidden]) .gate__crest { animation: pop .85s cubic-bezier(.3, 1.4, .5, 1) .08s both; }
  .gate:not([hidden]) .gate__ring { animation: spin 40s linear infinite; }
  .gate:not([hidden]) .gate__crest::before { animation: breathe 4s ease-in-out infinite; }
  .gate:not([hidden]) .gate__kicker { animation-delay: .12s; }
  .gate:not([hidden]) .gate__title { animation-delay: .18s; }
  .gate:not([hidden]) .gate__hint { animation-delay: .24s; }
  .gate:not([hidden]) .gate__field { animation-delay: .3s; }
  .gate:not([hidden]) .gate__go { animation-delay: .36s; }
  .gate:not([hidden]) .gate__skip { animation-delay: .42s; }
}

/* ---------- Bước 2: phong bì ---------- */
.cover-scene {
  min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(22px, 3.5vh, 36px) var(--gutter) 28px;
  text-align: center;
  overflow: clip;
}
.cover-scene__brand {
  position: relative; z-index: 8;
  display: inline-flex; align-items: center; justify-content: center;
  gap: clamp(10px, 1.8vw, 14px);
  margin: 0 0 clamp(14px, 2.6vh, 24px);
}
.cover-scene__logo {
  width: clamp(26px, 4vw, 32px); aspect-ratio: 1; flex: none;
  display: grid; place-items: center;
  filter: drop-shadow(0 0 12px rgba(155, 230, 210, .28));
}
.cover-scene__logo img { width: 100%; height: 100%; object-fit: contain; }
.cover-scene__school {
  margin: 0;
  color: rgba(196, 242, 232, .88);
  font-size: clamp(.72rem, 1.7vw, .875rem); font-weight: 500;
  letter-spacing: .22em; padding-left: .22em;
  text-transform: uppercase;
  line-height: 1.35;
}
.cover-scene__head { transition: opacity .5s, transform .5s var(--ease); }
.cover-scene__to { margin: 0; font-family: var(--display); font-style: italic; color: var(--mist); font-size: var(--fs-md); }
.cover-scene__guest {
  margin: 0 0 clamp(18px, 3.5vh, 32px);
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: clamp(2.125rem, 8vw, 3.35rem); line-height: 1.1;
  text-wrap: balance;
}
.cover-scene__hint { margin: clamp(18px, 3vh, 30px) 0 0; color: var(--mist); font-size: .9375rem; }
.cover-scene__after {
  display: none;
  margin: clamp(18px, 3vh, 28px) 0 0;
  flex-direction: column; align-items: center; gap: 10px;
}
.cover-scene__down {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  color: var(--mist); text-decoration: none; font-size: .9375rem;
}
.cover-scene__down:hover { color: var(--ice); }
.cover-scene__down svg { width: 22px; height: 22px; }
.is-open .cover-scene__hint { display: none; }
.is-open .cover-scene__after { display: flex; }
.is-opening .cover-scene__head, .is-open .cover-scene__head { opacity: 0; transform: translateY(-14px); pointer-events: none; }

.envelope {
  position: relative;
  width: min(460px, 86vw, calc(42svh * 3 / 2));
  aspect-ratio: 3 / 2;
  perspective: 1600px;
  container-type: inline-size;
  transition: margin-top .65s var(--ease);
}
.is-opening .envelope, .is-open .envelope {
  margin-top: clamp(24px, 4.5vh, 46px);
}
.envelope__back {
  position: absolute; inset: 0; z-index: 1;
  border-radius: 10px;
  background: linear-gradient(180deg, #080D33, #0E1650);
  box-shadow:
    0 0 0 1.5px rgba(155, 230, 210, .75),
    0 0 28px rgba(155, 230, 210, .3),
    0 60px 90px -40px rgba(0, 0, 0, .9);
  transition: box-shadow 1s ease .8s;
}
.is-opening .envelope__back, .is-open .envelope__back {
  box-shadow:
    0 0 0 1.5px rgba(210, 255, 242, .95),
    0 0 44px rgba(155, 230, 210, .45),
    0 60px 90px -40px rgba(0, 0, 0, .9);
}
.envelope__glow {
  position: absolute; left: 8%; right: 8%; top: -30%; height: 80%; z-index: 3;
  background: radial-gradient(50% 50% at 50% 60%, rgba(220, 255, 245, .7), rgba(155, 230, 210, .2) 55%, transparent 75%);
  filter: blur(14px);
  opacity: 0; pointer-events: none;
}
.is-open .envelope__glow { opacity: .35; }

.envelope__letter {
  position: absolute; left: 7.5%; right: 7.5%; top: 4%; height: 94%; z-index: 4;
  padding: 7.5cqi 7% 0;
  background: radial-gradient(120% 60% at 50% 0%, #FFFFFF, transparent 70%), var(--paper);
  color: var(--ink);
  border-radius: 6px;
  text-align: center;
  overflow: hidden;
  box-shadow: 0 -12px 34px -16px rgba(0, 0, 0, .55);
  transition: transform 1.05s cubic-bezier(.25, 1.25, .45, 1) .9s;
}
.envelope__letter::before {
  content: ""; position: absolute; inset: 10px; pointer-events: none;
  border: 1px solid rgba(30, 127, 106, .35); border-radius: 3px;
}
.letter__logo {
  position: relative;
  width: clamp(36px, 10cqi, 60px); aspect-ratio: 1;
  margin: 0 auto 2.2cqi;
}
.letter__logo img { width: 100%; height: 100%; object-fit: contain; }
.letter__label {
  margin: 0;
  color: var(--mint-ink);
  font-size: clamp(.6875rem, 2.1cqi, .8125rem); font-weight: 600;
  letter-spacing: .3em; text-transform: uppercase;
  padding-left: .3em;
  white-space: nowrap;
}
.letter__name {
  margin: .25em 0 .15em;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(1.625rem, 6.8cqi, 2.5rem); line-height: 1.15; letter-spacing: -.01em;
  color: var(--ink);
}
.letter__date {
  margin: 0;
  font-family: var(--display); font-style: italic;
  font-size: clamp(.9375rem, 3.2cqi, 1.25rem);
  color: var(--muted);
}
.letter__shine {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .9) 45%, rgba(196, 189, 255, .45) 52%, transparent 65%);
  transform: translateX(-130%);
  mix-blend-mode: soft-light;
}

.envelope__front {
  position: absolute; inset: 0; z-index: 5;
  width: 100%; height: 100%;
  clip-path: inset(0 round 10px);
  pointer-events: none;
}
.pocket-fold { fill: none; stroke: rgba(155, 230, 210, .16); stroke-width: 1; }
.pocket-edge { fill: none; stroke: rgba(155, 230, 210, .55); stroke-width: 1; }

.envelope__flap {
  position: absolute; left: 0; right: 0; top: 0; height: 56%; z-index: 6;
  transform-origin: 50% 0;
  transform-style: preserve-3d;
  transition: transform .8s var(--ease) .3s, z-index 0s .7s;
}
.flap__out {
  position: absolute; inset: 0; width: 100%; height: 100%;
  overflow: visible; backface-visibility: hidden;
  filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .35));
}
.flap-edge { fill: none; stroke: var(--mint); stroke-width: 1.2; opacity: .9; }
.flap__in {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  transform: rotateX(180deg);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(0deg, #101C58, #1A2A74);
}
.is-opening .envelope__flap, .is-open .envelope__flap { transform: rotateX(180deg); z-index: 2; }
.is-opening .envelope__letter, .is-open .envelope__letter { transform: translateY(-44%); }
.is-open .envelope__letter { cursor: pointer; }

.seal {
  position: absolute; left: 50%; top: 56%; z-index: 7;
  width: 40cqi; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  padding: 0; border: 0; border-radius: 50%; background: none;
  color: #C9F2E6; cursor: pointer;
  container-type: inline-size;
  transition: transform .5s var(--ease), opacity .45s ease;
}
.seal__art { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.seal__art .g-text { fill: var(--lilac); }
.seal::before {
  content: ""; position: absolute; inset: 1%; border-radius: 50%;
  background: radial-gradient(circle, #1B2A78 55%, #16236A 72%, rgba(22, 35, 106, 0) 73%);
  box-shadow: 0 14px 30px -10px rgba(0, 0, 0, .6);
}
.seal__core {
  position: absolute; inset: 0; margin: auto;
  width: 46%; aspect-ratio: 1; overflow: hidden;
  transition: transform .3s var(--ease);
}
.seal__core img { width: 100%; height: 100%; object-fit: cover; }
.seal:hover .seal__core { transform: scale(1.05) rotate(-4deg); }
.seal:focus-visible { outline-offset: 6px; border-radius: 50%; }
.is-opening .seal, .is-open .seal { transform: translate(-50%, -50%) scale(1.2); opacity: 0; pointer-events: none; }
.is-open .seal { visibility: hidden; }

@media (max-width: 600px) {
  .cover-scene__school { font-size: .7rem; letter-spacing: .14em; padding-left: .14em; }
  .envelope { aspect-ratio: 6 / 5; width: min(84vw, calc(42svh * 6 / 5)); }
  .is-opening .envelope, .is-open .envelope { margin-top: clamp(28px, 6vh, 52px); }
  .envelope__letter { padding-top: 7cqi; }
  .is-opening .envelope__letter, .is-open .envelope__letter { transform: translateY(-50%); }
  .seal { width: 56cqi; }
}

@media (prefers-reduced-motion: no-preference) {
  .js .seal__art path {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: draw 2.4s var(--ease) forwards;
    animation-delay: calc(var(--i) * 70ms + .3s);
  }
  .js .seal__art .g-hair, .js .seal__art .g-text { opacity: 0; animation: fade 1s ease 1.6s forwards; }
  .js .seal__core { opacity: 0; animation: fade .9s ease 1.2s forwards; }
  .js .has-gate .seal__art path, .js .has-gate .seal__art .g-hair, .js .has-gate .seal__art .g-text, .js .has-gate .seal__core { animation-play-state: paused; }
  .is-closed:not(.is-opening) .seal::after {
    content: ""; position: absolute; inset: 27%; border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(155, 230, 210, .5);
    animation: beckon 2.6s ease-out 3s infinite;
  }
  .is-opening .envelope { animation: thump .55s var(--ease); }
  .is-opening .envelope__glow { animation: glow 2.6s ease .85s both; }
  .is-opening .letter__logo { animation: logo-in .8s cubic-bezier(.3, 1.5, .5, 1) 1.7s both; }
  .is-opening .letter__label { animation: label-in 1s var(--ease) 1.95s both; }
  .is-opening .letter__name { animation: ink-in 1.1s var(--ease) 2.2s both; }
  .is-opening .letter__date { animation: rise .7s var(--ease) 3.1s both; }
  .is-opening .letter__shine { animation: shine 1.1s ease-in-out 3.4s both; }
  .is-open .cover-scene__after { animation: rise .7s var(--ease) both; }
  .is-open .cover-scene__down svg { animation: bob 1.8s ease-in-out 1s infinite; }
}

/* ---------- Tấm thiệp ---------- */
.card-section {
  min-height: 100svh;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center;
  padding: clamp(32px, 6vh, 64px) var(--gutter);
}

.card {
  position: relative;
  width: min(720px, 100%); margin: 0 auto;
  padding: clamp(40px, 7vw, 60px) clamp(20px, 5vw, 44px) clamp(32px, 5vw, 48px);
  outline: none;
  text-align: center;
  color: var(--ice);
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(122, 107, 239, .22), transparent 70%),
    radial-gradient(70% 30% at 50% 100%, rgba(94, 210, 180, .12), transparent 70%),
    linear-gradient(180deg, rgba(20, 28, 80, .86), rgba(10, 15, 50, .92));
  border: 1px solid rgba(155, 230, 210, .55);
  border-radius: 4px;
  box-shadow: 0 0 60px -14px rgba(155, 230, 210, .3), 0 60px 120px -40px rgba(0, 0, 0, .95);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
}
.card::before {
  content: ""; position: absolute; inset: 8px; pointer-events: none;
  border: 1px solid rgba(155, 230, 210, .22);
}

.card__crest { display: flex; align-items: center; justify-content: center; gap: 2px; margin: 0 auto 16px; color: var(--mint); }
.laurel { width: 72px; height: auto; opacity: .85; transform: translateY(10px); }
.laurel--r { transform: translateY(10px) scaleX(-1); }
.card__logo { width: 56px; aspect-ratio: 1; flex: none; }
.card__logo img { width: 100%; height: 100%; object-fit: contain; }

.card__kicker {
  margin: 0;
  color: var(--mint); font-size: .8125rem; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase; padding-left: .28em;
}
.card__guest {
  margin: .25em 0 .2em;
  font-family: var(--display); font-weight: 500;
  font-size: clamp(2rem, 7vw, 2.625rem); line-height: 1.15;
  color: #DFFBF3;
  text-wrap: balance;
}
.card__lead {
  margin: .35rem auto .45rem; max-width: 46ch;
  font-family: var(--display); font-size: clamp(.875rem, 2.2vw, .95rem); line-height: 1.65;
  color: var(--mist); text-wrap: balance;
}
.card__name {
  margin: .3em 0 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.5rem, 9vw, 4rem); line-height: 1.08; letter-spacing: -.01em;
  text-wrap: balance;
}
.card__degree {
  margin: .7em 0 0;
  color: var(--mint); font-size: .8125rem; font-weight: 500;
  letter-spacing: .18em; text-transform: uppercase;
}
.card__rule {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 1.75rem auto 1.5rem; color: var(--mint);
}
.card__rule span { width: min(140px, 26%); height: 1px; background: linear-gradient(90deg, transparent, rgba(155, 230, 210, .6)); }
.card__rule span:last-child { transform: scaleX(-1); }
.card__rule i { width: 22px; height: 22px; display: block; }
.card__rule .cap-icon { width: 100%; height: 100%; }
.card__rule .cap-icon .cap-cord { stroke: currentColor; }
.card__rule .cap-icon .cap-tuft { fill: currentColor; }
.card__rule .cap-icon .cap-board { stroke: none; }
.card__rule .cap-icon .cap-button { fill: var(--night); }

.when {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: start;
  margin: 0;
}
.when__col { padding: 4px clamp(8px, 2vw, 16px); }
.when__col dt {
  color: var(--mint); font-size: .75rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: 6px;
}
.when__col dd { margin: 0; }
.when__big { font-family: var(--display); font-size: var(--fs-lg); font-weight: 500; line-height: 1.3; text-wrap: balance; }
.when__sub { margin-top: 6px !important; font-size: .875rem; color: var(--mist); line-height: 1.5; text-wrap: balance; }
.when__sub:empty { display: none; }
.when__col--date { border-inline: 1px solid var(--line-soft); padding-inline: clamp(16px, 3.5vw, 32px); }
.when__col--date dd { display: grid; justify-items: center; }
.when__dow { font-size: .8125rem; color: var(--lilac); letter-spacing: .2em; text-transform: uppercase; }
.when__day { font-family: var(--display); font-weight: 400; font-size: clamp(3.25rem, 12vw, 4.5rem); line-height: 1.05; }
.when__month { font-size: .75rem; color: var(--mist); letter-spacing: .2em; text-transform: uppercase; }

.countdown { margin-top: 1.75rem; }
.countdown__cap { margin: 0 0 12px; font-size: var(--fs-sm); color: var(--mist); }
.countdown__row { display: flex; justify-content: center; gap: clamp(6px, 2vw, 12px); }
.countdown__unit {
  display: grid; justify-items: center; min-width: clamp(62px, 17vw, 84px);
  padding: 12px 6px 9px;
  border: 1px solid rgba(155, 230, 210, .28); border-radius: 8px;
  background: rgba(255, 255, 255, .03);
}
.countdown__unit b {
  font-family: var(--display); font-weight: 400; font-size: clamp(1.5rem, 6vw, 2rem); line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums; color: var(--ice);
}
.countdown__unit small { font-size: .6875rem; color: var(--mist); letter-spacing: .16em; text-transform: uppercase; margin-top: 2px; }
.countdown__msg { margin: 10px 0 0; font-size: .9375rem; color: var(--mist); }
.countdown__msg:empty { display: none; }

.notes { margin: 1.5rem auto 0; max-width: 32rem; }
.notes p { margin: 0 0 .5em; font-size: .9375rem; color: var(--mist); text-wrap: pretty; }
.notes b { color: var(--ice); font-weight: 600; }

.card__actions { margin-top: 1.75rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 12px; }
.card__more {
  display: inline-block; margin-top: 1.4rem;
  color: var(--mint); font-size: .9375rem; font-weight: 500;
  text-decoration: underline; text-decoration-color: rgba(155, 230, 210, .4); text-underline-offset: .25em;
}
.card__more:hover { text-decoration-color: currentColor; }

@media (max-width: 520px) {
  .when { grid-template-columns: 1fr; }
  .when__col { padding: 14px 0; }
  .when__col--date { order: -1; border-inline: 0; border-bottom: 1px solid var(--line-soft); padding-top: 0; }
  .when__col:last-child { border-top: 1px solid var(--line-soft); }
  .card__actions .btn { flex: 1 1 calc(50% - 6px); padding-inline: 1em; }
  .card__actions .btn--mint { flex-basis: 100%; }
  .laurel { width: 52px; }
}

/* ---------- Câu chuyện bốn năm (khung vòm 4 thẻ + số ngày + mốc thời gian) ---------- */
.story { padding: var(--section) 0; }
.story__grid {
  display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: clamp(44px, 7vw, 96px); align-items: center;
}
.story__visual { display: flex; flex-direction: column; align-items: center; }

.arch {
  position: relative;
  width: min(332px, 84vw);
  aspect-ratio: 3 / 3.85;
}
.arch__outline {
  position: absolute; inset: -8px 8px 8px -8px; pointer-events: none;
  border-radius: 999px 999px 14px 14px;
  border: 1px solid rgba(155, 230, 210, .42);
}
.arch__viewport {
  position: relative; width: 100%; height: 100%;
  border-radius: 999px 999px 14px 14px; overflow: hidden;
  border: 1px solid rgba(155, 230, 210, .34);
  background: linear-gradient(180deg, rgba(18, 27, 78, .92), rgba(8, 13, 42, .96));
  box-shadow: 0 32px 70px -28px rgba(0, 0, 0, .92), 0 0 42px -18px rgba(155, 230, 210, .22);
  touch-action: pan-y; cursor: grab; user-select: none;
}
.arch__viewport:active { cursor: grabbing; }
.arch__track {
  display: flex; width: 100%; height: 100%;
  transition: transform .55s var(--ease);
  will-change: transform;
}
.arch__track.is-dragging { transition: none; }
.arch__slide {
  flex: 0 0 100%; width: 100%; height: 100%;
  position: relative; overflow: hidden;
}

/* Thẻ 1: Ảnh trường Bách khoa (phủ sắc đêm dịu để hòa với nền cực quang) */
.arch-art { position: relative; width: 100%; height: 100%; }
.arch-art img {
  width: 100%; height: 100%; object-fit: cover; object-position: 52% 48%;
  filter: saturate(.9) contrast(1.04) brightness(.92);
  pointer-events: none;
}
.arch-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10, 17, 56, .62) 0%, rgba(18, 34, 92, .18) 28%, transparent 52%, rgba(7, 11, 38, .68) 100%),
    radial-gradient(90% 45% at 50% 0%, rgba(155, 230, 210, .14), transparent 70%);
}

/* Thẻ 2: Bức thư ngỏ trong khung vòm */
.arch-letter {
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 46px 26px 32px;
  text-align: center;
  background:
    radial-gradient(85% 42% at 50% 0%, rgba(155, 230, 210, .14), transparent 70%),
    linear-gradient(180deg, rgba(22, 32, 88, .92), rgba(9, 14, 46, .96));
}
.arch-letter__star { color: var(--mint); font-size: .875rem; letter-spacing: .3em; opacity: .85; margin-bottom: 14px; }
.arch-letter__body { overflow-y: auto; scrollbar-width: none; }
.arch-letter__body::-webkit-scrollbar { display: none; }
.arch-letter__body p {
  margin: 0 0 12px;
  font-family: var(--display); font-style: italic; font-weight: 400;
  font-size: .95rem; line-height: 1.65; color: #E2E8FF; text-wrap: pretty;
}
.arch-letter__body p:last-child { margin-bottom: 0; color: #C2CBEB; }
.arch-letter__sign {
  margin: 14px 0 0; padding: 12px 46px 0 0;
  border-top: 1px solid rgba(155, 230, 210, .2);
  font-family: var(--display); font-style: italic; font-size: 1.15rem; color: var(--mint);
}

/* Thẻ 3: git log hành trình KHMT */
.arch-git {
  height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 48px 22px 26px;
  font-family: ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: .8125rem;
  background:
    radial-gradient(90% 40% at 50% 0%, rgba(122, 107, 239, .24), transparent 68%),
    #080D2B;
}
.arch-git__bar {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding-bottom: 12px; margin-bottom: 16px;
  border-bottom: 1px solid rgba(155, 230, 210, .18);
  font-size: .72rem; letter-spacing: .12em; color: var(--mist);
}
.arch-git__dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(155, 230, 210, .65); }
.arch-git__dot--b { background: rgba(196, 189, 255, .65); }
.arch-git__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; text-align: left; }
.arch-git__list li { display: grid; grid-template-columns: 3.1em 1fr; gap: 8px; line-height: 1.45; color: #DCE4FF; }
.arch-git__yr { color: var(--mint); }
.arch-git__tag { color: var(--lilac); }
.arch-git__list li.is-hi { color: var(--mint-hi); }
.arch-git__list li.is-hi .arch-git__yr, .arch-git__list li.is-hi .arch-git__tag { color: var(--mint-hi); font-weight: 600; }
.arch-git__foot {
  margin: 0; padding: 12px 54px 0 0;
  border-top: 1px solid rgba(201, 210, 255, .12);
  font-size: .72rem; color: rgba(155, 230, 210, .78); text-align: left;
}
.arch-git__foot b { color: var(--mint-hi); font-weight: 600; }

/* Thẻ 4: Chòm sao 2022-2026 */
.arch-stars { width: 100%; height: 100%; display: block; background: #080D2E; }

/* Nút chuyển thẻ trên cạnh khung vòm */
.arch__nav {
  position: absolute; top: 50%; z-index: 3;
  transform: translateY(-50%);
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  color: var(--ice);
  background: rgba(10, 16, 52, .78);
  border: 1px solid rgba(155, 230, 210, .38);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  transition: background-color .2s, border-color .2s, transform .2s;
}
.arch__nav:hover { background: rgba(24, 36, 98, .92); border-color: var(--mint); transform: translateY(-50%) scale(1.06); }
.arch__nav svg { width: 18px; height: 18px; }
.arch__nav--prev { left: -18px; }
.arch__nav--next { right: -18px; }

/* Con dấu tròn xoay ở góc dưới phải khung vòm */
.arch__badge {
  position: absolute; right: -24px; bottom: -20px; z-index: 4;
  width: 102px; height: 102px; border-radius: 50%;
  background: #080D2E;
  border: 1px solid rgba(155, 230, 210, .45);
  box-shadow: 0 14px 32px rgba(0, 0, 0, .75);
  display: grid; place-items: center;
  pointer-events: none;
}
.arch__badge-ring { position: absolute; inset: 4px; width: calc(100% - 8px); height: calc(100% - 8px); overflow: visible; }
.arch__badge-ring text { font: 600 7.6px var(--sans); fill: #D8E2FF; letter-spacing: .16em; }
.arch__badge-core {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  color: #0D1645;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .92), transparent 44%),
    conic-gradient(from 210deg, #CDC6FF, #A9ECDA, #EEF2FF, #B4C3FF, #9BE6D2, #CDC6FF);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .55), 0 6px 14px rgba(0, 0, 0, .45);
}
.arch__badge-core .cap-icon { position: absolute; inset: 0; margin: auto; width: 62%; height: 62%; }
@media (prefers-reduced-motion: no-preference) {
  .arch__badge-ring { animation: spin 32s linear infinite; }
}

/* Chấm chỉ báo dưới khung vòm */
.arch__controls { margin-top: 28px; display: flex; justify-content: center; }
.arch__dots { display: flex; align-items: center; gap: 8px; }
.arch__dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px;
  background: rgba(201, 210, 255, .3); cursor: pointer;
  transition: width .3s var(--ease), background-color .25s;
}
.arch__dot:hover { background: rgba(155, 230, 210, .65); }
.arch__dot[aria-selected="true"] { width: 24px; background: var(--mint); }

/* Cột phải: Số ngày + mô tả + 3 ô thống kê + thanh mốc */
.story__info { min-width: 0; }
.story__kicker {
  margin: 0 0 .5em;
  color: var(--mint); font-size: .8125rem; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
}
.story__days {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4rem, 11vw, 6.25rem); line-height: 1.02; letter-spacing: -.02em;
  font-variant-numeric: lining-nums;
}
.story__lead {
  margin: .7em 0 0; max-width: 36ch; min-height: 4.8em;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.125rem, 2.4vw, 1.375rem); line-height: 1.6;
  color: #DCE3FA; text-wrap: pretty;
  transition: opacity .25s ease;
}
.story__lead b { color: var(--mint-hi); font-weight: 500; }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px;
  margin: 28px 0 34px;
}
.stat {
  padding: 16px 18px 14px;
  background: rgba(13, 20, 58, .55);
  border: 1px solid rgba(155, 230, 210, .2);
  border-radius: 12px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.stat dt { font-size: .875rem; color: var(--mist); margin: 4px 0 0; }
.stat dd {
  margin: 0;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.25rem); line-height: 1.1; color: var(--ice);
}

/* Thanh mốc 2022 -> Nay */
.timeline {
  position: relative;
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding-top: 2px;
}
.timeline::before {
  content: ""; position: absolute; left: 8%; right: 8%; top: 8px; height: 1px;
  background: rgba(201, 210, 255, .24);
}
.timeline__btn {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 2px; background: none; border: 0; cursor: pointer;
  color: var(--mist); font: inherit; font-size: .875rem;
  transition: color .2s;
}
.timeline__dot {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid rgba(201, 210, 255, .65);
  background: var(--night);
  transition: transform .25s var(--ease), background-color .25s, border-color .25s, box-shadow .25s;
}
.timeline__btn:hover { color: var(--ice); }
.timeline__btn:hover .timeline__dot { border-color: var(--mint); }
.timeline__btn[aria-selected="true"] { color: var(--mint-hi); font-weight: 500; }
.timeline__btn[aria-selected="true"] .timeline__dot {
  background: var(--mint); border-color: var(--mint-hi);
  box-shadow: 0 0 14px rgba(155, 230, 210, .95);
  transform: scale(1.2);
}

@media (max-width: 860px) {
  .story__grid { grid-template-columns: 1fr; gap: 44px; text-align: center; }
  .story__lead { margin-inline: auto; min-height: auto; }
  .arch__nav--prev { left: 8px; }
  .arch__nav--next { right: 8px; }
  .arch__badge { right: -10px; bottom: -16px; width: 92px; height: 92px; }
}
@media (max-width: 480px) {
  .stats { gap: 10px; }
  .stat { padding: 14px 10px 12px; }
  .timeline__btn { font-size: .78rem; }
}

/* ---------- Chỉ đường ---------- */
.directions { padding: var(--section) 0; border-top: 1px solid var(--line-soft); }
.directions__grid { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 72px); align-items: center; }
.directions__venue { font-family: var(--display); font-size: var(--fs-xl); line-height: 1.3; margin: 0 0 .3em; }
.directions__addr { color: var(--mist); margin: 0 0 1.75em; }
.directions__media { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.map-tabs {
  display: inline-flex; align-self: flex-start; gap: 4px; padding: 4px;
  border-radius: 999px;
  background: rgba(12, 18, 56, .76);
  border: 1px solid rgba(155, 230, 210, .28);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.map-tabs__btn {
  padding: 7px 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: transparent; color: var(--mist);
  font: 500 .875rem/1.2 var(--sans);
  transition: background-color .2s, color .2s;
}
.map-tabs__btn:hover { color: var(--ice); }
.map-tabs__btn[aria-selected="true"] { background: var(--mint); color: var(--ink); font-weight: 600; }

.map {
  position: relative;
  aspect-ratio: 4 / 3; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line); background: var(--night-2);
  display: grid; place-items: center;
  box-shadow: 0 0 40px -16px rgba(155, 230, 210, .35);
}
.map iframe { width: 100%; height: 100%; border: 0; display: block; filter: saturate(.85); }
.map__empty { margin: 0; padding: 24px; color: var(--mist); text-align: center; }
.map__empty code { font-size: .9em; color: var(--ice); }
.map--campus { background: #FFFFFF; }
.map__campus-btn {
  all: unset; box-sizing: border-box;
  position: relative; width: 100%; height: 100%;
  display: grid; place-items: center; padding: 8px;
  cursor: zoom-in;
}
.map__campus-btn img {
  width: 100%; height: 100%; object-fit: contain;
  transition: transform .35s var(--ease);
}
.map__campus-btn:hover img { transform: scale(1.02); }
.map__campus-btn:focus-visible { outline: 2px solid var(--mint); outline-offset: -4px; border-radius: 12px; }
@media (max-width: 800px) { .directions__grid { grid-template-columns: 1fr; } }

/* ---------- Form (kính mờ trên nền trời) ---------- */
.form {
  padding: clamp(22px, 5vw, 36px);
  background: linear-gradient(180deg, rgba(22, 32, 88, .62), rgba(12, 18, 56, .7));
  border: 1px solid rgba(155, 230, 210, .24); border-radius: 18px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 500; font-size: .9375rem; margin-bottom: 8px; padding: 0; }
.field__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.field__head label { margin-bottom: 0; }
.field__count { font-size: .75rem; color: var(--mist); font-variant-numeric: tabular-nums; }
.opt { font-weight: 400; color: var(--mist); }
.field input[type="text"], .field textarea, .stepper input {
  width: 100%; font: inherit; color: var(--ice);
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-soft);
  padding: 12px 14px; border-radius: 10px;
  transition: border-color .2s, background-color .2s, box-shadow .2s;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--mint); background: rgba(255, 255, 255, .08);
  box-shadow: 0 0 0 3px rgba(155, 230, 210, .18);
}
.field__err { display: none; color: var(--error); font-size: var(--fs-sm); margin: 6px 0 0; }
.field.is-invalid .field__err { display: block; }
.field.is-invalid input[type="text"], .field.is-invalid textarea { border-color: var(--error); }

.choice { display: flex; flex-wrap: wrap; gap: 10px; }
.choice legend { width: 100%; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--line-soft); background: rgba(255, 255, 255, .04);
  font-size: .9375rem; transition: background-color .2s, color .2s, border-color .2s;
}
.chip:hover span { border-color: var(--mint); }
.chip input:checked + span { background: var(--mint); color: var(--ink); border-color: var(--mint); font-weight: 600; }
.chip input:focus-visible + span { outline: 2px solid var(--mint); outline-offset: 2px; }

.stepper { display: inline-grid; grid-template-columns: 44px 72px 44px; align-items: center; gap: 6px; }
.stepper input { text-align: center; -moz-appearance: textfield; appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper button {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-soft);
  background: none; font-size: 1.2rem; color: var(--ice); cursor: pointer;
}
.stepper button:hover { border-color: var(--mint); }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.form__status { margin: 12px 0 0; font-size: .9375rem; min-height: 1.4em; text-align: center; color: var(--mist); }
.form__status:empty { min-height: 0; margin: 0; }
.form__status.is-error { color: var(--error); }

/* ---------- RSVP ---------- */
.rsvp { padding: var(--section) 0; border-top: 1px solid var(--line-soft); }
.rsvp__wrap { display: grid; grid-template-columns: 5fr 7fr; gap: clamp(32px, 6vw, 72px); align-items: start; }
.rsvp__intro p { color: var(--mist); max-width: 34ch; }
.rsvp__call a { color: var(--ice); font-weight: 500; }
.rsvp__busy {
  margin: 0 0 20px; padding: 12px 14px;
  font-size: .9375rem; line-height: 1.55; color: #D4DCF5;
  background: rgba(155, 230, 210, .07);
  border: 1px solid rgba(155, 230, 210, .24);
  border-radius: 10px;
}
.rsvp__busy a {
  color: var(--mint); font-weight: 500;
  text-decoration: underline; text-decoration-color: rgba(155, 230, 210, .5); text-underline-offset: .22em;
}
.rsvp__busy a:hover { color: var(--mint-hi); text-decoration-color: currentColor; }
.form.is-done { text-align: center; padding-block: 48px; }
.thanks__seal {
  width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%;
  display: grid; place-items: center; color: var(--ink);
  background: radial-gradient(circle at 32% 24%, rgba(255, 255, 255, .9), transparent 40%), conic-gradient(from 210deg, #CDC6FF, #A9ECDA, #EEF2FF, #9BE6D2, #CDC6FF);
}
.thanks__title { font-family: var(--display); font-weight: 400; font-size: var(--fs-2xl); margin: 0 0 .3em; }
.thanks__sub { margin: 0 auto; max-width: 36ch; color: var(--mist); }
.thanks__link { color: var(--mint); font-weight: 500; }
@media (prefers-reduced-motion: no-preference) {
  .form.is-done > * { animation: rise .6s var(--ease) both; }
  .rsvp__busy:not([hidden]) { animation: rise .35s var(--ease) both; }
}
@media (max-width: 800px) { .rsvp__wrap { grid-template-columns: 1fr; } }

/* ---------- Tường lời chúc (những tờ giấy lưu bút dán tường) ---------- */
.wall { padding: var(--section) 0; border-top: 1px solid var(--line-soft); }
.wall__grid { display: grid; grid-template-columns: minmax(0, 4.2fr) minmax(0, 7.8fr); gap: clamp(28px, 5vw, 60px); align-items: start; }
.wall__side { position: sticky; top: 28px; }
.wall__kicker {
  margin: 0 0 .85em;
  color: var(--mint); font-size: .75rem; font-weight: 600;
  letter-spacing: .28em; text-transform: uppercase;
}
.wall__side .h2 { margin-bottom: .45em; }
.wall__intro { color: #C2CBE6; margin: 0 0 28px; max-width: 34ch; text-wrap: pretty; }

/* Form đặt trực tiếp trên nền trời cực quang, gọn thoáng */
.form--wish {
  padding: 0; background: none; border: 0; border-radius: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.form--wish .field label { font-size: .875rem; color: #C6CFE9; }
.form--wish input[type="text"], .form--wish textarea {
  background: rgba(14, 21, 58, .55);
  border: 1px solid rgba(201, 210, 255, .22);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.form--wish input[type="text"]:focus, .form--wish textarea:focus {
  background: rgba(18, 28, 74, .72);
}
.form--wish input::placeholder, .form--wish textarea::placeholder { color: rgba(166, 176, 216, .48); }

/* Lưới những tờ giấy lời chúc dán lên tường (kích thước đồng đều nhau) */
.notes-wall {
  list-style: none; margin: 0; padding: 8px 0 0;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px; align-items: stretch;
}
.note {
  --paper-bg: #F6F8FD;
  --tape-bg: rgba(196, 238, 226, .46);
  position: relative;
  height: 184px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px 20px 14px;
  color: #1D2548;
  background:
    repeating-linear-gradient(
      to bottom,
      transparent 0,
      transparent 23px,
      rgba(22, 34, 106, .055) 23px,
      rgba(22, 34, 106, .055) 24px
    ) 0 15px / 100% 24px repeat-y,
    linear-gradient(160deg, #FFFFFF 0%, var(--paper-bg) 100%);
  border-radius: 3px;
  transform: rotate(var(--tilt, 0deg));
  box-shadow:
    0 18px 32px -18px rgba(0, 0, 0, .8),
    0 4px 10px -4px rgba(0, 0, 0, .32),
    inset 0 0 0 1px rgba(255, 255, 255, .75);
  transition: transform .32s var(--ease), box-shadow .32s var(--ease);
}
/* Dải băng dính mờ nhỏ dán giữ tờ giấy ở mép trên */
.note::before {
  content: ""; position: absolute; top: -7px; left: 50%;
  width: 48px; height: 14px;
  transform: translateX(-50%) rotate(var(--tape, -2deg));
  background: var(--tape-bg);
  border-inline: 1px solid rgba(255, 255, 255, .32);
  box-shadow: 0 2px 5px rgba(0, 0, 0, .14);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}
/* Nếp gấp góc giấy rất nhẹ ở góc dưới bên phải */
.note::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 14px; height: 14px; pointer-events: none;
  background: linear-gradient(135deg, rgba(16, 26, 70, .09) 0%, rgba(16, 26, 70, .03) 48%, transparent 50%);
  border-top-left-radius: 3px;
}
/* Sắc giấy nhẹ khác nhau như tập giấy lưu bút */
.note:nth-child(3n + 2) { --paper-bg: #F6F5FE; --tape-bg: rgba(205, 198, 255, .44); }
.note:nth-child(3n) { --paper-bg: #F3FAF8; --tape-bg: rgba(176, 232, 218, .46); }
.note:hover {
  transform: rotate(0deg) translateY(-4px);
  box-shadow:
    0 24px 40px -16px rgba(0, 0, 0, .88),
    0 8px 16px -6px rgba(0, 0, 0, .38),
    0 0 24px -10px rgba(155, 230, 210, .32),
    inset 0 0 0 1px rgba(255, 255, 255, .9);
  z-index: 2;
}
.note__text {
  margin: 0; flex: 1 1 auto; min-height: 0; max-height: 120px;
  overflow-y: auto; overscroll-behavior: contain; padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: rgba(30, 127, 106, .32) transparent;
  font-family: var(--hand); font-style: italic; font-weight: 400;
  font-size: .95rem; line-height: 24px;
  color: #1F284D;
  white-space: pre-line; overflow-wrap: anywhere;
}
.note__text::-webkit-scrollbar { width: 4px; }
.note__text::-webkit-scrollbar-track { background: transparent; }
.note__text::-webkit-scrollbar-thumb { background: rgba(30, 127, 106, .3); border-radius: 999px; }
.note__text::-webkit-scrollbar-thumb:hover { background: rgba(30, 127, 106, .55); }
.note__foot {
  flex: none;
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 12px;
}
.note__by {
  margin: 0; font-family: var(--sans); font-size: .8125rem; font-weight: 600; color: var(--mint-ink);
  overflow-wrap: anywhere;
}
.note__time { font-size: .75rem; color: #7C85A8; }

.note--empty {
  grid-column: 1 / -1;
  padding: 44px 24px; text-align: center;
  color: var(--mist); font-size: .9375rem;
  border: 1px dashed var(--line); border-radius: 10px;
  background: rgba(14, 21, 64, .32);
}

@media (prefers-reduced-motion: no-preference) {
  .note--new { animation: note-in .55s var(--ease) backwards; }
}
@media (max-width: 860px) {
  .wall__grid { grid-template-columns: 1fr; }
  .wall__side { position: static; }
}
@media (max-width: 560px) {
  .notes-wall { grid-template-columns: 1fr; gap: 18px; }
}

/* ---------- Lời cuối ---------- */
.finale {
  position: relative;
  min-height: 100svh;
  display: grid; grid-template-rows: 1fr auto;
  padding: var(--section) var(--gutter) 0;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}
/* cực quang đậm hơn ở cuối trang */
.finale::before {
  content: ""; position: absolute; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(60% 35% at 30% 18%, rgba(122, 107, 239, .35), transparent 70%),
    radial-gradient(60% 30% at 72% 30%, rgba(94, 210, 180, .3), transparent 70%),
    radial-gradient(80% 40% at 50% 110%, rgba(62, 123, 214, .35), transparent 70%);
  filter: blur(10px);
}
.finale__photo {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64%; z-index: -1;
  background-size: cover; background-position: center 72%;
  opacity: 0;
  -webkit-mask-image:
    linear-gradient(to top, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .74) 46%, transparent 100%),
    radial-gradient(85% 95% at 50% 100%, #000 50%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(to top, rgba(0, 0, 0, .95) 0%, rgba(0, 0, 0, .74) 46%, transparent 100%),
    radial-gradient(85% 95% at 50% 100%, #000 50%, transparent 100%);
  mask-composite: intersect;
  filter: saturate(.38) brightness(.52) contrast(1.06) hue-rotate(-10deg);
}
.finale__photo.has-photo { opacity: .72; }
.finale__inner { align-self: center; max-width: 52rem; margin: 0 auto; }
.finale__label {
  margin: 0 0 1.5rem;
  color: var(--ice); opacity: .85;
  font-size: .8125rem; font-weight: 600; letter-spacing: .4em; text-transform: uppercase; padding-left: .4em;
}
.finale__title {
  margin: 0 auto;
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.75rem, 8.5vw, 5.75rem); line-height: 1.08; letter-spacing: -.015em;
  text-wrap: balance;
}
.finale__line { display: block; color: var(--ice); }
.finale__line--holo { font-style: italic; color: transparent; }
.finale__text {
  margin: 1.5em auto 2.25em; max-width: 44ch;
  font-size: var(--fs-md); color: #D6DDF6; text-wrap: balance;
}
.finale__toss { min-height: 56px; padding-inline: 2em; font-size: var(--fs-md); }
.finale__toss i { width: 24px; height: 24px; display: block; }
.finale__toss .cap-icon { width: 100%; height: 100%; color: var(--ink); }
.finale__toss .cap-icon .cap-cord, .finale__toss .cap-icon .cap-tuft { stroke: var(--ink); fill: var(--ink); }
.finale__toss .cap-icon .cap-cord { fill: none; }
.finale__toss .cap-icon .cap-board { stroke: none; }
.finale__toss .cap-icon .cap-button { fill: var(--mint); }

.foot {
  padding: clamp(48px, 10vh, 96px) 0 calc(88px + env(safe-area-inset-bottom));
  text-align: center; color: var(--mist); font-size: .9375rem;
}
.foot__logo { width: 44px; aspect-ratio: 1; margin: 0 auto 16px; }
.foot__logo img { width: 100%; height: 100%; object-fit: contain; }
.foot__credit {
  margin: 0; color: var(--ice);
  font-size: .75rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
  text-wrap: balance;
}
.foot__contact { margin: .8em 0 0; }
.foot__contact a { color: var(--ice); }

/* ---------- Thanh nhắc xác nhận ---------- */
.nudge {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 14px;
  padding: 6px 6px 6px 20px; white-space: nowrap;
  background: rgba(14, 21, 64, .86); border: 1px solid var(--line); border-radius: 999px;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8), 0 0 30px -10px rgba(155, 230, 210, .35);
  font-size: .9375rem;
}

/* ---------- Nút bật/tắt nhạc nền (đĩa nhạc & nốt nhạc) ---------- */
.music-btn {
  position: fixed;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  z-index: 88;
  width: 46px; height: 46px; padding: 0;
  display: grid; place-items: center;
  border-radius: 50%; cursor: pointer;
  color: var(--mist);
  background:
    radial-gradient(circle at 32% 24%, rgba(196, 189, 255, .14), transparent 55%),
    rgba(11, 17, 52, .82);
  border: 1px solid rgba(155, 230, 210, .35);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .82);
  transition: color .25s, border-color .25s, background-color .25s, transform .25s var(--ease), box-shadow .25s;
}
.music-btn:hover {
  color: var(--ice); border-color: var(--mint);
  background: rgba(20, 30, 84, .9);
  transform: scale(1.06);
}
.music-btn__ring {
  position: absolute; inset: 4px; border-radius: 50%;
  border: 1px dashed rgba(155, 230, 210, .28);
  pointer-events: none;
  transition: border-color .25s;
}
.music-btn__disc {
  display: grid; place-items: center;
  width: 22px; height: 22px;
}
.music-btn__note { width: 20px; height: 20px; display: block; }
.music-btn__slash {
  position: absolute; width: 24px; height: 1.7px; border-radius: 99px;
  background: currentColor;
  transform: rotate(-45deg) scaleX(1);
  box-shadow: 0 0 0 2px rgba(11, 17, 52, .85);
  transition: transform .25s var(--ease), opacity .25s;
  pointer-events: none;
}
.music-btn.is-playing {
  color: var(--mint-hi);
  border-color: rgba(155, 230, 210, .78);
  box-shadow: 0 0 26px -6px rgba(155, 230, 210, .6), 0 12px 28px -12px rgba(0, 0, 0, .82);
}
.music-btn.is-playing .music-btn__ring { border-color: rgba(155, 230, 210, .55); }
.music-btn.is-playing .music-btn__slash { transform: rotate(-45deg) scaleX(0); opacity: 0; }
@media (prefers-reduced-motion: no-preference) {
  .music-btn.is-playing .music-btn__ring { animation: spin 10s linear infinite; }
  .music-btn.is-playing .music-btn__disc { animation: note-bob 2.2s ease-in-out infinite; }
}
@keyframes note-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-2px) rotate(4deg); }
}

/* ---------- Lightbox ---------- */
.lightbox {
  border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
  background: rgba(5, 8, 28, .96); color: var(--ice);
}
.lightbox[open] { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.lightbox.is-single[open] { grid-template-columns: 1fr; padding-inline: var(--gutter); }
.lightbox.is-single .lightbox__nav { display: none; }
.lightbox::backdrop { background: transparent; }
.lightbox__fig { margin: 0; display: grid; justify-items: center; gap: 14px; padding: 56px 0 24px; }
.lightbox__media { width: min(1040px, 100%); max-height: 80dvh; display: grid; place-items: center; }
.lightbox__media img { max-width: 100%; max-height: 80dvh; width: auto; object-fit: contain; border-radius: 10px; }
.lightbox figcaption { font-family: var(--display); font-size: var(--fs-md); text-align: center; padding: 0 8px; }
.lightbox__nav, .lightbox__close {
  background: none; border: 0; color: var(--ice); cursor: pointer;
  font-size: 2.4rem; line-height: 1; width: 56px; height: 56px; border-radius: 50%;
}
.lightbox__nav:hover, .lightbox__close:hover { background: rgba(255, 255, 255, .1); }
.lightbox__close { position: absolute; top: 12px; right: 12px; font-size: 2rem; }
@media (max-width: 600px) {
  .lightbox[open] { grid-template-columns: 44px 1fr 44px; }
  .lightbox__nav { width: 44px; height: 44px; font-size: 2rem; }
}

.ph {
  width: 100%; height: 100%; min-height: 200px;
  display: grid; place-content: center; gap: 8px; text-align: center;
  color: var(--mist); font-size: var(--fs-sm); padding: 12px; background: var(--night-2);
}
.ph svg { width: 36px; height: 36px; margin-inline: auto; opacity: .6; }

/* ---------- Keyframes ---------- */
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes note-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }
@keyframes spin { to { transform: rotate(1turn); } }
@keyframes breathe { 50% { transform: scale(1.08); opacity: .7; } }
@keyframes sheen { 0%, 100% { background-position: 100% 0; } 50% { background-position: 0 0; } }
@keyframes gate-in { from { opacity: 0; transform: translateY(22px) scale(.96); } }
@keyframes beckon { 0% { box-shadow: 0 0 0 0 rgba(155, 230, 210, .5); } 70%, 100% { box-shadow: 0 0 0 22px rgba(155, 230, 210, 0); } }
@keyframes thump { 35% { transform: scale(.975); } 70% { transform: scale(1.01); } }
@keyframes glow { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: .35; } }
@keyframes logo-in { from { opacity: 0; transform: scale(.4) rotate(-25deg); } }
@keyframes label-in { from { opacity: 0; letter-spacing: .7em; } }
@keyframes ink-in {
  from { clip-path: inset(-10% 100% -10% 0); filter: blur(3px); opacity: .4; }
  to { clip-path: inset(-10% 0 -10% 0); filter: blur(0); opacity: 1; }
}
@keyframes shine { from { transform: translateX(-130%); } to { transform: translateX(130%); } }
@keyframes bob { 50% { transform: translateY(4px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
