:root {
  --primary-green: #0e472b;
  --gold-accent: #c5a059;
  --bg-light: #faf7f2;
  --text-dark: #27332b;
  --text-muted: #6b776f;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Vazirmatn', sans-serif;
  background-color: #d1cbc1;
  color: var(--text-dark);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  line-height: 2;
}


/* ==================================================
   APP
================================================== */

.app-container {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;

  background-color: var(--bg-light);

  background-image:
    radial-gradient(
      rgba(197, 160, 89, 0.15) 1px,
      transparent 1px
    );

  background-size: 20px 20px;

  position: relative;

  overflow-x: hidden;

  box-shadow:
    0 10px 40px rgba(0, 0, 0, 0.2);
}


/* ==================================================
   PRELOADER
================================================== */

#preloader {
  position: fixed;

  inset: 0;

  width: 100%;
  height: 100%;

  background: var(--bg-light);

  z-index: 999999;

  display: flex;

  justify-content: center;
  align-items: center;

  opacity: 1;

  transition: opacity 0.8s ease;
}

.spinner {
  width: 45px;
  height: 45px;

  border: 2px solid rgba(197, 160, 89, 0.2);

  border-top-color: var(--gold-accent);

  border-radius: 50%;

  animation: spin 1s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}


/* ==================================================
   MUSIC POPUP
================================================== */

.music-popup {
  position: fixed;

  inset: 0;

  width: 100vw;
  height: 100vh;

  z-index: 999998;

  display: flex;

  align-items: center;
  justify-content: center;

  padding: 20px;

  background: rgba(14, 71, 43, 0.52);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 0.5s ease,
    visibility 0.5s ease;
}

.music-popup.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.music-popup-box {
  width: 100%;
  max-width: 350px;

  background: #fffdf8;

  border: 1px solid rgba(197, 160, 89, 0.45);

  border-radius: 20px;

  padding: 30px 22px;

  text-align: center;

  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.3);

  transform: translateY(20px) scale(0.94);

  transition:
    transform 0.5s ease;
}

.music-popup.show .music-popup-box {
  transform: translateY(0) scale(1);
}

.music-icon {
  width: 58px;
  height: 58px;

  margin: 0 auto 15px;

  display: flex;

  align-items: center;
  justify-content: center;

  border-radius: 50%;

  border: 1px solid var(--gold-accent);

  color: var(--gold-accent);

  font-family: 'Amiri', serif;

  font-size: 2rem;

  background: rgba(197, 160, 89, 0.08);
}

.music-popup-box h2 {
  color: var(--primary-green);

  font-family: 'Amiri', serif;

  font-size: 1.5rem;

  margin-bottom: 8px;
}

.music-popup-box p {
  color: var(--text-muted);

  font-size: 0.85rem;

  line-height: 2;

  margin-bottom: 22px;
}

.music-popup-buttons {
  display: flex;

  flex-direction: column;

  gap: 10px;
}

.music-btn {
  width: 100%;

  padding: 12px 15px;

  border-radius: 9px;

  font-family: inherit;

  font-size: 0.85rem;

  cursor: pointer;

  transition: transform 0.2s ease;
}

.music-btn:active {
  transform: scale(0.97);
}

.music-btn-yes {
  border: 1px solid var(--primary-green);

  background: var(--primary-green);

  color: #fff;
}

.music-btn-no {
  border: 1px solid var(--gold-accent);

  background: transparent;

  color: var(--primary-green);
}


/* ==================================================
   ENVELOPE
================================================== */

.envelope-section {
  position: relative;

  width: 100%;

  height: 90vh;

  min-height: 550px;

  perspective: 1200px;

  overflow: hidden;

  background: var(--bg-light);
}

.inner-content {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  opacity: 0;

  transform: scale(0.92);

  transition:
    all 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.3s;

  z-index: 1;

  padding: 20px;
}

.envelope-section.is-open .inner-content {
  opacity: 1;

  transform: scale(1);
}


/* ==================================================
   ENVELOPE DOORS
================================================== */

.env-door {
  position: absolute;

  top: 0;
  bottom: 0;

  width: 50%;

  z-index: 10;

  transition:
    transform 1.5s cubic-bezier(0.65, 0, 0.15, 1);

  transform-style: preserve-3d;

  backface-visibility: hidden;

  overflow: hidden;
}

.door-img {
  width: 100%;
  height: 100%;

  object-fit: cover;

  display: block;
}

.env-door.left {
  left: 0;

  transform-origin: left center;

  box-shadow:
    inset -5px 0 15px rgba(0, 0, 0, 0.2);
}

.env-door.right {
  right: 0;

  transform-origin: right center;

  box-shadow:
    inset 5px 0 15px rgba(0, 0, 0, 0.2);
}

