@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Cormorant Garamond";
  src: url("fonts/cormorant-garamond-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Great Vibes";
  src: url("fonts/great-vibes.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ivory: #fbf6ef;
  --paper: #fffdf9;
  --blush: #f3dcd6;
  --blush-deep: #e8bfb8;
  --rose: #b9707a;
  --wine: #7f3f4b;
  --gold: #b8955a;
  --gold-light: #d9bf8c;
  --ink: #3f2f31;
  --ink-soft: #6d5a5c;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --script: "Great Vibes", "Snell Roundhand", "Apple Chancery", cursive;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-variant-numeric: lining-nums;
  min-height: 100vh;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--ivory);
  overflow-x: hidden;
}

/* Fixed backdrop layer: background-attachment: fixed is ignored by iOS Safari. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 10% -10%, #f6e1db 0%, transparent 60%),
    radial-gradient(900px 600px at 110% 20%, #f4e6d4 0%, transparent 55%),
    radial-gradient(900px 700px at 50% 120%, #f3dcd6 0%, transparent 60%),
    var(--ivory);
}

.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

h1, h2, p { margin: 0; }

main { padding: 0 16px; }

/* ---------- Banner ---------- */

.hero {
  --overlap: clamp(64px, 12vw, 120px);
  position: relative;
  height: clamp(460px, 82vh, 820px);
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% 28%;
}

/* Fade the bottom of the photo into the page so the card sits on it softly. */
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 60%;
  background: linear-gradient(180deg, rgba(251, 246, 239, 0) 0%, rgba(251, 246, 239, .82) 55%, var(--ivory) 100%);
}

.hero-text {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(var(--overlap) + clamp(20px, 5vw, 40px));
  z-index: 1;
  text-align: center;
}

.hero-kicker {
  font-size: clamp(.75rem, 2.8vw, .9rem);
  font-weight: 600;
  letter-spacing: .34em;
  text-transform: uppercase;
  color: var(--rose);
}

.hero-title {
  margin-top: 4px;
  font-family: var(--script);
  font-size: clamp(2.1rem, 11vw, 5.6rem);
  line-height: 1.1;
  color: var(--wine);
  text-shadow: 0 1px 18px rgba(255, 253, 249, .9);
  text-wrap: balance;
}

/* Wide screens: the couple stands right of centre, so set the text in the open space on the left. */
@media (min-width: 900px) {
  .hero-text {
    left: max(6vw, calc(50% - 560px));
    right: auto;
    bottom: auto;
    top: 38%;
    max-width: 44%;
    text-align: left;
    transform: translateY(-50%);
  }
  .hero-title { font-size: clamp(3.6rem, 5.6vw, 5.6rem); }
}


/* ---------- Invitation card ---------- */

.card-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  margin-top: calc(-1 * clamp(64px, 12vw, 120px));
  padding: 0 0 clamp(24px, 6vw, 56px);
}

.card {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding: clamp(64px, 16vw, 104px) clamp(24px, 8vw, 64px) clamp(56px, 13vw, 88px);
  text-align: center;
  background:
    radial-gradient(circle at 20% 15%, rgba(243, 220, 214, .35) 0%, transparent 40%),
    radial-gradient(circle at 85% 90%, rgba(244, 230, 212, .5) 0%, transparent 45%),
    var(--paper);
  border-radius: 4px;
  box-shadow:
    0 1px 2px rgba(63, 47, 49, .06),
    0 24px 60px -20px rgba(127, 63, 75, .25);
}

.card::before,
.card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.card::before { inset: 12px; border: 1px solid rgba(184, 149, 90, .75); }
.card::after { inset: 18px; border: 1px solid rgba(184, 149, 90, .35); }

.corner {
  position: absolute;
  width: clamp(96px, 28vw, 156px);
  height: clamp(96px, 28vw, 156px);
  pointer-events: none;
}
.corner-tl { top: 4px; left: 4px; }
.corner-br { bottom: 4px; right: 4px; transform: rotate(180deg); }

