/* ============================================================
   Desiaray in Dubai — 60th Birthday Celebration
   Shared styles. Night-sky / desert theme.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Jost:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  --indigo:      #0c0628;   /* matches the background image's solid base */
  --indigo-2:    #140a33;
  --panel:       rgba(150, 138, 220, 0.10);
  --panel-line:  rgba(245, 191, 105, 0.28);
  --panel-line-soft: rgba(190, 180, 230, 0.18);
  --ink:         #f2f2f2;   /* off-white text */
  --ink-soft:    rgba(242, 242, 242, 0.62);
  --gold:        #f5bf69;   /* brand gold */
  --gold-soft:   rgba(245, 191, 105, 0.55);
  --col:         860px;     /* content column width */
  --track-wide:  0.2em;
  --track-xwide: 0.45em;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--indigo);
  color: var(--ink);
  font-family: 'Jost', 'Century Gothic', 'Futura', system-ui, sans-serif;
  font-weight: 300;
  line-height: 1.5;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Starfield (twinkling) ---------- */
.starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.star {
  position: absolute;
  width: 2px;
  height: 2px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.5;
  animation: twinkle var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes twinkle {
  0%, 100% { opacity: 0.12; transform: scale(0.7); }
  50%      { opacity: 0.95; transform: scale(1.15); }
}

/* ---------- Page column ---------- */
.page {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  /* skyline / desert scene scaled to the column width; its solid base
     (#0c0628) is the same as the body so it melts into the page */
  background: url('../assets/bg-night.jpg') top center / 100% auto no-repeat;
  padding: 0 24px 70px;
  min-height: 100vh;
}

/* drifting moon glow over the baked-in moon (upper-right of hero) */
.moon-glow {
  position: absolute;
  top: 2%;
  right: 6%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238,234,210,0.30) 0%, rgba(238,234,210,0.10) 38%, transparent 68%);
  filter: blur(6px);
  pointer-events: none;
  z-index: 0;
  animation: moonDrift 14s ease-in-out infinite;
}
@keyframes moonDrift {
  0%, 100% { transform: translate(0, 0) scale(1);     opacity: 0.85; }
  50%      { transform: translate(-10px, 8px) scale(1.05); opacity: 1; }
}

/* lift real content above the moon-glow (which sits at z-index 0) */
.hero, .section, .page > footer { position: relative; z-index: 1; }

/* ---------- Header / hero ---------- */
.hero {
  text-align: center;
  padding-top: clamp(28px, 7vw, 64px);
}
.hero__logo {
  display: block;
  width: min(82%, 560px);
  margin: 0 auto;
  height: auto;
}
.hero__title {
  font-size: clamp(20px, 5.2vw, 40px);
  font-weight: 400;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  margin: clamp(14px, 3vw, 26px) 0 0;
  color: var(--ink);
}
.hero__date {
  font-size: clamp(11px, 2.6vw, 19px);
  font-weight: 700;
  letter-spacing: var(--track-xwide);
  text-transform: uppercase;
  margin: 14px 0 0;
  color: var(--ink);
  padding-left: var(--track-xwide); /* offset tracking so it stays centered */
}
.hero__venue {
  display: block;
  width: min(58%, 360px);
  margin: clamp(18px, 4vw, 34px) auto 0;
  height: auto;
}

/* ---------- Section labels ---------- */
.section {
  margin-top: clamp(46px, 9vw, 84px);
}
.section__label {
  text-align: center;
  font-size: clamp(20px, 5vw, 38px);
  font-weight: 400;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 clamp(20px, 4vw, 34px);
  padding-left: var(--track-wide);
}

/* ---------- Video ---------- */
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 11;
  background: var(--panel);
  border: 1px solid var(--panel-line-soft);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.placeholder-note {
  text-align: center;
  color: var(--ink-soft);
  font-size: clamp(12px, 2.6vw, 16px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 24px;
  max-width: 80%;
}
.placeholder-note b { color: var(--gold); font-weight: 500; }

/* ---------- Photo grid ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 2.4vw, 22px);
}
.photo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--panel);
  border: 1px solid var(--panel-line-soft);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  display: block;
}
.photo-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(.2,.7,.2,1), opacity 0.6s ease;
}
.photo-cell:hover img,
.photo-cell:focus-visible img { transform: scale(1.07); }
.photo-cell:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.photo-cell.is-empty { cursor: default; }
.photo-cell.is-empty::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(245,191,105,0.05), rgba(245,191,105,0.0));
}

/* ---------- Buttons (brand PNGs) ---------- */
.btn-row {
  text-align: center;
  margin-top: clamp(30px, 6vw, 52px);
}
.btn-img {
  display: inline-block;
  transition: transform 0.25s ease, filter 0.25s ease;
}
.btn-img img {
  display: block;
  width: min(86%, 420px);
  margin: 0 auto;
  height: auto;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.45));
}
.btn-img:hover { transform: translateY(-2px) scale(1.02); }
.btn-img:active { transform: translateY(0) scale(0.99); }

/* ---------- Footer ---------- */
.thanks {
  text-align: center;
  font-size: clamp(16px, 4.2vw, 32px);
  font-weight: 400;
  letter-spacing: var(--track-wide);
  text-transform: uppercase;
  color: var(--gold);
  margin: clamp(54px, 10vw, 96px) 0 0;
  padding-left: var(--track-wide);
}
.footer-logo {
  display: block;
  width: min(50%, 300px);
  margin: clamp(24px, 5vw, 44px) auto 0;
  height: auto;
}

/* ---------- Scroll reveal ----------
   Capture-safe: opacity is NOT transitioned (snaps to 1 with the in-view
   class, so content is never frozen invisible); only transform animates,
   giving a subtle slide-up entrance in real browsers. */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: transform 0.7s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 3, 20, 0.94);
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  opacity: 0;
  padding: 24px;
}
.lightbox.open { visibility: visible; opacity: 1; }
.lightbox__img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(.2,.7,.2,1);
}
.lightbox.open .lightbox__img { transform: none; }
.lb-btn {
  position: absolute;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(245,191,105,0.4);
  color: var(--gold);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { background: rgba(245,191,105,0.18); transform: scale(1.06); }
.lb-close { top: 20px; right: 20px; }
.lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }
.lb-counter {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.2em;
}

/* ---------- Gallery nav (sticky top bar) ---------- */
.gallery-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 48px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: rgba(12, 6, 40, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(245, 191, 105, 0.15);
}
.gallery-nav__link {
  color: var(--gold);
  text-decoration: none;
  font-family: 'Jost', 'Century Gothic', 'Futura', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: opacity 0.2s ease;
}
.gallery-nav__link:hover { opacity: 0.75; }
body.has-gallery-nav .page { padding-top: 48px; }

/* ---------- Back-to-top button ---------- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 50;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(245, 191, 105, 0.4);
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease, background 0.2s ease, transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: rgba(245, 191, 105, 0.18); transform: scale(1.08); }

/* ---------- Responsive ---------- */
@media (max-width: 430px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .gallery-nav { padding: 0 16px; }
  .back-to-top { bottom: 20px; right: 16px; width: 44px; height: 44px; font-size: 20px; }
  .lb-btn { width: 44px; height: 44px; font-size: 22px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .star, .moon-glow { animation: none; }
  .reveal { opacity: 1; transform: none; animation: none; }
  .back-to-top { transition: none; }
}
