/* ==========================================================
   John & Mary — Wedding website demo
   Creative Heroes × Bitrow-IT Solutions
   ========================================================== */

:root {
  --ink: #1c1a18;
  --ink-soft: #3d3934;
  --paper: #faf8f4;
  --paper-2: #f1ece4;
  --muted: #8a837a;
  --gold: #b8995f;
  --gold-light: #dcc89f;
  --line: rgba(28, 26, 24, .12);

  --env: #efe5d4;
  --env-2: #e4d6bf;
  --env-3: #d8c7aa;

  --script: 'Pinyon Script', 'Great Vibes', cursive;
  --serif: 'Cormorant Garamond', 'Times New Roman', Georgia, serif;
  --sans: 'Jost', 'Helvetica Neue', Arial, sans-serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

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

html { -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-stopped { overflow: hidden; }

body {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; height: 100vh; height: 100dvh; }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

.container { width: min(1200px, 88vw); margin-inline: auto; }

/* ---------- Shared type ---------- */
.script-title {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 7.5vw, 6rem);
  line-height: 1.15;
  padding: 0 .1em;
}

.split .w { display: inline-block; white-space: nowrap; }
.split .c { display: inline-block; }

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1.05em 2.4em;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  border: 1px solid currentColor;
  border-radius: 999px;
  transition: color .5s var(--ease), border-color .5s var(--ease);
}
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .55s var(--ease);
}
.btn:hover { color: var(--paper); }
.btn:hover::before { transform: none; }
.btn--dark { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn--dark::before { background: var(--gold); }
.btn--dark:hover { color: var(--ink); border-color: var(--gold); }
.btn:disabled { opacity: .6; pointer-events: none; }

/* ---------- Global overlays ---------- */
.grain {
  position: fixed;
  inset: -50%;
  width: 200%;
  height: 200%;
  pointer-events: none;
  z-index: 200;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(8) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(-3%, 2%); }
  50% { transform: translate(2%, -3%); }
  75% { transform: translate(-2%, -1%); }
}

#confetti { position: fixed; inset: 0; z-index: 160; pointer-events: none; }

.cursor {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 34px; height: 34px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  pointer-events: none;
  z-index: 300;
  transition: width .4s var(--ease), height .4s var(--ease), background-color .4s;
}
.cursor.is-hover { width: 66px; height: 66px; background: rgba(184, 153, 95, .14); }

.progress {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  z-index: 90;
}

/* ==========================================================
   INTRO / ENVELOPE
   ========================================================== */
.intro {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 5vh, 3.2rem);
  padding: 2rem 1.25rem;
  background: radial-gradient(ellipse at 50% 42%, #34302b 0%, #1c1a18 62%, #121110 100%);
  color: var(--paper);
  overflow: hidden;
  clip-path: inset(0% 0% 0% 0%);
}
.intro__watermark {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -52%);
  font-family: var(--script);
  font-size: clamp(16rem, 48vw, 36rem);
  line-height: 1;
  color: rgba(220, 200, 159, .045);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}
.intro__eyebrow {
  position: relative;
  font-style: italic;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--gold-light);
}
.intro__hint {
  position: relative;
  text-align: center;
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: rgba(250, 248, 244, .7);
}
.intro__dots { display: flex; gap: 10px; justify-content: center; margin-top: 1rem; }
.intro__dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 1px solid var(--gold-light);
  transition: background .4s, transform .4s var(--ease), box-shadow .4s;
}
.intro__dots span.on { background: var(--gold-light); transform: scale(1.25); box-shadow: 0 0 12px var(--gold-light); }
.intro__skip {
  position: absolute;
  right: 1.5rem;
  bottom: calc(1.4rem + env(safe-area-inset-bottom));
  font-family: var(--sans);
  font-size: .66rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: rgba(250, 248, 244, .45);
  padding: .6rem;
  transition: color .3s;
}
.intro__skip:hover { color: var(--paper); }

