:root {
  --ivory: #f7f3ea;
  --paper: #eee8dc;
  --sage: #a9ad91;
  --olive: #858b68;
  --olive-deep: #68704e;
  --olive-soft: #b7bc9a;
  --ink: #645853;
  --white: #fffdf9;
  color-scheme: light;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #d8d0c5;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100%;
  background: #d8d0c5;
  color: var(--ink);
  font-family: "Tajawal", sans-serif;
  font-weight: 300;
}

body.is-locked {
  overflow: hidden;
  overscroll-behavior: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.page-frame {
  position: relative;
  width: min(100%, 560px);
  min-height: 100svh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--ivory);
  box-shadow: 0 0 48px rgba(73, 58, 46, 0.2);
}

.envelope {
  position: fixed;
  z-index: 100;
  inset: 0;
  width: min(100%, 560px);
  height: 100svh;
  margin: auto;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #f3f0e6 url("assets/envelope-cover.jpg") center center / cover no-repeat;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.envelope::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent 50%, rgba(76,59,49,.08));
}

.envelope__hint {
  position: absolute;
  z-index: 1;
  top: 8.5svh;
  left: 50%;
  color: rgba(104,112,78,.82);
  font-family: "Tajawal", sans-serif;
  font-size: clamp(.78rem, 3.2vw, .96rem);
  font-weight: 400;
  letter-spacing: .08em;
  text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 4px 14px rgba(63,51,44,.14);
  animation: breathe 2.2s ease-in-out infinite;
  transform: translateX(-50%);
}

.envelope.is-open {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% { opacity: .6; transform: translateX(-50%) translateY(0); }
  50% { opacity: 1; transform: translateX(-50%) translateY(4px); }
}

.opening-film {
  position: fixed;
  z-index: 90;
  inset: 0;
  width: min(100%, 560px);
  height: 100svh;
  margin: auto;
  background: #f0eae0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .65s ease, visibility .65s ease;
}

.opening-film.is-playing {
  opacity: 1;
  visibility: visible;
}

.opening-film.is-finished {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opening-film__video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.skip-intro {
  position: absolute;
  z-index: 1;
  top: max(18px, env(safe-area-inset-top));
  left: 18px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 99px;
  padding: 8px 16px;
  background: rgba(70,55,49,.24);
  color: #fff;
  font: inherit;
  font-size: .68rem;
  backdrop-filter: blur(8px);
}

.invitation {
  opacity: 0;
  visibility: hidden;
  transition: opacity 1.1s ease;
}

.invitation.is-visible {
  opacity: 1;
  visibility: visible;
}

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--white);
  text-align: center;
  isolation: isolate;
}

.hero__video,
.hero__veil {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero__video {
  object-fit: cover;
}

.hero__veil {
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(71,61,54,.3), rgba(82,70,62,.18) 42%, rgba(60,51,47,.34)),
    radial-gradient(circle at 50% 40%, transparent 8%, rgba(52,44,41,.2) 100%);
}

.hero__content {
  width: 100%;
  padding: 8svh 26px 16svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow: 0 2px 18px rgba(64,51,45,.38);
}

.eyebrow,
.section__kicker {
  margin: 0;
  font-size: clamp(.76rem, 3vw, .88rem);
  letter-spacing: .1em;
}

.eyebrow,
.section__kicker,
.scroll-cue,
.hero__date,
.hero__hijri,
.time-card span,
.venue-card__label,
.venue-card > p,
.venue-card__time span,
.map-button,
footer p {
  font-family: "Tajawal", sans-serif;
}

.couple-name {
  width: min(94%, 460px);
  margin: clamp(118px, 17svh, 176px) auto 0;
  line-height: 0;
}

.couple-name img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.fine-rule {
  width: 118px;
  margin: 18px auto 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .48rem;
}

.fine-rule::before,
.fine-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: currentColor;
  opacity: .65;
}

.hero__date,
.hero__hijri {
  margin: 2px 0;
  font-size: clamp(.82rem, 3.5vw, 1rem);
}

.hero__date--numbers {
  direction: rtl;
  font-weight: 400;
}

.hero__hijri {
  margin-top: 6px;
  font-size: .72rem;
  opacity: .86;
}

