@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=Cormorant+Garamond:wght@300;400;500;600&display=swap');

:root {
  --english-font: "Cormorant Garamond", serif;
  --script-font: "Great Vibes", cursive;
  --arabic-font: "Simplified Arabic Fixed", "Simplified Arabic", "Tahoma", "Arial", sans-serif;

  --off-white: #fbfaf6;
  --soft-beige: #f7f4ee;
  --gold: #9b7b4d;
  --gold-soft: #8a7a56;
  --text-dark: #5f564d;
  --text-soft: #8b8178;

  --taupe: #6f6458;
  --taupe-soft: #8a8176;
  --logo-gold: #d8c29a;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--soft-beige);
}

body {
  font-family: var(--english-font);
  color: var(--taupe);
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

section {
  margin: 0;
  padding: 0;
}

img,
video {
  display: block;
}

body.lock-scroll {
  overflow: hidden;
  height: 100dvh;
}

body.ready-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  height: auto;
}

/* =========================
   Full Screen Video Sections
========================= */

.screen {
  width: 100vw;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--soft-beige);
}

.full-media {
  width: 100%;
  height: 100%;
  display: block;
  background: var(--soft-beige);
}

.cover-media {
  object-fit: cover;
}

.contain-media {
  object-fit: contain;
}

.hidden {
  display: none !important;
}

/* =========================
   Smooth Scroll Section Transitions
========================= */

.section-animate {
  opacity: 1;
  transform: none;
  filter: none;
  will-change: auto;
}

.section-animate .countdown-box,
.section-animate .location-content h2,
.section-animate .location-pin,
.section-animate .venue-text,
.section-animate .location-time,
.section-animate .map-card,
.section-animate .maps-button,
.section-animate .location-rules,
.section-animate .final-presence-text {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
  will-change: opacity, transform;
}

.section-visible .countdown-box:nth-child(1) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.08s;
}

.section-visible .countdown-box:nth-child(2) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.14s;
}

.section-visible .countdown-box:nth-child(3) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

.section-visible .countdown-box:nth-child(4) {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.26s;
}

.section-visible .location-content h2 {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.section-visible .location-pin {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.1s;
}

.section-visible .venue-text {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.15s;
}

.section-visible .location-time {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.22s;
}

.section-visible .map-card {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.3s;
}

.section-visible .maps-button {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.38s;
}

.section-visible .location-rules {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.46s;
}

.section-visible .final-presence-text {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.54s;
}

.image-full-section.section-animate video,
.final-image-section.section-animate img {
  transform: scale(1.018);
  transition: transform 0.9s ease;
  will-change: transform;
}

.image-full-section.section-visible video,
.final-image-section.section-visible img {
  transform: scale(1);
}

/* =========================
   Intro Video
========================= */

.click-text {
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--gold);
  font-family: var(--english-font);
  font-size: clamp(16px, 4.5vw, 19px);
  letter-spacing: 2px;
  line-height: 1.7;
  animation: softPulse 2.2s ease-in-out infinite;
  z-index: 5;
}

.click-text .arabic,
.arabic {
  font-family: var(--arabic-font);
}

.click-text.fade-out {
  animation: textFadeOut 0.6s ease forwards;
}

#introScreen.fade-out-intro {
  animation: introFadeOut 1.5s ease forwards;
}

/* =========================
   Main Loop Video
========================= */

#mainVideoScreen {
  transform: translateY(100%);
  opacity: 0;
  overflow: hidden;
}

#mainVideoScreen.slide-up {
  animation: slideUpFade 0.45s ease-out forwards;
}

#mainVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.08);
  transform-origin: center center;
  pointer-events: none;
}

.scroll-text {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  text-align: center;
  color: white;
  font-family: var(--english-font);
  font-size: clamp(12px, 3.4vw, 15px);
  letter-spacing: 3px;
  line-height: 1.8;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.75);
  animation: softPulse 2.2s ease-in-out infinite;
  z-index: 5;
}

.scroll-text .arabic {
  font-family: var(--arabic-font);
}

