/* ═══════════════════════════════════════════════════════════════
   ONR RESORT — Design 11: Stacking Celebration (Production)
   ═══════════════════════════════════════════════════════════════

   PHILOSOPHY:
     • Cards stack via position:sticky + z-index (DOM order)
     • NO scroll-snap — it fights sticky. We use CSS scroll-driven
       animations (animation-timeline: scroll()) for the scale/dim
       physics, all on the compositor thread. ZERO JS style mutation.
     • JS only handles: dot tracking, mbar reveal, in-view detection,
       keyboard/dot navigation via scrollTo.
     • The .panel child is the visual surface. The .card itself is
       the sticky positioning box and NEVER transformed.
     • Snap-like behavior: JS detects scroll-end and settles to
       nearest card with scrollTo(smooth) — velocity aware, no fight.

   PERFORMANCE RULES:
     • will-change ONLY on .panel (the thing that scales)
     • opacity + transform ONLY — no layout-triggering props
     • rAF loop for in-view detection ONLY, no style writes
     • scroll listener is passive, no preventDefault

   ═══════════════════════════════════════════════════════════════ */


/* ── TOKENS ── */
:root {
  --ivory:      #FDF5E6;
  --sindoor:    #6B1D2A;
  --teal:       #134043;
  --cream:      #FAF0DC;
  --marigold:   #D4930D;
  --charcoal:   #191613;
  --vermillion: #C84B31;
  --haldi:      #D4A030;
  --sand:       #B8A88E;
  --soot:       #231F1B;

  --radius: 28px;
  --peek: 38px;

  --out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
  --smooth:    cubic-bezier(0.4, 0, 0.2, 1);
}


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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: auto;           /* smooth is set by JS only for programmatic nav */
}

body {
  font-family: 'Newsreader', Georgia, serif;
  background: var(--charcoal);
  color: var(--ivory);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}


/* ═══════════════════════════════════════
   CARD SYSTEM — sticky stacking
   ═══════════════════════════════════════

   Each .card is:
     position: sticky; top: 0;
     height: 100svh;
     z-index escalates per card.

   The .card is NEVER transformed.
   The .panel inside it is the visual surface
   that gets scale + dim treatment.   

   ═══════════════════════════════════════ */

.card {
  position: sticky;
  top: 0;
  height: 100svh;
  z-index: 1;
  /* NO overflow:hidden on the card itself — just on the panel */
}

/* z-index stacking — later cards on top */
.card--hero { z-index: 1; margin-bottom: calc(-1 * var(--peek)); }
.card--wed  { z-index: 2; }
.card--eve  { z-index: 3; }
.card--stay { z-index: 4; }
.card--conn { z-index: 5; }


/* ═══════════════════════════════════════
   PANEL — the visual card surface
   ═══════════════════════════════════════ */
.panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transform-origin: top center;
  /* GPU layer for scale/opacity animations */
  will-change: transform, opacity;
  /* Smooth CSS transition for scale changes driven by JS classes or CSS scroll */
  transition: none; /* JS handles this via rAF for 0-latency */
}

/* Rounded top for non-hero cards */
.panel--rounded {
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow:
    0 -10px 40px rgba(25,22,19,0.22),
    0 -2px 8px rgba(25,22,19,0.08);
}

/* Section colors */
.panel--ivory   { background: var(--ivory);   color: var(--charcoal); }
.panel--sindoor { background: var(--sindoor); color: var(--ivory); }
.panel--teal    { background: var(--teal);    color: var(--ivory); }
.panel--cream   { background: var(--cream);   color: var(--charcoal); }
.panel--gold    { background: var(--marigold); color: var(--charcoal); }


/* ═══════════════════════════════════════
   DIM OVERLAY — darkens card underneath
   ═══════════════════════════════════════ */
.panel__dim {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  z-index: 8;
  pointer-events: none;
  will-change: opacity;
}


/* ═══════════════════════════════════════
   GRAIN — analog film texture
   ═══════════════════════════════════════ */
.grain {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px;
}


/* ═══════════════════════════════════════
   RANGOLI DOT PATTERNS
   ═══════════════════════════════════════ */
