:root {
  --rose-950: #4f2f31;
  --rose-800: #704448;
  --rose-700: #8f5d5d;
  --rose-500: #bc8887;
  --rose-300: #dfb9b3;
  --rose-100: #f5e6e2;
  --rose-50: #fcf7f5;
  --paper: #fffdfb;
  --ink: #34292a;
  --muted: #786768;
  --green: #27794c;
  --green-dark: #1f623e;
  --shadow: 0 20px 55px rgba(79, 47, 49, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 0;
  font-family: "Tajawal", Tahoma, Arial, sans-serif;
  direction: rtl;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.8;
}

body.invitation-closed {
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}

.invitation-gate {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 28px 18px;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(31, 17, 19, 0.5), rgba(79, 47, 49, 0.76)),
    url("../image/cover.jpeg") center / cover no-repeat;
  will-change: opacity;
  transition: opacity 760ms ease, visibility 760ms ease;
}

.invitation-gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(255, 244, 237, 0.16), transparent 42%),
    linear-gradient(90deg, rgba(20, 10, 12, 0.2), transparent 30%, transparent 70%, rgba(20, 10, 12, 0.2));
  backdrop-filter: blur(2px);
}

.invitation-gate::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 50%;
  width: 135vmax;
  height: 135vmax;
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 253, 251, 0.98) 0 42%, rgba(245, 230, 226, 0.95) 72%, rgba(223, 185, 179, 0.88));
  transform: translate(-50%, -50%) scale(0.025);
  will-change: transform, opacity;
  transition:
    transform 920ms cubic-bezier(0.16, 0.72, 0.18, 1),
    opacity 280ms ease;
}

.invitation-gate.is-leaving {
  visibility: hidden;
  opacity: 0;
}

.invitation-gate.is-revealing::after {
  opacity: 0.96;
  transform: translate(-50%, -50%) scale(1);
}

.gate-content {
  position: relative;
  z-index: 2;
  width: min(470px, 100%);
  text-align: center;
}

.gate-eyebrow {
  margin: 0 0 2px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  transition: opacity 420ms ease, transform 620ms ease;
}

.gate-title {
  margin: 0 0 20px;
  font-family: "Aref Ruqaa", serif;
  font-size: clamp(2.4rem, 10vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  text-shadow: 0 5px 24px rgba(0, 0, 0, 0.35);
  transition: opacity 420ms ease, transform 620ms ease;
}

.open-invitation {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
}

.open-invitation:disabled {
  cursor: wait;
}

.open-invitation:disabled .envelope {
  opacity: 0.82;
  filter: drop-shadow(0 18px 20px rgba(20, 10, 12, 0.28)) saturate(0.85);
}

.envelope {
  position: relative;
  display: block;
  width: min(390px, 88vw);
  aspect-ratio: 1.42;
  margin: 0 auto;
  perspective: 1000px;
  filter: drop-shadow(0 24px 24px rgba(20, 10, 12, 0.35));
  will-change: transform, opacity, filter;
  transition:
    transform 880ms cubic-bezier(0.16, 0.72, 0.18, 1),
    opacity 580ms ease,
    filter 700ms ease;
}

.open-invitation:hover .envelope,
.open-invitation:focus-visible .envelope {
  transform: translateY(-5px);
}

.open-invitation:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 10px;
  border-radius: 8px;
}

.envelope-back,
.envelope-letter,
.envelope-front,
.envelope-flap,
.envelope-seal {
  position: absolute;
  display: block;
}

.envelope-back {
  inset: 8% 0 0;
  border: 1px solid rgba(110, 67, 70, 0.28);
  border-radius: 5px;
  background: #e8c8c0;
}

