/* ==========================================================================
   Sawsan & Ahmad - Digital Wedding Invitation Stylesheet
   Design Tokens, Typography, Animations, 3D Envelope & Responsive Layout
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Aref+Ruqaa:wght@400;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;1,400&family=Great+Vibes&display=swap');

:root {
  --font-amiri: 'Amiri', serif;
  --font-ruqaa: 'Aref Ruqaa', serif;
  --font-cormorant: 'Cormorant Garamond', serif;
  --font-vibes: 'Great Vibes', cursive;
  
  --color-rose-primary: #c9899a;
  --color-rose-accent: #d7aeb4;
  --color-rose-dark: #bd7d8c;
  --color-rose-deep: #a5727e;
  --color-text-main: #2a2320;
  --color-text-body: #4a4038;
  --color-text-muted: #8a7861;
  --color-text-gold: #6d5a4c;
  
  --color-bg-light: #fffdf9;
  --color-bg-card: #f6ecdc;
  --color-border: #ecd8d6;
  --color-error: #c0575f;
  
  --bg-gradient-page: radial-gradient(120% 60% at 50% 0%, #fdf8f1 0%, #f4ebde 55%, #efe4d3 100%);
  --bg-gradient-overlay: radial-gradient(120% 90% at 50% 30%, #fdf8f1, #f3e9dc);
  --bg-gradient-btn: linear-gradient(180deg, #d7aeb4, #bd7d8c);
  --bg-gradient-btn-hover: linear-gradient(180deg, #cf98a1, #a86372);
  --bg-gradient-seal: radial-gradient(circle at 35% 30%, #d7aeb4, #bd7d8c);
}

/* Base resets & typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
}

html {
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
  direction: rtl;
}

body {
  min-height: 100%;
  background: var(--bg-gradient-page) fixed;
  font-family: var(--font-amiri);
  color: var(--color-text-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes revealUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-9px); }
}

@keyframes spinSlow {
  to { transform: rotate(360deg); }
}

@keyframes sealPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 0 0 rgba(138, 21, 27, 0.45);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 0 0 0 12px rgba(138, 21, 27, 0);
  }
}

@keyframes bob {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* Progress bar */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  z-index: 55;
  background: linear-gradient(90deg, #d7aeb4, #c9899a);
  box-shadow: 0 0 8px rgba(201, 137, 154, 0.6);
  transition: width 0.12s linear;
  pointer-events: none;
}

/* Main Container & Sections */
.main-wrapper {
  position: relative;
  width: 100%;
}

.scene-section {
  min-height: 100vh;
  scroll-snap-align: start;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9vh 7vw;
  box-sizing: border-box;
  position: relative;
}

.scene-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.scene-content[data-reveal] {
  opacity: 0;
}

.scene-content.revealed {
  animation: revealUp 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Decorative Divider */
.rose-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 22px 0;
}

.rose-divider .line {
  height: 1px;
  width: 46px;
}