.envelope-section.is-open .env-door.left {
  transform: rotateY(-120deg);
}

.envelope-section.is-open .env-door.right {
  transform: rotateY(120deg);
}


/* ==================================================
   SEAL
================================================== */

.seal-btn {
  position: absolute;

  top: 50%;
  left: 50%;

  transform: translate(-50%, -50%);

  z-index: 20;

  width: 110px;
  height: 110px;

  background: #fbf7ef;

  border: 2px solid var(--gold-accent);

  border-radius: 50%;

  display: flex;

  flex-direction: column;

  align-items: center;
  justify-content: center;

  cursor: pointer;

  color: var(--primary-green);

  box-shadow:
    0 10px 25px rgba(0, 0, 0, 0.3);

  transition: all 0.6s ease;

  animation: pulse 2s infinite alternate;
}

@keyframes pulse {
  0% {
    box-shadow:
      0 5px 15px rgba(0, 0, 0, 0.2);
  }

  100% {
    box-shadow:
      0 15px 30px rgba(0, 0, 0, 0.4);
  }
}

.envelope-section.is-open .seal-btn {
  opacity: 0;

  transform:
    translate(-50%, -50%)
    scale(0.3);

  pointer-events: none;
}


/* ==================================================
   VIDEO
================================================== */

.magic-video {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  object-fit: cover;

  pointer-events: none;

  outline: none;

  border: none;

  z-index: 0;
}


/* ==================================================
   HERO TEXT
================================================== */

.top-welcome-text {
  position: absolute;

  top: 60px;

  left: 50%;

  transform: translateX(-50%);

  width: 100%;

  text-align: center;

  z-index: 5;

  font-size: 0.85rem;

  color: var(--gold-accent);

  font-weight: 500;

  letter-spacing: 1px;

  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.4);

  opacity: 0;

  transition: opacity 1.5s ease;
}

.top-welcome-text.reveal-text {
  opacity: 1;
}

.hero-text-overlay {
  position: relative;

  z-index: 5;

  text-align: center;

  top: -80px;

  opacity: 0;

  transform: translateY(20px);

  transition: all 1.5s ease;
}

.hero-text-overlay.reveal-text {
  opacity: 1;

  transform: translateY(0);
}

.hero-title {
  font-family: 'Vazirmatn', serif;

  font-size: 1rem;

  color: var(--primary-green);

  margin-bottom: 5px;

  font-weight: 700;
}


/* ==================================================
   SCROLL HINT
================================================== */

.scroll-hint {
  position: absolute;

  bottom: 25px;

  left: 50%;

  transform: translateX(-50%);

  display: flex;

  flex-direction: column;

  align-items: center;

  z-index: 10;

  opacity: 0;

  pointer-events: none;

  transition:
    opacity 1.5s ease 1s;
}

.scroll-hint.show-hint {
  opacity: 1;
}

.scroll-hint span {
  font-size: 0.9rem;

  font-weight: 700;

  color: var(--primary-green);

  background: rgba(250, 247, 242, 0.85);

  padding: 4px 14px;

  border-radius: 20px;

  margin-bottom: 5px;

  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.15);
}

.scroll-hint svg {
  width: 28px;
  height: 28px;

  color: var(--primary-green);

  filter:
    drop-shadow(
      0 2px 4px rgba(255, 255, 255, 0.9)
    );

  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(8px);
  }

  60% {
    transform: translateY(4px);
  }
}


/* ==================================================
   SCRATCH TIMER
================================================== */

.scratch-section {
  padding: 30px 16px;

  text-align: center;

  position: relative;
}

.scratch-hint {
  font-size: 0.8rem;

  color: var(--primary-green);

  margin-bottom: 12px;

  font-weight: 500;

  background:
    rgba(197, 160, 89, 0.1);

  display: inline-block;

  padding: 4px 15px;

  border-radius: 20px;
}

.scratch-wrapper {
  position: relative;

  width: 100%;

  max-width: 340px;

  margin: 0 auto;

  border-radius: 12px;

  overflow: hidden;

  box-shadow:
    0 8px 25px rgba(14, 71, 43, 0.15);

  border:
    1px solid rgba(197, 160, 89, 0.4);

  background: #fff;
}

.timer-content {
  display: flex;

  justify-content: space-evenly;

  align-items: center;

  padding: 20px 10px;

  background:
    rgba(14, 71, 43, 0.03);
}

.time-box {
  text-align: center;
}

.time-val {
  font-size: 1.7rem;

  font-weight: 700;

  color: var(--primary-green);

  line-height: 1.1;
}

.time-lbl {
  font-size: 0.7rem;

  color: var(--text-muted);

  margin-top: 4px;
}