.scroll-cue {
  position: absolute;
  bottom: max(22px, env(safe-area-inset-bottom));
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: .57rem;
  letter-spacing: .08em;
  text-decoration: none;
  transform: translateX(-50%);
}

.scroll-cue i {
  width: 14px;
  height: 14px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  animation: descend 1.8s ease-in-out infinite;
  transform: rotate(45deg);
}

@keyframes descend {
  0%, 100% { opacity: .4; transform: rotate(45deg) translate(0,0); }
  50% { opacity: 1; transform: rotate(45deg) translate(4px,4px); }
}

.section {
  position: relative;
  padding: 88px 22px;
  text-align: center;
  overflow: hidden;
}

.section::before,
.section::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border: 1px solid rgba(170,129,123,.2);
  border-radius: 50%;
}

.section::before { top: -82px; right: -58px; }
.section::after { bottom: -78px; left: -58px; }

.section__ornament {
  margin-bottom: 12px;
  color: var(--olive);
  font-family: serif;
  font-size: 1.7rem;
}

.section h2 {
  position: relative;
  display: inline-block;
  margin: 10px 0 34px;
  color: var(--olive-deep);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: clamp(1.45rem, 6.4vw, 2.1rem);
  font-weight: 500;
  letter-spacing: -.04em;
  text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 9px 24px rgba(104,112,78,.14);
  animation: title-glow 4.6s ease-in-out infinite;
}

.section h2::after {
  content: "";
  position: absolute;
  width: min(150px, 78%);
  height: 8px;
  right: 50%;
  bottom: -18px;
  background:
    radial-gradient(closest-side, var(--olive) 65%, transparent 70%) 50% 50% / 8px 8px no-repeat,
    linear-gradient(90deg, transparent, rgba(133,139,104,.58) 18%, rgba(133,139,104,.58) 44%, transparent 44% 56%, rgba(133,139,104,.58) 56%, rgba(133,139,104,.58) 82%, transparent);
  opacity: .84;
  transform: translateX(50%);
  animation: title-rule 4.6s ease-in-out infinite;
}

@keyframes title-glow {
  0%, 100% { text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 9px 24px rgba(104,112,78,.12); }
  50% { text-shadow: 0 1px 0 rgba(255,255,255,.95), 0 12px 28px rgba(104,112,78,.27); }
}

@keyframes title-rule {
  0%, 100% { opacity: .58; transform: translateX(50%) scaleX(.9); }
  50% { opacity: .95; transform: translateX(50%) scaleX(1); }
}

.countdown {
  background:
    radial-gradient(circle at 20% 20%, rgba(183,188,154,.3), transparent 35%),
    var(--ivory);
}

.countdown__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.time-card {
  min-width: 0;
  padding: 18px 4px 15px;
  border: 1px solid rgba(133,139,104,.3);
  border-radius: 999px 999px 20px 20px;
  background: rgba(255,255,255,.43);
}

.time-card strong,
.time-card span {
  display: block;
}

.time-card strong {
  color: var(--olive-deep);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: clamp(1.25rem, 6vw, 1.75rem);
  font-weight: 500;
}

.time-card span {
  margin-top: 3px;
  font-size: clamp(.52rem, 2.4vw, .68rem);
}

.vector-divider {
  position: relative;
  z-index: 2;
  padding: 0 10px;
  background: var(--ivory);
  color: var(--olive);
}

.vector-divider svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.clock-divider {
  margin-block: -12px -18px;
  padding-block: 2px 8px;
}

.divider-branches,
.divider-clock {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.divider-leaves {
  fill: rgba(133,139,104,.14);
  stroke: currentColor;
  stroke-width: 1.2;
}

.divider-blooms {
  fill: rgba(215,184,176,.42);
  stroke: rgba(133,139,104,.68);
  stroke-width: 1;
}

.divider-clock circle:first-child {
  fill: rgba(183,188,154,.13);
}

.details {
  background:
    linear-gradient(rgba(238,232,220,.95), rgba(238,232,220,.97)),
    url("assets/envelope-cover.jpg") center / cover fixed;
}

.venue-card {
  position: relative;
  padding: 48px 22px 30px;
  border: 1px solid rgba(126,101,91,.22);
  border-radius: 180px 180px 24px 24px;
  background: rgba(255,253,249,.7);
  box-shadow: 0 22px 50px rgba(89,69,60,.09);
  backdrop-filter: blur(8px);
}

.venue-card__pin {
  width: 66px;
  height: 66px;
  margin: -12px auto 18px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--olive);
  color: var(--white);
}

