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

/* Abdelaziz & Heba — ivory / sage / delicate Arabic typography */
:root {
  --paper: #fdfcf7;
  --card-paper: #f7f5f1;
  --sage: #556953;
  --sage-dark: #465a45;
  --sage-soft: #778a72;
  --sage-line: rgba(85, 105, 83, 0.34);
  --arabic-font: "Amiri", "Noto Naskh Arabic", Georgia, serif;
  --arabic-title: "Aref Ruqaa", "Amiri", serif;
  --number-font: "Cormorant Garamond", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; padding: 0; }
html { background: var(--paper); }
body { background: var(--paper); color: var(--sage); font-family: var(--arabic-font); overflow-x: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img, video { display: block; }
[hidden] { display: none !important; }
body.lock-scroll { height: 100svh; overflow: hidden; }
body.ready-scroll { height: auto; overflow-y: auto; overflow-x: hidden; }

/* Keep the invitation beautifully centered when viewed on desktop. */
.screen, .invitation-content { width: 100%; max-width: 540px; margin-inline: auto; }
.invitation-content { background: var(--paper); }

/* 1. Stamp video */
.screen { height: 100svh; min-height: 100svh; position: relative; overflow: hidden; background: var(--paper); }
.opening-screen {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  opacity: 1;
  transition: opacity 0.8s ease;
}
.opening-screen.is-leaving { opacity: 0; pointer-events: none; }
.full-video { width: 100%; height: 100%; object-fit: cover; object-position: center center; background: var(--paper); }
.click-text {
  position: absolute;
  bottom: calc(52px + env(safe-area-inset-bottom));
  inset-inline: 0;
  width: 100%;
  padding: 12px;
  border: 0;
  background: transparent;
  color: var(--sage-dark);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  font-family: var(--number-font);
  font-weight: 500;
  font-size: clamp(17px, 4.3vw, 22px);
  letter-spacing: 1px;
  cursor: pointer;
  text-shadow: 0 1px 7px rgba(255,255,255,.75);
  animation: softPulse 2.4s ease-in-out infinite;
}
.click-arabic { font-family: var(--arabic-font); font-size: clamp(17px, 4.1vw, 21px); letter-spacing: 0; }
.click-text.fade-out { animation: textFadeOut 0.35s ease forwards; pointer-events: none; }

/* 2. Looping intro video / scroll indicator */
.main-video-screen { background: var(--paper); }
.main-video-screen .full-video { pointer-events: none; }
.scroll-text {
  position: absolute;
  bottom: calc(23px + env(safe-area-inset-bottom));
  inset-inline: 0;
  color: var(--sage-dark);
  text-align: center;
  font-family: var(--number-font);
  font-size: clamp(11px, 3.1vw, 15px);
  letter-spacing: 2.8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.35;
  text-shadow: 0 1px 6px rgba(255,255,255,.80);
  animation: softPulse 2.4s ease-in-out infinite;
}
.scroll-arabic { margin-top: 4px; font: 400 16px/1.5 var(--arabic-font); letter-spacing: 0; }
.down-arrow { font-family: Georgia, serif; font-size: 24px; margin-top: 1px; }

/* 3. Original artwork at its natural aspect ratio (never crop the text). */
.art-section, .location-section { position: relative; width: 100%; line-height: 0; margin: 0; padding: 0; background: var(--paper); }
.art-section img, .location-section > img { width: 100%; height: auto; display: block; object-fit: contain; }

/* 4. Live countdown matched to the reference image. */
.countdown-section {
  width: 100%;
  padding: 43px 18px 42px;
  background: var(--paper);
  text-align: center;
}
.countdown-inner { width: 100%; max-width: 470px; margin: 0 auto; }
.countdown-title {
  margin: 0 auto 20px;
  color: var(--sage);
  font-family: var(--arabic-title);
  font-weight: 400;
  font-size: clamp(31px, 8.1vw, 44px);
  line-height: 1.7;
}
.countdown-display {
  margin: 0 auto;
  width: 100%;
  max-width: 400px;
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr) auto minmax(0,1fr);
  align-items: start;
  gap: clamp(1px, 0.5vw, 5px);
}
.countdown-unit { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.countdown-unit > span, .countdown-colon {
  color: var(--sage);
  font-family: var(--number-font);
  font-size: clamp(38px, 10vw, 58px);
  font-weight: 400;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
  white-space: nowrap;
}
.countdown-colon { line-height: .90; transform: translateY(-1px); }
.countdown-unit small {
  display: block;
  margin-top: 3px;
  color: var(--sage);
  font-family: var(--number-font);
  font-size: clamp(9px, 2.05vw, 12px);
  font-weight: 600;
  letter-spacing: 1.3px;
  white-space: nowrap;
}
.countdown-note {
  display: inline-block;
  margin: 26px 0 0;
  padding-top: 12px;
  min-width: 185px;
  border-top: 1px solid var(--sage-line);
  color: var(--sage);
  font-family: var(--arabic-font);
  font-size: clamp(17px, 4.3vw, 21px);
  line-height: 1.8;
}

/* 5. RSVP: minimal, with the same sage palette and paper background. */
.rsvp-section { width: 100%; padding: 46px 22px 58px; text-align: center; background: var(--paper); }
.rsvp-content { width: 100%; max-width: 430px; margin: 0 auto; }
.rsvp-ornament { color: var(--sage-soft); font: 400 30px/1 var(--number-font); margin-bottom: 10px; }
.rsvp-content h2 { margin: 0; color: var(--sage); font: 400 clamp(33px, 9vw, 46px)/1.7 var(--arabic-title); }
.rsvp-subtitle { margin: 0 0 4px; color: var(--sage-dark); font: 400 clamp(17px, 4.5vw, 21px)/1.7 var(--arabic-font); }
.rsvp-children-note { margin: 0 auto 25px; color: var(--sage-soft); font: 400 clamp(16px, 4.1vw, 19px)/1.7 var(--arabic-font); }
.rsvp-choice { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rsvp-choice-btn {
  min-height: 49px;
  padding: 9px 10px;
  background: transparent;
  border: 1px solid var(--sage-line);
  border-radius: 2px;
  color: var(--sage);
  font: 400 clamp(16px, 4.1vw, 20px)/1.25 var(--arabic-font);
  cursor: pointer;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}
.rsvp-choice-btn:is(.active, :hover) { color: var(--paper); background: var(--sage); border-color: var(--sage); }
.rsvp-choice-btn:focus-visible, .submit-rsvp:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 3px; }
.rsvp-form { margin-top: 26px; text-align: right; animation: formReveal .4s ease both; }
.rsvp-form-title { margin: 0 0 16px; font-size: 18px; line-height: 1.6; }
.rsvp-form input, .rsvp-form textarea {
  display: block;
  width: 100%;
  padding: 12px 15px;
  margin: 0 0 14px;
  background: rgba(255,255,255,.45);
  color: var(--sage-dark);
  border: 1px solid var(--sage-line);
  border-radius: 3px;
  font: 400 18px/1.6 var(--arabic-font);
  text-align: right;
  direction: rtl;
  outline: none;
}
.rsvp-form input { min-height: 48px; }
.rsvp-form textarea { min-height: 86px; resize: vertical; }
.rsvp-form input::placeholder, .rsvp-form textarea::placeholder { color: #82917b; }
.rsvp-form :is(input,textarea):focus { border-color: var(--sage); box-shadow: 0 0 0 3px rgba(85,105,83,.10); }
.submit-rsvp {
  width: 100%; min-height: 50px; border: 1px solid var(--sage); border-radius: 2px;
  background: var(--sage); color: var(--paper); font: 400 19px/1.3 var(--arabic-font);
  cursor: pointer; transition: background-color .2s ease;
}
.submit-rsvp:hover { background: var(--sage-dark); }
.submit-rsvp:disabled { opacity: .60; cursor: wait; }
.rsvp-status { margin: 17px auto 0; padding: 12px 14px; line-height: 1.65; font-size: 17px; border: 1px solid var(--sage-line); }
.rsvp-status.error { color: #8d4a45; border-color: rgba(141,74,69,.4); }
.rsvp-status.success { color: var(--sage-dark); }
.visually-hidden { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }

/* 6. Full location artwork with an unobtrusive map link in the blank space. */
.location-map-link {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 41.8%;
  transform: translateX(-50%);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
  max-width: 80%;
  padding: 5px 12px;
  border: 1px solid var(--sage-line);
  border-radius: 2px;
  background: rgba(253,252,247,.80);
  color: var(--sage);
  font: 400 clamp(12px, 3.2vw, 16px)/1.4 var(--arabic-font);
  white-space: nowrap;
  text-decoration: none;
}
.location-map-link svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; }
.location-map-link:hover { background: var(--paper); }
.location-map-link:focus-visible { outline: 2px solid var(--sage-dark); outline-offset: 2px; }

@keyframes softPulse { 0%,100% {opacity:.78} 50% {opacity:1} }
@keyframes textFadeOut { from {opacity:1} to {opacity:0} }
@keyframes formReveal { from {opacity:0; transform:translateY(-9px)} to {opacity:1; transform:translateY(0)} }
@media (max-width: 360px) {
  .countdown-section { padding-inline: 10px; }
  .countdown-unit > span, .countdown-colon { font-size: 10vw; }
  .countdown-unit small { font-size: 2.1vw; letter-spacing: .8px; }
  .rsvp-choice { gap: 7px; }
  .rsvp-choice-btn { font-size: 15px; }
  .location-map-link { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