.rose-divider .line.left {
  background: linear-gradient(90deg, transparent, #c9899a);
}

.rose-divider .line.right {
  background: linear-gradient(90deg, #c9899a, transparent);
}

.rose-divider .flower {
  color: #c9899a;
  font-size: 15px;
}

/* Scene 1 - Hero */
.hero-flex {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(30px, 5vw, 76px);
  width: 100%;
  max-width: 1040px;
}

.hero-img-col {
  flex: 1 1 360px;
  max-width: 500px;
  display: flex;
  justify-content: center;
}

.hero-img {
  width: 100%;
  max-width: 500px;
  height: min(66vh, 600px);
  object-fit: cover;
  object-position: center 32%;
  border-radius: 220px 220px 16px 16px;
  border: 1px solid #e6d3d0;
  box-shadow: 0 26px 56px rgba(150, 105, 85, 0.24);
}

.hero-text-col {
  flex: 1 1 320px;
  max-width: 400px;
  text-align: center;
}

.welcome-label {
  font-family: var(--font-cormorant);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--color-rose-deep);
  padding-left: 0.42em;
  direction: ltr;
}

.welcome-sub {
  font-family: var(--font-amiri);
  font-size: 18px;
  color: var(--color-text-muted);
  margin-top: 6px;
}

.groom-name, .bride-name {
  font-family: var(--font-ruqaa);
  font-weight: 700;
  font-size: clamp(32px, 4.7vw, 48px);
  color: var(--color-text-main);
  line-height: 1.35;
}

.ampersand {
  font-family: var(--font-vibes);
  font-size: 38px;
  color: var(--color-rose-primary);
  margin: 2px 0;
  direction: ltr;
}

.invite-lead {
  font-family: var(--font-amiri);
  font-size: 19px;
  color: var(--color-text-gold);
  margin-top: 20px;
  line-height: 1.9;
}

/* Scene 2 - Verse */
.verse-container {
  max-width: 720px;
  text-align: center;
}

.floating-flower {
  color: var(--color-rose-primary);
  font-size: 26px;
  animation: floatY 4s ease-in-out infinite;
}

.quran-verse {
  font-family: var(--font-amiri);
  font-size: clamp(24px, 3.5vw, 33px);
  line-height: 2.1;
  color: #4a4038;
  margin-top: 22px;
}

.verse-english {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 21px;
  color: var(--color-text-muted);
  margin-top: 24px;
  line-height: 1.7;
  direction: ltr;
}

/* Scene 3 - Story */
.story-container {
  text-align: center;
  width: 100%;
  max-width: 620px;
}

.section-title-en {
  font-family: var(--font-vibes);
  font-size: 36px;
  color: var(--color-rose-primary);
  direction: ltr;
}

.section-title-ar {
  font-family: var(--font-amiri);
  font-size: 18px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.story-frame {
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 24px auto 0;
  padding: 12px;
  background: var(--color-bg-light);
  border: 1px solid var(--color-border);
  box-shadow: 0 18px 40px rgba(201, 137, 154, 0.16);
}

.story-img {
  display: block;
  width: 100%;
  height: min(54vh, 500px);
  object-fit: cover;
  object-position: center 34%;
}

.story-quote {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 19px;
  color: var(--color-text-muted);
  margin-top: 20px;
  direction: ltr;
}

/* Scene 4 - Save the Date & Countdown */
.save-date-title {
  font-family: var(--font-vibes);
  font-size: clamp(44px, 5.6vw, 60px);
  color: var(--color-rose-primary);
  direction: ltr;
}

.event-date-ar {
  font-family: var(--font-ruqaa);
  font-weight: 700;
  font-size: clamp(38px, 6vw, 62px);
  color: var(--color-text-main);
  margin-top: 20px;
}

.event-time {
  font-family: var(--font-cormorant);
  letter-spacing: 0.14em;
  font-size: clamp(22px, 2.6vw, 27px);
  color: #4a4038;
}

.countdown-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin-top: 42px;
  direction: ltr;
}

.countdown-box {
  width: 100px;
  padding: 24px 8px;
  background: linear-gradient(180deg, #fffdf9, #f6ecdc);
  border: 1px solid #ecd8d6;
  border-radius: 3px;
  text-align: center;
  box-shadow: 0 8px 20px rgba(201, 137, 154, 0.12);
}

.countdown-val {
  font-family: var(--font-cormorant);
  font-weight: 600;
  font-size: 44px;
  color: var(--color-text-main);
  line-height: 1;
}

.countdown-unit-en {
  font-family: var(--font-cormorant);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  color: var(--color-rose-primary);
  margin-top: 10px;
  padding-left: 0.16em;
}

.countdown-unit-ar {
  font-family: var(--font-amiri);
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 3px;
}

/* Scene 5 - Venue */
.venue-container {
  text-align: center;
  width: 100%;
  max-width: 680px;
}

.venue-card {
  margin-top: 22px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 22px 48px rgba(150, 105, 85, 0.26);
}

.venue-img {
  display: block;
  width: 100%;
  height: min(52vh, 430px);
  object-fit: cover;
  object-position: center 28%;
}

.venue-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 16, 13, 0) 45%, rgba(20, 16, 13, 0.78) 100%);
}

.venue-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  color: #fff;
}

.venue-name-en {
  font-family: var(--font-cormorant);
  font-weight: 600;
  letter-spacing: 0.14em;
  font-size: clamp(18px, 3.4vw, 25px);
  white-space: nowrap;
  direction: ltr;
}

.venue-name-ar {
  font-family: var(--font-amiri);
  font-size: 17px;
  margin-top: 2px;
  color: #f0e6d6;
}

.location-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  text-decoration: none;
  border: 1px solid var(--color-rose-primary);
  color: var(--color-rose-deep);
  font-family: var(--font-cormorant);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 2px;
  white-space: nowrap;
  transition: all 0.25s;
}

.location-btn:hover {
  background: var(--color-rose-primary);
  color: #fff;
}