#scratchCanvas {
  position: absolute;

  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  z-index: 5;

  cursor: crosshair;

  touch-action: none;

  transition:
    opacity 0.8s ease;
}

#scratchCanvas.fade-out {
  opacity: 0;

  pointer-events: none;
}


/* ==================================================
   CONTENT
================================================== */

.content-body {
  padding: 0 20px 50px;
}

.fade-up-item {
  opacity: 0;

  transform: translateY(25px);

  transition:
    all 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);

  margin-bottom: 35px;
}

.fade-up-item.visible {
  opacity: 1;

  transform: translateY(0);
}

.content-card {
  background: #ffffff;

  border-radius: 16px;

  padding: 30px 20px;

  box-shadow:
    0 5px 20px rgba(0, 0, 0, 0.05);

  border:
    1px solid rgba(197, 160, 89, 0.25);

  text-align: center;

  position: relative;

  overflow: hidden;
}

.card-content-layer {
  position: relative;

  z-index: 2;
}


/* ==================================================
   FLOWERS
================================================== */

.card-flower-bg {
  position: absolute;

  width: 70px;

  height: auto;

  opacity: 0.8;

  pointer-events: none;

  z-index: 1;
}

.flower-top-left {
  top: -10px;

  left: 10px;

  transform: rotate(-15deg);
}

.flower-top-right {
  top: -10px;

  left: -10px;

  transform: rotate(-15deg);
}

.flower-bottom-left {
  bottom: 10px;

  left: 10px;

  transform: rotate(25deg);
}

.flower-bottom-right {
  bottom: -10px;

  right: -10px;

  transform: rotate(25deg);
}


/* ==================================================
   CLOUDS
================================================== */

.custom-clouds-wrapper {
  position: absolute;

  top: 10;
  left: 0;

  width: 100%;
  height: 100%;

  z-index: 10;

  pointer-events: none;
}

.cloud-img {
  position: absolute;

  top: 38%;

  width: 55%;

  height: auto;

  object-fit: contain;

  transition:
    transform 5s cubic-bezier(0.2, 0.8, 0.2, 1) 2.4s,
    opacity 3.5s ease 8.4s;
}

.cloud-left {
  left: 5%;
  top : 39;

  transform:
    translateY(-50%)
    translateX(0);
}

.cloud-right {
  right: 10%;
    top : 35;
  transform:
    translateY(-50%)
    translateX(0);
}

.fade-up-item.visible .cloud-left {
  transform:
    translateY(-50%)
    translateX(-120%);

  opacity: 0;
}

.fade-up-item.visible .cloud-right {
  transform:
    translateY(-50%)
    translateX(120%);

  opacity: 0;
}


/* ==================================================
   STORY
================================================== */

.bismillah {
  font-family: 'Amiri', serif;

  font-size: 1.25rem;

  color: var(--gold-accent);

  margin-bottom: 15px;

  position: relative;

  z-index: 2;
}

.story-text {
  font-size: 0.95rem;

  color: var(--text-dark);

  font-weight: 400;

  line-height: 2.1;

  margin-bottom: 15px;

  position: relative;

  z-index: 2;
}


/* ==================================================
   DIVIDER
================================================== */

.gold-divider {
  display: flex;

  align-items: center;

  justify-content: center;

  gap: 15px;

  margin: 25px 0;
}

.gold-divider::before,
.gold-divider::after {
  content: '';

  height: 1px;

  width: 40px;

  background: var(--primary-green);

  opacity: 0.3;
}

.divider-flower {
  width: 50px;

  height: auto;

  opacity: 0.85;
}


/* ==================================================
   PHOTO
================================================== */

.wavy-photo {
  display: inline-block;

  position: relative;

  line-height: 0;

  margin-top: 25px;
}

.wavy-photo img {
  display: block;

  width: 100%;

  max-width: 300px;

  height: auto;

  border: none;

  box-shadow: none;

  -webkit-mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      black 7%,
      black 93%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      black 7%,
      black 93%,
      transparent 100%
    );

  -webkit-mask-composite: intersect;

  mask-image:
    linear-gradient(
      to right,
      transparent 0%,
      black 7%,
      black 93%,
      transparent 100%
    ),
    linear-gradient(
      to bottom,
      transparent 0%,
      black 7%,
      black 93%,
      transparent 100%
    );

  mask-composite: intersect;
}


/* ==================================================
   INFO
================================================== */

.section-title {
  color: var(--primary-green);

  font-size: 1.2rem;

  margin-bottom: 5px;
}

.info-list {
  display: flex;

  flex-direction: column;

  gap: 12px;

  margin: 20px 0;

  background:
    rgba(14, 71, 43, 0.03);

  padding: 15px;

  border-radius: 12px;
}