.rangoli {
  position: absolute;
  pointer-events: none;
  z-index: 2;
}

.rangoli--tr {
  top: -20px; right: -20px;
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(212,147,13,0.18) 2px, transparent 2px) 0 0 / 20px 20px;
  opacity: 0.6;
  border-radius: 50%;
}

.rangoli--bl {
  bottom: calc(var(--peek) + 2rem); left: -30px;
  width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(200,75,49,0.1) 1.5px, transparent 1.5px) 0 0 / 16px 16px;
  opacity: 0.5;
  border-radius: 50%;
}

.rangoli--s1 {
  bottom: 2rem; right: 1rem;
  width: 120px; height: 160px;
  background: radial-gradient(circle, rgba(253,245,230,0.07) 1.5px, transparent 1.5px) 0 0 / 16px 16px;
}

.rangoli--s2 {
  top: calc(var(--radius) + 1rem); left: 1rem;
  width: 100px; height: 100px;
  background: radial-gradient(circle, rgba(253,245,230,0.055) 1.5px, transparent 1.5px) 0 0 / 14px 14px;
}

.rangoli--s3 {
  bottom: 1.5rem; left: 1.5rem;
  width: 140px; height: 70px;
  background: radial-gradient(circle, rgba(200,75,49,0.12) 2px, transparent 2px) 0 0 / 18px 18px;
}


/* ═══════════════════════════════════════
   TOP-EDGE LIP — material depth line
   ═══════════════════════════════════════ */
.panel--rounded::after {
  content: '';
  position: absolute;
  top: 0;
  left: var(--radius);
  right: var(--radius);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08) 20%, rgba(255,255,255,0.08) 80%, transparent);
  z-index: 9;
  pointer-events: none;
}

.panel--cream::after,
.panel--gold::after {
  background: linear-gradient(90deg, transparent, rgba(0,0,0,0.04) 20%, rgba(0,0,0,0.04) 80%, transparent);
}


/* ═══════════════════════════════════════
   BADGE — ONR pill at hero top
   ═══════════════════════════════════════ */
.badge {
  position: absolute;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--charcoal);
  background: var(--ivory);
  padding: 0.45rem 0.95rem;
  border-radius: 100px;
  box-shadow: 0 2px 16px rgba(25,22,19,0.1);
}


/* ═══════════════════════════════════════
   CARD BODY — content positioning
   ═══════════════════════════════════════ */
.card__body {
  position: relative;
  z-index: 5;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4rem 1.5rem;
}

.card__body--conn {
  padding-bottom: 6.5rem;
}

.content {
  max-width: 520px;
  width: 100%;
}

.content--dark { color: var(--charcoal); }


/* ═══════════════════════════════════════
   HERO TYPOGRAPHY
   ═══════════════════════════════════════ */
.hero {
  padding-top: 5rem;
  justify-content: center;
}

.hero__content { max-width: 520px; width: 100%; }

.hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2.8rem;
}

.hero__loc {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--sand);
}

.hero__loc svg { color: var(--vermillion); }

.hero__stars {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--marigold);
  padding: 0.35rem 0.85rem;
  border: 1.5px solid rgba(212,147,13,0.35);
  border-radius: 100px;
}

.hero__stars svg { color: var(--marigold); }

/* H1 — three-line hero statement */
h1 { margin-bottom: 2.5rem; }

.h1__line {
  display: block;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-optical-sizing: auto;
  font-size: clamp(3rem, 11vw, 7rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: var(--charcoal);
}

.h1__accent {
  color: var(--vermillion);
  font-weight: 400;
  font-style: italic;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(3.4rem, 12.5vw, 8.5rem);
  letter-spacing: -0.02em;
  line-height: 0.93;
}

.hero__sub {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 400;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sand);
}


/* ═══════════════════════════════════════
   SECTION TAG — "01 ─── WEDDINGS"
   ═══════════════════════════════════════ */
.tag {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}

.tag__num {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: rgba(253,245,230,0.35);
}

.tag__rule {
  display: block;
  width: 28px;
  height: 2px;
  background: var(--vermillion);
}

