/* ============================================================
   GALA 20/11 IMAP — "ĐIỆN ẢNH – SCENES OF INSPIRATION"
   style.css: biến màu/font + layout chung + thành phần dùng lại
   (intro.css: màn mở đầu · film.css: hiệu ứng phim, rạp · sections.css: từng trang)
============================================================ */
:root {
  /* Đỏ nhung */
  --velvet-900: #3d0408;
  --velvet-700: #7a0c12;
  --velvet-500: #b3121c;

  /* Vàng ánh kim */
  --gold-100: #fff3c4;
  --gold-300: #f0c96a;
  --gold-500: #c9973b;
  --gold-700: #8a5a1c;
  --gold-gradient: linear-gradient(180deg, #fff3c4 0%, #f0c96a 38%, #c9973b 72%, #8a5a1c 100%);
  --gold-gradient-h: linear-gradient(100deg, #8a5a1c 0%, #c9973b 18%, #fff3c4 45%, #f0c96a 62%, #c9973b 82%, #8a5a1c 100%);

  /* Rạp tối & giấy phim */
  --ink: #0b0705;
  --ink-2: #140c09;
  --ink-3: #1e1410;
  --film-cream: #f3e6c8;
  --film-cream-2: #e6d2a6;
  --text: #f6ecd8;
  --text-soft: #d9c9ab;
  --text-dim: #a8977c;

  /* Ánh cháy sáng */
  --leak: #ff7a1a;

  --font-display: 'Playfair Display', 'Times New Roman', serif;
  --font-script: 'Great Vibes', cursive;
  --font-sans: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Dải phim hai rìa */
  --strip-w: 20px;
  --edge-pad: calc(var(--strip-w) + 14px);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --reveal-dur: 1.6s;

  font-variant-numeric: lining-nums proportional-nums;
}

@media (min-width: 768px) {
  :root {
    --strip-w: 28px;
    --edge-pad: calc(var(--strip-w) + 28px);
  }
}

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

html {
  width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--ink);
}

body {
  width: 100%;
  min-height: 100vh;
  overflow-x: clip;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html.no-scroll,
body.no-scroll { overflow: hidden !important; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

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

.main-content { position: relative; width: 100%; }

/* Trong lúc màn mở đầu chạy, giấu nội dung khỏi trình đọc màn hình & tab */
body.is-intro .main-content { visibility: hidden; }

/* ============ CHỮ VÀNG ÁNH KIM ============ */
.gold-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  /* chừa chỗ cho dấu tiếng Việt chồng (Ệ, Ặ, Ỗ) để không bị cắt */
  padding-block: .08em;
}

.script { font-family: var(--font-script); font-weight: 400; }

/* ============ KHUNG CHUNG CỦA MỖI TRANG ============ */
.scene {
  position: relative;
  isolation: isolate;
  padding: 72px 16px;
}

.scene--edges { padding-inline: var(--edge-pad); }

.section-head {
  text-align: center;
  margin: 0 auto 32px;
  max-width: 560px;
}

.section-head__kicker {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--gold-300);
  margin-bottom: 6px;
}

.section-head__title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 10vw, 56px);
  line-height: 1.12;
  letter-spacing: .04em;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .55));
}

.section-head__note {
  margin-top: 8px;
  font-size: 13px;
  font-style: italic;
  color: var(--text-dim);
}

/* ============ NÚT ============ */
.btn-map,
.btn-velvet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .04em;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), filter .25s var(--ease);
}

.btn-velvet {
  width: 100%;
  min-height: 50px;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 15px;
  color: var(--gold-100);
  background: linear-gradient(180deg, var(--velvet-500), var(--velvet-700) 60%, var(--velvet-900));
  box-shadow: 0 6px 18px rgba(61, 4, 8, .45), inset 0 1px 0 rgba(255, 243, 196, .25);
}

.btn-velvet:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn-velvet:disabled { cursor: wait; filter: grayscale(.4) brightness(.85); transform: none; }

:focus-visible {
  outline: 2px solid var(--gold-300);
  outline-offset: 3px;
}

/* ============ REVEAL KHI CUỘN (giữ cơ chế của source) ============ */
.reveal,
.reveal-fade,
.reveal-fade-down,
.reveal-left,
.reveal-right {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: var(--reveal-dur);
  transition-timing-function: var(--ease-out);
}

.reveal { transform: translate3d(0, 24px, 0); }
.reveal-fade-down { transform: translate3d(0, -18px, 0); }
.reveal-right { transform: translate3d(-20px, 0, 0); }
.reveal-left { transform: translate3d(20px, 0, 0); }
.reveal-fade { transform: none; }

.reveal.is-visible,
.reveal-fade.is-visible,
.reveal-fade-down.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.delay-1 { transition-delay: .18s; }
.delay-2 { transition-delay: .36s; }
.delay-3 { transition-delay: .54s; }
.delay-4 { transition-delay: .72s; }
.delay-5 { transition-delay: .9s; }

/* ============ NÚT NHẠC ============ */
.music-toggle {
  position: fixed;
  right: clamp(14px, 4vw, 24px);
  bottom: calc(clamp(14px, 4vw, 24px) + env(safe-area-inset-bottom, 0px));
  z-index: 990;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid rgba(240, 201, 106, .6);
  background: rgba(20, 12, 9, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-300);
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .45);
  transition: transform .3s var(--ease);
}

.music-toggle:hover { transform: scale(1.06); }
.music-toggle__icon { width: 18px; height: 18px; }
.music-toggle.is-playing { animation: musicPulse 2.8s ease-in-out infinite; }
.music-toggle.is-playing .music-toggle__icon { animation: musicSpin 4.5s linear infinite; }

@keyframes musicSpin { to { transform: rotate(360deg); } }
@keyframes musicPulse {
  0% { box-shadow: 0 0 0 0 rgba(240, 201, 106, .4); }
  70% { box-shadow: 0 0 0 10px rgba(240, 201, 106, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 201, 106, 0); }
}

/* ============ CREDIT TAZ ============ */
.footer-designed {
  position: relative;
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding: 10px 20px 22px;
  background: var(--ink);
}

.footer-designed a { color: var(--gold-300); font-weight: 600; }

/* ============ LIGHTBOX ============ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}

.lightbox.is-open { opacity: 1; visibility: visible; }

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 3, 2, .92);
}

.lightbox__content {
  position: relative;
  z-index: 2;
  width: 88vw;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__close {
  position: absolute;
  top: -46px;
  right: 0;
  background: transparent;
  border: none;
  color: var(--film-cream);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.lightbox__img-container {
  width: 100%;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 14px;
  border: 6px solid #120b08;
  box-shadow: 0 0 0 1px rgba(240, 201, 106, .3), 0 20px 50px rgba(0, 0, 0, .6);
}

.lightbox__img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  transition: opacity .15s ease;
}

.lightbox__img.is-animating { opacity: 0; }

.lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 12, 9, .7);
  border: 1px solid rgba(240, 201, 106, .4);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-100);
  cursor: pointer;
}

.lightbox__nav--prev { left: -14px; }
.lightbox__nav--next { right: -14px; }
.lightbox--single .lightbox__nav { display: none; }

.lightbox__footer {
  margin-top: 12px;
  color: var(--film-cream);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  font-size: 13px;
}

/* ============ GIẢM CHUYỂN ĐỘNG ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal,
  .reveal-fade,
  .reveal-fade-down,
  .reveal-left,
  .reveal-right {
    transform: none !important;
    transition-duration: .4s;
    transition-delay: 0s;
  }
  .music-toggle.is-playing,
  .music-toggle.is-playing .music-toggle__icon { animation: none; }
}