.envelope-letter {
  z-index: 2;
  top: 13%;
  right: 7%;
  width: 86%;
  height: 76%;
  padding: 23px 18px;
  border: 1px solid rgba(143, 93, 93, 0.2);
  border-radius: 3px;
  color: var(--rose-950);
  background:
    linear-gradient(rgba(255, 253, 251, 0.94), rgba(255, 249, 245, 0.94)),
    repeating-linear-gradient(0deg, transparent 0 25px, rgba(143, 93, 93, 0.04) 26px);
  box-shadow: 0 3px 10px rgba(79, 47, 49, 0.1);
  transition: transform 620ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.letter-ornament,
.letter-heading,
.letter-names,
.letter-date {
  display: block;
}

.letter-ornament {
  color: var(--rose-500);
  font-size: 1.35rem;
  line-height: 1;
}

.letter-heading {
  margin-top: 3px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.letter-names {
  margin-top: 3px;
  font-family: "Aref Ruqaa", serif;
  font-size: clamp(1.65rem, 7vw, 2.4rem);
  font-weight: 700;
  line-height: 1.25;
}

.letter-date {
  margin-top: 5px;
  color: var(--rose-700);
  font-family: "Cormorant Garamond", "Tajawal", serif;
  font-size: 0.9rem;
  letter-spacing: 0.12em;
}

.envelope-front {
  z-index: 4;
  inset: 8% 0 0;
  border-radius: 0 0 5px 5px;
  background: linear-gradient(145deg, #f0d9d3, #dcb7ae);
  clip-path: polygon(0 29%, 50% 65%, 100% 29%, 100% 100%, 0 100%);
}

.envelope-front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.15);
  clip-path: polygon(0 29%, 50% 65%, 0 100%);
}

.envelope-flap {
  z-index: 5;
  top: 8%;
  right: 0;
  width: 100%;
  height: 64%;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(165deg, #f2ddd7, #d6aaa1);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: 50% 0;
  transition: transform 540ms cubic-bezier(0.4, 0, 0.2, 1), z-index 0s 270ms;
}

.envelope-seal {
  z-index: 6;
  top: 53%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 235, 219, 0.4);
  border-radius: 50%;
  color: #fff4eb;
  font-family: "Aref Ruqaa", serif;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 0.85;
  background:
    radial-gradient(circle at 35% 30%, #b67879, #704448 75%);
  box-shadow: 0 4px 12px rgba(79, 47, 49, 0.38), inset 0 0 0 4px rgba(255, 255, 255, 0.08);
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, transform 220ms ease;
}

.gate-prompt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 22px;
  padding: 9px 27px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 700;
  background: rgba(79, 47, 49, 0.6);
  box-shadow: 0 9px 24px rgba(20, 10, 12, 0.22);
  backdrop-filter: blur(8px);
  animation: none;
  transition: opacity 360ms ease, transform 520ms ease;
}

.invitation-gate.is-ready .gate-prompt {
  animation: gate-pulse 1.8s ease-in-out infinite;
}

.gate-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(250px, 74vw);
  margin: 13px auto 0;
  font-size: 0.76rem;
  transition: opacity 300ms ease, transform 300ms ease;
}

.gate-loading-track {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
}

.gate-loading-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #fff7f1;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
  transition: width 260ms ease;
}

.invitation-gate.is-ready .gate-loading {
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
}

.gate-note {
  margin: 13px 0 0;
  font-size: 0.84rem;
  text-shadow: 0 2px 9px rgba(0, 0, 0, 0.45);
  transition: opacity 360ms ease, transform 560ms ease;
}

.invitation-gate.is-opening .envelope-flap {
  z-index: 1;
  transform: rotateX(178deg);
}

.invitation-gate.is-opening .envelope-letter {
  transform: translateY(-25%);
}

.invitation-gate.is-opening .envelope-seal {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
}

.invitation-gate.is-opening .gate-prompt {
  animation: none;
  opacity: 0;
}

.invitation-gate.is-revealing .envelope {
  opacity: 0;
  filter: blur(7px) drop-shadow(0 24px 24px rgba(20, 10, 12, 0.2));
  transform: translateY(-5vh) scale(2.15);
}

.invitation-gate.is-revealing .gate-eyebrow,
.invitation-gate.is-revealing .gate-title,
.invitation-gate.is-revealing .gate-note,
.invitation-gate.is-revealing .gate-loading {
  opacity: 0;
  transform: translateY(-16px);
}

