/* Royal wedding invitation — mobile first */

:root {
  --cream: #eef2e6;
  --blush: #e4ead8;
  --petal: #dce4d0;
  /* لوحة زيتية */
  --olive: #e8f0dc;
  --olive-soft: #d0ddb8;
  --olive-muted: #b4c49a;
  --olive-deep: #8a9b6e;
  --olive-shadow: #3d4a32;
  --gold: #c4d4a0;
  --gold-soft: #dde8c8;
  --gold-deep: #9aad7a;
  --ink: var(--olive);
  --ink-soft: rgba(232, 240, 220, 0.94);
  --white: #ffffff;
  --shadow-soft: 0 0.35rem 1.5rem rgba(0, 0, 0, 0.35);
  /* قراءة النص مباشرة فوق الفيديو دون طبقة تعتيم */
  --text-glow:
    0 0 0.06em rgba(0, 0, 0, 0.92),
    0 0.04em 0.12em rgba(0, 0, 0, 0.95),
    0 0.12em 0.35em rgba(0, 0, 0, 0.85),
    0 0.2em 0.9em rgba(0, 0, 0, 0.55);
  --font-ar: "Tajawal", "Noto Sans Arabic", "Segoe UI", system-ui, sans-serif;
  --font-en: "Cinzel", "Palatino Linotype", Palatino, Georgia, serif;
  --reveal-duration: 0.78s;
  --reveal-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  color: var(--olive);
  background: #0f140c;
  overflow-x: hidden;
}

/* Full-screen video background */
.video-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 2s ease;
}

.video-bg__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

body.lang-ar {
  font-family: var(--font-ar);
}

body.lang-en {
  font-family: var(--font-en);
}

/* Language switcher */
.lang-toggle {
  position: fixed;
  z-index: 50;
  top: 1rem;
  inset-inline-end: 1rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lang-toggle__inner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.65rem;
  min-height: 2.15rem;
  padding: 0.48rem 0.82rem;
  border-radius: 0.38rem;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(8, 10, 8, 0.35);
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  font-family: var(--font-en);
  letter-spacing: 0.08em;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lang-toggle__label {
  font-family: var(--font-en);
  font-size: 0.78rem;
  line-height: 1;
}

.lang-toggle:hover .lang-toggle__inner {
  border-color: #fff;
  background: rgba(8, 10, 8, 0.5);
  box-shadow: 0 0.4rem 1.25rem rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.lang-toggle:active .lang-toggle__inner {
  transform: translateY(0);
}

.lang-toggle__label--en {
  display: none;
}

body.lang-en .lang-toggle__label--ar {
  display: none;
}

body.lang-en .lang-toggle__label--en {
  display: inline;
}

.intro-spacer {
  min-height: clamp(18vh, 26vw, 30vh);
  pointer-events: none;
}

.invitation {
  position: relative;
  z-index: 1;
  max-width: 32rem;
  margin: 0 auto;
  padding: 4.5rem 1.35rem 4rem;
}

/* الأقسام لا تعتمّ فوق الفيديو؛ الظهور التدريجي عبر .reveal فقط */
.section {
  position: relative;
  margin-bottom: clamp(2.5rem, 8vw, 3.5rem);
  opacity: 1;
  transform: none;
}

.section.in-view {
  opacity: 1;
  transform: none;
}

.content-stack {
  display: grid;
}

.content-stack > .lang-block {
  grid-area: 1 / 1;
  align-self: center;
  justify-self: center;
  width: 100%;
  text-align: center;
  transition: opacity 0.38s ease;
}

body.lang-ar .lang-block--en,
body.lang-en .lang-block--ar {
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

body.lang-ar .lang-block--ar,
body.lang-en .lang-block--en {
  opacity: 1;
  pointer-events: auto;
  z-index: 1;
}

.lang-block {
  transition: opacity 0.4s ease;
}

/* Hero */
.section--hero {
  text-align: center;
  padding-top: 0.5rem;
}

.reveal {
  opacity: 0;
  transform: translate3d(0, 1rem, 0);
  transition: opacity var(--reveal-duration) var(--reveal-ease),
    transform var(--reveal-duration) var(--reveal-ease);
}

html[dir="rtl"] .section--hero .reveal {
  transform: translate3d(0.75rem, 0.5rem, 0);
}

html[dir="ltr"] .section--hero .reveal {
  transform: translate3d(-0.75rem, 0.5rem, 0);
}

.reveal.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.reveal-line {
  margin: 0 0 clamp(0.65rem, 2.5vw, 0.9rem);
  font-size: clamp(1.12rem, 4.6vw, 1.38rem);
  font-weight: 600;
  color: var(--olive);
  line-height: 1.55;
  text-shadow: var(--text-glow);
}

body.lang-en .reveal-line {
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 3.5vw, 1.05rem);
}

.reveal-line--accent {
  font-size: clamp(1.28rem, 5.2vw, 1.52rem);
  background: none;
  -webkit-background-clip: border-box;
  background-clip: border-box;
  color: #ffffff;
  -webkit-text-fill-color: #ffffff;
  font-weight: 700;
  text-shadow: var(--text-glow);
  filter: drop-shadow(0 0.12em 0.35em rgba(0, 0, 0, 0.55));
}

body.lang-en .reveal-line--accent {
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: clamp(1.02rem, 3.9vw, 1.15rem);
}

/* Names */
.section--names {
  text-align: center;
}

.names.content-stack {
  display: grid;
}

.names .lang-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.2rem, 1.4vw, 0.55rem);
  width: 100%;
}