.eyebrow {
  font-size: clamp(.72rem, 2.6vw, .85rem);
  font-weight: 500;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--rose);
}

.names {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: clamp(18px, 5vw, 28px) 0 clamp(14px, 4vw, 22px);
  font-weight: 400;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.person {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.creds {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-top: 6px;
  font-size: clamp(.82rem, 3.3vw, .95rem);
  line-height: 1.45;
  color: var(--ink-soft);
  text-wrap: balance;
}
.creds span { display: block; }
.creds .cred-title {
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--ink);
}
.creds .cred-title:not(:first-child) { margin-top: 8px; }

.name {
  font-family: var(--script);
  font-size: clamp(2.1rem, 11vw, 4.4rem);
  line-height: 1.15;
  color: var(--wine);
}

.amp {
  margin: clamp(10px, 3vw, 16px) 0 clamp(2px, 1vw, 6px);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 6vw, 2.2rem);
  line-height: 1.2;
  background: linear-gradient(135deg, #a8803f 0%, #e3c98f 45%, #a8803f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.invite-text {
  font-style: italic;
  font-size: clamp(1.05rem, 3.8vw, 1.25rem);
  color: var(--ink-soft);
}

.flourish {
  display: block;
  width: min(220px, 70%);
  height: 24px;
  margin: clamp(22px, 6vw, 32px) auto;
}

.date {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(12px, 4vw, 22px);
  max-width: 360px;
  margin: 0 auto;
}

.date-side {
  padding: 8px 0;
  border-top: 1px solid rgba(184, 149, 90, .6);
  border-bottom: 1px solid rgba(184, 149, 90, .6);
  font-size: clamp(.78rem, 2.8vw, .92rem);
  font-weight: 600;
  letter-spacing: .22em;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--ink);
}

.date-day {
  font-size: clamp(3.4rem, 15vw, 4.8rem);
  font-weight: 400;
  line-height: 1;
  color: var(--wine);
}

.time {
  margin-top: clamp(14px, 4vw, 20px);
  font-size: clamp(.95rem, 3.6vw, 1.1rem);
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--wine);
}
.time span {
  font-style: italic;
  font-weight: 400;
  letter-spacing: .04em;
  text-transform: none;
  color: var(--ink-soft);
}

.venue {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: clamp(24px, 7vw, 36px);
}
.venue-room {
  font-family: var(--script);
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.2;
  color: var(--rose);
}
.venue-name {
  font-size: clamp(1.05rem, 4vw, 1.25rem);
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.venue-city {
  font-style: italic;
  color: var(--ink-soft);
}

.dress-code {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: clamp(20px, 6vw, 28px);
}
.dress-code-label {
  font-size: clamp(.72rem, 2.6vw, .82rem);
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--rose);
}
.dress-code-value {
  font-style: italic;
  font-size: clamp(1.05rem, 4vw, 1.2rem);
  color: var(--ink);
}

.card-sign {
  margin-top: clamp(24px, 7vw, 36px);
  font-family: var(--script);
  font-size: clamp(1.5rem, 5.5vw, 1.9rem);
  color: var(--rose);
}

/* ---------- Countdown ---------- */

.countdown {
  max-width: 640px;
  margin: 0 auto;
  padding: clamp(32px, 8vw, 56px) 0;
  text-align: center;
}

.script-title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 3.2rem);
  line-height: 1.1;
  color: var(--wine);
}

.countdown-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(8px, 3vw, 18px);
  max-width: 480px;
  margin: clamp(20px, 6vw, 32px) auto 0;
}
.countdown-grid[hidden] { display: none; }

.count {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: clamp(12px, 4vw, 20px) 4px;
  background: rgba(255, 253, 249, .75);
  border: 1px solid rgba(184, 149, 90, .4);
  border-radius: 999px 999px 12px 12px;
}

.count-num {
  font-size: clamp(1.9rem, 8vw, 2.8rem);
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--wine);
}