.envelope {
  position: relative;
  width: min(460px, 86vw);
  aspect-ratio: 1.55;
  perspective: 1400px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  outline: none;
}
.envelope:focus-visible { outline: 2px solid var(--gold); outline-offset: 12px; }

.envelope__back {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 6px;
  background: repeating-linear-gradient(45deg, #cdb994 0 7px, #c5b08a 7px 14px);
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .8);
}

.envelope__letter {
  position: absolute;
  left: 5%; top: 5%;
  width: 90%; height: 88%;
  z-index: 2;
  overflow: hidden;
  background: #fffdf9;
  border-radius: 4px;
  color: var(--ink);
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
  cursor: default;
}
.letter__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .45rem;
  margin: 10px;
  padding: clamp(1.4rem, 5vw, 2.2rem) clamp(1rem, 4vw, 1.8rem);
  border: 1px solid rgba(184, 153, 95, .45);
  border-radius: 2px;
}
.letter__ornament { color: var(--gold); font-size: 1rem; line-height: 1; }
.letter__small { font-style: italic; font-size: 1.05rem; color: var(--muted); line-height: 1.3; }
.letter__title { font-family: var(--script); font-weight: 400; font-size: clamp(2.3rem, 8vw, 3.1rem); line-height: 1.15; }
.letter__from { font-size: 1.15rem; line-height: 1.3; }
.letter__from strong { font-weight: 500; letter-spacing: .04em; }
.letter__rule { width: 56px; height: 1px; background: var(--gold); margin: .5rem 0; }
.letter__couple { font-family: var(--sans); font-size: .72rem; letter-spacing: .34em; text-transform: uppercase; margin-right: -.34em; }
.letter__date { font-style: italic; color: var(--muted); font-size: 1rem; line-height: 1.2; }
.letter__btn { margin-top: 1rem; }

.envelope__front {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: 6px;
  background: linear-gradient(160deg, var(--env) 0%, var(--env-2) 100%);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}
.envelope__front::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, var(--env) 0%, #f5eee1 100%);
  clip-path: polygon(0 100%, 50% 46%, 100% 100%);
}

