:root {
  --paper: #f6efe4;
  --paper-light: #fbf7ef;
  --ink: #203a5b;
  --muted: #59616b;
  --gold: #9f7f48;
  --blue-soft: #8fa6bd;
  --line: rgba(32, 58, 91, 0.24);
  --shadow: 0 24px 90px rgba(32, 58, 91, 0.18);
}

@font-face {
  font-family: "Arslan Wessam A";
  src: url("./fonts/(A) Arslan Wessam A.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(179, 158, 124, 0.28), transparent 25%),
    radial-gradient(circle at 82% 48%, rgba(195, 181, 158, 0.22), transparent 22%),
    linear-gradient(135deg, #ece2d4, #fffaf2 46%, #eadfce);
  font-family: "Cairo", system-ui, sans-serif;
}

.invitation-shell {
  position: relative;
  isolation: isolate;
  width: min(100%, 1054px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.invitation-shell::before {
  content: none;
  position: absolute;
  inset: 0;
  z-index: -3;
  opacity: 0.36;
  background-image:
    linear-gradient(90deg, rgba(32, 58, 91, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(32, 58, 91, 0.06) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at center, transparent 0, black 38%, transparent 100%);
}

.invitation-shell::after {
  content: none;
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(103, 97, 84, 0.08) 0 1px, transparent 2px),
    radial-gradient(circle at 70% 20%, rgba(103, 97, 84, 0.07) 0 1px, transparent 2px);
  background-size: 18px 22px, 26px 28px;
  mix-blend-mode: multiply;
}

.hero {
  position: relative;
  aspect-ratio: 1054 / 1492;
  min-height: auto;
  padding: 0;
  overflow: hidden;
  background: url("./background.png") center / cover no-repeat;
}

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

.couple-photo {
  position: absolute;
  z-index: 2;
  left: 21.9%;
  bottom: 0;
  width: 52.65%;
  height: auto;
  filter: drop-shadow(0 18px 20px rgba(32, 58, 91, 0.08));
  animation: portraitFloat 6s ease-in-out infinite;
}

.map-hotspot {
  position: absolute;
  z-index: 3;
  top: 42%;
  left: 34%;
  width: 32%;
  height: 14%;
  border-radius: 12px;
  outline: 0;
}

.map-hotspot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid transparent;
  border-radius: 16px;
  transition: border-color 180ms ease, background 180ms ease;
}

.map-hotspot:hover::after,
.map-hotspot:focus-visible::after {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(159, 127, 72, 0.38);
}

.blessing,
.invite-line,
.with-god,
.detail-item,
.field,
.choice,
.submit-button,
.form-status {
  letter-spacing: 0;
}

.blessing {
  margin: 0 0 32px;
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  font-weight: 500;
  line-height: 1.75;
}

.invite-line {
  margin: 0 0 44px;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  font-weight: 500;
}

.couple-name {
  margin: 0;
  font-family: "Cairo", system-ui, sans-serif;
  font-size: clamp(5rem, 15vw, 9.8rem);
  font-weight: 700;
  line-height: 0.95;
  color: #273e5a;
  text-shadow: 0 5px 18px rgba(32, 58, 91, 0.12);
}

.with-god {
  margin: 18px 0 28px;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  font-weight: 500;
}

.details {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  width: min(680px, 100%);
  margin: 0 auto 18px;
  color: #48505c;
}

.detail-item {
  position: relative;
  display: grid;
  align-content: start;
  min-height: 132px;
  padding: 0 clamp(12px, 3vw, 28px);
  color: inherit;
  text-decoration: none;
  font-size: clamp(0.9rem, 2vw, 1.12rem);
  line-height: 1.7;
  transition: transform 220ms ease, color 220ms ease;
}

.detail-item + .detail-item {
  border-right: 2px solid var(--line);
}

.detail-item strong {
  color: #414b5a;
  font-size: 1.03em;
  font-weight: 700;
}

.map-link:hover,
.map-link:focus-visible {
  color: var(--ink);
  transform: translateY(-4px);
  outline: none;
}

.map-link::after {
  content: "";
  position: absolute;
  inset: -10px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  transition: border-color 220ms ease, background 220ms ease;
}

.map-link:hover::after,
.map-link:focus-visible::after {
  border-color: rgba(159, 127, 72, 0.35);
  background: rgba(255, 255, 255, 0.32);
}

.detail-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 4px;
  color: var(--gold);
}

.detail-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.couple-portrait {
  position: relative;
  width: min(440px, 74vw);
  height: min(530px, 72vw);
  margin-top: -2px;
  animation: portraitFloat 6s ease-in-out infinite;
}

.portrait-glow {
  position: absolute;
  inset: 48% 10% 0;
  background: radial-gradient(ellipse, rgba(90, 128, 120, 0.3), transparent 66%);
  filter: blur(8px);
}

.bride,
.groom {
  position: absolute;
  bottom: 0;
}

.bride {
  right: 48%;
  width: 47%;
  height: 94%;
}

.groom {
  left: 18%;
  width: 42%;
  height: 97%;
}

.face {
  position: absolute;
  top: 16%;
  left: 34%;
  width: 32%;
  height: 17%;
  border-radius: 48% 48% 44% 44%;
  background: linear-gradient(#d9a983, #c99672);
  box-shadow: inset 0 -12px 20px rgba(109, 70, 45, 0.12);
}

.hair {
  position: absolute;
  background: #2d241e;
}

.bride .hair {
  top: 11%;
  left: 18%;
  width: 54%;
  height: 68%;
  border-radius: 48% 46% 38% 50%;
  background:
    repeating-linear-gradient(105deg, rgba(218, 177, 96, 0.35) 0 2px, transparent 2px 12px),
    radial-gradient(circle at 62% 18%, #4d3929, #211a17 68%);
}

.groom .hair {
  top: 10%;
  left: 33%;
  width: 36%;
  height: 12%;
  border-radius: 50% 55% 22% 26%;
  background: linear-gradient(145deg, #1f1b19, #3b3029);
}

.dress {
  position: absolute;
  left: 23%;
  bottom: 0;
  width: 48%;
  height: 68%;
  clip-path: polygon(34% 0, 64% 0, 86% 100%, 8% 100%);
  background:
    repeating-linear-gradient(90deg, transparent 0 12px, rgba(176, 135, 77, 0.18) 12px 14px),
    linear-gradient(#f4e5cf, #e4cda9);
}

.cloak {
  position: absolute;
  left: 3%;
  bottom: 0;
  width: 82%;
  height: 71%;
  clip-path: polygon(30% 0, 68% 0, 100% 100%, 0 100%);
  background:
    radial-gradient(circle at 24% 28%, rgba(203, 153, 65, 0.85) 0 1px, transparent 2px),
    radial-gradient(circle at 66% 48%, rgba(203, 153, 65, 0.78) 0 1px, transparent 2px),
    linear-gradient(115deg, rgba(13, 36, 67, 0.94), rgba(29, 58, 94, 0.9));
  background-size: 18px 18px, 21px 21px, auto;
  border-radius: 48% 42% 0 0;
}

.shirt {
  position: absolute;
  left: 37%;
  bottom: 13%;
  width: 23%;
  height: 64%;
  clip-path: polygon(20% 0, 88% 0, 100% 100%, 0 100%);
  background: linear-gradient(#fffaf3, #e9dccb);
}

.suit {
  position: absolute;
  left: 14%;
  bottom: 0;
  width: 72%;
  height: 78%;
  clip-path: polygon(20% 0, 78% 0, 98% 100%, 3% 100%);
  background:
    linear-gradient(120deg, transparent 0 43%, rgba(255, 255, 255, 0.72) 43% 50%, transparent 50%),
    linear-gradient(145deg, #0f2748, #182f51 48%, #0d213d);
  border-radius: 20% 20% 0 0;
}

.watercolor {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  filter: blur(0.3px);
}

.watercolor-top {
  top: -90px;
  right: -80px;
  width: 360px;
  height: 300px;
  background: radial-gradient(circle at 50% 60%, rgba(174, 157, 128, 0.28), transparent 68%);
}

.watercolor-right {
  top: 32%;
  left: -70px;
  width: 260px;
  height: 420px;
  background: radial-gradient(ellipse, rgba(180, 165, 140, 0.22), transparent 68%);
}

.watercolor-bottom {
  bottom: -80px;
  left: 28%;
  width: 420px;
  height: 220px;
  background: radial-gradient(ellipse, rgba(96, 145, 133, 0.26), transparent 64%);
}

.invitation-shell .watercolor-bottom::before,
.invitation-shell .watercolor-bottom::after {
  content: "";
  position: absolute;
  bottom: 16px;
  width: 280px;
  height: 170px;
  opacity: 0.9;
  background:
    radial-gradient(ellipse at 50% 100%, rgba(28, 60, 93, 0.36), transparent 52%),
    repeating-linear-gradient(76deg, transparent 0 15px, rgba(32, 58, 91, 0.22) 16px 18px);
  mask-image: radial-gradient(ellipse at bottom, black 42%, transparent 72%);
}

.invitation-shell .watercolor-bottom::before {
  left: -250px;
  transform: rotate(-10deg);
}

.invitation-shell .watercolor-bottom::after {
  right: -260px;
  transform: rotate(10deg);
}

.butterfly {
  position: absolute;
  z-index: 2;
  width: 52px;
  height: 44px;
  transform-origin: center;
  animation: butterflyDrift 6s ease-in-out infinite;
}

.butterfly::before,
.butterfly::after {
  content: "";
  position: absolute;
  top: 8px;
  width: 23px;
  height: 29px;
  border-radius: 80% 18% 72% 24%;
  background: radial-gradient(circle at 70% 35%, rgba(255, 255, 255, 0.9), transparent 22%), var(--wing);
  box-shadow: 0 4px 10px rgba(32, 58, 91, 0.12);
}

.butterfly::before {
  right: 23px;
  transform: rotate(24deg);
}

.butterfly::after {
  left: 23px;
  transform: scaleX(-1) rotate(24deg);
}

.butterfly-blue {
  --wing: linear-gradient(145deg, #dce9f4, #7f9eba 72%);
  top: 47%;
  right: 12%;
}

.butterfly-gold {
  --wing: linear-gradient(145deg, #fff6db, #ba9154 76%);
}

.butterfly-gold.top {
  top: 43%;
  left: 13%;
  animation-delay: 1.4s;
}

.butterfly-gold.bottom {
  bottom: 14%;
  right: 17%;
  animation-delay: 2.4s;
}

.rsvp-section {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(280px, 1.1fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
  padding: clamp(48px, 8vw, 92px) clamp(20px, 6vw, 84px) clamp(70px, 8vw, 96px);
  background: rgba(255, 251, 244, 0.82);
  border-top: 1px solid rgba(32, 58, 91, 0.12);
}

.section-copy {
  text-align: right;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-family: "Cairo", system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
}

.section-copy h2 {
  margin: 0;
  font-family: "Arslan Wessam A", "Cairo", system-ui, sans-serif;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  font-weight: 400;
  line-height: 1.05;
}

.rsvp-form {
  display: grid;
  gap: 18px;
  padding: clamp(20px, 4vw, 32px);
  background: rgba(255, 255, 255, 0.56);
  border: 1px solid rgba(159, 127, 72, 0.2);
  border-radius: 8px;
  box-shadow: 0 18px 54px rgba(32, 58, 91, 0.08);
  backdrop-filter: blur(8px);
}

.choice-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice,
.submit-button {
  min-height: 52px;
  border: 1px solid rgba(32, 58, 91, 0.18);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.choice {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.62);
}

.choice.active {
  color: #fffaf3;
  border-color: transparent;
  background: linear-gradient(135deg, #203a5b, #314f73);
  box-shadow: 0 12px 30px rgba(32, 58, 91, 0.18);
}

.choice:hover,
.submit-button:hover {
  transform: translateY(-2px);
}

.submit-button:disabled {
  cursor: wait;
  opacity: 0.78;
  transform: none;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 10px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(32, 58, 91, 0.2);
  border-radius: 8px;
  font: inherit;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field input:focus {
  border-color: rgba(159, 127, 72, 0.8);
  box-shadow: 0 0 0 4px rgba(159, 127, 72, 0.12);
}

.guest-count-field.hidden {
  display: none;
}

.submit-button {
  color: #fffaf3;
  background: linear-gradient(135deg, #9f7f48, #b7985d);
  border-color: transparent;
  font-weight: 700;
}

.form-status {
  min-height: 28px;
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.7;
}

.closing-blessing {
  grid-column: 1 / -1;
  margin: clamp(18px, 4vw, 34px) 0 0;
  color: var(--ink);
  text-align: center;
  font-family: "Cairo", system-ui, sans-serif;
  font-size: clamp(1.05rem, 2.5vw, 1.55rem);
  font-weight: 500;
  line-height: 1.9;
}

.attendance-screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 32% 24%, rgba(159, 127, 72, 0.2), transparent 28%),
    radial-gradient(circle at 72% 70%, rgba(143, 166, 189, 0.28), transparent 30%),
    rgba(246, 239, 228, 0.78);
  backdrop-filter: blur(12px);
  transition: opacity 320ms ease;
}

.attendance-screen.show {
  pointer-events: auto;
  opacity: 1;
}

.attendance-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 18px;
  width: min(420px, 92vw);
  padding: clamp(36px, 8vw, 58px) clamp(22px, 6vw, 40px);
  overflow: hidden;
  text-align: center;
  background:
    linear-gradient(rgba(255, 250, 243, 0.86), rgba(255, 250, 243, 0.94)),
    url("./background.png") center / cover no-repeat;
  border: 1px solid rgba(159, 127, 72, 0.26);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(32, 58, 91, 0.24);
  transform: translateY(18px) scale(0.96);
}

.attendance-screen.show .attendance-card {
  animation: screenBloom 700ms cubic-bezier(0.22, 0.8, 0.2, 1) forwards;
}

.attendance-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--ink);
  font-family: "Cairo", system-ui, sans-serif;
  font-size: clamp(3.4rem, 16vw, 6rem);
  line-height: 1;
}

.attendance-location,
.attendance-close {
  position: relative;
  z-index: 1;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
}

.attendance-location {
  display: inline-grid;
  place-items: center;
  color: #fffaf3;
  text-decoration: none;
  background: linear-gradient(135deg, #203a5b, #314f73);
  box-shadow: 0 12px 30px rgba(32, 58, 91, 0.16);
}

.attendance-close {
  color: var(--muted);
  cursor: pointer;
  background: transparent;
  border: 0;
}

.attendance-sparkle {
  position: absolute;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 127, 72, 0.32), transparent 68%);
  animation: sparkleFloat 4s ease-in-out infinite;
}

.attendance-sparkle.one {
  top: 12%;
  right: 12%;
}

.attendance-sparkle.two {
  bottom: 14%;
  left: 10%;
  width: 112px;
  height: 112px;
  animation-delay: 1.2s;
}

.attendance-sparkle.three {
  top: 54%;
  right: -28px;
  width: 70px;
  height: 70px;
  animation-delay: 2.1s;
}

.reveal,
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(22px);
}

.reveal {
  animation: revealUp 840ms cubic-bezier(0.22, 0.7, 0.22, 1) forwards;
}

.delay-1 {
  animation-delay: 90ms;
}

.delay-2 {
  animation-delay: 260ms;
}

.delay-3 {
  animation-delay: 430ms;
}

.delay-4 {
  animation-delay: 560ms;
}

.delay-5 {
  animation-delay: 720ms;
}

.delay-6 {
  animation-delay: 920ms;
}

.reveal-on-scroll.visible {
  animation: revealUp 720ms cubic-bezier(0.22, 0.7, 0.22, 1) forwards;
}

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

@keyframes butterflyDrift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(-5deg);
  }
  50% {
    transform: translate3d(8px, -12px, 0) rotate(7deg);
  }
}

@keyframes portraitFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes screenBloom {
  to {
    transform: translateY(0) scale(1);
  }
}

@keyframes sparkleFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
    opacity: 0.55;
  }
  50% {
    transform: translateY(-14px) scale(1.08);
    opacity: 0.9;
  }
}

@media (max-width: 780px) {
  .hero {
    padding-top: 0;
  }

  .details {
    grid-template-columns: 1fr;
    gap: 12px;
    width: min(360px, 100%);
    margin-bottom: 18px;
  }

  .detail-item {
    min-height: auto;
    padding: 12px 16px;
    border: 1px solid rgba(32, 58, 91, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.36);
  }

  .detail-item + .detail-item {
    border-right: 1px solid rgba(32, 58, 91, 0.14);
  }

  .couple-portrait {
    width: min(390px, 92vw);
    height: 470px;
  }

  .couple-photo {
    width: 52.65%;
  }

  .rsvp-section {
    grid-template-columns: 1fr;
  }

  .section-copy {
    text-align: center;
  }

  .choice-group {
    grid-template-columns: 1fr;
  }

  .butterfly-blue {
    right: 5%;
  }

  .butterfly-gold.top {
    left: 6%;
  }
}

@media (max-width: 480px) {
  .blessing {
    margin-bottom: 22px;
  }

  .invite-line {
    margin-bottom: 28px;
  }

  .couple-name {
    font-size: clamp(4.2rem, 23vw, 6rem);
  }

  .couple-portrait {
    height: 410px;
  }

  .couple-photo {
    width: 52.65%;
  }
}

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