/* =====================================================================
   Mariam & Ahmed — wedding invitation
   Custom styles. Tailwind utility classes are generated by the
   Tailwind CDN script referenced in index.html.
   ===================================================================== */

/* Base Reset & Rich Burgundy Bokeh Floral Backdrop */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: #2d0811;
  color: #fdfbf7;
  font-family: 'Tajawal', sans-serif;
  overflow-x: hidden;
}

/* Keep the invitation page still while the envelope is closed */
body.scroll-locked {
  position: fixed;
  inset: 0;
  width: 100%;
  overflow: hidden;
  touch-action: none;
}

/* Multi-layered Blurred Deep Burgundy Rose & Bokeh Background */
.burgundy-floral-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 18% 22%, rgba(152, 34, 58, 0.55) 0%, transparent 45%),
    radial-gradient(circle at 82% 28%, rgba(114, 18, 39, 0.65) 0%, transparent 50%),
    radial-gradient(circle at 50% 65%, rgba(138, 28, 50, 0.45) 0%, transparent 55%),
    radial-gradient(circle at 20% 85%, rgba(78, 12, 26, 0.85) 0%, transparent 50%),
    radial-gradient(circle at 85% 88%, rgba(125, 22, 44, 0.5) 0%, transparent 48%),
    linear-gradient(160deg, #3c0b17 0%, #27060e 45%, #460e1b 78%, #21050b 100%);
}

/* Soft Organic Floral Petal & Bokeh Orbs */
.bokeh-orb {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  filter: blur(28px);
  animation: floatSlow 14s ease-in-out infinite alternate;
}

@keyframes floatSlow {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-22px) scale(1.06); }
}

/* Cotton Paper Texture Effect */
.cotton-paper {
  background-color: #f9f5ed;
  background-image:
    radial-gradient(rgba(110, 75, 65, 0.045) 1px, transparent 0),
    radial-gradient(rgba(130, 90, 75, 0.035) 1px, transparent 0),
    linear-gradient(135deg, rgba(255,255,255,0.65) 0%, rgba(236,226,210,0.45) 100%);
  background-size: 22px 22px, 31px 31px, 100% 100%;
  background-position: 0 0, 11px 13px, 0 0;
}

/* 3D Envelope Opening Scene */
.envelope-perspective {
  perspective: 1400px;
}

.envelope-wrapper {
  position: relative;
  width: min(88vw, 370px);
  height: min(56vw, 236px);
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.envelope-wrapper:hover {
  transform: translateY(-4px) scale(1.015);
}

.envelope-flap {
  transform-origin: top center;
  transition: transform 0.95s cubic-bezier(0.4, 0, 0.2, 1), z-index 0.3s ease;
  transform-style: preserve-3d;
  z-index: 30;
}

.envelope-wrapper.opened .envelope-flap {
  transform: rotateX(180deg);
  z-index: 5;
}

.wax-seal-btn {
  transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.45s ease;
}

.envelope-wrapper.opened .wax-seal-btn {
  transform: translate(-50%, -50%) scale(0.4) rotate(-25deg);
  opacity: 0;
  pointer-events: none;
}

.envelope-card-peek {
  transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.35s;
}

.envelope-wrapper.opened .envelope-card-peek {
  transform: translateY(-58px);
}

/* Hero Overlay Exit Transition */
#hero-overlay {
  transition: opacity 0.95s ease, visibility 0.95s ease, transform 0.95s cubic-bezier(0.22, 1, 0.36, 1);
}

#hero-overlay.hidden-hero {
  opacity: 0;
  visibility: hidden;
  transform: scale(1.06);
  pointer-events: none;
}

/* Main Content Reveal */
#main-invitation {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s ease 0.25s, transform 1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s;
}

#main-invitation.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Scroll Reveal Animations */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.85s ease, transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* Pulse Subtle Prompt */
@keyframes pulseGentle {
  0%, 100% { opacity: 0.78; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.pulse-prompt {
  animation: pulseGentle 2.6s ease-in-out infinite;
}

/* Transparent design.png lace trim, angled like the original ribbon */
.lace-photo {
  width: 100%;
  height: auto;
  transform: rotate(-18deg);
}

/* Phones: widen the lace past the edges so it reads as a full-size ribbon */
@media (max-width: 639px) {
  .lace-photo {
    width: 155%;
    max-width: none;
    margin-left: -27.5%;
    margin-right: -27.5%;
  }
}

/* Scroll Banner 3D Curls */
.scroll-curl-left {
  background: linear-gradient(90deg, #cbb89d 0%, #f6efe2 38%, #e4d4bc 78%, #baa384 100%);
  box-shadow: inset -4px 0 8px rgba(65, 35, 25, 0.25), -6px 8px 16px rgba(15, 2, 5, 0.45);
}

.scroll-curl-right {
  background: linear-gradient(270deg, #cbb89d 0%, #f6efe2 38%, #e4d4bc 78%, #baa384 100%);
  box-shadow: inset 4px 0 8px rgba(65, 35, 25, 0.25), 6px 8px 16px rgba(15, 2, 5, 0.45);
}

.scroll-body {
  background: linear-gradient(180deg, #efe4d2 0%, #faf5eb 18%, #f8f2e6 82%, #e6d6be 100%);
  box-shadow: 0 14px 28px rgba(18, 2, 6, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: #23050c;
}
::-webkit-scrollbar-thumb {
  background: #7b1a30;
  border-radius: 9999px;
}
