/* Layout concept: an ivory "sky" that dissolves into the venue photographs,
   then quiet stone-coloured sections with one script heading each. */
:root {
  --ivory: #F5F1EA;
  --paper: #FBF8F3;
  --stone: #ECE6DB;
  --ink: #2F3229;
  --ink-soft: #595C4F;
  --sage: #7C8A6E;
  --sage-deep: #55623F;
  --lavender: #9A8FB0;
  --lavender-deep: #675C88;
  --line: rgba(47, 50, 41, 0.16);
  --error: #9B2C2C;

  --font-script: "Italianno", "Snell Roundhand", "Apple Chancery", cursive;
  --font-serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --font-sans: "Jost", "Futura", "Century Gothic", system-ui, sans-serif;

  --gutter: clamp(16px, 5vw, 56px);
  --max: 1120px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { max-width: 100%; display: block; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--lavender-deep); outline-offset: 3px; border-radius: 2px; }

.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;
}
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: 10px 16px;
  font-family: var(--font-sans); font-size: 14px; text-decoration: none;
}
.skip-link:focus { top: calc(env(safe-area-inset-top, 0px) + 12px); }

.script { font-family: var(--font-script); font-weight: 400; line-height: 1; }

.eyebrow, .label {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: max(100svh, 640px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  isolation: isolate;
  background: var(--ivory);
}
/* The photo sits below the title and dissolves upward into the ivory "sky" */
.hero__slides {
  position: relative;
  order: 3;
  flex: 1 1 auto;
  min-height: 46vh;
  margin-top: clamp(-150px, -12vh, -48px);
  z-index: -1;
  overflow: hidden;
}
.hero__slides::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to bottom,
    var(--ivory) 0%,
    rgba(245, 241, 234, 0.85) 9%,
    rgba(245, 241, 234, 0.45) 20%,
    rgba(245, 241, 234, 0.12) 32%,
    rgba(245, 241, 234, 0) 40%);
  pointer-events: none;
}
.hero__top { order: 1; }
.hero__title { order: 2; position: relative; }
.slide {
  position: absolute; inset: 0; margin: 0;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}
.slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 62%;
  transform: scale(1.06);
  transition: transform 7s var(--ease-out);
}
.slide.is-active { opacity: 1; }
.slide.is-active img { transform: scale(1); }

.hero__top {
  display: grid;
  justify-items: center;
  gap: clamp(20px, 3.5vh, 36px);
  padding: calc(env(safe-area-inset-top, 0px) + clamp(22px, 4vh, 40px)) var(--gutter) 0;
}

.monogram {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  text-decoration: none;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1;
  padding: 4px 8px;
}
.monogram__first { grid-column: 1; grid-row: 1; padding-right: 0.7em; }
.monogram__second { grid-column: 2; grid-row: 2; margin-top: 0.12em; }
.monogram__amp {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-58%, -46%);
  font-family: var(--font-script);
  font-size: 2.6em;
  color: var(--lavender);
  opacity: 0.55;
  z-index: -1;
  pointer-events: none;
}

.nav {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
}
.nav li { display: flex; align-items: center; }
.nav li + li::before {
  content: "";
  width: 22px; height: 1px;
  background: var(--line);
  margin: 0 clamp(6px, 1.6vw, 22px);
}
.nav a {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 12px 4px;
  transition: color 0.2s;
}
.nav a:hover { color: var(--ink); }
.nav a[href="#rsvp"] { color: var(--ink); }

.hero__title {
  text-align: center;
  padding: clamp(20px, 4vh, 56px) var(--gutter) 0;
  animation: rise 1.4s var(--ease-out) both 0.15s;
}
.hero__title h1 .script {
  display: block;
  font-size: clamp(5.25rem, 15vw, 12.5rem);
  color: var(--ink);
  letter-spacing: 0.005em;
  line-height: 0.9;
}
.hero__date {
  margin-top: 0.35em;
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  letter-spacing: 0.08em;
  color: var(--ink);
  font-variant-numeric: lining-nums;
  text-shadow: 0 0 12px var(--ivory), 0 0 24px var(--ivory);
}

