/* =============================================================
 *  style.css — giao diện tone tím nhạt + hồng nhạt (pastel).
 *  Muốn đổi màu: chỉ sửa mấy biến ở :root.
 * ============================================================= */

:root {
  /* --- Hai màu chủ đạo (dùng cho nền, khối, viền) --- */
  --lilac:      #cbaaf0;   /* tím nhạt */
  --pink:       #f9b6d3;   /* hồng nhạt */
  --pink-deep:  #ef8bb8;

  /* --- Bản đậm hơn, CHỈ dùng cho chữ để đủ tương phản (≥ 4.5:1) --- */
  --lilac-deep: #7b4fbf;
  --pink-text:  #b53a71;

  /* --- Nền & chữ --- */
  --bg:        #fbf6ff;
  --bg-alt:    #fdf1f7;
  --surface:   rgba(255, 255, 255, .72);
  --line:      rgba(155, 116, 212, .22);
  --text:      #4b3560;
  --muted:     #6f5c88;

  --radius:    18px;
  --radius-sm: 12px;
  --wrap:      1080px;
  --shadow:    0 18px 40px rgba(150, 110, 200, .18);
  --shadow-sm: 0 8px 20px rgba(150, 110, 200, .14);

  /* Màu dùng trên lớp phủ tối của modal */
  --overlay:      rgba(70, 46, 92, .62);
  --on-overlay:   #fdf7ff;

  --font-body:    'Quicksand', ui-rounded, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
html.has-modal { overflow: hidden; }

body {
  margin: 0;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 45% at 12% 0%, rgba(203, 170, 240, .38), transparent 60%),
    radial-gradient(55% 40% at 92% 8%, rgba(249, 182, 211, .34), transparent 62%);
  background-attachment: fixed;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

a { color: var(--lilac-deep); }

:focus-visible {
  outline: 2px solid var(--lilac-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 20px;
}
.wrap--narrow { max-width: 680px; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--lilac);
  color: #3b2551;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* Chỉ dành cho trình đọc màn hình */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- Canvas hiệu ứng ---------- */
#fx {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, .68);
  border-bottom: 1px solid var(--line);
}

.nav {
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav__list {
  display: flex;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav__list::-webkit-scrollbar { display: none; }

.nav__list a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .92rem;
  white-space: nowrap;
  transition: color .2s, background-color .2s;
}
.nav__list a:hover {
  color: var(--lilac-deep);
  background: rgba(203, 170, 240, .22);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: calc(100vh - 58px);
  min-height: calc(100svh - 58px);   /* trình duyệt cũ bỏ qua dòng này */
  display: grid;
  place-items: center;
  text-align: center;
  padding: 72px 0 96px;
  overflow: hidden;
}

.hero__glow {
  position: absolute;
  inset: -25% -10% auto -10%;
  height: 95%;
  background:
    radial-gradient(45% 55% at 28% 32%, rgba(203, 170, 240, .55), transparent 68%),
    radial-gradient(42% 52% at 74% 40%, rgba(249, 182, 211, .50), transparent 68%);
  filter: blur(14px);
  pointer-events: none;
}

.hero__inner { position: relative; }

.hero__eyebrow {
  margin: 0 0 10px;
  color: var(--lilac-deep);
  letter-spacing: .16em;
  text-transform: uppercase;
  font-size: .74rem;
  font-weight: 700;
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 5rem);
  line-height: 1.08;
  margin: 0 0 18px;
}
.accent {
  background: linear-gradient(100deg, var(--lilac-deep), var(--pink-text));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-style: italic;
}

.hero__tagline {
  min-height: 2.2em;
  margin: 0 auto 30px;
  max-width: 30ch;
  color: var(--muted);
  font-size: clamp(1rem, 2.6vw, 1.2rem);
}

.caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  vertical-align: -.15em;
  margin-left: 3px;
  background: var(--lilac-deep);
  animation: blink 1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.hero__scroll {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--lilac-deep);
  animation: float 2.4s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 8px); }
}

/* ---------- Nút ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: linear-gradient(120deg, var(--lilac), var(--pink));
  color: #4a2a63;
  box-shadow: 0 10px 26px rgba(180, 130, 220, .35);
}
.btn--primary:hover { box-shadow: 0 14px 30px rgba(180, 130, 220, .42); }

.btn--ghost {
  background: rgba(255, 255, 255, .6);
  border-color: var(--line);
  color: var(--text);
}
.btn--ghost:hover { background: #fff; }

/* ---------- Section ---------- */
.section { padding: 84px 0; }
.section--alt {
  background: var(--bg-alt);
  border-block: 1px solid var(--line);
}
[id] { scroll-margin-top: 76px; }

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  text-align: center;
  margin: 0 0 8px;
}
.section__sub {
  text-align: center;
  color: var(--muted);
  margin: 0 0 40px;
}

/* ---------- Bộ đếm ---------- */
.counter {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 720px;
  margin-inline: auto;
}

.counter__cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.counter__num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 6vw, 2.6rem);
  font-weight: 700;
  color: var(--lilac-deep);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.counter__label {
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.counter__next {
  text-align: center;
  color: var(--pink-text);
  font-weight: 600;
  margin: 26px 0 0;
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0 0 0 30px;
  position: relative;
  max-width: 720px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(var(--lilac), var(--pink), transparent);
}

.timeline__item {
  position: relative;
  padding: 0 0 34px;
}
.timeline__item::before {
  content: "";
  position: absolute;
  left: -30px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--lilac), var(--pink));
  box-shadow: 0 0 0 4px rgba(203, 170, 240, .28);
}
.timeline__item:last-child { padding-bottom: 0; }

