/* ==========================================================================
   Zarnab + Waqar · Save the Date · editorial version
   ========================================================================== */

:root {
  --ivory: #fdfbf6;          /* cream, not beige */
  --ivory-deep: #f5f1e9;
  --black: #141210;
  --ink: #1c1916;
  --ink-soft: #55504a;
  --ink-faint: #8f887e;
  --rule: #d9d2c4;
  --oxblood: #5e2130;
  --rose: #f4e9e5;           /* the faintest wash of oxblood */
  --prussian: #2b4a5c;       /* the second ink, for the postmark */

  --serif: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --frame: clamp(14px, 2.4vw, 34px);   /* the ivory border around the film */
  --measure: 560px;
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* --------------------------------------------------------------------------
   1 · Video hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  padding: var(--frame);
  background: var(--ivory);
}

.hero__frame {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--black);
}

.hero__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: grayscale(1) contrast(1.04);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--frame) + 22px);
  width: 22px;
  height: 22px;
  margin-left: -11px;
  color: var(--ivory);
  opacity: 0;
  transition: opacity .6s ease;
  animation: hint-float 2s ease-in-out infinite;
}
.hero.is-ready .scroll-hint { opacity: .7; }
.scroll-hint.is-hidden { opacity: 0 !important; pointer-events: none; }
.scroll-hint svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes hint-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(6px); }
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

main { display: block; }

.intro,
.note__inner,
.mail,
.more,
.cal {
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: 24px;
}

/* 2 · Intro: names, a line, the dates, and a great deal of air */
.intro {
  text-align: center;
  padding-top: clamp(96px, 18vh, 180px);
  padding-bottom: clamp(96px, 18vh, 180px);
}
.intro__names {
  font-weight: 400;
  font-size: clamp(2.4rem, 5.2vw, 4.2rem);
  letter-spacing: .06em;
  line-height: 1.05;
  margin: 0 0 26px;
}
.intro__names .amp { font-style: italic; font-weight: 400; margin: 0 .08em; color: var(--oxblood); }
.intro__line {
  font-style: italic;
  font-size: clamp(1.2rem, 1.9vw, 1.5rem);
  margin: 0 0 14px;
}
.intro__dates {
  font-variant: small-caps;
  letter-spacing: .22em;
  font-size: 1rem;
  color: var(--ink-soft);
  margin: 0;
}

/* 3 · One large photo, no frame */
.photo { margin: 0; overflow: hidden; background: var(--ivory-deep); }
.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.05);
}
.photo--wide { height: clamp(360px, 82vh, 900px); }
.photo--wide img { object-position: 50% 40%; }

/* 4 · The note, on an oxblood band in cream type */
.note {
  background: var(--oxblood);
  color: var(--ivory);
  padding-top: clamp(80px, 14vh, 150px);
  padding-bottom: clamp(80px, 14vh, 150px);
}
.note__signoff { color: rgba(253, 251, 246, .8); }
.note__heading {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(2rem, 3.8vw, 2.9rem);
  line-height: 1.1;
  margin: 0 0 28px;
}
.note p { margin: 0 0 1.1em; font-size: clamp(1.1rem, 1.5vw, 1.25rem); }
.note__signoff { font-style: italic; margin-top: 2em !important; }
.note__sig { display: block; margin-top: .05em; font-size: 1.5em; line-height: 1.2; color: var(--ivory); }

/* 5 · Mailing address */
.mail {
  padding-top: clamp(80px, 14vh, 150px);
  padding-bottom: clamp(80px, 14vh, 150px);
}
.mail__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}
.mail__heading {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  line-height: 1.15;
  margin: 0 0 8px;
  max-width: 12em;
}
.mail__note { font-style: italic; color: var(--ink-faint); margin: 0 0 40px; }

/* 6 · the one small detail: a monogram seal beside the form */
.postmark {
  flex: 0 0 auto;
  width: 96px;
  margin-top: 4px;
  color: var(--prussian);
  opacity: .85;
  transform: rotate(-7deg);
}
.postmark svg { display: block; width: 100%; height: auto; overflow: visible; }
.postmark circle { fill: none; stroke: currentColor; stroke-width: 1.5; }
.postmark circle + circle { stroke-width: .9; }
.postmark__mono { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; fill: currentColor; }
.postmark__small { font-family: var(--serif); font-size: 8px; font-weight: 600; letter-spacing: 1.2px; fill: currentColor; }

