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

/* =========================
   Fonts
========================= */

@font-face {
  font-family: "Omnes Arabic";
  src: url("assets/fonts/omnes-arabic.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Omnes Arabic";
  src: url("assets/fonts/omnes-arabic-light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Omnes Arabic";
  src: url("assets/fonts/omnes-arabic-medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Omnes Arabic";
  src: url("assets/fonts/omnes-arabic-bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* =========================
   Variables
========================= */

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

  --white: #ffffff;
  --black: #000000;
  --copper: #ad7852;
  --copper-soft: rgba(173, 120, 82, 0.55);
  --copper-light: rgba(173, 120, 82, 0.10);
}

/* =========================
   Reset
========================= */

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

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

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

section {
  margin: 0;
  padding: 0;
}

img,
video {
  display: block;
}

.hidden {
  display: none !important;
}

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;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;
  background: var(--white);
}

.full-media {
  width: 100%;
  height: 100%;
  display: block;
}

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

/* =========================
   Stamp Screen
========================= */

#introScreen {
  display: block;
  position: relative;
  z-index: 10;
  background: var(--white);
}

#introScreen.hidden {
  display: none !important;
}

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

#firstVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  background: var(--white);
  pointer-events: none;
}

/* =========================
   Click Text
========================= */

.click-text {
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 20;

  color: var(--white);
  font-family: var(--english-font);
  font-size: clamp(14px, 4vw, 18px);
  font-weight: 400;
  line-height: 1.7;
  letter-spacing: 2px;

  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.65);
  animation: softPulse 2.2s ease-in-out infinite;
  pointer-events: none;
}

.click-text .arabic {
  color: var(--white);
  font-family: var(--arabic-font);
  font-size: clamp(14px, 4vw, 18px);
  letter-spacing: 0;
}

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

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

#mainVideoScreen {
  position: relative;
  z-index: 1;
  width: 100vw;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--black);

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

#mainVideoScreen.hidden {
  display: none !important;
}

#mainVideoScreen.slide-up {
  display: block !important;
  animation: slideUpFade 0.85s ease-out forwards;
}

#mainVideo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;

  opacity: 1;
  visibility: visible;
  background: var(--black);
  pointer-events: none;
}

/* =========================
   Scroll Text
========================= */

.scroll-text {
  position: absolute;
  bottom: calc(28px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  text-align: center;
  z-index: 5;

  color: var(--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.55);
  animation: softPulse 2.2s ease-in-out infinite;
}

.scroll-text .arabic {
  color: var(--white);
  font-family: var(--arabic-font);
  letter-spacing: 0;
}

.scroll-text span {
  display: block;
  color: var(--white);
  font-size: 20px;
}

/* =========================
   Image Sections
========================= */

.image-full-section {
  width: 100%;
  height: auto;
  min-height: 0;
  display: block;
  overflow: hidden;
  background: var(--white);
  line-height: 0;
  font-size: 0;
}

.image-full-section img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center top;
  margin: 0;
  padding: 0;
  border: 0;
  transform: none;
  animation: none;
  transition: none;
  vertical-align: top;
}

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

.countdown-section,
.vintage-countdown-section {
  width: 100%;
  min-height: 100dvh;
  padding: 0 22px;

  background-image: url("assets/countdown.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;

  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.countdown-inner {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  padding-top: 285px;
  text-align: center;
  background: transparent;
  direction: ltr;
}

.countdown-wedding-title {
  width: 100%;
  text-align: center;
  margin: 0 auto 36px;
  color: var(--copper);
}

.countdown-wedding-title p {
  margin: 0 0 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: clamp(12px, 3vw, 15px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--copper);
}

.countdown-wedding-title h2 {
  margin: 0;
  font-family: var(--english-font);
  font-size: clamp(26px, 7.2vw, 36px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.5px;
  color: var(--copper);
}

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

.countdown-box {
  width: 100%;
  min-height: 82px;

  background: var(--copper-light);
  border: 1px solid var(--copper-soft);
  border-radius: 16px;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  box-shadow: none;
  backdrop-filter: blur(2px);
}

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

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

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

.location-section {
  width: 100%;
  min-height: 100dvh;
  position: relative;
  overflow: hidden;

  padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom));

  background-image: url("assets/location.png");
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
}

.location-content {
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
  padding-top: 50px;
  text-align: center;
  color: var(--copper);
}

.location-content h2 {
  font-family: var(--arabic-font);
  font-size: clamp(30px, 8vw, 42px);
  font-weight: 400;
  line-height: 1.4;
  color: var(--copper);
  margin-bottom: 14px;
}

.location-pin {
  width: 22px;
  height: 22px;
  margin: 0 auto 8px;
  color: var(--copper);
}

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

.location-pin path,
.location-pin circle {
  fill: none;
  stroke: var(--copper);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.venue-text {
  font-family: var(--arabic-font);
  font-size: clamp(12px, 3.4vw, 15px);
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0.3px;
  color: var(--copper);
  margin-bottom: 16px;
  text-align: center;
  direction: rtl;
}

.map-card {
  width: 76%;
  max-width: 270px;
  aspect-ratio: 1.45 / 1;
  margin: 0 auto;
  overflow: hidden;

  background: var(--white);
  border-radius: 16px;
  border: 1px solid rgba(173, 120, 82, 0.35);
  box-shadow: 0 10px 22px rgba(70, 58, 48, 0.18);
}

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

.maps-button {
  display: inline-block;
  margin-top: 18px;
  padding: 7px 22px;

  border: 1px solid var(--copper-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);

  color: var(--copper);
  text-decoration: none;
  font-family: var(--arabic-font);
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0.3px;

  backdrop-filter: blur(4px);
  direction: rtl;
}

.rsvp-text {
  margin-top: 90px;
  font-family: var(--arabic-font);
  font-size: clamp(13px, 3.3vw, 15px);
  font-weight: 400;
  line-height: 1.6;
  letter-spacing: 0.3px;
  color: var(--copper);
  direction: rtl;
  text-align: center;
}

.rsvp-text p {
  color: var(--copper);
}

/* =========================
   Scroll Reveal Animations
========================= */

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

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

.section-visible .countdown-wedding-title {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.05s;
}

.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 .map-card {
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0.2s;
}

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

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

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

.white-transition {
  display: none !important;
}

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

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

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

@keyframes introFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes textFadeOut {
  from {
    opacity: 1;
  }

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

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

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

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

/* =========================
   Mobile Adjustments
========================= */

@media (max-width: 390px) {
  .countdown-inner {
    padding-top: 270px;
  }

  .countdown-wedding-title {
    margin-bottom: 32px;
  }

  .countdown-grid {
    gap: 12px;
  }

  .countdown-box {
    min-height: 78px;
  }

  .map-card {
    width: 88%;
    max-width: 300px;
  }

  .rsvp-text {
    margin-top: 76px;
  }
}

/* =========================
   Desktop Message
========================= */

@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: var(--copper);
    background: var(--white);
  }
}

/* =========================
   Reduced Motion
========================= */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}