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

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

  --off-white: #fbfaf6;
  --soft-beige: #f7f4ee;
  --paper-beige: #f0e9df;
  --gold: #9b7b4d;
  --text-dark: #5f564d;
  --text-soft: #8b8178;
  --location-text: #747063;
  --location-line: #b8b0a4;
}

* {
  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: #6f6458;
}

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

.hidden {
  display: none !important;
}

/* Intro click text */
.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);
}

/* Main video animation */
#mainVideoScreen {
  transform: translateY(100%);
  opacity: 0;
}

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

#mainVideo {
  pointer-events: none;
}

.fade-out-video {
  animation: videoFadeOut 3s ease forwards;
}

/* Scroll text */
.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 image 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;
}

.image-full-section img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Countdown section */
.countdown-section {
  width: 100%;
  min-height: auto;
  background: var(--off-white);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 24px 52px;
}

.countdown-header {
  text-align: center;
  margin-top: 0;
  margin-bottom: 14px;
}

.countdown-header h2 {
  font-family: var(--script-font);
  font-size: clamp(42px, 13vw, 60px);
  font-weight: 400;
  line-height: 1;
  color: var(--text-dark);
  letter-spacing: 0.5px;
}

.countdown-header p {
  margin-top: 8px;
  font-family: var(--english-font);
  font-size: clamp(14px, 3.8vw, 18px);
  line-height: 1.35;
  letter-spacing: 1.1px;
  color: var(--text-soft);
}

.countdown-layout {
  position: relative;
  width: min(100%, 390px);
  height: 310px;
  margin-top: 0;
}