.name-part {
  display: block;
  font-size: clamp(2.35rem, 11vw, 3.55rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.04em;
  text-shadow: var(--text-glow);
}

body.lang-en .name-part {
  letter-spacing: 0.22em;
  font-weight: 600;
}

.name-amp {
  display: block;
  font-size: clamp(1.55rem, 6.5vw, 2.15rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  font-family: var(--font-en);
  text-shadow: var(--text-glow);
}

.names .reveal {
  transform: translate3d(0, 1.25rem, 0) scale(0.96);
}

.names .reveal.is-visible {
  transform: translate3d(0, 0, 0) scale(1);
}

/* Details */
.details .reveal {
  margin: 0 0 0.5rem;
  font-size: clamp(1.08rem, 4vw, 1.28rem);
  color: #fff;
  line-height: 1.6;
  text-shadow: var(--text-glow);
}

body.lang-en .details .reveal {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: clamp(0.86rem, 3vw, 0.98rem);
}

/* Our story */
.section--story .content-stack > .lang-block {
  justify-self: stretch;
  width: 100%;
  max-width: 22rem;
  text-align: start;
}

.section-heading {
  margin: 0 0 0.35rem;
  font-size: clamp(1.35rem, 5.5vw, 1.78rem);
  font-weight: 600;
  color: #fff;
  line-height: 1.25;
  text-shadow: var(--text-glow);
}

body.lang-en .section-heading {
  font-family: var(--font-en);
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: clamp(1.12rem, 4.2vw, 1.48rem);
}

.timeline {
  margin-top: 0.5rem;
  padding-inline-start: 1.2rem;
  border-inline-start: 2px solid rgba(255, 255, 255, 0.5);
}

.timeline__item {
  position: relative;
  margin-bottom: clamp(1rem, 3.2vw, 1.4rem);
}

.timeline__item:last-child {
  margin-bottom: 0;
}

.timeline__item::before {
  content: "";
  position: absolute;
  inset-inline-start: calc(-1.2rem - 6px);
  top: 0.42em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
}

.timeline__text {
  margin: 0;
  font-size: clamp(1.02rem, 3.8vw, 1.18rem);
  line-height: 1.65;
  color: #fff;
  text-shadow: var(--text-glow);
}

body.lang-en .timeline__text {
  font-family: var(--font-en);
  font-size: clamp(0.95rem, 3.4vw, 1.08rem);
  letter-spacing: 0.04em;
}

/* Countdown */
.section--countdown .content-stack > .lang-block {
  justify-self: stretch;
  width: 100%;
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.65rem 0.4rem;
  margin-top: 1.15rem;
  width: 100%;
  max-width: 26rem;
  margin-inline: auto;
}

.countdown__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
}

.countdown__num {
  font-family: var(--font-en);
  font-size: clamp(1.85rem, 8.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1;
  color: var(--olive);
  text-shadow: var(--text-glow);
  font-variant-numeric: tabular-nums;
}

.countdown__label {
  font-size: clamp(0.62rem, 2.3vw, 0.74rem);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--text-glow);
}

body.lang-ar .countdown__label {
  letter-spacing: 0.06em;
  text-transform: none;
  font-size: clamp(0.72rem, 2.6vw, 0.84rem);
  color: #fff;
}

/* Map */
.section--map {
  text-align: center;
}

.map-wrap {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(160, 180, 130, 0.4);
  margin-bottom: 1.25rem;
}

.map-iframe {
  display: block;
  width: 100%;
  height: clamp(14rem, 42vw, 17rem);
  border: 0;
}

.btn-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  padding: 0.9rem 1.3rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(0.95rem, 3.2vw, 1.08rem);
  font-weight: 700;
  color: #1e2618;
  background: linear-gradient(120deg, var(--gold-soft) 0%, var(--gold) 45%, #c5d4a8 100%);
  box-shadow: 0 0.35rem 1.75rem rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.lang-en .btn-map {
  font-family: var(--font-en);
  font-weight: 600;
}

.btn-map:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 2.25rem rgba(160, 190, 130, 0.45);
}

.btn-map__en {
  display: none;
}

body.lang-en .btn-map__ar {
  display: none;
}

body.lang-en .btn-map__en {
  display: inline;
}

.btn-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 22rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(0.95rem, 3.2vw, 1.08rem);
  font-weight: 700;
  color: #fff;
  background: linear-gradient(120deg, #3fe877 0%, #25d366 48%, #1bae55 100%);
  box-shadow: 0 0.35rem 1.75rem rgba(0, 0, 0, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

body.lang-en .btn-wa {
  font-family: var(--font-en);
  font-weight: 600;
}

.btn-wa:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 2rem rgba(37, 211, 102, 0.45);
}

.btn-wa:active {
  transform: translateY(0);
}

.btn-wa__en {
  display: none;
}

body.lang-en .btn-wa__ar {
  display: none;
}

body.lang-en .btn-wa__en {
  display: inline;
}

/* Footer / closing */
.footer-stack .reveal {
  transform: translate3d(0, 0.5rem, 0);
}

.footer-stack {
  min-height: 2.5rem;
}

.footer-share {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: clamp(1.25rem, 4vw, 1.75rem);
  padding-bottom: 0.25rem;
}

.footer-share .btn-wa {
  margin-top: 0;
}

.closing-rule {
  height: 1px;
  width: 100%;
  max-width: 15rem;
  margin: 0 auto 1.15rem;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(160, 180, 130, 0.7),
    transparent
  );
  border: 0;
  border-radius: 1px;
}

.closing-tagline {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: clamp(1.02rem, 3.6vw, 1.2rem);
  font-weight: 600;
  color: var(--olive-muted);
  text-shadow: var(--text-glow);
}

body.lang-en .closing-tagline {
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: clamp(0.9rem, 3.2vw, 1.02rem);
}

.closing-couple {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin: 0 0 0.35rem;
  text-align: center;
  font-size: clamp(1.4rem, 5.2vw, 1.85rem);
  font-weight: 600;
  color: var(--olive);
  letter-spacing: 0.05em;
  text-shadow: var(--text-glow);
}

.closing-couple .closing-name {
  display: block;
}

body.lang-en .closing-couple {
  font-family: var(--font-en);
  letter-spacing: 0.14em;
}

body.lang-en .closing-couple .closing-name {
  font-family: var(--font-en);
}

body.lang-ar .closing-couple {
  font-family: var(--font-ar);
}

body.lang-ar .closing-couple .closing-name {
  font-family: var(--font-ar);
}

.closing-amp {
  display: block;
  line-height: 1;
  color: var(--olive-deep);
  margin: 0;
  font-family: var(--font-en);
  font-size: clamp(1.1rem, 4vw, 1.45rem);
}

.closing-credit {
  margin: 0.95rem 0 0;
  text-align: center;
  font-size: clamp(0.66rem, 2.3vw, 0.76rem);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: var(--text-glow);
}

/* Utilities */
.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;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .section,
  .reveal {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .section {
    opacity: 1;
    transform: none;
  }
}

/* Wider screens */
@media (min-width: 480px) {
  .invitation {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .lang-toggle {
    inset-inline-end: 1.5rem;
  }
}

@media (min-width: 768px) {
  .invitation {
    max-width: 36rem;
    padding-top: 5.5rem;
  }
}