.location-btn:active {
  background: var(--color-rose-deep);
  color: #fff;
  transform: scale(0.97);
}

/* Scene 6 - RSVP */
.rsvp-container {
  text-align: center;
  width: 100%;
  max-width: 640px;
}

.rsvp-title {
  font-family: var(--font-cormorant);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-size: clamp(28px, 3.6vw, 36px);
  color: var(--color-rose-primary);
  padding-left: 0.32em;
  direction: ltr;
}

.rsvp-subtitle {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: clamp(19px, 2.2vw, 22px);
  color: var(--color-text-muted);
  margin-top: 10px;
  line-height: 1.7;
}

.rsvp-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 26px;
}

.rsvp-label {
  font-family: var(--font-cormorant);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  color: var(--color-rose-deep);
  padding-left: 0.2em;
  margin-bottom: 6px;
}

.guest-input {
  width: 330px;
  max-width: 90vw;
  padding: 17px 20px;
  text-align: center;
  box-sizing: border-box;
  font-family: var(--font-amiri);
  font-size: 21px;
  color: var(--color-text-body);
  background: var(--color-bg-light);
  border: 1px solid var(--color-rose-accent);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.guest-input.has-error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(192, 87, 95, 0.14);
}

.rsvp-error-msg {
  font-family: var(--font-amiri);
  font-size: 15px;
  color: var(--color-error);
  margin-top: 8px;
  height: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.rsvp-error-msg.visible {
  opacity: 1;
}

.rsvp-btn-group {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  margin-top: 6px;
}

.rsvp-btn {
  width: 330px;
  max-width: 90vw;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-amiri);
  font-size: 24px;
  padding: 19px 26px;
  border-radius: 2px;
  transition: all 0.25s;
}

.rsvp-btn-yes {
  background: var(--bg-gradient-btn);
  color: #fff;
  box-shadow: 0 10px 24px rgba(189, 125, 140, 0.32);
}

.rsvp-btn-yes:hover {
  background: var(--bg-gradient-btn-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(189, 125, 140, 0.45);
}

.rsvp-btn-yes:active {
  transform: scale(0.96);
}

.rsvp-btn-no {
  background: transparent;
  border: 1px solid var(--color-rose-accent);
  color: var(--color-rose-deep);
}

.rsvp-btn-no:hover {
  background: var(--color-rose-accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(189, 125, 140, 0.35);
}

.rsvp-btn-no:active {
  background: var(--color-rose-dark);
  color: #fff;
  transform: scale(0.96);
}

/* Scene 7 - Closing */
.closing-monogram {
  position: relative;
  width: 78px;
  height: 78px;
  margin: 0 auto;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient-seal);
  border: 2px solid #f0d9cf;
  box-shadow: 0 8px 20px rgba(189, 125, 140, 0.45);
}

.monogram-text {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 30px;
  color: #fff;
  letter-spacing: -3px;
  direction: ltr;
}

.closing-message {
  font-family: var(--font-amiri);
  font-size: 22px;
  color: #4a4038;
  margin-top: 26px;
  line-height: 1.9;
}

.closing-names {
  font-family: var(--font-ruqaa);
  font-weight: 700;
  font-size: 31px;
  color: var(--color-rose-primary);
  margin-top: 18px;
}

.closing-date {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 22px;
  color: #a99a86;
  margin-top: 8px;
  letter-spacing: 0.08em;
  direction: ltr;
}

/* Controls - Music & Scroll Cue */
.music-toggle-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--color-rose-accent);
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(6px);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
  display: none;
  align-items: center;
  justify-content: center;
}

.music-toggle-btn.visible {
  display: flex;
}

.music-note {
  font-size: 18px;
  color: var(--color-rose-primary);
  display: inline-block;
}

.music-note.playing {
  animation: spinSlow 4s linear infinite;
}

.scroll-cue {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 38;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  transition: opacity 0.5s ease;
}

.scroll-cue.visible {
  display: flex;
}

.scroll-cue-text {
  font-family: var(--font-cormorant);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--color-rose-deep);
  direction: ltr;
}

.scroll-cue-arrow {
  color: var(--color-rose-primary);
  font-size: 18px;
  animation: bob 1.8s ease-in-out infinite;
}

/* ==========================================================================
   Envelope Opener Overlay
   ========================================================================== */

.envelope-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 54px;
  background: var(--bg-gradient-overlay);
  cursor: pointer;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.85s ease;
  touch-action: none;
}