.info-item {
  display: flex;

  align-items: center;

  justify-content: space-between;

  border-bottom:
    1px dashed rgba(197, 160, 89, 0.3);

  padding-bottom: 8px;

  gap: 8px;
}

.info-item:last-child {
  border-bottom: none;

  padding-bottom: 0;
}

.info-badge {
  background: var(--primary-green);

  color: #fff;

  padding: 2px 10px;

  border-radius: 20px;

  font-size: 0.75rem;

  white-space: nowrap;
}

.info-text {
  font-size: 0.85rem;

  font-weight: 500;
}

.map-btns {
  display: flex;

  gap: 10px;

  margin-top: 15px;
}

.btn-map {
  flex: 1;

  padding: 12px;

  text-align: center;

  border:
    1px solid var(--primary-green);

  color: var(--primary-green);

  border-radius: 8px;

  text-decoration: none;

  font-size: 0.85rem;

  transition: all 0.2s;
}

.btn-map:active {
  background: var(--primary-green);

  color: #fff;
}


/* ==================================================
   FORMS
================================================== */

.form-box {
  text-align: right;
}

.form-title {
  text-align: center;

  font-size: 1.1rem;

  margin-bottom: 5px;
}

.form-description {
  font-size: 0.85rem;

  color: var(--text-muted);

  text-align: center;

  margin-bottom: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;

  font-size: 0.85rem;

  color: var(--primary-green);

  margin-bottom: 6px;

  font-weight: 500;
}

.form-input {
  width: 100%;

  padding: 12px;

  border:
    1px solid #dcd3bf;

  border-radius: 8px;

  font-family: inherit;

  font-size: 0.9rem;

  background: #fff;

  outline: none;
}

.form-input:focus {
  border-color: var(--gold-accent);
}

textarea.form-input {
  min-height: 80px;

  resize: vertical;
}

.btn-submit {
  width: 100%;

  padding: 14px;

  background: var(--primary-green);

  color: #fff;

  border: none;

  border-radius: 8px;

  font-size: 0.95rem;

  font-weight: 500;

  cursor: pointer;
}

.btn-submit:disabled {
  opacity: 0.65;

  cursor: wait;
}

.status-msg {
  display: none;

  font-size: 0.85rem;

  color: var(--primary-green);

  text-align: center;

  margin-top: 10px;

  font-weight: bold;
}


/* ==================================================
   FLOWER SEPARATOR
================================================== */

.flower-separator {
  text-align: center;

  margin:
    20px 0
    20px 0;
}

.flower-separator img {
  width: 100px;

  height: auto;

  opacity: 0.85;
}


/* ==================================================
   MOBILE
================================================== */

@media (max-width: 440px) {

  body {
    background: var(--bg-light);
  }

  .app-container {
    box-shadow: none;
  }

}




/* =========================
   اسم عروس و داماد
========================= */

.names-section {
  width: 100%;
  padding: 45px 15px;
  box-sizing: border-box;

  display: flex;
  justify-content: center;
  align-items: center;

  overflow: hidden;
}

/* همه در یک ردیف */
.names-content {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 14px;

  direction: rtl;

  opacity: 0;
  transform: translateY(35px);

  transition:
    opacity 1.1s ease,
    transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ورود با اسکرول */
.names-section.show .names-content {
  opacity: 1;
  transform: translateY(0);
}

/* اسم‌ها */
.couple-name {
  font-family: "Vazirmatn", serif;
  font-size: 31px;
  font-weight: 700;
  color: #0e472b;
  white-space: nowrap;

  opacity: 0;
  transform: translateY(15px);

  transition:
    opacity 0.8s ease,
    transform 0.8s ease;
}

/* اسم اول */
.names-section.show .couple-name:first-child {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

/* اسم دوم */
.names-section.show .couple-name:last-child {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.45s;
}


/* =========================
   حلقه کوچک وسط
========================= */

.ring-wrapper {
  width: 50px;
  height: 50px;

  flex: 0 0 50px;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  transform: scale(0.5);

  transition:
    opacity 0.8s ease,
    transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);

  transition-delay: 0.3s;
}

.names-section.show .ring-wrapper {
  opacity: 1;
  transform: scale(1);
}

.ring-image {
  width: 50px;
  height: 50px;

  max-width: 50px;
  max-height: 50px;

  object-fit: contain;
  display: block;
}


/* =========================
   موبایل
========================= */

@media (max-width: 480px) {

  .names-section {
    padding: 38px 10px;
  }

  .names-content {
    gap: 10px;
  }

  .couple-name {
    font-size: 27px;
  }

  .ring-wrapper {
    width: 50px;
    height: 50px;
    flex-basis: 50px;
  }

  .ring-image {
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
  }
}