.envelope__flap {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 58%;
  z-index: 4;
  transform-origin: 50% 0;
}
.envelope__flap::before,
.envelope__flap::after {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.envelope__flap::before { background: rgba(0, 0, 0, .22); transform: translateY(3px); filter: blur(2px); }
.envelope__flap::after { background: linear-gradient(180deg, var(--env-3) 0%, var(--env) 100%); border-radius: 6px 6px 0 0; }

.envelope__seal {
  position: absolute;
  left: 50%; top: 58%;
  z-index: 5;
  width: clamp(56px, 15vw, 72px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 48% 52% 50% 50% / 52% 48% 52% 48%;
  background: radial-gradient(circle at 35% 30%, #423c36 0%, #1c1a18 70%);
  box-shadow: 0 5px 12px rgba(0, 0, 0, .4), inset 0 0 0 5px rgba(255, 255, 255, .04), inset 0 -3px 6px rgba(0, 0, 0, .5);
  color: var(--gold-light);
  font-family: var(--script);
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  line-height: 1;
}
.envelope__seal span { transform: translateY(2px); }

.envelope__strip {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 14px;
  z-index: 6;
  overflow: hidden;
  border-radius: 6px 6px 0 0;
  background: var(--env-3);
}
.envelope__strip::before {
  content: "";
  position: absolute;
  left: 3%; right: 3%; top: 50%;
  border-top: 1px dashed rgba(0, 0, 0, .28);
}
.envelope__cut {
  position: absolute;
  left: 0; top: 50%;
  width: 0; height: 2px;
  transform: translateY(-50%);
  background: linear-gradient(90deg, var(--gold), #fff4d8);
  box-shadow: 0 0 10px rgba(255, 220, 150, .9);
}

.envelope__knife {
  position: absolute;
  left: 0; top: 7px;
  z-index: 7;
  width: clamp(64px, 17vw, 84px);
  pointer-events: none;
  filter: drop-shadow(0 8px 8px rgba(0, 0, 0, .45));
}
.envelope__knife svg { display: block; width: 100%; height: auto; }

.paper-bit { position: fixed; z-index: 155; width: 7px; height: 3px; background: var(--env); pointer-events: none; }
.tap-ring { position: fixed; z-index: 155; width: 20px; height: 20px; margin: -10px 0 0 -10px; border: 1px solid var(--gold-light); border-radius: 50%; pointer-events: none; }

/* ==========================================================
   NAVIGATION
   ========================================================== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1.5rem + env(safe-area-inset-top)) 5vw 1.5rem;
  color: #fff;
  transition: background-color .5s, color .5s, padding .5s var(--ease), transform .7s var(--ease), border-color .5s;
  border-bottom: 1px solid transparent;
}
.nav.is-solid {
  padding: calc(.85rem + env(safe-area-inset-top)) 5vw .85rem;
  color: var(--ink);
  background: rgba(250, 248, 244, .86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-color: var(--line);
}
.nav.is-hidden { transform: translateY(-110%); }
.nav__logo { font-family: var(--script); font-size: 2.1rem; line-height: 1; }
.nav__links { display: flex; align-items: center; gap: clamp(1.6rem, 3vw, 3rem); }
.nav__links a {
  position: relative;
  padding: .3em 0;
  font-family: var(--sans);
  font-size: .74rem;
  letter-spacing: .36em;
  text-transform: uppercase;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: calc(100% - .36em); height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .5s var(--ease);
}
.nav__links a:hover::after, .nav__links a.active::after { transform: scaleX(1); transform-origin: left; }
.nav__links .nav__cta { padding: .75em 1.5em .75em 1.85em; border: 1px solid currentColor; border-radius: 999px; transition: background-color .4s, color .4s; }
.nav__links .nav__cta::after { display: none; }
.nav__links .nav__cta:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }

.nav__toggle { display: none; position: relative; width: 40px; height: 40px; }
.nav__toggle span { position: absolute; left: 8px; right: 8px; height: 1px; background: currentColor; transition: transform .45s var(--ease), top .45s var(--ease); }
.nav__toggle span:first-child { top: 16px; }
.nav__toggle span:last-child { top: 24px; }
.menu-open .nav__toggle span:first-child { top: 20px; transform: rotate(45deg); }
.menu-open .nav__toggle span:last-child { top: 20px; transform: rotate(-45deg); }
.menu-open .nav { color: #fff; background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; transform: none; }

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 79;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  background: var(--ink);
  color: var(--paper);
  clip-path: circle(0% at calc(100% - 2.6rem) 2.6rem);
  transition: clip-path .9s var(--ease);
  visibility: hidden;
}
.menu-open .mobile-menu { clip-path: circle(150% at calc(100% - 2.6rem) 2.6rem); visibility: visible; }
.mobile-menu a { font-weight: 300; font-size: 2.6rem; line-height: 1.2; }
.mobile-menu__date { margin-top: 2rem; font-style: italic; color: var(--gold-light); }

@media (max-width: 860px) {
  .nav__links { display: none; }
  .nav__toggle { display: block; }
}

/* ==========================================================
   HERO
   ========================================================== */
.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 620px;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: #111;
}
.hero__media { position: absolute; inset: 0; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero__overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .6) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, .35) 0%, transparent 30%, transparent 62%, rgba(0, 0, 0, .55) 100%);
}
.hero__content { position: relative; z-index: 2; padding: 0 1.5rem; }
.hero__eyebrow { font-style: italic; font-size: clamp(1.1rem, 2vw, 1.4rem); color: rgba(255, 255, 255, .85); }

.monogram {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  height: .95em;
  margin: 1.4rem 0 1.2rem;
  font-family: var(--script);
  font-size: clamp(8rem, 22vw, 15rem);
  line-height: 1;
}
.monogram .m1, .monogram .m2 { display: inline-block; }
.monogram .m1 { transform: translate(.1em, -.06em); }
.monogram .m2 { transform: translate(-.1em, .08em); }
.monogram .ch { display: inline-block; }