.envelope-overlay.gone {
  display: none !important;
}

.envelope-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.corner-flower {
  position: absolute;
  font-size: 42px;
  color: #e2c3c8;
  transition: opacity 0.6s ease;
}

.corner-tl {
  top: 7vh;
  left: 8vw;
  animation: floatY 6s ease-in-out infinite;
}

.corner-br {
  bottom: 7vh;
  right: 8vw;
  animation: floatY 7s ease-in-out infinite;
}

.envelope-top-text {
  font-family: var(--font-amiri);
  font-size: 22px;
  color: #8a6f74;
  letter-spacing: 0.02em;
  text-align: center;
  transition: all 0.5s ease;
}

.invited-label {
  font-family: var(--font-cormorant);
  letter-spacing: 0.36em;
  text-transform: uppercase;
  font-size: 11px;
  color: var(--color-rose-primary);
  padding-left: 0.36em;
  margin-bottom: 8px;
  direction: ltr;
}

.envelope-scene {
  position: relative;
  width: 300px;
  height: 200px;
  perspective: 1000px;
}

.envelope-paper {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 248px;
  height: 186px;
  z-index: 2;
  transform-origin: 50% 100%;
  box-sizing: border-box;
  padding: 26px 18px;
  background: linear-gradient(180deg, #ffffff, #fdf6ef);
  border: 1px solid #efe1d2;
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(120, 80, 60, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transform: translateX(-50%) translateY(0);
  transition: transform 0.85s cubic-bezier(0.5, 0, 0.2, 1);
}

.envelope-paper.lifted {
  transform: translateX(-50%) translateY(-232px);
}

.envelope-paper.grown {
  transform: translateX(-50%) translateY(-30px) scale(3.1);
}

.paper-welcome {
  font-family: var(--font-cormorant);
  letter-spacing: 0.34em;
  text-transform: uppercase;
  font-size: 9px;
  color: var(--color-rose-deep);
  padding-left: 0.34em;
  direction: ltr;
}

.paper-names {
  font-family: var(--font-ruqaa);
  font-weight: 700;
  font-size: 17px;
  color: #6d4a54;
  margin-top: 10px;
  line-height: 1.5;
}

.paper-line {
  width: 34px;
  height: 1px;
  background: var(--color-rose-accent);
  margin: 9px auto;
}

.paper-date {
  font-family: var(--font-cormorant);
  font-style: italic;
  font-size: 12px;
  color: var(--color-rose-deep);
  direction: ltr;
}

.envelope-back {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 6px;
  background: linear-gradient(160deg, #f5ecdd, #ecdcc8);
  box-shadow: 0 34px 70px rgba(120, 80, 55, 0.28);
}

.envelope-front {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 6px;
  background: linear-gradient(135deg, #f8efe3, #e9dbc7);
  clip-path: polygon(0 0, 0 100%, 100% 100%, 100% 0, 50% 62%);
  box-shadow: inset 0 -20px 40px rgba(160, 120, 90, 0.12);
}

.envelope-flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  z-index: 4;
  border-left: 150px solid transparent;
  border-right: 150px solid transparent;
  border-top: 124px solid #f2e7d7;
  transform-origin: 50% 0%;
  backface-visibility: hidden;
  filter: drop-shadow(0 3px 5px rgba(150, 110, 80, 0.18));
  transform: rotateX(0deg);
  transition: transform 0.7s ease, z-index 0s 0.35s;
}

.envelope-flap.opened {
  transform: rotateX(-172deg);
  z-index: 2;
}

.envelope-seal {
  position: absolute;
  left: 50%;
  top: 108px;
  z-index: 5;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient-seal);
  border: 2px solid #f0d9cf;
  box-shadow: 0 5px 14px rgba(189, 125, 140, 0.5);
  opacity: 1;
  transition: opacity 0.3s ease;
  animation: sealPulse 2.4s ease-in-out infinite;
}

.envelope-seal.opened {
  opacity: 0;
  animation: none;
}

.seal-monogram {
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 19px;
  color: #fff;
  letter-spacing: -2px;
  direction: ltr;
}

.envelope-hint {
  font-family: var(--font-amiri);
  font-size: 18px;
  color: #a99a86;
  text-align: center;
  animation: floatY 3s ease-in-out infinite;
  transition: opacity 0.4s ease;
}

.hint-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9b7a3;
  margin: 14px auto 0;
}