.count-label {
  font-size: clamp(.62rem, 2.4vw, .75rem);
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.countdown-message {
  margin-top: 18px;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Meet the couple ---------- */

.couple {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(16px, 4vw, 32px) 0 clamp(24px, 6vw, 48px);
  text-align: center;
}

.couple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr));
  gap: clamp(20px, 5vw, 32px);
  margin-top: clamp(24px, 6vw, 40px);
}

.couple-card {
  padding: clamp(28px, 7vw, 40px) clamp(20px, 5vw, 36px) clamp(28px, 7vw, 36px);
  background: rgba(255, 253, 249, .85);
  border: 1px solid rgba(184, 149, 90, .35);
  border-radius: 4px;
  box-shadow: 0 16px 40px -24px rgba(127, 63, 75, .3);
}

.portrait {
  display: block;
  width: clamp(140px, 40vw, 180px);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--paper);
  box-shadow: 0 0 0 1px var(--gold), 0 14px 30px -14px rgba(127, 63, 75, .5);
}

.couple-role {
  margin-top: 18px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .32em;
  text-transform: uppercase;
  color: var(--rose);
}

.couple-name {
  margin: 4px 0 0;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 2.8rem);
  line-height: 1.15;
  color: var(--wine);
}

.couple-nickname {
  font-style: italic;
  font-size: 1.1rem;
  color: var(--ink-soft);
}

.bio {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
  font-size: clamp(1rem, 3.6vw, 1.08rem);
  line-height: 1.6;
  color: var(--ink);
}
.bio li {
  position: relative;
  padding-left: 22px;
}
.bio li + li { margin-top: 10px; }
.bio li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .55em;
  width: 10px;
  height: 10px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23b8955a' d='M12 21s-8-5.2-8-11a4.5 4.5 0 0 1 8-2.8A4.5 4.5 0 0 1 20 10c0 5.8-8 11-8 11Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.bio-love {
  margin-top: 20px;
  font-family: var(--script);
  font-size: clamp(1.45rem, 5.5vw, 1.7rem);
  line-height: 1.3;
  color: var(--rose);
  text-wrap: balance;
}

/* ---------- Gallery ---------- */

.gallery {
  max-width: 960px;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 48px) 0 clamp(40px, 10vw, 72px);
  text-align: center;
}

.story {
  max-width: 34em;
  margin: clamp(18px, 5vw, 28px) auto 0;
  font-size: clamp(1.08rem, 4vw, 1.22rem);
  line-height: 1.75;
  color: var(--ink);
  text-wrap: pretty;
}
.story p + p { margin-top: 1em; }
.story > p:first-child::first-letter {
  font-family: var(--script);
  font-size: 2.2em;
  line-height: 1;
  padding-right: .12em;
  color: var(--wine);
}
.story .nickname {
  font-style: italic;
  font-weight: 600;
  color: var(--wine);
  white-space: nowrap;
}
.story-quote {
  margin: 1.4em 0;
  font-family: var(--script);
  font-size: clamp(1.7rem, 6.5vw, 2.2rem);
  line-height: 1.3;
  color: var(--rose);
}
.story .story-end {
  margin-top: 1.4em;
  font-style: italic;
  font-size: 1.15em;
  color: var(--wine);
}

.gallery .flourish { margin: clamp(24px, 6vw, 36px) auto clamp(10px, 3vw, 16px); }

.gallery-intro {
  margin-top: 6px;
  font-style: italic;
  color: var(--ink-soft);
}

/* Row-by-row layout keeps photos in story order. The first photo is featured full width; the rest
   are even portrait tiles (2 per row on phones, 4 on wider screens), some double width. A short last
   row is centred. Built only from long-supported CSS (flex-wrap, margins, percentage padding) so it
   also works on older phone browsers. */
.mosaic {
  --gap: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: clamp(24px, 6vw, 40px) calc(var(--gap) / -2) 0;
}
@media (min-width: 760px) {
  .mosaic { --gap: 14px; }
}

