/* ============================================================
   ZAHRA & ABDULLAH — rebuilt from the Canva original
   Fonts, colours and proportions extracted from the live site.
   See DESIGN-SPEC.md.
   ============================================================ */

@font-face {
  font-family: "ZA Display";
  src: url("assets/font/za-display.woff") format("woff");
  font-display: swap;
}
@font-face {
  font-family: "ZA Script";
  src: url("assets/font/za-script.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "ZA Type";
  src: url("assets/font/za-type.woff") format("woff");
  font-display: swap;
}

:root {
  --ivory: #FFFCF5;
  --ink: #221F1A;
  --paper: #F5F3F0;
  --mocha: #6E6357;
  --mocha-dk: #554C42;
  --mocha-lt: #8B8073;

  --display: "ZA Display", "Times New Roman", serif;
  --script: "ZA Script", "Snell Roundhand", cursive;
  --type: "ZA Type", "Courier New", monospace;

  /* page gutter */
  --gut: clamp(18px, 5vw, 64px);
}

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

/* The base colour behind everything. Any sliver not covered by the video —
   behind the Safari bars, past the notch, during overscroll bounce — lands on
   this rather than on white. Keep it in step with the theme-color meta tag.

   It lives HERE, not on body.
   A background on <html> paints into the canvas, behind the z-index:-2 video.
   The same declarations on <body> would paint as an ordinary element
   background — which comes AFTER negative-z-index children in paint order —
   and would cover the video completely. Do not move these to body. */
html {
  -webkit-text-size-adjust: 100%;
  background-color: #453E35;
  /* fallback if the video is absent — approximates the drapery footage */
  background-image:
    radial-gradient(75% 45% at 50% 30%, rgba(0,0,0,.20) 0%, transparent 70%),
    radial-gradient(130% 50% at 82% 4%, #8A7F71 0%, transparent 52%),
    radial-gradient(110% 45% at 8% 96%, #7A6F62 0%, transparent 58%),
    linear-gradient(155deg, #4E453B 0%, #6B6054 38%, #5C5348 68%, #40382F 100%);
  background-attachment: fixed;
}

body {
  margin: 0;
  position: relative;          /* containing block for the background video */
  color: var(--ink);
  font-family: var(--type);
  line-height: 1.45;
  overflow-x: hidden;
  /* Canva's subsets keep the GSUB ligature rules but drop the ligature
     glyphs, so "th" etc. silently vanish. Turn all substitution off. */
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "clig" 0, "dlig" 0, "hlig" 0, "calt" 0;
}

img, video { max-width: 100%; display: block; }

[hidden] { display: none !important; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: var(--ivory);
  padding: 12px 18px; z-index: 100; font-size: 14px; letter-spacing: .1em;
}
.skip:focus { left: 8px; top: 8px; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

/* ============================================================
   HERO
   ============================================================ */

.hero {
  position: relative;
  /* deliberately under a full viewport: the top of the Wedding day card peeks
     in below the fold, which invites the scroll without needing a cue */
  min-height: 84svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 3vh, 40px) var(--gut) clamp(20px, 3.5vh, 40px);
  /* no background — the drapery video behind the page must show through here */
}


/* One drapery loop behind the whole page. Pinned to the viewport rather than
   stretched over the full document — stretching it across ~5000px magnifies
   the footage ~4x and the drape stops reading as moving fabric. */
.bgvideo {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  /* NOT svh. The small viewport height stops short of the Safari bars, so when
     they retract on scroll a pale strip of page shows through at the edges.
     lvh is the largest viewport, so the footage stays behind the bars. */
  height: 100vh;
  height: 100lvh;
  object-fit: cover;
  z-index: -2;
  pointer-events: none;
  /* the footage is a pale beige; the original reads as deep mocha */
  filter: brightness(.60) saturate(1.05) contrast(1.04);
}

.hero__inner {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 980px;
  text-align: center;
  color: var(--ivory);
}

.monogram {
  width: clamp(176px, 24vw, 304px);
  height: auto;
  /* the hero centres its content, so a larger bottom margin lifts the
     monogram clear of the invitation rather than pushing it down */
  margin: 0 auto clamp(18px, 3.5vh, 44px);
  opacity: .95;
}

/* --- the lace-framed invitation panel --- */
.invite {
  border: clamp(22px, 3.4vw, 44px) solid transparent;
  border-image: url("assets/img/lace.png") 58 round;
  padding: clamp(22px, 4.5vw, 54px) clamp(10px, 3vw, 40px);
}

.invite__eyebrow {
  margin: 0 auto;
  max-width: 26em;
  font-family: var(--type);
  font-size: clamp(11px, 2vw, 26px);
  letter-spacing: .35em;   /* 30% tighter than the original .5em */
  text-indent: .35em;
  line-height: 1.7;
}

.invite__names {
  margin: clamp(16px, 2.8vw, 34px) 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(25px, 5vw, 64px);
  letter-spacing: .1em;
  line-height: 1.24;
  text-indent: .1em;
}
.invite__name { display: block; }

/* The ampersand sits on its own line in the script face and tucks into the
   names above and below, so the three lines read as one locked-up unit. */
.invite__amp {
  display: block;
  font-family: var(--script);
  font-size: 1.3em;
  letter-spacing: 0;
  text-indent: 0;
  line-height: .78;
  margin: -0.07em 0 -0.09em;
  position: relative;
  z-index: 1;
}

.invite__date {
  margin: clamp(18px, 3vw, 34px) 0 0;
  font-family: var(--script);
  font-size: clamp(19px, 3.2vw, 42px);
  line-height: 1.15;
}

/* --- respond-by block --- */
.respond {
  margin-top: clamp(22px, 4vh, 50px);
  color: #fff;
}

/* same treatment as the "YOU'RE INVITED TO THE WEDDING OF" line, two sizes up */
.respond__by {
  margin: 0 auto;
  max-width: 22em;
  font-family: var(--type);
  font-size: clamp(14px, 2.5vw, 33px);
  letter-spacing: .35em;   /* 30% tighter than the original .5em */
  text-indent: .35em;
  line-height: 1.55;
}

/* only appears if the send turns out to have failed after we said it worked */
.respond__problem {
  margin: clamp(14px, 2vh, 22px) auto 0;
  max-width: 30em;
  font-family: var(--type);
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: .06em;
  line-height: 1.6;
  color: #FFD9D2;
}

/* used as a <button> on party pages, so the font must be set explicitly */
.respond__cta {
  display: inline-block;
  margin-top: clamp(20px, 3.6vh, 40px);
  padding: clamp(11px, 1.5vw, 18px) clamp(26px, 4vw, 48px);
  border: 1px solid rgba(255, 255, 255, .55);
  background: transparent;
  cursor: pointer;
  color: #fff;
  font-family: var(--type);
  font-size: clamp(13px, 1.9vw, 25px);
  letter-spacing: .06em;
  text-decoration: underline;
  text-underline-offset: .22em;
  transition: background-color .25s ease, border-color .25s ease;
}
.respond__cta:hover,
.respond__cta:focus-visible { background: rgba(255, 255, 255, .13); border-color: #fff; }

/* ============================================================
   HOLDING PAGE  (the bare domain — no wedding details)
   ============================================================ */

.holding__inner {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(26px, 5vh, 48px);
  padding: clamp(24px, 5vh, 60px) var(--gut);
  text-align: center;
  color: var(--ivory);
}
.holding__inner .monogram { margin: 0; }

.holding__note {
  margin: 0;
  max-width: 24em;
  font-family: var(--type);
  font-size: clamp(11px, 1.6vw, 17px);
  letter-spacing: .28em;
  text-indent: .28em;
  line-height: 1.9;
  text-transform: uppercase;
  opacity: .85;
}

/* ============================================================
   PAPER SHEETS
   ============================================================ */

.sheet {
  padding: clamp(26px, 5vw, 70px) var(--gut);
}

.sheet__inner {
  max-width: 1020px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 96px) clamp(22px, 5vw, 78px);
  background: #FCFBF9 url("assets/img/paper.jpg") center / cover;
  box-shadow: 0 22px 60px rgba(30, 24, 18, .3);
  color: var(--ink);
}

/* --- display headings --- */
.h-display {
  margin: 0 0 clamp(26px, 4vw, 52px);
  font-family: var(--type);
  font-weight: 400;
  text-align: center;
  text-transform: uppercase;
  line-height: 1.05;
}
.h-display--wide {
  font-size: clamp(26px, 5.4vw, 76px);
  letter-spacing: clamp(.1em, .45em, .45em);
  text-indent: .45em;
}
.h-display--wider {
  font-size: clamp(24px, 5.2vw, 79px);
  letter-spacing: clamp(.12em, .73em, .73em);
  text-indent: .73em;
}

.h-script {
  margin: 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(24px, 3.6vw, 41px);
  letter-spacing: .06em;
  line-height: 1.3;
  text-align: center;
}

/* ============================================================
   RUNNING ORDER
   ============================================================ */

.run { list-style: none; margin: 0; padding: 0; }

.run__row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(12px, 3vw, 40px);
  align-items: center;
  padding: clamp(16px, 2.6vw, 30px) 0;
  border-bottom: 1px dotted rgba(34, 31, 26, .45);
}
.run__row:last-child { border-bottom: 0; }

.run__time {
  margin: 0;
  font-size: clamp(15px, 2.35vw, 38px);
  letter-spacing: .02em;
  white-space: nowrap;
}
.run__onwards {
  display: block;
  font-size: .62em;
  letter-spacing: .1em;
}

.run__what {
  text-align: right;
  font-size: clamp(13px, 2.1vw, 36px);
  letter-spacing: .02em;
  line-height: 1.45;
}
.run__what span { display: block; }

/* --- venue + dress code, sitting under the running order --- */
.card-note {
  margin-top: clamp(32px, 4.8vw, 58px);
  text-align: center;
}
.card-note:first-child { margin-top: 0; }

.card-note .h-script { font-size: clamp(27px, 4vw, 46px); }

/* outranks `.card-note p` above without needing !important */
.card-note p.card-note__when {
  margin: clamp(6px, 1vw, 10px) auto 0;
  font-size: clamp(10px, 1.1vw, 13px);
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  opacity: .72;
}

.card-note p,
.card-note__addr {
  margin: clamp(10px, 1.6vw, 18px) auto 0;
  max-width: 26em;
  font-family: var(--type);
  font-style: normal;
  font-size: clamp(15px, 1.9vw, 27px);
  line-height: 1.55;
}

/* ============================================================
   RSVP FORM
   ============================================================ */

.rsvp__lede {
  margin: calc(-1 * clamp(10px, 2vw, 26px)) 0 clamp(28px, 4vw, 46px);
  text-align: center;
  font-size: clamp(14px, 1.7vw, 22px);
  letter-spacing: .06em;
}
.rsvp__lede strong { font-weight: 400; border-bottom: 1px solid rgba(34,31,26,.5); }

.form { max-width: 620px; margin: 0 auto; }

/* Sending collapses the entire RSVP section away. JS sets an explicit pixel
   height first — height:auto can't be transitioned. */
#rsvp { transition: height .65s cubic-bezier(.4, 0, .2, 1), opacity .4s ease; }
#rsvp.is-collapsing { opacity: 0; }

/* The RSVP title alone keeps its size; everything else in the card is up one. */
#rsvp .h-display--wider { font-size: clamp(24px, 5.2vw, 79px); }


.f { margin: 0 0 clamp(20px, 2.6vw, 30px); }
.f--set { border: 0; padding: 0; }

.f label,
.f legend {
  display: block;
  margin-bottom: 9px;
  font-size: clamp(11.5px, 1.3vw, 15px);
  letter-spacing: .22em;
  text-indent: .22em;
}
.f__opt { letter-spacing: .06em; text-indent: 0; opacity: .55; text-transform: lowercase; }

.f input,
.f select,
.f textarea {
  width: 100%;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px solid rgba(34, 31, 26, .38);
  background: transparent;
  color: var(--ink);
  font-family: var(--type);
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.4;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s ease;
}
.f textarea { resize: vertical; }
.f select {
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 11px) 55%, calc(100% - 6px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
.f input:focus,
.f select:focus,
.f textarea:focus { outline: 0; border-bottom-color: var(--ink); border-bottom-width: 2px; padding-bottom: 10px; }

.f input[aria-invalid="true"],
.f textarea[aria-invalid="true"] { border-bottom-color: #9B3B2E; }

.f__err {
  display: none;
  margin-top: 7px;
  font-size: 12px;
  letter-spacing: .04em;
  color: #9B3B2E;
}
.f__err.is-on { display: block; }

/* ============================================================
   NAMED-GUEST RSVP  (party pages)
   ============================================================ */

.ev { border: 0; padding: 0; margin: 0 0 clamp(30px, 4.4vw, 52px); }

.ev__legend {
  display: block;
  width: 100%;
  padding: 0;
  margin-bottom: clamp(14px, 2vw, 22px);
  text-align: center;
  border-bottom: 1px solid rgba(34, 31, 26, .3);
  padding-bottom: clamp(10px, 1.4vw, 16px);
}
/* Event names are set in the plain typewriter face, not the script —
   overrides the .h-script the markup also carries. */
.ev__name {
  display: block;
  margin: 0;
  line-height: 1.45;
  font-weight: 400;
  font-family: var(--type);
  font-size: clamp(17px, 2.15vw, 28px);
  letter-spacing: .2em;
  text-indent: .2em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: .3em;
  text-decoration-thickness: 1px;
}
.ev__meta {
  display: block;
  margin-top: 7px;
  font-size: clamp(11px, 1.2vw, 14px);
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  opacity: .72;
}
.ev__note {
  margin: 0 auto clamp(14px, 1.8vw, 20px);
  max-width: 30em;
  text-align: center;
  font-size: clamp(12px, 1.3vw, 15px);
  letter-spacing: .04em;
  opacity: .78;
}

.guests { list-style: none; margin: 0; padding: 0; }

.guest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px clamp(12px, 2vw, 26px);
  padding: clamp(12px, 1.7vw, 18px) 0;
  border-bottom: 1px dotted rgba(34, 31, 26, .35);
}
.guest:last-child { border-bottom: 0; }

.guest__name {
  font-size: clamp(15px, 1.75vw, 21px);
  letter-spacing: .04em;
  flex: 1 1 8em;
  min-width: 0;
}

.guest__choice { display: flex; gap: 8px; flex: 0 0 auto; }

.tick { position: relative; margin: 0; }
.tick input {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.tick span {
  display: block;
  padding: 9px clamp(10px, 1.3vw, 16px);
  border: 1px solid rgba(34, 31, 26, .34);
  font-size: clamp(10px, 1.05vw, 13px);
  letter-spacing: .14em;
  text-indent: .14em;
  white-space: nowrap;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.tick:hover span { border-color: var(--ink); }
.tick input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }

/* both choices fill solid when picked — a declined guest is a real answer,
   not a lesser one, and the greyed-out version read as "not selected" */
.tick--yes input:checked + span,
.tick--no  input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.guest.is-missing { background: rgba(155, 59, 46, .07); }
.guest.is-missing .tick span { border-color: rgba(155, 59, 46, .6); }

@media (max-width: 480px) {
  .guest { flex-direction: column; align-items: stretch; }
  .guest__name { flex: none; }
  .guest__choice { display: grid; grid-template-columns: 1fr 1fr; }
  .tick span { text-align: center; }
}

/* --- honeypot --- */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- submit --- */
.send {
  display: block;
  width: 100%;
  margin-top: clamp(28px, 3.6vw, 40px);
  padding: clamp(15px, 1.8vw, 20px) 24px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--type);
  font-size: clamp(13.5px, 1.5vw, 18px);
  letter-spacing: .3em;
  text-indent: .3em;
  cursor: pointer;
  transition: background-color .25s ease, color .25s ease;
}
.send:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.send:disabled { opacity: .5; cursor: progress; }
.send.is-sending span::after {
  content: "";
  display: inline-block;
  width: 1em;
  text-align: left;
  animation: dots 1.1s steps(4, end) infinite;
}
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.form__status {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13px;
  letter-spacing: .05em;
  min-height: 1.4em;
}
.form__status.is-bad { color: #9B3B2E; }

/* --- success --- */
.done {
  text-align: center;
  max-width: 520px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(14px);
}
.done.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .6s ease, transform .6s cubic-bezier(.2, .7, .3, 1);
}
.done__mono { width: 110px; height: auto; margin: 0 auto clamp(16px, 2.4vw, 26px); opacity: .8; }
.done p { margin: 14px 0 0; font-size: clamp(13px, 1.4vw, 17px); line-height: 1.55; }

.linkish {
  margin-top: 26px;
  border: 0; background: none;
  color: var(--ink);
  font-family: var(--type);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: .25em;
  cursor: pointer;
}

/* ============================================================
   VENUE + FOOTER
   ============================================================ */

.foot {
  position: relative;
  min-height: clamp(180px, 26vh, 260px);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.foot__mono { position: relative; z-index: 1; width: clamp(92px, 10vw, 124px); height: auto; opacity: .9; }

/* ============================================================
   MOTION
   ============================================================ */

.reveal { opacity: 0; transform: translateY(18px); }
.reveal.is-in { opacity: 1; transform: none; transition: opacity .9s ease, transform .9s cubic-bezier(.2,.7,.3,1); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.is-in { opacity: 1; transform: none; transition: none; }
  .hero__bg { display: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