.hero__controls {
  position: absolute;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 4px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(31, 33, 27, 0.38);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  color: #fff;
}
.ctrl {
  display: grid; place-items: center;
  min-width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer;
  border-radius: 999px;
  touch-action: manipulation;
}
.ctrl svg { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.ctrl--arrow svg { width: 44px; height: 12px; transition: transform 0.25s var(--ease-out); }
.ctrl--arrow[data-dir="-1"]:hover svg { transform: translateX(-3px); }
.ctrl--arrow[data-dir="1"]:hover svg { transform: translateX(3px); }
.ctrl--pause svg { width: 12px; height: 12px; stroke-width: 1.5; }
.ctrl--pause .i-play { fill: currentColor; stroke: none; }
.ctrl--pause .i-play, .ctrl--pause[aria-pressed="true"] .i-pause { display: none; }
.ctrl--pause[aria-pressed="true"] .i-play { display: block; }
.ctrl:focus-visible { outline-color: #fff; }
.ctrl__count {
  font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.08em; min-width: 30px; text-align: center;
  font-variant-numeric: tabular-nums;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Mini bar ---------- */
.minibar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) var(--gutter) 6px;
  background: rgba(245, 241, 234, 0.92);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  transform: translateY(-110%);
  transition: transform 0.35s var(--ease-out);
}
.minibar.is-visible { transform: none; }
.minibar__mark {
  font-family: var(--font-serif); font-size: 1.375rem; text-decoration: none; white-space: nowrap;
}
.minibar__mark span { font-family: var(--font-script); font-size: 1.6em; color: var(--lavender-deep); line-height: 0; }
.minibar__links { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: clamp(4px, 2vw, 24px); }
.minibar__links a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px;
  font-family: var(--font-sans); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase; text-decoration: none; color: var(--ink-soft);
}
.minibar__links a:hover { color: var(--ink); }
.minibar__links .minibar__rsvp {
  min-height: 36px; padding: 0 14px; border: 1px solid var(--ink); color: var(--ink); border-radius: 999px;
}

/* ---------- Intro ---------- */
.intro {
  display: grid; justify-items: center; gap: 20px;
  text-align: center;
  padding: clamp(64px, 10vw, 120px) var(--gutter) clamp(40px, 6vw, 72px);
}
.intro__lede {
  max-width: 30ch;
  font-size: clamp(1.5rem, 3.2vw, 2.125rem);
  line-height: 1.35;
  font-weight: 400;
  font-style: italic;
}
.countdown { display: grid; justify-items: center; gap: 2px; margin-top: 12px; }
.countdown__num {
  font-size: clamp(3rem, 7vw, 4.5rem);
  font-weight: 400;
  line-height: 1;
  color: var(--sage-deep);
  font-variant-numeric: lining-nums tabular-nums;
  min-height: 1em;
}
.countdown__label { font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--ink-soft); }

/* ---------- Sections ---------- */
.section {
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin: 0 auto;
  padding: clamp(64px, 10vw, 128px) var(--gutter);
}
.section + .section { border-top: 1px solid var(--line); }
.section__head { display: grid; justify-items: center; gap: 6px; text-align: center; margin-bottom: clamp(36px, 6vw, 64px); }
.script-heading {
  font-family: var(--font-script); font-weight: 400;
  font-size: clamp(4rem, 9vw, 6.5rem);
  line-height: 0.95;
  color: var(--ink);
}
.section__intro { max-width: 52ch; margin-top: 10px; color: var(--ink-soft); }

/* The Day */
.day__grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(32px, 6vw, 88px);
  align-items: stretch;
}
/* The photo matches the timeline's height exactly: top rule to bottom rule */
.day__photo { margin: 0; position: relative; min-height: 100%; }
.day__photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: center 35%;
}