.tag__name {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--vermillion);
}

/* Dark text variant */
.tag--dark .tag__num  { color: var(--sand); }
.tag--dark .tag__name { color: var(--vermillion); }
.tag--dark .tag__rule { background: var(--vermillion); }

/* Gold bg variant */
.tag--gold .tag__num  { color: rgba(25,22,19,0.3); }
.tag--gold .tag__name { color: var(--sindoor); }
.tag--gold .tag__rule { background: var(--sindoor); }


/* ═══════════════════════════════════════
   SECTION BODY TYPOGRAPHY
   ═══════════════════════════════════════ */
h2 {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 800;
  font-size: clamp(2.2rem, 8vw, 4.2rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.2rem;
}

h2 em {
  font-family: 'Newsreader', serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.15em;
}

/* Per-section italic accent colors */
.card--wed h2 em  { color: var(--haldi); }
.card--eve h2 em  { color: var(--haldi); }
.card--stay h2 em { color: var(--vermillion); }
.card--conn h2 em { font-family: 'Newsreader', serif; color: var(--sindoor); }

.desc {
  font-family: 'Newsreader', serif;
  font-size: 0.95rem;
  line-height: 1.85;
  opacity: 0.72;
  margin-bottom: 1.4rem;
  max-width: 480px;
}


/* ═══════════════════════════════════════
   FEATURE LIST
   ═══════════════════════════════════════ */
.feat {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.feat li {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  opacity: 0.72;
}

.feat__gem {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  color: var(--haldi);
}

.card--stay .feat__gem { color: var(--vermillion); }


/* ═══════════════════════════════════════
   CONNECT — note text
   ═══════════════════════════════════════ */
.conn__note {
  font-family: 'Newsreader', serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.7;
  opacity: 0.55;
  margin-top: 0.5rem;
}


/* ═══════════════════════════════════════
   DOT NAV — right edge diamonds
   ═══════════════════════════════════════ */
.dots {
  position: fixed;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  opacity: 0;
  transition: opacity 0.5s var(--smooth);
  pointer-events: none;
}

.dots--visible {
  opacity: 1;
  pointer-events: auto;
}

/* Thread line */
.dots__track {
  position: absolute;
  top: 2px;
  bottom: 2px;
  left: 50%;
  width: 1px;
  background: rgba(255,255,255,0.08);
  transform: translateX(-50%);
  z-index: -1;
  transition: background 0.4s var(--smooth);
}

.dots--light .dots__track {
  background: rgba(25,22,19,0.06);
}

.dots__dot {
  width: 7px;
  height: 7px;
  border: 1.5px solid rgba(212,160,48,0.35);
  background: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  border-radius: 50%;
  transition: all 0.35s var(--spring);
}

.dots__dot:hover {
  border-color: rgba(212,160,48,0.6);
}

.dots__dot--active {
  background: var(--vermillion);
  border-color: var(--vermillion);
  transform: scale(1.35);
  box-shadow: 0 0 8px rgba(200,75,49,0.3);
}

/* Light section dots */
.dots--light .dots__dot {
  border-color: rgba(25,22,19,0.15);
}

.dots--light .dots__dot--active {
  background: var(--sindoor);
  border-color: var(--sindoor);
  box-shadow: 0 0 8px rgba(107,29,42,0.2);
}


/* ═══════════════════════════════════════
   MOBILE BOTTOM BAR
   ═══════════════════════════════════════ */
.mbar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: 0.85rem 1rem max(0.85rem, env(safe-area-inset-bottom));
  pointer-events: none;
  transform: translateY(120%);
  transition: transform 0.55s var(--spring);
}

.mbar--show {
  transform: translateY(0);
}

.mbar__pill {
  display: flex;
  align-items: center;
  background: rgba(20,18,16,0.88);
  backdrop-filter: saturate(180%) blur(28px);
  -webkit-backdrop-filter: saturate(180%) blur(28px);
  border-radius: 100px;
  max-width: 380px;
  margin: 0 auto;
  box-shadow:
    0 8px 32px rgba(0,0,0,0.35),
    0 2px 8px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.08);
  pointer-events: auto;
  overflow: hidden;
}