.hero__names {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(.95rem, 1.6vw, 1.15rem);
  letter-spacing: .55em;
  margin-right: -.55em;
  text-transform: uppercase;
}
.hero__date { margin-top: .6rem; font-style: italic; font-size: clamp(1.15rem, 2vw, 1.45rem); color: rgba(255, 255, 255, .92); }
.hero__place { margin-top: .2rem; font-size: 1.05rem; color: rgba(255, 255, 255, .7); }

.hero__scroll {
  position: absolute;
  left: 0; right: 0;
  bottom: calc(2.2rem + env(safe-area-inset-bottom));
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .4em;
  text-transform: uppercase;
  margin-right: -.4em;
}
.hero__scroll span { position: relative; width: 1px; height: 56px; overflow: hidden; background: rgba(255, 255, 255, .28); }
.hero__scroll span::after {
  content: "";
  position: absolute;
  left: 0; top: -100%;
  width: 100%; height: 100%;
  background: #fff;
  animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine { 0% { top: -100%; } 65%, 100% { top: 100%; } }

/* ==========================================================
   INVITATION
   ========================================================== */
.invite { padding: clamp(6rem, 14vw, 11rem) 0; background: var(--paper); }
.invite__grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3.5rem, 8vw, 8rem); align-items: center; }
.invite__media { position: relative; padding: 18px 18px 0 0; }
.invite__media::before {
  content: "";
  position: absolute;
  top: 0; right: 0;
  width: calc(100% - 18px); height: calc(100% - 18px);
  border: 1px solid var(--gold);
}
.invite__photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.invite__photo img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.invite__text { text-align: center; }
.invite__lead { max-width: 30ch; margin: 1.2rem auto 0; font-size: clamp(1.15rem, 1.6vw, 1.3rem); color: var(--ink-soft); }
.divider { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 2rem auto; color: var(--gold); font-size: .85rem; }
.divider::before, .divider::after { content: ""; width: 56px; height: 1px; background: currentColor; }
.invite__date { font-style: italic; font-size: clamp(1.45rem, 2.4vw, 1.9rem); line-height: 1.3; }
.invite__time { margin-top: .4rem; color: var(--muted); }
.invite__venue { margin: 1.6rem 0 2.6rem; font-size: 1.15rem; line-height: 1.5; }

@media (max-width: 860px) {
  .invite__grid { grid-template-columns: 1fr; }
  .invite__media { max-width: 440px; margin-inline: auto; width: 100%; }
}

/* ---------- Marquee ---------- */
.marquee { overflow: hidden; padding: 1.8rem 0; background: var(--paper); border-block: 1px solid var(--line); }
.marquee__track { display: flex; width: max-content; }
.marquee__group { display: flex; align-items: center; flex-shrink: 0; }
.marquee__group span {
  padding-right: clamp(2rem, 4vw, 3.5rem);
  white-space: nowrap;
  font-weight: 300;
  font-style: italic;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.2;
}
.marquee__group .s { font-family: var(--script); font-style: normal; color: var(--gold); }

/* ==========================================================
   COUNTDOWN
   ========================================================== */
.countdown {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  text-align: center;
  color: #fff;
  background: #111;
}
.countdown__media { position: absolute; inset: -12% 0; }
.countdown__media img { width: 100%; height: 100%; object-fit: cover; object-position: 28% 15%; filter: grayscale(1) blur(1.5px); transform: scale(1.04); }
.countdown__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 10, 10, .55), rgba(10, 10, 10, .35) 50%, rgba(10, 10, 10, .6)); }
.countdown__inner { position: relative; z-index: 2; padding: 5rem 1rem; }
.countdown__eyebrow { font-style: italic; font-size: clamp(1.15rem, 2vw, 1.45rem); color: var(--gold-light); }
.clock { display: flex; align-items: flex-start; justify-content: center; gap: clamp(.2rem, 1.4vw, 1.2rem); margin: 2rem 0 1.6rem; }
.unit { display: flex; flex-direction: column; align-items: center; }
.num {
  display: block;
  font-weight: 300;
  font-size: clamp(3.4rem, 12vw, 9.5rem);
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}
.label { margin-top: .9rem; font-family: var(--sans); font-size: clamp(.55rem, 1vw, .72rem); letter-spacing: .36em; text-transform: uppercase; opacity: .75; margin-right: -.36em; }
.colon { font-weight: 300; font-size: clamp(2.6rem, 9vw, 7rem); line-height: 1.05; opacity: .5; }
.countdown__note { font-style: italic; font-size: clamp(1.05rem, 1.8vw, 1.3rem); color: rgba(255, 255, 255, .85); }

