/* ======================================================
   TEMA CP 005 - SCROLL-LOCKED ENGINE WITH RE-TRIGGERING ANIMATIONS
   ====================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;1,400&family=Cinzel+Decorative:wght@400;700&family=Cinzel:wght@400;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=Italianno&family=Montserrat:wght@300;400;500;600&display=swap');

:root {
  --font-title: 'Cinzel', 'Cormorant Garamond', serif;
  --font-serif: 'Cormorant Garamond', serif;
  --font-script: 'Italianno', cursive;
  --font-decorative: 'Cinzel Decorative', serif;
  --font-sans: 'Cabin', 'Montserrat', sans-serif;

  --color-bg-dark: #0d0d0d;
  --color-card-beige: #F0EEEA;
  --color-border-warm: #B9B6B0;
  --color-btn-olive: #999786;
  --color-text-dark: #222222;
  --color-text-muted: #636363;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  background-color: #050505;
  font-family: var(--font-sans);
  color: #ffffff;
}

/* PRELOADER INITIALS OVERLAY */
#cp005-preloader {
  position: fixed;
  inset: 0;
  background-color: #050505;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 1.8s cubic-bezier(0.16, 1, 0.3, 1), visibility 1.8s ease;
}

#cp005-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.preloader-content {
  text-align: center;
  color: #ffffff;
}

.preloader-monogram {
  font-family: var(--font-title);
  font-size: 84px;
  font-weight: 400;
  line-height: 1;
  margin-bottom: 16px;
  color: #ffffff;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.preloader-monogram .mono-letter {
  display: inline-block;
  opacity: 0;
  will-change: opacity, transform;
}

.preloader-monogram .mono-letter.letter-left {
  transform: translateX(-45px) scale(0.85);
  animation: letterSlideLeft 2.2s cubic-bezier(0.12, 1, 0.2, 1) 0.3s forwards;
}

.preloader-monogram .mono-letter.letter-right {
  transform: translateX(45px) scale(0.85);
  animation: letterSlideRight 2.2s cubic-bezier(0.12, 1, 0.2, 1) 1.0s forwards;
}

.preloader-names {
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 16px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  opacity: 0;
  animation: namesExpand 2.4s cubic-bezier(0.12, 1, 0.2, 1) 1.8s forwards;
  will-change: opacity, letter-spacing;
}