.hero {
  transition: transform 1100ms cubic-bezier(0.16, 0.72, 0.18, 1), filter 900ms ease;
}

body.invitation-closed .hero {
  filter: blur(5px);
  transform: scale(1.055);
}

body.invitation-closed #music-toggle,
body.invitation-closed #toTop {
  pointer-events: none;
  opacity: 0;
}

@keyframes gate-pulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@media (max-height: 680px) {
  .invitation-gate { padding-block: 14px; }
  .gate-title { margin-bottom: 8px; font-size: 2.25rem; }
  .envelope { width: min(320px, 78vw); }
  .gate-prompt { margin-top: 10px; }
  .gate-note { margin-top: 6px; }
}

@media (max-width: 700px) {
  .invitation-gate {
    background:
      linear-gradient(180deg, rgba(31, 17, 19, 0.5), rgba(79, 47, 49, 0.76)),
      url("../image/cover-mobile.jpeg") center / cover no-repeat;
  }

  .invitation-gate.is-revealing .envelope {
    filter: blur(8px) drop-shadow(0 20px 20px rgba(20, 10, 12, 0.16));
    transform: translateY(-3vh) scale(3.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate-prompt { animation: none; }
  .envelope,
  .envelope-letter,
  .envelope-flap,
  .envelope-seal,
  .invitation-gate { transition-duration: 1ms; }
}

body,
button,
a {
  font-family: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

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

.center {
  text-align: center;
}

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(28, 17, 18, 0.38), rgba(56, 30, 33, 0.62)),
    url("../image/cover.jpeg") center 36% / cover no-repeat;
  background-attachment: fixed;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(34, 18, 20, 0.18), transparent 34%, transparent 66%, rgba(34, 18, 20, 0.18)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.25), transparent 22%, transparent 72%, rgba(0, 0, 0, 0.3));
}

.site-nav {
  position: relative;
  z-index: 10;
  width: 100%;
  padding: 18px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(180deg, rgba(26, 16, 17, 0.45), transparent);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.nav-brand {
  font-family: "Aref Ruqaa", serif;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.36);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links a {
  position: relative;
  padding: 8px 0;
  font-size: 0.98rem;
  font-weight: 500;
}

.nav-links a::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 180ms ease;
}

.nav-links a:hover::after,
.nav-links a:focus-visible::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px auto;
  border-radius: 4px;
  background: currentColor;
  transition: transform 180ms ease, opacity 180ms ease;
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(960px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0 118px;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.45);
}

.hero-kicker {
  margin: 0 0 10px;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.14em;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin: 0;
  font-family: "Aref Ruqaa", serif;
  font-size: clamp(3.25rem, 8vw, 6.5rem);
  font-weight: 700;
  line-height: 1.08;
}

.hero-title-en {
  margin-top: 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.42em;
  font-weight: 600;
  letter-spacing: 0.035em;
}

.hero-divider {
  width: 76px;
  height: 1px;
  margin: 23px auto 19px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 0 22px rgba(255, 255, 255, 0.3);
}

.hero-date {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  font-size: clamp(1rem, 2.4vw, 1.24rem);
  font-weight: 500;
}

.hero-notices {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 17px 0 0;
}

.hero-notice,
.children-note {
  margin: 0;
  padding: 7px 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.6;
  background: rgba(79, 47, 49, 0.52);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
  backdrop-filter: blur(7px);
}

.children-note {
  flex-basis: auto;
}

.countdown {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 10px;
  width: min(540px, 100%);
  margin-top: 20px;
  direction: rtl;
}

.countdown-item {
  padding: 13px 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.11);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(7px);
}

.countdown-item strong {
  display: block;
  font-size: 1.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.countdown-item span {
  display: block;
  margin-top: 4px;
  font-size: 0.85rem;
}

.countdown.is-finished {
  display: block;
  padding: 18px 24px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 14px;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(7px);
}

.scroll-cue {
  position: absolute;
  z-index: 3;
  right: 50%;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 0.78rem;
  transform: translateX(50%);
}

.scroll-cue svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  animation: float-down 1.8s ease-in-out infinite;
}

@keyframes float-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