.mbar__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 1rem;
  color: var(--ivory);
  text-decoration: none;
  font-family: 'Bricolage Grotesque', sans-serif;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  transition: background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.mbar__btn:active {
  background: rgba(255,255,255,0.08);
}

.mbar__btn--wa { color: #34d399; }

.mbar__sep {
  width: 1px;
  height: 22px;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}


/* ═══════════════════════════════════════
   ENTRANCE ANIMATIONS
   ═══════════════════════════════════════ */

/* Hero entrance — immediate, staggered */
.hero__content > * {
  opacity: 0;
  transform: translateY(28px);
  animation: a-rise 0.8s var(--out-expo) forwards;
}
.hero__content > *:nth-child(1) { animation-delay: 0.05s; }
.hero__content > *:nth-child(2) { animation-delay: 0.18s; }
.hero__content > *:nth-child(3) { animation-delay: 0.32s; }

@keyframes a-rise {
  to { opacity: 1; transform: translateY(0); }
}

/* Badge drop-in */
.badge {
  opacity: 0;
  transform: translateX(-50%) translateY(-16px);
  animation: a-badge 0.6s var(--out-expo) 0.1s forwards;
}

@keyframes a-badge {
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Section content — triggered by .is-visible via JS */
.card:not(.card--hero) .tag,
.card:not(.card--hero) h2,
.card:not(.card--hero) .desc,
.card:not(.card--hero) .feat,
.card:not(.card--hero) .conn__note {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s var(--out-expo),
    transform 0.7s var(--out-expo);
}

.card:not(.card--hero).is-visible .tag {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.06s;
}

.card:not(.card--hero).is-visible h2 {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.14s;
}

.card:not(.card--hero).is-visible .desc {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.22s;
}

.card:not(.card--hero).is-visible .feat {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.3s;
}

.card:not(.card--hero).is-visible .conn__note {
  opacity: 1; transform: translateY(0);
  transition-delay: 0.22s;
}


/* ═══════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════ */
@media (min-width: 768px) {
  :root {
    --radius: 32px;
    --peek: 42px;
  }
  .card__body { padding: 4rem 3rem; }
  .hero { padding-top: 5.5rem; }
  .content { max-width: 560px; }
  .card__body--conn { padding-bottom: 4rem; }
  .mbar__pill { max-width: 340px; }
  .dots { right: 22px; }
}

@media (min-width: 1080px) {
  :root {
    --radius: 36px;
    --peek: 48px;
  }
  .card__body { padding: 4.5rem; }
  .content { max-width: 600px; }
  .h1__line   { font-size: 6.5rem; }
  .h1__accent { font-size: 8rem; }
  h2          { font-size: 3.8rem; }
}


/* ═══════════════════════════════════════
   HERO BACKGROUND 
   ═══════════════════════════════════════ */
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 80%;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(25,22,19,0.1) 0%, rgba(25,22,19,0.5) 40%, rgba(25,22,19,0.95) 100%);
}

.badge--dark {
  background: rgba(20,18,16,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--ivory);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: none;
}

/* ═══════════════════════════════════════
   IMAGE GALLERY — Horizontal Snapping
   ═══════════════════════════════════════ */
.gallery {
  display: flex;
  gap: 1.2rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Firefox */
  padding: 0.5rem 1.5rem 1.5rem 1.5rem;
  margin: 1.5rem -1.5rem 0 -1.5rem; /* Break out of content width */
  -webkit-overflow-scrolling: touch;
}

.gallery::-webkit-scrollbar {
  display: none;
}

.gallery__item {
  flex: 0 0 78%; /* Shows a peek of the next image */
  scroll-snap-align: center;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4/5; /* Portrait orientation works beautifully on mobile */
  transform: scale(0.92);
  opacity: 0.5;
  transition: transform 0.6s var(--out-expo), opacity 0.6s var(--out-expo), box-shadow 0.6s var(--out-expo);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  background: rgba(0,0,0,0.1);
}

.gallery__item.is-active {
  transform: scale(1);
  opacity: 1;
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}

.gallery__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}


/* ═══════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