@keyframes letterSlideLeft {
  0% { opacity: 0; transform: translateX(-45px) scale(0.85); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes letterSlideRight {
  0% { opacity: 0; transform: translateX(45px) scale(0.85); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes namesExpand {
  0% { opacity: 0; letter-spacing: 20px; }
  100% { opacity: 1; letter-spacing: 5px; }
}

/* DESKTOP SPLIT-SCREEN LAYOUT */
.cp005-desktop-wrapper {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Left Pane: Fixed Background on Desktop (>= 992px) */
.cp005-left-pane {
  flex: 1;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4rem 5rem;
  overflow: hidden;
}

.cp005-left-pane::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.65) 100%);
  z-index: 1;
}

.cp005-left-content {
  position: relative;
  z-index: 2;
  color: #ffffff;
}

.cp005-left-sub {
  font-family: var(--font-sans);
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 12px;
  font-weight: 500;
}

.cp005-left-title {
  font-family: var(--font-title);
  font-size: clamp(48px, 6vw, 84px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 2px;
  color: #ffffff;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.cp005-left-title span { display: block; }
.cp005-left-amp {
  font-family: var(--font-script);
  font-size: 0.7em;
  color: rgba(255,255,255,0.7);
  margin: -10px 0;
}

.cp005-left-footer {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: rgba(255,255,255,0.75);
}

.cp005-left-note {
  font-family: var(--font-serif);
  font-size: 13px;
  font-style: italic;
  letter-spacing: 1px;
}

/* Right Pane Container */
.cp005-right-pane {
  width: 440px;
  height: 100vh;
  position: relative;
  background-color: var(--color-bg-dark);
  box-shadow: -10px 0 50px rgba(0,0,0,0.9);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  z-index: 10;
  -webkit-overflow-scrolling: touch;
}

/* SCROLL LOCKED STATE (BEFORE OPEN INVITATION CLICKED) */
.cp005-right-pane.scroll-locked {
  overflow: hidden !important;
  touch-action: none !important;
}

@media (max-width: 991px) {
  .cp005-left-pane { display: none; }
  .cp005-right-pane { width: 100vw; height: 100vh; box-shadow: none; }
}

/* CONTINUOUS SECTIONS */
.cp005-section {
  position: relative;
  min-height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 3rem 1.25rem;
  overflow: hidden;
}

/* PARALLAX ZOOM BACKGROUND */
.bg-cover-zoom {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 1;
  transition: transform 2.8s cubic-bezier(0.12, 1, 0.2, 1);
  will-change: transform;
}

.bg-overlay-dark {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  z-index: 2;
}

.slide-content {
  position: relative;
  z-index: 3;
  width: 100%;
  text-align: center;
}

/* SWIPE UP INDICATOR */
.swipe-indicator {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  pointer-events: none;
  animation: floatBounce 2s infinite;
}
.swipe-indicator i { font-size: 14px; }

@keyframes floatBounce {
  0%, 100% { transform: translate(-50%, 0); opacity: 0.6; }
  50% { transform: translate(-50%, -6px); opacity: 1; }
}

/* MUSIC BUTTON */
.cp005-music-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 99;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transition: all 0.3s ease;
}
.cp005-music-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.35);
}

/* ======================================================
   TEXT & ELEMENT ANIMATIONS (TRIGGERED WHEN IN VIEWPORT)
   ====================================================== */

/* 1. TRACKING IN */
.anim-track-in {
  opacity: 0;
  letter-spacing: 20px;
  transition: opacity 2.5s cubic-bezier(0.12, 1, 0.2, 1), letter-spacing 3.2s cubic-bezier(0.12, 1, 0.2, 1);
  will-change: opacity, letter-spacing;
}
.is-visible .anim-track-in {
  opacity: 1;
  letter-spacing: 2px;
}

/* 2. DROP DOWN */
.anim-drop-down {
  opacity: 0;
  transform: translateY(-60px);
  transition: opacity 2.2s cubic-bezier(0.12, 1, 0.2, 1), transform 2.8s cubic-bezier(0.12, 1, 0.2, 1);
  will-change: opacity, transform;
}
.is-visible .anim-drop-down {
  opacity: 1;
  transform: translateY(0);
}

/* 3. SLIDE UP */
.anim-slide-up {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 2.2s cubic-bezier(0.12, 1, 0.2, 1), transform 2.8s cubic-bezier(0.12, 1, 0.2, 1);
  will-change: opacity, transform;
}
.is-visible .anim-slide-up {
  opacity: 1;
  transform: translateY(0);
}

/* 4. ZOOM IN */
.anim-zoom-in {
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 2.2s cubic-bezier(0.12, 1, 0.2, 1), transform 2.8s cubic-bezier(0.12, 1, 0.2, 1);
  will-change: opacity, transform;
}
.is-visible .anim-zoom-in {
  opacity: 1;
  transform: scale(1);
}

/* 5. POLAROID TILT DROP */
.anim-polaroid-drop {
  opacity: 0;
  transform: translateY(-80px) rotate(-12deg);
  transition: opacity 2.5s cubic-bezier(0.12, 1, 0.2, 1), transform 3.2s cubic-bezier(0.12, 1, 0.2, 1);
  will-change: opacity, transform;
}
.is-visible .anim-polaroid-drop {
  opacity: 1;
  transform: translateY(0) rotate(-3deg);
}

/* STAGGERED DELAY STEPS */
.delay-1 { transition-delay: 0.3s !important; }
.delay-2 { transition-delay: 0.7s !important; }
.delay-3 { transition-delay: 1.1s !important; }
.delay-4 { transition-delay: 1.5s !important; }

/* TYPOGRAPHY & SECTIONS */
.cover-sub {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 2px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 6px;
}
.cover-names {
  font-family: var(--font-title);
  font-size: 32px;
  font-weight: 400;
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.cover-date-text {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.85);
  margin-bottom: 40px;
}
.cover-guest-label {
  font-family: var(--font-serif);
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.cover-guest-name {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 25px;
}
.btn-open-cp005 {
  display: inline-block;
  background-color: var(--color-btn-olive);
  color: #ffffff;
  padding: 12px 32px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-open-cp005:hover { background-color: #838171; }

.quote-content {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.85;
  color: #ffffff;
  margin-bottom: 20px;
  font-weight: 400;
}
.quote-author {
  font-family: var(--font-serif);
  font-size: 14px;
  font-style: italic;
  color: #E2D9CC;
}

/* GROOM & BRIDE CARDS */
.profile-card-top {
  position: absolute;
  top: 4rem;
  left: 1.5rem;
  right: 1.5rem;
  z-index: 3;
}
.profile-card-top.right { text-align: right; }
.profile-card-top.left { text-align: left; }

.groom-name-big {
  font-family: var(--font-title);
  font-size: 44px;
  letter-spacing: 2px;
  font-weight: 400;
  color: #222222;
  line-height: 1;
  margin-bottom: 6px;
}
.groom-name-big.white { color: #ffffff; }

.groom-full-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: #222222;
  margin-bottom: 12px;
}
.groom-full-name.white { color: #f0f0f0; }

.groom-parents {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.6;
  color: #555555;
  margin-bottom: 16px;
}
.groom-parents.white { color: #cccccc; }

.ig-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background-color: var(--color-btn-olive);
  color: #ffffff;
  padding: 8px 18px;
  border-radius: 14px;
  font-size: 13px;
  text-decoration: none;
  font-family: var(--font-sans);
}

/* POLAROID & TIMELINE */
.script-heading {
  font-family: var(--font-script);
  font-size: 56px;
  color: #ffffff;
  margin-bottom: 20px;
  font-weight: 400;
  line-height: 1;
}

.polaroid-frame {
  background: var(--color-card-beige);
  padding: 12px 12px 24px 12px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.5);
  width: 250px;
  margin: 0 auto 30px auto;
  position: relative;
}

.tape-top-right {
  position: absolute;
  top: -12px;
  right: -10px;
  width: 60px;
  height: 22px;
  background: rgba(220, 210, 195, 0.7);
  transform: rotate(25deg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  z-index: 5;
}
.tape-bottom-left {
  position: absolute;
  bottom: -10px;
  left: -12px;
  width: 60px;
  height: 22px;
  background: rgba(220, 210, 195, 0.7);
  transform: rotate(-30deg);
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  z-index: 5;
}
.flower-branch-art {
  position: absolute;
  left: -35px;
  bottom: 10px;
  width: 80px;
  z-index: 6;
  pointer-events: none;
}

.polaroid-frame img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  display: block;
  margin-bottom: 12px;
}
.polaroid-caption-text {
  font-family: var(--font-serif);
  font-size: 14px;
  color: #222222;
  letter-spacing: 1px;
}

.timeline-list {
  position: relative;
  padding-left: 60px;
  text-align: left;
  width: 100%;
  max-height: 65vh;
  overflow-y: auto;
}
.timeline-vertical-line {
  position: absolute;
  left: 45px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: rgba(255,255,255,0.35);
}
.timeline-row {
  position: relative;
  margin-bottom: 24px;
}
.timeline-date-label {
  position: absolute;
  left: -55px;
  top: 0;
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
}
.timeline-date-label::after { content: '—'; margin-left: 4px; }
.timeline-body-text {
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.65;
  color: rgba(255,255,255,0.85);
}

/* GALLERY ("OUR MOMENTS") */
.moments-grid-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  max-height: 68vh;
  overflow-y: auto;
  padding: 5px;
}
.moments-grid-item {
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  background: #111;
  aspect-ratio: 4/5;
}
.moments-grid-item.full-width {
  grid-column: span 2;
  aspect-ratio: 16/9;
}
.moments-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}
.moments-grid-item:hover img {
  transform: scale(1.06);
}

/* WISHES SECTION */
.wishes-card-box {
  background: rgba(0,0,0,0.45);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 16px;
  text-align: left;
  max-height: 52vh;
  overflow-y: auto;
  width: 100%;
  margin-bottom: 12px;
}
.wishes-card-box::-webkit-scrollbar { width: 5px; }
.wishes-card-box::-webkit-scrollbar-track { background: rgba(255,255,255,0.05); }
.wishes-card-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.4); border-radius: 3px; }