.timeline { list-style: none; margin: 0; padding: 0; display: grid; }
.timeline li {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  align-items: baseline;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.timeline li:first-child { border-top: 1px solid var(--line); }
.timeline time {
  font-size: 1.75rem; line-height: 1.1; font-weight: 400;
  font-variant-numeric: lining-nums tabular-nums;
  color: var(--ink);
}
.timeline time small {
  font-family: var(--font-sans); font-size: 0.6875rem; letter-spacing: 0.16em;
  text-transform: uppercase; margin-left: 4px; color: var(--ink-soft);
}
.timeline h3 { font-size: 1.375rem; font-weight: 600; line-height: 1.25; }
.timeline p { color: var(--ink-soft); font-size: 1.0625rem; }
.timeline .is-key time { color: var(--lavender-deep); }
.timeline .is-key h3::after {
  content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--lavender); margin-left: 10px; vertical-align: middle;
}

/* Venue */
.venue__banner { margin: 0 0 clamp(28px, 4vw, 44px); }
.venue__banner img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: center 55%; }

.venue__address {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 32px;
  padding-bottom: clamp(28px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
}
.venue__addr { font-size: clamp(1.375rem, 2.6vw, 1.75rem); font-weight: 400; margin-top: 4px; }
.venue__actions { display: flex; flex-wrap: wrap; gap: 10px; }

.travel {
  list-style: none; margin: 0; padding: clamp(32px, 5vw, 52px) 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(24px, 3.5vw, 44px);
}
.travel li { display: grid; align-content: start; gap: 8px; }
.travel .icon { width: 28px; height: 28px; fill: none; stroke: var(--sage-deep); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.travel h3 { font-size: 1.375rem; font-weight: 600; margin-top: 6px; }
.travel p { font-size: 1.0625rem; color: var(--ink-soft); }

.map {
  aspect-ratio: 16 / 7; max-width: 100%;
  background: var(--stone);
  border: 1px solid var(--line);
  overflow: hidden;
}
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(0.55) sepia(0.12); }

/* Details */
.details__pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(20px, 3vw, 32px); }
.note {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(28px, 4vw, 44px);
  display: grid; gap: 10px; align-content: start;
}
.note h3 { font-size: clamp(1.625rem, 2.6vw, 2rem); font-weight: 500; line-height: 1.15; }
.note p:last-child { color: var(--ink-soft); max-width: 46ch; }

