@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;

  --taupe: #6f6458;
  --taupe-soft: #8a8176;

  --theme-green: #7c8260;
  --theme-green-dark: #646b4d;

  --logo-gold: #d8c29a;
}

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

* {
  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;
}

.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;
  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;
}

/* =========================
   Smooth Scroll Animations
========================= */

.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;
}

/* Remove image/video zoom animation */
.image-full-section.section-animate video,
.image-full-section.section-visible video,
.final-image-section.section-animate img,
.final-image-section.section-visible img {
  transform: none !important;
  transition: none !important;
  animation: none !important;
}

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

.click-text {
  position: absolute;
  bottom: calc(72px + env(safe-area-inset-bottom));
  left: 0;
  width: 100%;
  text-align: center;
  color: var(--theme-green-dark);
  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;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.65);
}

.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: var(--theme-green-dark);
  font-family: var(--english-font);
  font-size: clamp(12px, 3.4vw, 15px);
  letter-spacing: 3px;
  line-height: 1.8;
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.7);
  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: 34px;
  line-height: 1;
}

/* =========================
   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: auto;
  background: #ffffff !important;
  background-image: none !important;

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

  padding: 58px 22px 64px;
  overflow: hidden;
  margin: 0;
}

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

.countdown-logo-top {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 28px;
}

.countdown-logo-top img {
  width: 130px;
  max-width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: transparent;
}

.countdown-grid {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;

  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  direction: rtl;
}

.countdown-box {
  min-height: 94px;
  background: #faf8f4;

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

  border: 1px solid rgba(124, 130, 96, 0.25);
  border-radius: 18px;
  box-shadow: none;
  backdrop-filter: none;
}

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

.countdown-box small {
  display: block;
  font-family: var(--arabic-font);
  color: var(--theme-green);
  font-size: clamp(14px, 3vw, 18px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
}

/* =========================
   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(--arabic-font);
  font-size: clamp(38px, 10vw, 52px);
  font-weight: 400;
  line-height: 1.25;
  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;
}

/* =========================
   Location Time
========================= */

.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;
}

.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);
}

/* =========================
   Location Rule Icons
========================= */

.location-rules {
  width: 100%;
  max-width: 210px;
  margin: 22px auto 0;

  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
}

/* Remove container behind each icon */
.rule-item {
  width: auto;
  min-height: 0;
  padding: 0;

  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;

  display: flex;
  align-items: center;
  justify-content: center;
}

.rule-item img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  margin: 0;
  opacity: 0.95;
}

.rule-item p {
  display: none;
}

/* =========================
   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 {
    padding: 52px 18px 58px;
  }

  .countdown-logo-top {
    margin-bottom: 24px;
  }

  .countdown-logo-top img {
    width: 125px;
  }

  .countdown-grid {
    max-width: 100%;
    gap: 14px;
  }

  .countdown-box {
    min-height: 88px;
    border-radius: 16px;
  }

  .countdown-box span {
    font-size: clamp(28px, 7.8vw, 38px);
  }

  .countdown-box small {
    font-size: 14px;
  }

  .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 {
    margin-top: 20px;
    gap: 20px;
  }

  .rule-item img {
    width: 38px;
    height: 38px;
  }

  .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: var(--theme-green);
    background: #efe8dc;
  }
}

/* =========================
   Countdown Colors Same as Logo
========================= */

:root {
  --logo-burgundy: #7A0014 !important;
}

/* Countdown numbers and labels */
.countdown-box span,
.countdown-box small {
  color: var(--logo-burgundy) !important;
}

/* Countdown boxes border */
.countdown-box {
  border-color: rgba(122, 0, 20, 0.35) !important;
  background: rgba(122, 0, 20, 0.035) !important;
}

/* Slightly stronger border on hover/visible */
.countdown-box:hover {
  border-color: rgba(122, 0, 20, 0.55) !important;
}

/* Logo image clean */
.countdown-logo-top img {
  width: 135px !important;
}