.section {
  padding: 94px 32px;
}

.section-inner {
  width: min(1160px, 100%);
  margin: 0 auto;
}

.section-inner.narrow {
  width: min(760px, 100%);
}

.section-eyebrow {
  margin: 0 0 5px;
  color: var(--rose-700);
  font-size: 0.98rem;
  font-weight: 700;
}

.section-title {
  margin: 0 0 48px;
  color: var(--rose-950);
  font-family: "Aref Ruqaa", serif;
  font-size: clamp(2.3rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.25;
}

.invitation {
  position: relative;
  overflow: hidden;
  background:
    url("../image/divider-flowers-leaves.png") bottom -45px center / auto 180px no-repeat,
    var(--paper);
}

.invitation::before,
.invitation::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid rgba(188, 136, 135, 0.18);
  border-radius: 50%;
}

.invitation::before {
  top: -150px;
  right: -80px;
}

.invitation::after {
  bottom: -155px;
  left: -90px;
}

.bismillah {
  width: auto;
  max-width: min(290px, 80%);
  max-height: 66px;
  margin-bottom: 25px;
  object-fit: contain;
}

.greeting {
  margin: 0 0 16px;
  color: var(--rose-800);
  font-size: 1.15rem;
  font-weight: 700;
}

.invitation-copy {
  margin: 0 auto;
  font-size: clamp(1.04rem, 2.2vw, 1.22rem);
}

.couple-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 42px 0 0;
  color: var(--rose-800);
  font-family: "Aref Ruqaa", serif;
}

.couple-names p {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.1rem);
  font-weight: 700;
  line-height: 1.15;
}

.couple-names > span {
  margin: -2px 0;
  color: var(--rose-500);
  font-family: "Cormorant Garamond", serif;
  font-size: 2.7rem;
  line-height: 1;
}