.timeline__date {
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lilac-deep);
  font-weight: 600;
}
.timeline__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin: 4px 0 6px;
}
.timeline__text { margin: 0; color: var(--muted); }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.gallery__item {
  position: relative;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, rgba(203, 170, 240, .35), rgba(249, 182, 211, .35));
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.gallery__item:hover img { transform: scale(1.06); }

.gallery__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 12px 10px;
  background: linear-gradient(transparent, rgba(70, 46, 92, .82));
  color: #fff;
  font-size: .86rem;
  text-align: left;
  line-height: 1.35;
}

/* ---------- Thẻ lý do ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 26px;
  text-align: center;
  box-shadow: var(--shadow);
}
.card__text {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 3.4vw, 1.5rem);
  font-style: italic;
  min-height: 3.2em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 22px;
  color: var(--text);
}
.card__text.is-in { animation: pop .35s ease; }
@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.card__meta {
  margin: 16px 0 0;
  font-size: .82rem;
  color: var(--muted);
}

/* ---------- Hộp quà ---------- */
.giftbox {
  display: block;
  margin: 0 auto;
  width: 190px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.giftbox__lid,
.giftbox__body { display: block; position: relative; }

.giftbox__lid {
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(150deg, #e3cdf8, var(--lilac));
  box-shadow: 0 8px 20px rgba(180, 130, 220, .35);
  transform-origin: left bottom;
  transition: transform .5s cubic-bezier(.34, 1.4, .64, 1);
}
.giftbox__lid::after {
  content: "🎀";
  position: absolute;
  top: -26px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 28px;
}

.giftbox__body {
  height: 130px;
  margin-top: 6px;
  border-radius: 0 0 14px 14px;
  background: linear-gradient(150deg, var(--pink), var(--pink-deep));
  box-shadow: var(--shadow-sm);
}
.giftbox__body::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 50%;
  width: 18px;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, .55);
}

.giftbox:hover .giftbox__lid { transform: translateY(-6px) rotate(-4deg); }
.giftbox.is-open .giftbox__lid { transform: translate(-14px, -46px) rotate(-24deg); }

.giftbox__cta {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: .92rem;
  letter-spacing: .06em;
}

/* ---------- Footer ---------- */
.site-footer {
  padding: 46px 0 60px;
  text-align: center;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}
.footer__line { margin: 0; color: var(--muted); }
.footer__sign {
  margin: 6px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--lilac-deep);
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .2s ease;
}
.modal.is-open { opacity: 1; }
.modal[hidden] { display: none; }

.modal__close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: var(--on-overlay);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.modal__close:hover { background: rgba(255, 255, 255, .38); }
.modal__close--inline { position: absolute; }

.modal__nav {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: var(--on-overlay);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.modal__nav:hover { background: rgba(255, 255, 255, .4); }

.lightbox__figure {
  margin: 0;
  max-width: min(900px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}
.lightbox__figure img {
  max-height: 74vh;
  width: auto;
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(40, 20, 60, .45);
  object-fit: contain;
}
.lightbox__figure figcaption {
  color: var(--on-overlay);
  text-align: center;
  font-size: .92rem;
}

/* ---------- Lá thư ---------- */
.letter {
  position: relative;
  max-width: 620px;
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 44px 32px 36px;
  border-radius: var(--radius);
  background: linear-gradient(170deg, #fdf8ff, #fdeef6);
  color: #4b3560;
  box-shadow: 0 24px 60px rgba(40, 20, 60, .38);
  transform: translateY(14px);
  transition: transform .28s ease;
}
.modal--letter.is-open .letter { transform: none; }

.letter .modal__close--inline {
  top: 10px;
  right: 12px;
  border-color: rgba(75, 53, 96, .18);
  background: rgba(155, 116, 212, .12);
  color: #6b4b8a;
}
.letter .modal__close--inline:hover { background: rgba(155, 116, 212, .22); }

.letter__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 0 0 14px;
  color: var(--lilac-deep);
}
.letter__body p { margin: 0 0 14px; }
.letter__sign {
  margin: 22px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  text-align: right;
  color: var(--pink-text);
}

/* ---------- Nút nhạc ---------- */
.music-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: 50px;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .85);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.music-btn.is-playing { animation: spin 4s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hiện dần khi cuộn ---------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Mobile ---------- */
@media (max-width: 720px) {
  .section { padding: 62px 0; }
  .counter { grid-template-columns: repeat(2, 1fr); }
  .nav__brand { font-size: 1rem; }
  .nav__list a { padding: 6px 9px; font-size: .85rem; }
  .modal { padding: 12px; gap: 4px; }
  .modal__nav { width: 40px; height: 40px; font-size: 24px; }
  .letter { padding: 44px 22px 28px; }
  body { background-attachment: scroll; }
}

/* Màn hình hẹp: nút chuyển ảnh nằm đè hai bên để ảnh được rộng hết cỡ */
@media (max-width: 520px) {
  #lightbox .modal__nav {
    position: absolute;
    bottom: 20px;
    background: rgba(255, 255, 255, .28);
  }
  .modal__nav--prev { left: 20px; }
  .modal__nav--next { right: 20px; }
  .lightbox__figure { padding-bottom: 62px; }
}

/* ---------- Tôn trọng thiết lập giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__scroll { animation: none; }
}