.countdown-logo {
  position: absolute;
  width: clamp(105px, 35vw, 150px);
  height: auto;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.countdown-item {
  position: absolute;
  width: 105px;
  text-align: center;
  color: #6a5d52;
  z-index: 3;
}

.countdown-item span {
  display: block;
  font-family: var(--english-font);
  font-size: clamp(36px, 11vw, 52px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 1px;
}

.countdown-item small {
  display: block;
  margin-top: 4px;
  font-family: var(--english-font);
  font-size: clamp(11px, 3vw, 14px);
  letter-spacing: 1px;
  color: #8c8178;
}

.countdown-days {
  top: 17%;
  left: 5%;
}

.countdown-hours {
  top: 17%;
  right: 5%;
}

.countdown-minutes {
  top: 64%;
  left: 5%;
}

.countdown-seconds {
  top: 64%;
  right: 5%;
}

/* Location section */
.location-section {
  width: 100%;
  min-height: 100dvh;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  padding: calc(34px + env(safe-area-inset-top)) 24px calc(38px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.location-content {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  text-align: center;
  color: var(--location-text);
}

.location-content h2 {
  font-family: var(--script-font);
  font-size: clamp(36px, 11vw, 50px);
  font-weight: 400;
  line-height: 0.95;
  color: var(--location-text);
  margin-bottom: 18px;
}

.location-building {
  width: min(88%, 310px);
  height: auto;
  margin: 0 auto 22px;
  opacity: 0.93;
  filter: sepia(16%) saturate(70%) opacity(94%);
}

.venue-block {
  width: 100%;
  margin: 0 auto 24px;
}

.venue-main {
  font-family: var(--english-font);
  font-size: clamp(18px, 5.4vw, 25px);
  font-weight: 500;
  letter-spacing: clamp(4px, 1.9vw, 8px);
  color: var(--location-text);
  line-height: 1.25;
  text-transform: uppercase;
}

.venue-sub {
  margin-top: 7px;
  font-family: var(--english-font);
  font-size: clamp(9px, 2.7vw, 12px);
  font-weight: 500;
  letter-spacing: 4px;
  line-height: 1.7;
  color: var(--location-text);
  text-transform: uppercase;
}

.venue-divider {
  width: 118px;
  margin: 14px auto 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--location-line);
}

.venue-divider span {
  display: block;
  width: 44px;
  height: 1px;
  background: rgba(184, 176, 164, 0.75);
}

.venue-divider em {
  font-style: normal;
  font-size: 9px;
  line-height: 1;
}

.map-card {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1.65 / 1;
  margin: 0 auto;
  overflow: hidden;
  background: white;
  border: none;
  box-shadow: none;
}

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

.maps-button {
  display: inline-block;
  margin-top: 24px;
  padding: 7px 24px;
  border: 1px solid rgba(135, 128, 116, 0.55);
  border-radius: 0;
  background: rgba(255, 255, 255, 0.55);
  color: var(--location-text);
  text-decoration: none;
  font-family: var(--english-font);
  font-size: clamp(12px, 3vw, 14px);
  letter-spacing: 0.4px;
}

/* Celebration message section */
.celebration-section {
  width: 100%;
  min-height: 100dvh;
  background: var(--paper-beige);
  padding: calc(70px + env(safe-area-inset-top)) 24px calc(54px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.celebration-content {
  width: 100%;
  max-width: 390px;
  margin: 0 auto;
  text-align: center;
  color: #777163;
}

.celebration-line {
  font-family: var(--calligraphy-font);
  font-size: clamp(38px, 11.5vw, 58px);
  font-weight: 400;
  line-height: 0.88;
  color: #777163;
  letter-spacing: 0.2px;
}

.celebration-spacer {
  height: 38px;
}

.celebration-wine {
  width: min(82%, 330px);
  height: auto;
  margin: 54px auto 0;
  opacity: 0.94;
  filter: sepia(18%) saturate(65%) opacity(94%);
}

/* RSVP form section */
.rsvp-section {
  width: 100%;
  min-height: 100dvh;
  background: var(--off-white);
  padding: calc(54px + env(safe-area-inset-top)) 24px calc(54px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsvp-content {
  width: 100%;
  max-width: 430px;
  text-align: center;
}

.rsvp-content h2 {
  font-family: var(--script-font);
  font-size: clamp(46px, 14vw, 64px);
  font-weight: 400;
  line-height: 1;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.rsvp-content > p {
  font-family: var(--english-font);
  font-size: clamp(15px, 4vw, 19px);
  color: var(--text-soft);
  margin-bottom: 28px;
}

.rsvp-choice {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 24px;
}

.rsvp-choice button,
.submit-rsvp {
  width: 100%;
  border: 1px solid rgba(95, 86, 77, 0.55);
  background: rgba(255, 255, 255, 0.55);
  color: #6b6258;
  font-family: var(--english-font);
  font-size: clamp(15px, 4vw, 18px);
  padding: 13px 18px;
  cursor: pointer;
  letter-spacing: 0.5px;
}

.rsvp-choice button.active {
  background: #6b6258;
  color: white;
}

.rsvp-form {
  width: 100%;
  margin-top: 10px;
}

.form-group {
  width: 100%;
  margin-bottom: 14px;
}

.rsvp-form input,
.rsvp-form textarea {
  width: 100%;
  border: 1px solid rgba(95, 86, 77, 0.35);
  background: rgba(255, 255, 255, 0.75);
  color: #5f564d;
  font-family: var(--english-font);
  font-size: clamp(15px, 4vw, 18px);
  padding: 13px 14px;
  outline: none;
  border-radius: 0;
}

.rsvp-form textarea {
  min-height: 95px;
  resize: none;
}

.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder {
  color: rgba(95, 86, 77, 0.65);
}

.submit-rsvp {
  margin-top: 6px;
  background: #5f564d;
  color: white;
}

.rsvp-status {
  margin-top: 18px;
  font-family: var(--english-font);
  font-size: clamp(14px, 3.8vw, 17px);
  color: #5f564d;
  line-height: 1.5;
}

.rsvp-status.success {
  color: #4f7a55;
}

.rsvp-status.error {
  color: #9b4d4d;
}

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

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

.white-transition.fade-away {
  animation: whiteFadeOut 0.75s 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 slideUpFade {
  from {
    transform: translateY(100%);
    opacity: 0;
  }

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

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

  70% {
    opacity: 1;
  }

  100% {
    opacity: 1;
  }
}

@keyframes whiteFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

@keyframes videoFadeOut {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

/* Small phone adjustments */
@media (max-width: 390px) {
  .countdown-section {
    padding: 38px 22px 46px;
  }

  .countdown-layout {
    height: 285px;
  }

  .countdown-logo {
    width: clamp(96px, 34vw, 135px);
  }

  .countdown-item {
    width: 92px;
  }

  .location-section {
    padding: calc(28px + env(safe-area-inset-top)) 20px calc(32px + env(safe-area-inset-bottom));
  }

  .location-building {
    width: min(88%, 285px);
    margin-bottom: 18px;
  }

  .venue-main {
    letter-spacing: 4px;
  }

  .venue-sub {
    letter-spacing: 3px;
  }

  .map-card {
    max-width: 330px;
  }

  .celebration-section {
    padding: calc(60px + env(safe-area-inset-top)) 22px calc(48px + env(safe-area-inset-bottom));
  }

  .celebration-line {
    font-size: clamp(36px, 12vw, 52px);
  }

  .celebration-spacer {
    height: 34px;
  }

  .celebration-wine {
    width: min(86%, 305px);
    margin-top: 48px;
  }

  .rsvp-section {
    padding: 44px 22px 46px;
  }
}

/* Mobile only */
@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;
  }
}

/* Celebration image section */
.celebration-section {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  background: #f0e9df;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.celebration-full-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  display: block;
}