.faq { max-width: 760px; margin: clamp(48px, 7vw, 88px) auto 0; }
.faq__title { font-size: 1.75rem; font-weight: 500; text-align: center; margin-bottom: 20px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:first-of-type { border-top: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  min-height: 56px; padding: 14px 0;
  font-size: 1.25rem; font-weight: 600;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px;
  border-right: 1.5px solid var(--ink-soft); border-bottom: 1.5px solid var(--ink-soft);
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.25s var(--ease-out);
}
.faq details[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
.faq details p { padding: 0 0 20px; color: var(--ink-soft); max-width: 62ch; }
.faq strong { color: var(--ink); font-weight: 600; }

/* RSVP */
.rsvp { max-width: calc(760px + 2 * var(--gutter)); }
.section.rsvp { border-top: 0; }
.rsvp__card {
  background: var(--paper);
  border: 1px solid var(--line);
  padding: clamp(36px, 6vw, 72px) clamp(20px, 6vw, 72px);
  position: relative;
}
.rsvp__card::before {
  content: ""; position: absolute; inset: 8px; border: 1px solid var(--line); pointer-events: none;
}
.rsvp .section__head { margin-bottom: clamp(28px, 4vw, 40px); }

.form { display: grid; gap: 28px; position: relative; }
.field { display: grid; gap: 8px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend {
  font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink);
  padding: 0;
}
.field legend { margin-bottom: 8px; }
.req { color: var(--lavender-deep); }
.field input[type="text"], .field textarea {
  width: 100%;
  font: inherit; font-size: 1.1875rem; font-weight: 500; color: var(--ink);
  background: var(--ivory);
  border: 1px solid rgba(47, 50, 41, 0.32);
  border-radius: 2px;
  padding: 12px 14px;
  min-height: 52px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field textarea { resize: vertical; min-height: 96px; }
.field input[type="text"]:focus, .field textarea:focus {
  outline: none; border-color: var(--lavender-deep); box-shadow: 0 0 0 3px rgba(103, 92, 136, 0.2);
}
.field.has-error input[type="text"] { border-color: var(--error); }
.help { font-size: 1rem; color: var(--ink-soft); font-style: italic; }
.error { font-family: var(--font-sans); font-size: 0.875rem; color: var(--error); }

.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field .choice {
  position: relative; cursor: pointer;
  font-family: var(--font-serif); font-size: 1rem; font-weight: 500;
  letter-spacing: normal; text-transform: none;
}
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 60px; padding: 12px 16px;
  border: 1px solid rgba(47, 50, 41, 0.32);
  background: var(--ivory);
  font-size: 1.25rem; font-style: italic;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.choice:hover span { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.choice input:focus-visible + span { outline: 2px solid var(--lavender-deep); outline-offset: 3px; }
.field.has-error .choice span { border-color: var(--error); }

.form__extra { display: grid; gap: 28px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px;
  font-family: var(--font-sans); font-size: 0.8125rem; font-weight: 500;
  letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none;
  border-radius: 999px; cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  touch-action: manipulation;
}
.btn:active { transform: scale(0.98); }
.btn--ghost { background: transparent; border: 1px solid rgba(47, 50, 41, 0.4); color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink); background: rgba(47, 50, 41, 0.04); }
.btn--solid { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); min-height: 56px; justify-self: center; padding: 0 44px; }
.btn--solid:hover { background: #20221B; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid currentColor; border-right-color: transparent;
  display: none; animation: spin 0.8s linear infinite;
}
.btn.is-loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.form__status { text-align: center; font-size: 1.0625rem; min-height: 1.6em; }
.form__status.is-error { color: var(--error); }

.thanks { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 8px 0; }
.thanks:focus { outline: none; }
.thanks__script { font-size: clamp(3.5rem, 8vw, 5rem); color: var(--lavender-deep); }
.thanks__msg { font-size: 1.375rem; max-width: 34ch; }

/* Footer */
.footer {
  display: grid; justify-items: center; gap: 10px; text-align: center;
  padding: clamp(56px, 8vw, 96px) var(--gutter) calc(env(safe-area-inset-bottom, 0px) + 48px);
  background: var(--stone);
}
.footer__names .script { font-size: clamp(3.5rem, 8vw, 5.5rem); }
.footer__meta { letter-spacing: 0.08em; color: var(--ink-soft); }
.footer__top {
  margin-top: 12px; padding: 12px;
  font-family: var(--font-sans); font-size: 0.75rem; letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--ink-soft); text-decoration: none;
}
.footer__top:hover { color: var(--ink); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .day__grid { grid-template-columns: minmax(0, 1fr); }
  .day__photo img { position: static; height: auto; aspect-ratio: 4 / 5; object-position: center 30%; }
  .details__pair { grid-template-columns: minmax(0, 1fr); }
  .travel { grid-template-columns: minmax(0, 1fr); }
  .venue__banner img { aspect-ratio: 16 / 10; }
  .map { aspect-ratio: 4 / 3; }
  .minibar__links li:not(:last-child) { display: none; }
  .nav { flex-wrap: nowrap; }
  .nav a { letter-spacing: 0.16em; padding: 12px 2px; }
  .nav li + li::before { width: 10px; margin: 0 8px; }
}
@media (max-width: 560px) {
  body { font-size: 1.125rem; }
  .slide img { object-position: center 70%; }
  .hero__slides { margin-top: -24px; }
  .hero__slides::after {
    background: linear-gradient(to bottom,
      var(--ivory) 0%,
      rgba(245, 241, 234, 0.85) 14%,
      rgba(245, 241, 234, 0.4) 30%,
      rgba(245, 241, 234, 0) 48%);
  }
  .nav a { letter-spacing: 0.12em; }
  .nav li + li::before { width: 8px; margin: 0 6px; }
  .travel { grid-template-columns: minmax(0, 1fr); }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .timeline li { grid-template-columns: 5.25rem minmax(0, 1fr); gap: 14px; }
  .timeline time { font-size: 1.5rem; }
  .venue__actions, .venue__actions .btn { width: 100%; }
  .btn--solid { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .slide img, .slide.is-active img { transform: none; }
}