.couple-names small {
  margin-top: 12px;
  color: var(--muted);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.floral-divider {
  display: block;
  width: auto;
  max-width: min(220px, 70%);
  max-height: 62px;
  margin: 46px auto 0;
  object-fit: contain;
}

.schedule-section {
  background: linear-gradient(135deg, var(--rose-100), #f2deda);
}

.schedule-card {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(820px, 100%);
  margin: 0 auto 35px;
  overflow: hidden;
  border: 1px solid rgba(143, 93, 93, 0.2);
  border-radius: 22px;
  background: rgba(255, 253, 251, 0.74);
  box-shadow: var(--shadow);
}

.schedule-part {
  display: flex;
  min-height: 185px;
  padding: 28px 18px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.schedule-part + .schedule-part {
  border-right: 1px solid rgba(143, 93, 93, 0.17);
}

.schedule-part span {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.9rem;
}

.schedule-part strong {
  color: var(--rose-950);
  font-family: "Aref Ruqaa", serif;
  font-size: 2.35rem;
  line-height: 1.15;
}

.schedule-date strong {
  color: var(--rose-700);
  font-size: 4.7rem;
}

.schedule-part b {
  color: var(--rose-800);
  font-size: 1rem;
}

.action-button,
.rsvp-submit {
  display: inline-flex;
  min-height: 58px;
  padding: 12px 24px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: 0 12px 28px rgba(79, 47, 49, 0.2);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.action-button {
  background: var(--rose-700);
}

.action-button:hover,
.action-button:focus-visible {
  background: var(--rose-800);
  box-shadow: 0 16px 32px rgba(79, 47, 49, 0.27);
  transform: translateY(-2px);
}

.action-button svg,
.rsvp-submit svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.location-section {
  background: var(--rose-50);
}

.venue-copy {
  width: min(760px, 100%);
  margin: -19px auto 35px;
}

.venue-copy h3 {
  margin: 0 0 8px;
  color: var(--rose-800);
  font-family: "Aref Ruqaa", serif;
  font-size: 2rem;
}

.venue-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.venue-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  width: min(1100px, 100%);
  margin: 0 auto 28px;
}

.map-frame,
.venue-photo {
  min-height: 460px;
  margin: 0;
  overflow: hidden;
  border: 8px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  background: #e6d8d6;
  box-shadow: var(--shadow);
}

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

.venue-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.gallery-section {
  background: var(--paper);
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.memory-card {
  position: relative;
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: var(--rose-100);
  box-shadow: 0 13px 36px rgba(79, 47, 49, 0.16);
}

.memory-card::after {
  content: "";
  position: absolute;
  inset: 40% 0 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent, rgba(31, 17, 19, 0.86));
}

.memory-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.memory-card:nth-child(1) img {
  object-position: center 34%;
}

.memory-card:nth-child(3) img {
  object-position: center center;
}

.memory-card:nth-child(4) img {
  object-position: center 38%;
}

.memory-card:hover img {
  transform: scale(1.035);
}

.memory-card figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  padding: 25px;
  color: #fff;
  text-align: right;
}

.memory-card figcaption span {
  display: block;
  margin-bottom: 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.78rem;
  font-weight: 500;
}

.memory-card figcaption p {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.55;
}

.rsvp-section {
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(rgba(78, 44, 47, 0.9), rgba(78, 44, 47, 0.94)),
    url("../image/gallery-4.jpeg") center 42% / cover no-repeat;
}

.rsvp-section .section-eyebrow,
.rsvp-section .section-title {
  color: #fff;
}

.rsvp-copy {
  margin: -18px auto 30px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.rsvp-form {
  position: relative;
  display: grid;
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 30px;
  gap: 20px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.1);
  text-align: right;
  backdrop-filter: blur(9px);
}

.rsvp-field {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  font-weight: 700;
}

.rsvp-field input,
.rsvp-field textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
  font: inherit;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.rsvp-field input {
  height: 52px;
  padding: 0 15px;
}

.rsvp-field textarea {
  min-height: 130px;
  padding: 13px 15px;
  resize: vertical;
}

.rsvp-field input:focus,
.rsvp-field textarea:focus {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.rsvp-field input:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.guest-count-field {
  width: min(230px, 100%);
}

.attendance-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.attendance-fieldset legend {
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.92rem;
  font-weight: 700;
}

.attendance-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.attendance-options label {
  display: flex;
  min-height: 50px;
  padding: 10px 13px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.attendance-options input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--green);
}

.honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

.rsvp-submit {
  min-width: 240px;
  margin: 3px auto 0;
  border: 0;
  background: var(--green);
  box-shadow: 0 14px 32px rgba(13, 50, 31, 0.28);
  cursor: pointer;
}

.rsvp-submit:hover,
.rsvp-submit:focus-visible {
  background: var(--green-dark);
  box-shadow: 0 18px 36px rgba(13, 50, 31, 0.36);
  transform: translateY(-2px);
}

.rsvp-submit:disabled {
  cursor: wait;
  opacity: 0.65;
  transform: none;
}

.rsvp-status {
  min-height: 1.55em;
  margin: -4px 0 0;
  color: rgba(255, 255, 255, 0.82);
  text-align: center;
  font-size: 0.9rem;
  font-weight: 700;
}

.rsvp-status.is-success {
  color: #c7f7d9;
}

.rsvp-status.is-error {
  color: #ffd2d5;
}

.privacy-note {
  width: min(720px, 100%);
  margin: 17px auto 0;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.76rem;
  line-height: 1.7;
}

.rsvp-section .floral-divider {
  filter: brightness(0) invert(1);
  opacity: 0.78;
}

.closing-names {
  margin: 24px 0 0;
  font-family: "Aref Ruqaa", serif;
  font-size: 2.45rem;
  font-weight: 700;
}

.closing-date {
  margin: -7px 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.95rem;
  letter-spacing: 0.22em;
}

#toTop {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--rose-700);
  box-shadow: 0 12px 28px rgba(79, 47, 49, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 180ms ease, transform 180ms ease, background-color 180ms ease;
}

#toTop.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#toTop:hover {
  background: var(--rose-800);
}

#toTop svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

#music-toggle {
  position: fixed;
  z-index: 40;
  bottom: 22px;
  left: 22px;
  display: inline-flex;
  min-height: 48px;
  padding: 10px 15px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 999px;
  color: #fff;
  background: rgba(79, 47, 49, 0.9);
  box-shadow: 0 10px 28px rgba(79, 47, 49, 0.28);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

#music-toggle svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

#music-toggle .music-icon-pause,
#music-toggle.is-playing .music-icon-play {
  display: none;
}