.wish-item-row {
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.wish-item-row:last-child { border-bottom: none; }
.wish-author-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 4px;
}
.wish-text-content {
  font-family: var(--font-serif);
  font-size: 13px;
  color: rgba(255,255,255,0.9);
  line-height: 1.5;
  margin-bottom: 4px;
}
.wish-timestamp {
  font-family: var(--font-serif);
  font-size: 10px;
  font-style: italic;
  color: rgba(255,255,255,0.45);
}

.wishes-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}
.btn-wish-nav {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 10px;
  cursor: pointer;
}

/* CARDS (MATRIMONY & RECEPTION) */
.cream-event-card {
  background-color: var(--color-card-beige);
  color: var(--color-text-dark);
  border-radius: 2px;
  padding: 32px 22px;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 15px 40px rgba(0,0,0,0.6);
  text-align: center;
}
.card-icon-svg { width: 44px; height: 44px; margin: 0 auto 12px auto; }
.card-event-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 400;
  color: #222222;
  margin-bottom: 20px;
}
.card-date-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.card-h-line { flex: 1; height: 1px; background-color: #222222; }
.card-day-txt, .card-time-txt {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.card-big-date {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 400;
  line-height: 1;
}
.card-year-txt {
  font-family: var(--font-serif);
  font-size: 12px;
  margin-bottom: 20px;
}
.card-venue-title {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.card-venue-sub {
  font-family: var(--font-serif);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.card-venue-addr {
  font-family: var(--font-serif);
  font-size: 11px;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 20px;
}
.btn-gmaps-dark {
  display: inline-block;
  background-color: #222222;
  color: #ffffff;
  padding: 10px 26px;
  border-radius: 20px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
}

/* COUNTDOWN BOX */
.cd-wrapper { margin-bottom: 20px; }
.cd-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 15px;
}
.cd-cell span {
  display: block;
  font-family: var(--font-serif);
  font-size: 34px;
  line-height: 1;
}
.cd-cell label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: rgba(255,255,255,0.7);
}

/* DRESSCODE & GIFT */
.color-swatches-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 32px 0;
}
.swatch-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
.wedding-rings-svg { width: 130px; margin: 0 auto; opacity: 0.85; }
.gift-envelope-svg { width: 90px; margin: 0 auto 15px auto; }
.gift-msg-text {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255,255,255,0.9);
  max-width: 290px;
  margin: 0 auto 25px auto;
}
.btn-pill-cream {
  display: inline-block;
  background-color: #E2DBD0;
  color: #222222;
  padding: 12px 32px;
  border-radius: 25px;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

/* MODAL REKENING */
.cp005-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cp005-modal.active { display: flex; }
.cp005-modal-card {
  background: var(--color-card-beige);
  color: #222222;
  border-radius: 8px;
  padding: 25px 20px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