/* ==========================================================
   OUR STORY
   ========================================================== */
.story { padding: clamp(6rem, 12vw, 10rem) 0; background: var(--paper-2); }
.story__head { text-align: center; margin-bottom: clamp(3.5rem, 8vw, 6rem); }
.story__intro { max-width: 46ch; margin: 1rem auto 0; font-size: 1.2rem; color: var(--ink-soft); }

.timeline { position: relative; }
.timeline__line { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--line); transform: translateX(-50%); }
.timeline__line span { position: absolute; inset: 0; background: var(--gold); transform: scaleY(0); transform-origin: top; }

.moment { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(3rem, 9vw, 9rem); align-items: center; padding: clamp(2.5rem, 5vw, 4rem) 0; }
.moment::before {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  z-index: 1;
  width: 13px; height: 13px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px solid var(--gold);
  transform: translate(-50%, -50%);
  transition: background .6s, box-shadow .6s;
}
.moment.is-active::before { background: var(--gold); box-shadow: 0 0 0 6px rgba(184, 153, 95, .18); }
.moment--rev .moment__media { order: 2; }
.moment__media { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.moment__media img { width: 100%; height: 116%; object-fit: cover; margin-top: -8%; }
.moment__year { display: block; font-family: var(--script); font-size: clamp(3.2rem, 6vw, 4.8rem); line-height: 1; color: var(--gold); }
.moment h3 { font-weight: 400; font-size: clamp(1.9rem, 3.2vw, 2.7rem); line-height: 1.15; margin: .5rem 0 1rem; }
.moment p { max-width: 40ch; color: var(--ink-soft); }

@media (max-width: 860px) {
  .timeline__line { left: 6px; }
  .moment { grid-template-columns: 1fr; gap: 1.8rem; padding-left: 36px; }
  .moment::before { left: 6px; top: 3.4rem; }
  .moment--rev .moment__media { order: 0; }
}

/* ---------- Horizontal gallery ---------- */
.gallery { position: relative; height: 100vh; height: 100svh; overflow: hidden; background: var(--ink); color: var(--paper); }
.gallery__track { display: flex; align-items: center; gap: clamp(1.2rem, 3vw, 3rem); height: 100%; padding: 0 6vw; width: max-content; will-change: transform; }
.gallery__intro { flex: 0 0 min(420px, 78vw); }
.gallery__title { font-weight: 300; font-size: clamp(2.8rem, 6vw, 4.8rem); line-height: 1.05; }
.gallery__title em { font-family: var(--script); font-style: normal; font-size: 1.25em; color: var(--gold-light); }
.gallery__intro p { margin-top: 1.4rem; font-style: italic; color: rgba(250, 248, 244, .55); }
/* Widths are set explicitly (not via aspect-ratio) so the scroll distance is identical on every browser,
   including iPhone Safari/Chrome, before and after the photos finish loading. */
.gallery__item { --h: min(66vh, 620px); position: relative; flex: 0 0 auto; height: var(--h); width: calc(var(--h) * 3 / 4); overflow: hidden; }
.gallery__item.wide { width: calc(var(--h) * 3 / 2); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.gallery__item figcaption {
  position: absolute;
  left: 1.2rem; bottom: 1rem;
  font-style: italic;
  font-size: 1.15rem;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.gallery__end { flex: 0 0 auto; padding: 0 4vw 0 2vw; font-family: var(--script); font-size: clamp(4rem, 9vw, 8rem); color: var(--gold-light); white-space: nowrap; }

@media (max-width: 600px) {
  .gallery__item { --h: 56vh; }
  .gallery__item.wide { width: calc(var(--h) * 4 / 5); }
}

/* ==========================================================
   DETAILS
   ========================================================== */
.details { padding: clamp(6rem, 12vw, 10rem) 0; background: var(--paper); }
.details__head { text-align: center; margin-bottom: clamp(3rem, 6vw, 4.5rem); }
.details__head p { font-size: 1.2rem; color: var(--ink-soft); }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card { padding: clamp(2.2rem, 4vw, 3.4rem) clamp(1.6rem, 3vw, 2.6rem); background: var(--paper); text-align: center; transition: background-color .6s; }
.card:hover { background: #fff; }
.card__icon { display: block; width: 46px; height: 46px; margin: 0 auto 1.4rem; color: var(--gold); }
.card h3 { font-family: var(--sans); font-weight: 400; font-size: .74rem; letter-spacing: .34em; text-transform: uppercase; margin-bottom: .8rem; margin-right: -.34em; }
.card__big { font-style: italic; font-size: 1.65rem; line-height: 1.3; margin-bottom: .6rem; }
.card p:not(.card__big) { max-width: 30ch; margin-inline: auto; font-size: 1.05rem; line-height: 1.6; color: var(--ink-soft); }
.card__link { display: inline-block; margin-top: 1rem; font-family: var(--sans); font-size: .7rem; letter-spacing: .25em; text-transform: uppercase; border-bottom: 1px solid var(--gold); padding-bottom: .2em; transition: color .3s; }
.card__link:hover { color: var(--gold); }

.schedule { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(3rem, 7vw, 6rem); align-items: center; margin-top: clamp(5rem, 10vw, 8rem); }
.schedule__media { aspect-ratio: 4 / 5; overflow: hidden; }
.schedule__media img { width: 100%; height: 100%; object-fit: cover; }
.schedule__title { font-weight: 300; font-size: clamp(2.3rem, 4.5vw, 3.6rem); line-height: 1.1; margin-bottom: 2rem; }
.schedule__list { list-style: none; border-top: 1px solid var(--line); }
.schedule__list li { display: grid; grid-template-columns: 90px 1fr; gap: 1.5rem; align-items: baseline; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.schedule__time { font-family: var(--sans); font-size: .85rem; letter-spacing: .12em; color: var(--gold); font-variant-numeric: tabular-nums; }
.schedule__what { font-size: 1.35rem; line-height: 1.3; }
.schedule__what small { display: block; font-size: 1rem; font-style: italic; color: var(--muted); }

@media (max-width: 960px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 860px) {
  .schedule { grid-template-columns: 1fr; }
  .schedule__media { max-width: 440px; width: 100%; margin-inline: auto; }
}
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } }

/* ==========================================================
   RSVP
   ========================================================== */
.rsvp { position: relative; padding: clamp(6rem, 12vw, 10rem) 0; overflow: hidden; color: var(--paper); background: #111; }
.rsvp__bg { position: absolute; inset: -12% 0; }
.rsvp__bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); opacity: .38; }
.rsvp__shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(17, 17, 17, .85) 0%, rgba(17, 17, 17, .4) 100%); }
.rsvp__inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(3rem, 6vw, 6rem); align-items: center; }
.rsvp__intro p { max-width: 34ch; margin-top: 1rem; font-size: 1.25rem; color: rgba(250, 248, 244, .82); }
.rsvp__intro strong { font-weight: 500; color: var(--gold-light); }