.venue-card__pin svg,
.map-button svg {
  width: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.venue-card__label {
  margin: 0;
  color: var(--olive-deep);
  font-size: .66rem;
  letter-spacing: .18em;
}

.venue-card h3 {
  margin: 10px auto 6px;
  max-width: 390px;
  color: var(--olive-deep);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: clamp(1.15rem, 4.8vw, 1.55rem);
  font-weight: 500;
  line-height: 1.5;
}

.venue-card > p:not(.venue-card__label) {
  margin: 0;
  font-size: .75rem;
}

.venue-card__date {
  width: min(100%, 280px);
  margin: 30px auto 26px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border-block: 1px solid rgba(126,101,91,.2);
  padding: 14px 0;
  font-size: .65rem;
}

.venue-card__date strong {
  color: var(--olive-deep);
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 1.75rem;
  font-weight: 500;
}

.venue-card__time {
  margin: -10px auto 24px !important;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 10px;
  color: var(--olive-deep);
}

.venue-card__time span {
  font-size: .58rem;
  letter-spacing: .06em;
}

.venue-card__time strong {
  font-family: "Noto Kufi Arabic", sans-serif;
  font-size: 1rem;
  font-weight: 500;
}

.map-button {
  width: min(100%, 290px);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--olive-deep);
  border-radius: 999px;
  padding: 13px 18px;
  background: var(--olive-deep);
  color: var(--white);
  font-size: .72rem;
  text-decoration: none;
  box-shadow: 0 12px 28px rgba(104,112,78,.2);
  transition: transform .2s ease, box-shadow .2s ease;
}

.map-button:active {
  transform: scale(.98);
}

.map-button svg { width: 20px; }

footer {
  position: relative;
  padding: 18px 20px calc(52px + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0, rgba(255,255,255,.08), transparent 46%),
    linear-gradient(180deg, #7f8565, #62694b);
  color: var(--white);
  text-align: center;
}

footer::before,
footer::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 50%;
}

footer::before { top: -105px; right: -92px; }
footer::after { bottom: -116px; left: -92px; }

.footer__flourish {
  width: min(100%, 440px);
  margin: 0 auto 4px;
  color: rgba(255,255,255,.48);
}

.footer__flourish svg {
  width: 100%;
  display: block;
  overflow: visible;
}

.footer__flourish path,
.footer__flourish ellipse,
.footer__flourish circle {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.footer__flourish ellipse {
  fill: rgba(255,255,255,.06);
}

.footer__calligraphy {
  width: min(74%, 310px);
  height: auto;
  margin: -4px auto 6px;
  display: block;
  filter: brightness(0) invert(1);
}

footer p {
  margin: 4px 0;
  font-size: .62rem;
  letter-spacing: .08em;
}

.footer__time {
  color: rgba(255,255,255,.78);
}

.sound-toggle {
  position: fixed;
  z-index: 110;
  right: max(16px, calc((100vw - 560px) / 2 + 16px));
  bottom: max(16px, env(safe-area-inset-bottom));
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 50%;
  background: rgba(163,159,128,.84);
  color: #fff;
  box-shadow: 0 8px 20px rgba(73,58,46,.14);
  backdrop-filter: blur(8px);
}

.sound-toggle[hidden] { display: none; }

.sound-toggle svg {
  width: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.sound-toggle .sound-off { display: none; }
.sound-toggle.is-muted .sound-on { display: none; }
.sound-toggle.is-muted .sound-off { display: block; }

.reveal-on-scroll {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .8s ease, transform .8s ease;
}

.reveal-on-scroll.is-seen {
  opacity: 1;
  transform: translateY(0);
}

@media (min-width: 561px) {
  .envelope,
  .opening-film {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

@media (max-width: 370px) {
  .section { padding-inline: 16px; }
  .countdown__grid { gap: 5px; }
  .time-card { padding-inline: 2px; }
}

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