:root {
  --bg: #eef2f8;
  --surface: #ffffff;
  --navy: #13294b;
  --accent: #244f8a;
  --accent-hover: #1c4178;
  --accent-soft: #dde7f5;
  --text: #1b2a44;
  --muted: #51627e;
  --placeholder: #7a889e;
  --field-bg: #f7f9fc;
  --border: #d3dcea;
  --focus: rgba(36, 79, 138, 0.18);
  --danger: #b4233a;
  --success: #1f7a4d;
  --radius-lg: 28px;
  --radius-md: 12px;
  --shadow: 0 30px 60px -30px rgba(19, 41, 75, 0.18);
  --serif: "Boska", "Georgia", "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px 40px 28px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0 30px;
}

.logo {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1;
  color: var(--navy);
  text-decoration: none;
  letter-spacing: -0.01em;
}

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

.nav a {
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  color: var(--text);
  padding: 10px 22px;
  border-radius: 999px;
  transition: background 0.15s;
}

.nav a:hover { background: rgba(255, 255, 255, 0.7); }
.nav a.active { background: var(--accent-soft); color: var(--accent); }

/* ---------- Layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: stretch;
}

.card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}

/* ---------- Invitation card ---------- */
.invite {
  position: relative;
  overflow: hidden;
  padding: 72px 48px 200px;
  background: linear-gradient(180deg, #f4f7fb 0%, #eef3fa 55%, #dbe5f4 100%);
  isolation: isolate;
  container-type: inline-size;
  text-align: center;
}

.card .flora {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  user-select: none;
}

.flora-bottom {
  bottom: 0;
  right: 0;
  width: 505px;
  max-width: 85%;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 22%), linear-gradient(to right, transparent 0%, #000 12%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 22%), linear-gradient(to right, transparent 0%, #000 12%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

/* Mirrored copies frame the left side of the card */
.flora-bottom-left {
  bottom: 0;
  left: 0;
  width: 400px;
  max-width: 65%;
  opacity: 0.9;
  transform: scaleX(-1);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%), linear-gradient(to right, transparent 0%, #000 35%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 30%), linear-gradient(to right, transparent 0%, #000 35%);
  -webkit-mask-composite: source-in;
          mask-composite: intersect;
}

/* Upside-down copies of the bottom sprays form the top band */
.flora-bottom.flora-flip { top: 0; bottom: auto; transform: scaleY(-1); }
.flora-bottom-left.flora-flip { top: 0; bottom: auto; transform: scale(-1, -1); }

.bismillah {
  margin: 0 auto 20px;
  font-family: "Amiri", "Geeza Pro", "Noto Naskh Arabic", serif;
  font-size: min(40px, 7.4cqi);
  line-height: 1.6;
  color: var(--navy);
}

.ayah {
  max-width: 440px;
  margin: 0 auto 26px;
}

.ayah-ar {
  margin: 0;
  font-family: "Amiri Quran", "Amiri", "Geeza Pro", serif;
  font-size: 18px;
  line-height: 1.9;
  color: var(--navy);
}

.ayah-en {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}

.ayah figcaption {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.page-bare { padding-top: 48px; padding-bottom: 48px; }

.together {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.names {
  margin: 10px 0 14px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(48px, 7vw, 96px);
  font-size: min(64px, 11cqi);
  white-space: nowrap;
  line-height: 1;
  color: var(--navy);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.together-below { margin-bottom: 22px; }

.names .amp {
  font-style: italic;
  color: #3d6aaa;
  font-size: 0.8em;
  margin: 0 0.04em;
}

.invite-line {
  margin: 0 0 42px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 30px;
  color: var(--navy);
}

.details {
  background: rgba(250, 252, 255, 0.92);
  border: 1px solid #e3e9f3;
  border-radius: 20px;
  padding: 26px 28px;
  max-width: 588px;
  margin: 0 auto;
}

.detail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.detail + .detail {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e3e9f3;
}

.icon-chip {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--navy);
}

.detail strong {
  display: block;
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.25;
  font-weight: 500;
  color: var(--navy);
}

.detail span { color: var(--muted); font-size: 15px; }

.directions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.directions:hover { text-decoration: underline; }

/* ---------- RSVP form ---------- */
.rsvp {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: linear-gradient(180deg, #dbe5f4 0px, #e9eff8 150px, #ffffff 260px);
  padding: 200px 44px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rsvp h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 72px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  color: var(--navy);
}

.rsvp h2, .rsvp .lede { text-align: center; }

.lede {
  margin: 14px 0 30px;
  font-size: 18px;
  color: var(--muted);
}

.form { display: grid; gap: 18px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field { display: grid; gap: 8px; min-width: 0; }

.label, .field label, fieldset legend {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  padding: 0;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 13px 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

input::placeholder, textarea::placeholder { color: var(--placeholder); }

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--focus);
  background: #fff;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2313294b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

select:invalid { color: var(--placeholder); }
select:disabled { opacity: 0.55; cursor: not-allowed; }

textarea { resize: vertical; min-height: 72px; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
fieldset legend { margin-bottom: 8px; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.choice input {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
  width: 17px;
  height: 17px;
  flex: none;
  border: 1.5px solid #8f9cb1;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.choice input::after {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  transform: scale(0);
  transition: transform 0.12s;
}

.choice input:checked { border-color: var(--accent); }
.choice input:checked::after { transform: scale(1); }
.choice:has(input:checked) { border-color: var(--accent); background: #f3f7fd; }
.choice:has(input:focus-visible) { box-shadow: 0 0 0 4px var(--focus); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, transform 0.05s;
}

.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.65; cursor: progress; }

.btn-primary {
  position: relative;
  width: 100%;
  margin-top: 18px;
  padding: 18px 20px;
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary .arrow { position: absolute; right: 20px; }

.btn-secondary {
  padding: 10px 16px;
  font-size: 14px;
  background: var(--accent-soft);
  color: var(--accent);
}

.btn-secondary:hover { background: #cfdcef; }

.error {
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.field-error { border-color: var(--danger) !important; }

.notice {
  font-size: 13px;
  color: var(--muted);
  background: #fff7e6;
  border: 1px solid #f1dfb5;
  border-radius: 10px;
  padding: 10px 12px;
  margin: 0 0 18px;
}

/* ---------- Thank you ---------- */
.thanks { text-align: center; }
.thanks .badge {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  margin: 0 auto 22px;
}
.thanks h2 { font-size: 56px; }
.thanks .summary {
  margin: 22px 0 26px;
  padding: 18px 20px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--muted);
}
.thanks .summary b { color: var(--text); font-weight: 600; }

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; }

.footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 26px 0 0;
}

.footer a { text-decoration: none; }

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

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .invite { padding-bottom: 210px; }
}

@media (max-width: 640px) {
  .page { padding: 16px 16px 24px; }
  .site-header { padding-bottom: 18px; }
  .logo { font-size: 28px; }
  .nav a { padding: 8px 14px; }
  .invite { padding: 44px 22px 150px; }
  .bismillah { margin-bottom: 14px; }
  .ayah-ar { font-size: 16px; }
  .ayah-en { font-size: 12.5px; }
  .page-bare { padding-top: 16px; padding-bottom: 16px; }
  .invite-line { font-size: 24px; margin-bottom: 30px; }
  .details { padding: 20px 18px; }
  .detail strong { font-size: 19px; }
  .rsvp { padding: 140px 22px 28px; background: linear-gradient(180deg, #dbe5f4 0px, #e9eff8 90px, #ffffff 170px); }
  .together { font-size: 11.5px; letter-spacing: 0.12em; }
  .rsvp h2 { font-size: 56px; }
  .lede { font-size: 16px; margin-bottom: 22px; }
  .row, .choices { grid-template-columns: 1fr; }
}

[hidden] { display: none !important; }

/* ---------- RSVP-by reminder pop-up ---------- */
.reminder {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}

.reminder-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(19, 41, 75, 0.38);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  animation: reminder-fade 0.45s ease both;
}

.reminder-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: min(420px, 100%);
  padding: 168px 36px 36px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #dbe5f4 0px, #e9eff8 110px, #ffffff 190px);
  box-shadow: 0 40px 80px -30px rgba(19, 41, 75, 0.45);
  text-align: center;
  animation: reminder-pop 0.7s cubic-bezier(0.2, 0.9, 0.25, 1.15) 0.1s both;
}

.reminder-flora {
  position: absolute;
  top: 0;
  left: 50%;
  z-index: -1;
  width: 460px;
  transform: translateX(-50%) scaleY(-1);
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 35%);
  animation: reminder-bloom 1.2s ease 0.2s both;
}

.reminder-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--muted);
  animation: reminder-rise 0.6s ease 0.35s both;
}

.reminder-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 48px;
  line-height: 1.05;
  color: var(--navy);
  animation: reminder-rise 0.6s ease 0.45s both;
}

.reminder-date {
  margin: 8px 0 26px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: #3d6aaa;
  animation: reminder-rise 0.6s ease 0.55s both;
}

.reminder-cta {
  margin-top: 0;
  animation: reminder-rise 0.6s ease 0.65s both;
}

.reminder-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--navy);
  cursor: pointer;
  z-index: 1;
}

.reminder-x:hover { background: #fff; }

.reminder.closing .reminder-backdrop { animation: reminder-fade 0.3s ease reverse both; }
.reminder.closing .reminder-card { animation: reminder-out 0.3s ease both; }

@keyframes reminder-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes reminder-pop {
  from { opacity: 0; transform: translateY(40px) scale(0.92); }
  to   { opacity: 1; transform: none; }
}
@keyframes reminder-out { to { opacity: 0; transform: translateY(16px) scale(0.96); } }
@keyframes reminder-rise {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}
@keyframes reminder-bloom {
  from { opacity: 0; transform: translateX(-50%) scaleY(-1) scale(1.08); }
  to   { opacity: 1; transform: translateX(-50%) scaleY(-1); }
}

@media (prefers-reduced-motion: reduce) {
  .reminder *, .reminder-backdrop { animation-duration: 0.01ms !important; animation-delay: 0s !important; }
}

@media (max-width: 640px) {
  .reminder-card { padding: 150px 24px 28px; }
  .reminder-title { font-size: 40px; }
  .reminder-date { font-size: 21px; }
}