.scroll-text span {
  display: block;
  font-size: 20px;
}

/* =========================
   Invitation Video Section
========================= */

.image-full-section {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--soft-beige);
  overflow: hidden;
}

.card-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

/* =========================
   Countdown Section
========================= */

.vintage-countdown-section {
  width: 100%;
  min-height: 92dvh;
  background-image: url("assets/countdown.jpeg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 370px 24px 18px;
  overflow: hidden;
  margin: 0;
}

.countdown-inner {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  padding-bottom: 0;
  text-align: center;
}

.countdown-grid {
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 14px;
}

.countdown-box {
  min-height: 82px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(216, 194, 154, 0.55);
  border-radius: 16px;
  box-shadow: none;
  backdrop-filter: blur(1.5px);
}

.countdown-box span {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--logo-gold);
  font-size: clamp(28px, 8vw, 38px);
  font-weight: 400;
  line-height: 1;
  margin-bottom: 7px;
  letter-spacing: 1px;
}

.countdown-box small {
  display: block;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--logo-gold);
  font-size: clamp(10px, 2.7vw, 13px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* =========================
   Final Image Section
========================= */

.final-image-section {
  width: 100%;
  min-height: 100dvh;
  height: 100dvh;
  background: #f6f1ea;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.final-image-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center bottom;
  margin: 0;
  padding: 0;
}

/* =========================
   Location Section
========================= */

.location-section {
  width: 100%;
  min-height: 100dvh;
  background-image: url("assets/location.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0 22px calc(34px + env(safe-area-inset-bottom));
}

.location-content {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: 54px;
  text-align: center;
  color: var(--taupe);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.location-header {
  width: 100%;
  text-align: center;
}

.location-content h2 {
  font-family: var(--script-font);
  font-size: clamp(42px, 12vw, 58px);
  font-weight: 400;
  line-height: 1;
  color: var(--taupe);
  margin-bottom: 16px;
}

.location-pin {
  width: 24px;
  height: 24px;
  margin: 0 auto 9px;
  color: var(--taupe);
  opacity: 0.9;
}

.location-pin svg,
.time-clock svg {
  width: 100%;
  height: 100%;
  display: block;
}

.location-pin path,
.location-pin circle,
.time-clock circle,
.time-clock path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.venue-text {
  font-family: var(--arabic-font);
  font-size: clamp(14px, 3.8vw, 18px);
  line-height: 1.7;
  letter-spacing: 0.5px;
  color: var(--taupe);
  margin-bottom: 16px;
}

/* Time block */

.location-time {
  width: 100%;
  margin: 0 auto 20px;
  text-align: center;
  color: var(--taupe);
}

.time-clock {
  width: 34px;
  height: 34px;
  margin: 0 auto 7px;
  color: var(--taupe);
  opacity: 0.9;
}

.time-line {
  margin: 0;
  color: var(--taupe);
  font-family: var(--arabic-font);
  font-size: clamp(15px, 3.8vw, 18px);
  line-height: 1.6;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.time-numbers {
  display: inline-block;
  direction: ltr;
  unicode-bidi: embed;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.95em;
  letter-spacing: 0.5px;
}

/* Map */

.map-card {
  width: 88%;
  max-width: 315px;
  aspect-ratio: 1.45 / 1;
  margin: 0 auto;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 18px;
  border: 1px solid rgba(111, 100, 88, 0.22);
  box-shadow:
    0 16px 34px rgba(70, 58, 48, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.45) inset;
}

.map-card iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Map button */

.maps-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
  padding: 8px 28px;
  min-width: 230px;
  border: 1px solid rgba(111, 100, 88, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--taupe);
  text-decoration: none;
  font-family: var(--arabic-font);
  font-size: clamp(12px, 3vw, 14px);
  line-height: 1.7;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
  transition:
    transform 0.25s ease,
    background 0.25s ease,
    border-color 0.25s ease;
}

.maps-button:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.45);
  border-color: rgba(111, 100, 88, 0.55);
}

/* Rules icons */

.location-rules {
  width: 100%;
  max-width: 330px;
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  align-items: stretch;
}

.rule-item {
  min-height: 120px;
  padding: 11px 8px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(111, 100, 88, 0.12);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  backdrop-filter: blur(2px);
}

.rule-item img {
  width: 66px;
  height: 66px;
  object-fit: contain;
  margin-bottom: 8px;
  opacity: 0.9;
}

.rule-item p {
  color: var(--taupe);
  font-family: var(--arabic-font);
  font-size: clamp(12px, 3.2vw, 14px);
  line-height: 1.55;
  letter-spacing: 0.2px;
}

/* Final closing text */

.final-presence-text {
  margin-top: 18px;
  color: var(--taupe);
  font-family: var(--arabic-font);
  font-size: clamp(15px, 3.8vw, 17px);
  line-height: 1.8;
  letter-spacing: 0.5px;
}

/* RTL */

.location-section[dir="rtl"] .location-content,
.location-section[dir="rtl"] .venue-text,
.location-section[dir="rtl"] .final-presence-text {
  text-align: center;
  direction: rtl;
}

.location-section[dir="rtl"] .maps-button {
  direction: rtl;
}

/* =========================
   White Transition
========================= */

.white-transition {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
}

.white-transition.show {
  display: block !important;
  animation: whiteFlash 0.7s ease forwards;
}

/* =========================
   Animations
========================= */

@keyframes softPulse {
  0% {
    opacity: 0.45;
    transform: translateY(0);
  }

  50% {
    opacity: 1;
    transform: translateY(-6px);
  }

  100% {
    opacity: 0.45;
    transform: translateY(0);
  }
}

@keyframes textFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

@keyframes introFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes slideUpFade {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes whiteFlash {
  0% {
    opacity: 0;
  }

  35% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

/* =========================
   Small Phone Adjustments
========================= */

@media (max-width: 390px) {
  .vintage-countdown-section {
    min-height: 90dvh;
    padding: 350px 20px 16px;
    background-position: center top;
  }

  .countdown-inner {
    padding-bottom: 0;
  }

  .countdown-grid {
    max-width: 330px;
    gap: 12px;
  }

  .countdown-box {
    min-height: 76px;
    border-radius: 14px;
  }

  .countdown-box span {
    font-size: clamp(26px, 7.5vw, 34px);
  }

  .countdown-box small {
    font-size: 11px;
    letter-spacing: 1.2px;
  }

  .location-content {
    padding-top: 44px;
  }

  .venue-text {
    margin-bottom: 14px;
  }

  .location-time {
    margin-bottom: 18px;
  }

  .time-clock {
    width: 31px;
    height: 31px;
    margin-bottom: 6px;
  }

  .map-card {
    width: 90%;
    max-width: 320px;
  }

  .location-rules {
    max-width: 310px;
    gap: 13px;
    margin-top: 24px;
  }

  .rule-item {
    min-height: 112px;
    padding: 10px 6px 9px;
  }

  .rule-item img {
    width: 60px;
    height: 60px;
    margin-bottom: 7px;
  }

  .rule-item p {
    font-size: 12px;
  }

  .final-presence-text {
    margin-top: 14px;
  }
}

/* =========================
   Reduce Motion
========================= */

@media (prefers-reduced-motion: reduce) {
  .section-animate,
  .section-animate .countdown-box,
  .section-animate .location-content h2,
  .section-animate .location-pin,
  .section-animate .venue-text,
  .section-animate .location-time,
  .section-animate .map-card,
  .section-animate .maps-button,
  .section-animate .location-rules,
  .section-animate .final-presence-text,
  .image-full-section.section-animate video,
  .final-image-section.section-animate img {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* =========================
   Mobile Only Website
========================= */

@media (min-width: 768px) {
  body > * {
    display: none !important;
  }

  body::before {
    content: "Please open this invitation on a mobile phone.";
    display: flex;
    width: 100vw;
    height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    font-family: Arial, sans-serif;
    font-size: 20px;
    color: #8b6a3e;
    background: #efe8dc;
  }
}