.photo {
  position: relative;
  display: block;
  width: calc(50% - var(--gap));
  margin: calc(var(--gap) / 2);
  overflow: hidden;
  border-radius: 4px;
  background: var(--blush);
  box-shadow: 0 10px 24px -14px rgba(127, 63, 75, .45);
}
/* Portrait 4:5 tile shape. */
.photo::before {
  content: "";
  display: block;
  padding-top: 125%;
}
.photo img {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
  transition: transform .6s var(--ease);
}

.photo:first-child { width: calc(100% - var(--gap)); }
.photo:first-child::before { display: none; }
.photo:first-child img { position: static; height: auto; }

/* Wide tiles: a full row on phones (8:5), two columns on wider screens. There a wide tile is
   2 tiles + 1 gap across, so matching the portrait tiles' height (1.25 x tile) needs
   62.5% of its own width minus 0.625 gap. */
.photo-wide { width: calc(100% - var(--gap)); }
.photo-wide::before { padding-top: 62.5%; }
@media (min-width: 760px) {
  .photo { width: calc(25% - var(--gap)); }
  .photo-wide { width: calc(50% - var(--gap)); }
  .photo-wide::before { padding-top: calc(62.5% - .625 * var(--gap)); }
}
.photo:hover img { transform: scale(1.03); }
.photo:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- Lightbox ---------- */

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(32, 22, 24, .97);
  color: var(--paper);
  overscroll-behavior: contain;
}
.lightbox::backdrop { background: rgba(32, 22, 24, .97); }
html:has(.lightbox[open]) { overflow: hidden; }

.lightbox-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  margin: 0;
  padding: max(56px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.lightbox-img {
  max-width: 100%;
  max-height: calc(100% - 40px);
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-caption {
  font-size: .8rem;
  letter-spacing: .24em;
  color: var(--gold-light);
}

.lightbox-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(217, 191, 140, .5);
  border-radius: 50%;
  background: rgba(32, 22, 24, .55);
  color: var(--paper);
  cursor: pointer;
}
.lightbox-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lightbox-btn:hover,
.lightbox-btn:focus-visible { background: var(--wine); border-color: var(--wine); }
.lightbox-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.lightbox-close { top: max(10px, env(safe-area-inset-top)); right: 12px; }
.lightbox-prev,
.lightbox-next { top: 50%; transform: translateY(-50%); }
.lightbox-prev { left: 12px; }
.lightbox-next { right: 12px; }

@media (max-width: 600px) {
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: max(14px, env(safe-area-inset-bottom)); transform: none; }
}

/* ---------- Footer ---------- */

.footer {
  padding: 8px 0 calc(56px + env(safe-area-inset-bottom));
  text-align: center;
}
.footer .flourish { margin-top: 0; }
.footer-monogram {
  font-family: var(--script);
  font-size: clamp(2.6rem, 10vw, 3.4rem);
  line-height: 1;
  color: var(--wine);
}
.footer-monogram span { color: var(--gold); font-size: .75em; }
.footer-date {
  margin-top: 8px;
  font-weight: 600;
  letter-spacing: .3em;
  color: var(--ink-soft);
}
.footer-note {
  margin-top: 6px;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Petals ---------- */

.petal {
  position: fixed;
  top: -24px;
  z-index: 40;
  width: var(--size, 14px);
  height: calc(var(--size, 14px) * .85);
  border-radius: 150% 0 150% 0;
  background: linear-gradient(135deg, #f7d9d4 0%, #e9aeb0 100%);
  opacity: .75;
  pointer-events: none;
  animation:
    petal-fall var(--fall, 12s) linear var(--delay, 0s) infinite,
    petal-sway var(--sway, 3s) ease-in-out var(--delay, 0s) infinite alternate;
}

@keyframes petal-fall {
  0% { transform: translate3d(0, 0, 0) rotate(0deg); }
  100% { transform: translate3d(var(--drift, 60px), 110vh, 0) rotate(var(--spin, 360deg)); }
}
@keyframes petal-sway {
  from { margin-left: -18px; }
  to { margin-left: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
  }
  .petal { display: none; }
}