/* the form: ruled lines, nothing boxed */
.form { margin: 0; }
.field {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 16px;
  align-items: end;
  margin-bottom: 30px;
}
.field label {
  font-style: italic;
  font-size: .95rem;
  color: var(--ink-soft);
  padding-bottom: 6px;
  white-space: nowrap;
}
.field__line { position: relative; }
.field__lines { display: grid; }
.field__line--split {
  display: grid;
  grid-template-columns: 1.6fr .8fr .9fr;
  column-gap: 12px;
}
.field input {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--ink-faint);
  background: transparent;
  padding: 2px 4px 4px;
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 2rem;
  color: var(--ink);
  border-radius: 0;
  outline: none;
  transition: border-color .3s ease;
}
.field input::placeholder { font-style: italic; font-size: .95rem; color: var(--ink-faint); opacity: 1; }
.field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px var(--ivory) inset; -webkit-text-fill-color: var(--ink); }
.field__line::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  height: 1px; width: 100%;
  background: var(--oxblood);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease-out);
}
.field:focus-within .field__line::after { transform: scaleX(1); }
.field:focus-within label { color: var(--oxblood); }
.field__hint {
  position: absolute; right: 4px; top: 100%;
  margin-top: 3px;
  font-style: italic; font-size: .85rem; color: var(--ink-faint);
  pointer-events: none;
  transition: opacity .3s ease;
}
.field--names:focus-within .field__hint,
.field--names.has-value .field__hint { opacity: 0; }
.field__error {
  position: absolute; left: 0; top: 100%;
  margin-top: 3px;
  font-size: .85rem; font-style: italic; color: var(--oxblood);
  opacity: 0; transform: translateY(-3px);
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
}
.field.is-invalid input { border-bottom-color: var(--oxblood); }
.field.is-invalid .field__error { opacity: 1; transform: none; }
.field.is-invalid, .field--names, .field--address { margin-bottom: 36px; }
.field--address { align-items: start; }
.field--address label { padding: 6px 0 0; }

.form__footer { margin-top: 34px; text-align: center; }
.form__status { margin: 18px 0 0; font-style: italic; color: var(--oxblood); min-height: 1.4em; }

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 10px 26px;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .04em;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease;
}
.btn:hover { color: var(--oxblood); border-color: var(--oxblood); }
.btn:focus-visible { outline: 2px solid var(--oxblood); outline-offset: 3px; }
.btn__spinner {
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(28, 25, 22, .25);
  border-top-color: var(--ink);
  opacity: 0;
  animation: spin .8s linear infinite;
}
.btn.is-busy { pointer-events: none; }
.btn.is-busy .btn__label { opacity: 0; }
.btn.is-busy .btn__spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }

.received { animation: fade-in .8s ease both; }
.received__title {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin: 0 0 12px;
}
.received p { margin: 0 0 1em; }
.received__line {
  display: inline-block;
  font-variant: small-caps;
  letter-spacing: .2em;
  font-size: .9rem;
  color: var(--ink-soft);
  padding-bottom: 3px;
  border-bottom: 1px solid var(--oxblood);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* 7 · Photo pair, like a spread */
.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.pair .photo { height: clamp(420px, 92vh, 1000px); }
.pair .photo img { object-position: 50% 30%; }

/* 8 · More to come, and the calendar links inside it */
.more {
  text-align: center;
  padding-top: clamp(80px, 14vh, 150px);
  padding-bottom: clamp(80px, 12vh, 130px);
}
.more__heading {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.8rem, 3.2vw, 2.5rem);
  line-height: 1.1;
  margin: 0 0 22px;
}
.more p { margin: 0 0 1.1em; font-size: clamp(1.1rem, 1.5vw, 1.25rem); }
.more__cal { color: var(--ink-soft); }
.nowrap { white-space: nowrap; }
.cal-link {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(28, 25, 22, .3);
  padding-bottom: 1px;
  transition: color .25s ease, border-color .25s ease;
}
.cal-link:hover { color: var(--oxblood); border-bottom-color: var(--oxblood); }

/* 10 · Footer: a short mark and two quiet lines, on the same measure */
.footer {
  background: var(--oxblood);
  color: var(--ivory);
  text-align: center;
  padding: clamp(48px, 8vh, 80px) 24px clamp(48px, 8vh, 80px);
}
.footer__mark { display: block; width: 64px; height: 20px; margin: 0 auto 14px; fill: var(--ivory); overflow: visible; }
.footer__line { margin: 0; font-size: 1.05rem; }
.footer__meta { margin: 2px 0 0; font-style: italic; font-size: .95rem; color: rgba(253, 251, 246, .7); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
  body { font-size: 18px; }
  /* on a phone the film is a near-square landscape frame, with the page following close behind */
  .hero { height: auto; min-height: 0; padding: 18px 18px 6px; }
  .hero__frame { position: static; height: auto; aspect-ratio: 5 / 4; }
  .hero__video { object-position: 50% 50%; }
  .scroll-hint { position: static; display: block; margin: 14px auto 0; color: var(--ink-faint); }
  .intro { padding-top: clamp(56px, 10vh, 96px); }
  .field { grid-template-columns: 1fr; row-gap: 2px; }
  .field label { padding-bottom: 0; }
  .field--address label { padding: 0; }
  .field__line--split { grid-template-columns: 1.4fr .7fr .9fr; column-gap: 10px; }
  /* on a phone the stamp sits centred above the heading, like a chapter mark */
  .mail__head { flex-direction: column-reverse; align-items: center; gap: 18px; text-align: center; }
  .mail__heading { max-width: none; }
  .mail__note { text-align: center; }
  .postmark { width: 108px; margin: 0; }
  /* on a phone the pair stacks, each photo given the full width */
  .pair { grid-template-columns: 1fr; gap: 6px; }
  .pair .photo { aspect-ratio: 1 / 1; height: auto; }
  .pair .photo img { object-position: 50% 50%; }
  .photo--wide { height: clamp(300px, 70vh, 600px); }
  /* the couple sit right of centre in this shot; keep their backs in the middle of the phone crop */
  .photo--wide img { object-position: 64% 40%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .scroll-hint { animation: none; }
}