#music-toggle.is-playing .music-icon-pause {
  display: block;
}

::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  background: var(--rose-100);
}

::-webkit-scrollbar-thumb {
  border: 2px solid var(--rose-100);
  border-radius: 999px;
  background: var(--rose-500);
}

@media (max-width: 900px) {
  .hero {
    background-attachment: scroll;
  }

  .memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .hero {
    background-image:
      linear-gradient(180deg, rgba(28, 17, 18, 0.38), rgba(56, 30, 33, 0.62)),
      url("../image/cover-mobile.jpeg");
    background-position: center center;
    background-size: cover;
  }

  .site-nav {
    padding: 16px 20px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

  .nav-links {
    position: absolute;
    top: 65px;
    right: 20px;
    left: 20px;
    display: none;
    padding: 15px 18px;
    flex-direction: column;
    gap: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 16px;
    background: rgba(55, 31, 34, 0.94);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(14px);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    width: 100%;
    padding: 10px 5px;
    text-align: center;
  }

  .hero-content {
    padding-top: 70px;
  }

  .countdown {
    grid-template-columns: repeat(4, minmax(65px, 1fr));
    gap: 7px;
  }

  .countdown-item {
    padding: 11px 5px 8px;
  }

  .countdown-item strong {
    font-size: 1.5rem;
  }

  .countdown-item span {
    font-size: 0.76rem;
  }

  .section {
    padding: 76px 20px;
  }

  .section-title {
    margin-bottom: 38px;
  }

  .schedule-card {
    grid-template-columns: 1fr;
    width: min(420px, 100%);
  }

  .schedule-part {
    min-height: 135px;
    padding: 22px 18px;
  }

  .schedule-part + .schedule-part {
    border-top: 1px solid rgba(143, 93, 93, 0.17);
    border-right: 0;
  }

  .schedule-date strong {
    font-size: 4rem;
  }

  .map-frame,
  .venue-photo {
    border-width: 5px;
    border-radius: 17px;
  }

  .venue-visuals {
    grid-template-columns: 1fr;
    width: min(560px, 100%);
  }

  .map-frame,
  .venue-photo {
    min-height: 370px;
  }

  .venue-photo {
    aspect-ratio: 3 / 2;
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .hero-content {
    width: min(100% - 28px, 680px);
  }

  .hero-title {
    width: 100%;
    font-size: clamp(1.65rem, 8.2vw, 2.35rem);
  }

  #hero-names-ar {
    display: block;
    white-space: nowrap;
  }

  .hero-title-en {
    font-size: 0.58em;
  }

  .hero-kicker {
    font-size: 0.95rem;
  }

  .hero-notices {
    width: 100%;
    gap: 6px;
    margin-top: 12px;
  }

  .hero-notice,
  .children-note {
    max-width: 100%;
    padding: 5px 13px;
    font-size: 0.8rem;
  }

  .children-note {
    flex-basis: 100%;
  }

  .memory-grid {
    grid-template-columns: 1fr;
    width: min(430px, 100%);
    margin: 0 auto;
  }

  .memory-card {
    aspect-ratio: 4 / 5;
  }

  .memory-card figcaption {
    padding: 22px;
  }

  .action-button,
  .rsvp-submit {
    width: 100%;
    max-width: 340px;
  }
}

@media (max-width: 620px) {
  .rsvp-form {
    padding: 22px 17px;
  }

  .attendance-options {
    grid-template-columns: 1fr;
  }

  .guest-count-field {
    width: 100%;
  }

  #music-toggle {
    bottom: 15px;
    left: 15px;
    width: 48px;
    padding: 0;
    justify-content: center;
  }

  #music-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }
}

@media (max-width: 390px) {
  .countdown {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-content {
    padding-bottom: 140px;
  }
}

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