.form {
  position: relative;
  padding: clamp(2rem, 4vw, 3.4rem);
  background: var(--paper);
  color: var(--ink);
  border-radius: 3px;
  box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .7);
}
.form.shake { animation: shake .5s var(--ease); }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.field { position: relative; margin-bottom: 2rem; }
.field label, .field__label {
  display: block;
  margin-bottom: .35rem;
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--muted);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: .5rem 0;
  font: inherit;
  font-size: 1.15rem;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(28, 26, 24, .25);
  border-radius: 0;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}
.field input::placeholder, .field textarea::placeholder { color: rgba(28, 26, 24, .35); font-style: italic; }
.field textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
.field select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23b8995f' stroke-width='1.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
.field .bar { position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .6s var(--ease); }
.field textarea ~ .bar { bottom: 6px; }
.field:focus-within .bar { transform: scaleX(1); }
.field .err { position: absolute; left: 0; top: calc(100% + .25rem); font-size: .9rem; font-style: italic; line-height: 1.2; color: #a3423a; opacity: 0; transition: opacity .3s; }
.field.error .err { opacity: 1; }
.field.error input { border-color: #a3423a; }
.field.error .choice span { border-color: #a3423a; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .6rem; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.2rem;
  padding: .8rem 1rem;
  text-align: center;
  font-family: var(--sans);
  font-size: .7rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  line-height: 1.3;
  border: 1px solid rgba(28, 26, 24, .22);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .4s, color .4s, border-color .4s;
}
.choice span:hover { border-color: var(--ink); }
.choice input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 3px; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.form.declining .attending-only { display: none; }
.form__submit { width: 100%; margin-top: .4rem; }

@media (max-width: 960px) { .rsvp__inner { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; gap: 0; } }

/* ==========================================================
   FOOTER
   ========================================================== */
.footer { padding: 6rem 1.5rem calc(2.5rem + env(safe-area-inset-bottom)); background: var(--ink); color: var(--paper); text-align: center; }
.footer__mono { font-family: var(--script); font-size: clamp(4.5rem, 10vw, 6.5rem); line-height: 1; color: var(--gold-light); }
.footer__names { margin-top: 1rem; font-family: var(--sans); font-size: .8rem; letter-spacing: .5em; text-transform: uppercase; margin-right: -.5em; }
.footer__date { margin-top: .4rem; font-style: italic; color: rgba(250, 248, 244, .7); }
.footer__top { display: inline-block; margin-top: 2.2rem; font-style: italic; border-bottom: 1px solid var(--gold); transition: color .3s; }
.footer__top:hover { color: var(--gold-light); }
.footer__credit { margin-top: 4rem; padding-top: 2rem; border-top: 1px solid rgba(255, 255, 255, .1); font-size: .95rem; color: rgba(250, 248, 244, .5); }
.footer__credit a { color: var(--gold-light); }

/* ==========================================================
   MODAL
   ========================================================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  background: rgba(12, 11, 10, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}
.modal.open { opacity: 1; visibility: visible; }
.modal__card {
  position: relative;
  width: 100%;
  max-width: 470px;
  padding: 3.2rem 2.2rem 2.6rem;
  background: var(--paper);
  text-align: center;
  border-radius: 3px;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .6);
  transform: translateY(30px) scale(.94);
  transition: transform .7s var(--ease);
}
.modal.open .modal__card { transform: none; }
.modal__card::before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(184, 153, 95, .45); pointer-events: none; }
.modal__heart { display: block; font-size: 1.4rem; color: var(--gold); animation: beat 1.4s ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.25); } 30% { transform: scale(1); } 45% { transform: scale(1.15); } }
.modal__title { margin-top: .6rem; font-family: var(--script); font-weight: 400; font-size: clamp(2.6rem, 8vw, 3.3rem); line-height: 1.15; }
.modal__msg { margin: .8rem auto 2rem; max-width: 26ch; font-style: italic; font-size: 1.35rem; line-height: 1.45; color: var(--ink-soft); }

/* ==========================================================
   Reduced motion
   ========================================================== */
@media (prefers-reduced-motion: reduce) {
  .grain, .hero__scroll span::after, .modal__heart { animation: none; }
}
