:root {
  --serif: "EB Garamond", "Cormorant Garamond", "Palatino Linotype", Georgia, serif;
  --script: "Pinyon Script", "Great Vibes", "Bickham Script Pro", "Edwardian Script ITC", cursive;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --paper: #fffdf8;
  --paper-strong: #ffffff;
  --ink: #30343a;
  --muted: #62636a;
  --olive: #667a62;
  --wine: #6f8796;
  --gold: #e7bd72;
  --rose: #8db8d6;
  --flower-blue: #9cc4dd;
  --flower-yellow: #f2cf83;
  --envelope-blue: #6f8796;
  --envelope-blue-dark: #4f6b78;
  --line: rgba(79, 107, 120, 0.18);
  --shadow: 0 24px 70px rgba(54, 71, 78, 0.18);
  --viewport-height: 100svh;
  --header-height: 5.25rem;
  --section-viewport: calc(var(--viewport-height) - var(--header-height));
}

@supports (height: 100dvh) {
  :root {
    --viewport-height: 100dvh;
  }
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-regular.ttf") format("truetype");
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-semibold.ttf") format("truetype");
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/eb-garamond-italic.ttf") format("truetype");
}

@font-face {
  font-family: "Pinyon Script";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/pinyon-script-regular.ttf") format("truetype");
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  --church-x: 0px;
  --church-y: 0px;
  --church-scroll: 0px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 253, 248, 0.94), rgba(255, 255, 255, 0.8) 45%, rgba(244, 248, 244, 0.72)),
    var(--paper);
  font-family: var(--serif);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(18px);
}

.site-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translate3d(
    calc(var(--church-x) * 0.04),
    calc(var(--church-y) * 0.03),
    0
  );
  transition: transform 220ms ease-out;
  will-change: transform;
}

.site-backdrop::before {
  position: absolute;
  inset: -6vh -5vw;
  content: "";
  background:
    radial-gradient(ellipse at 62% 28%, rgba(255, 253, 248, 0) 34%, rgba(255, 253, 248, 0.34) 78%),
    url("/assets/photos/iglesia-acuarela.jpeg");
  background-position:
    center,
    calc(58% + var(--church-x)) calc(4.85rem + var(--church-y) + var(--church-scroll));
  background-repeat: no-repeat;
  background-size:
    auto,
    min(96vw, 76rem) auto;
  filter: saturate(1.08) contrast(1.04);
  opacity: 0.84;
  transform: translate3d(
    calc(var(--church-x) * 0.34),
    calc(var(--church-y) * 0.3),
    0
  );
  transition: opacity 240ms ease, transform 220ms ease-out;
  will-change: transform, background-position;
  mask-image: radial-gradient(ellipse at 58% 38%, #000 0 48%, rgba(0, 0, 0, 0.76) 62%, transparent 86%);
  -webkit-mask-image: radial-gradient(ellipse at 58% 38%, #000 0 48%, rgba(0, 0, 0, 0.76) 62%, transparent 86%);
}

.site-backdrop::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 12% 18%, rgba(156, 196, 221, 0.22) 0 0.11rem, transparent 0.14rem),
    radial-gradient(circle at 15% 20%, rgba(242, 207, 131, 0.28) 0 0.1rem, transparent 0.14rem),
    radial-gradient(circle at 18% 17%, rgba(102, 122, 98, 0.18) 0 0.09rem, transparent 0.13rem),
    radial-gradient(circle at 72% 62%, rgba(156, 196, 221, 0.18) 0 0.12rem, transparent 0.16rem),
    radial-gradient(circle at 76% 65%, rgba(242, 207, 131, 0.2) 0 0.1rem, transparent 0.15rem),
    linear-gradient(90deg, rgba(255, 253, 248, 0.78), rgba(255, 253, 248, 0.2) 48%, rgba(255, 253, 248, 0.46)),
    linear-gradient(180deg, rgba(255, 253, 248, 0.58), rgba(255, 253, 248, 0.14) 48%, rgba(255, 253, 248, 0.76));
  background-size:
    14rem 14rem,
    14rem 14rem,
    14rem 14rem,
    18rem 18rem,
    18rem 18rem,
    auto,
    auto;
}

main {
  position: relative;
  z-index: 1;
}

.brand {
  display: inline-flex;
  width: 3.2rem;
  height: 3rem;
  align-items: center;
  justify-content: center;
  color: var(--wine);
}

.brand svg {
  width: 3rem;
  height: auto;
  overflow: visible;
}

.ring-stroke,
.ring-gem {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.3;
}

.ring-gem {
  fill: rgba(185, 146, 84, 0.12);
  stroke: var(--gold);
  stroke-width: 2.4;
}

.brand:hover {
  color: var(--gold);
}

nav {
  display: flex;
  align-items: center;
  gap: clamp(0.6rem, 2vw, 1.6rem);
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 700;
}

nav a {
  transition: color 180ms ease;
}

nav a:hover {
  color: var(--wine);
}

.menu-toggle {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.hero {
  position: relative;
  display: grid;
  min-height: var(--viewport-height);
  grid-template-columns: minmax(0, min(100%, 52rem));
  align-items: center;
  justify-content: center;
  justify-items: center;
  overflow: hidden;
  padding: clamp(7rem, 13vw, 10rem) clamp(1.25rem, 7vw, 5rem)
    clamp(5rem, 12vw, 8rem);
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  height: 24rem;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(255, 250, 245, 0.96));
  pointer-events: none;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.34;
}

.hero-content {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.hero-content {
  display: grid;
  justify-items: center;
  width: min(100%, 48rem);
  max-width: 48rem;
  text-align: center;
}

.hero-content::before {
  position: absolute;
  inset: -2.5rem -3.5rem -2rem;
  z-index: -1;
  content: "";
  background: radial-gradient(ellipse at center, rgba(255, 250, 245, 0.88), rgba(255, 250, 245, 0) 72%);
  pointer-events: none;
}

.eyebrow {
  margin: 0 0 0.9rem;
  color: var(--wine);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.invitation-kicker,
.hero-date {
  margin: 0;
  color: var(--wine);
  font-family: var(--serif);
  font-size: clamp(1rem, 1.8vw, 1.55rem);
  font-style: italic;
  font-weight: 600;
}

.invitation-kicker {
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: clamp(1.35rem, 2.4vw, 2rem);
}

.hero-date {
  margin-top: 1rem;
  color: var(--wine);
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: var(--script);
  font-size: clamp(5.4rem, 7.2vw, 7.4rem);
  font-weight: 400;
  line-height: 0.78;
  overflow-wrap: normal;
  word-break: normal;
}

.couple-title {
  display: grid;
  width: 100%;
  min-width: 0;
  gap: 0.05em;
  justify-items: center;
}

.couple-title span {
  white-space: nowrap;
}

.couple-title em {
  margin: 0.12em 0 0.08em;
  color: var(--gold);
  font-family: var(--serif);
  font-size: 0.26em;
  font-style: italic;
  line-height: 0.7;
}

.hero-copy {
  max-width: 32rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2vw, 1.8rem);
  font-style: italic;
  line-height: 1.45;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font-family: var(--sans);
  font-weight: 800;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: #fff;
  background: var(--wine);
  box-shadow: 0 16px 32px rgba(79, 107, 120, 0.24);
}

.button.ghost {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.58);
}

/* Kept for older markup during local refreshes. */
.invitation-art {
  justify-self: center;
  width: min(100%, 23rem);
  max-height: 72svh;
  filter: drop-shadow(var(--shadow));
}

.section {
  display: grid;
  width: 100%;
  min-height: var(--section-viewport);
  align-content: center;
  padding: clamp(2.6rem, 5svh, 4rem) clamp(1.25rem, 6vw, 5rem)
    clamp(2rem, 4svh, 3rem);
}

.section-heading {
  width: min(100%, 62rem);
  margin: 0 auto clamp(1rem, 2.5svh, 1.6rem);
}

.section-heading h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 5rem);
  font-weight: 600;
  line-height: 1;
}

.agenda-map-section {
  align-content: center;
  background: rgba(255, 255, 255, 0.78);
}

.agenda-map-layout {
  display: grid;
  width: min(100%, 74rem);
  grid-template-columns: minmax(18rem, 0.78fr) minmax(0, 1.22fr);
  gap: clamp(1rem, 3vw, 2rem);
  margin: 0 auto;
  align-items: stretch;
  height: min(56svh, 34rem);
  min-height: clamp(20rem, 52svh, 29rem);
}

.timeline {
  display: grid;
  align-content: center;
  border-top: 1px solid var(--line);
}

.timeline-item {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2rem);
  padding: clamp(0.9rem, 2svh, 1.2rem) 0;
  border-bottom: 1px solid var(--line);
}

.timeline-item time {
  color: var(--olive);
  font-family: var(--sans);
  font-weight: 900;
}

.timeline-item h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 500;
}

.timeline-item p {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.gallery-section {
  background:
    linear-gradient(90deg, rgba(215, 162, 166, 0.18), transparent 42%),
    rgba(255, 250, 245, 0.82);
}

.photo-strip {
  display: grid;
  width: min(100%, 74rem);
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  grid-auto-rows: minmax(10rem, 24svh);
  gap: 1rem;
  margin: 0 auto;
}

.photo-card {
  min-height: 13rem;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #ece4dd;
}

.photo-card.wide {
  grid-row: span 2;
}

.photo-card.tall {
  grid-column: span 2;
}

.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.leaflet-map-shell {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(92, 111, 82, 0.14), rgba(185, 146, 84, 0.1)),
    #eef0ea;
  box-shadow: 0 18px 50px rgba(37, 37, 41, 0.12);
  isolation: isolate;
}

.wedding-map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: transparent;
}

.leaflet-container {
  font-family: var(--sans);
}

.leaflet-control-attribution {
  font-family: var(--sans);
  font-size: 0.68rem;
}

.leaflet-popup-content {
  margin: 0.75rem 0.9rem;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 700;
}

.map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1rem;
  padding: 0 1rem 1rem;
  background: rgba(255, 250, 245, 0.94);
}

.map-center-button {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  z-index: 500;
  min-height: 2.35rem;
  border: 1px solid rgba(79, 107, 120, 0.22);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  color: var(--envelope-blue-dark);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 24px rgba(54, 71, 78, 0.16);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.map-center-button:hover {
  color: var(--wine);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(54, 71, 78, 0.2);
}

.wedding-marker {
  display: grid;
  width: 2.05rem;
  height: 2.05rem;
  place-items: center;
  color: #fff;
  background: var(--wine);
  border: 2px solid rgba(255, 250, 245, 0.95);
  border-radius: 50%;
  box-shadow: 0 10px 24px rgba(37, 37, 41, 0.22);
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 900;
}

.wedding-marker.is-party {
  background: var(--olive);
}

.route-runner {
  display: block;
  width: 1rem;
  height: 1rem;
  background: var(--gold);
  border: 3px solid #fffaf5;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(185, 146, 84, 0.22);
}

.route-runner-icon {
  background: transparent;
  border: 0;
}

.animated-route {
  stroke-dasharray: 11 12;
  animation: routeDash 1.4s linear infinite;
}

@keyframes routeDash {
  to {
    stroke-dashoffset: -46;
  }
}

.text-link {
  display: inline-flex;
  margin-top: 0.9rem;
  color: var(--wine);
  font-weight: 900;
}

.rsvp-section {
  position: relative;
  overflow-anchor: none;
  scroll-margin-top: calc(var(--header-height) + 0.75rem);
  background:
    linear-gradient(180deg, rgba(111, 135, 150, 0.08), rgba(255, 253, 248, 0.18) 34%, rgba(255, 255, 255, 0.64)),
    transparent;
}

.rsvp-section .section-heading,
.rsvp-chat {
  position: relative;
  z-index: 1;
  width: min(100%, 49rem);
}

.rsvp-section .section-heading h2 {
  font-size: clamp(2.6rem, 7vw, 5.7rem);
}

.rsvp-chat {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(19rem, 1fr) auto auto auto;
  gap: 0;
  margin: 0 auto;
  overflow-anchor: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 253, 248, 0.94)),
    rgba(255, 253, 248, 0.9);
  box-shadow: 0 22px 64px rgba(54, 71, 78, 0.16);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.rsvp-chat::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, rgba(231, 189, 114, 0), rgba(231, 189, 114, 0.78), rgba(111, 135, 150, 0));
}

.rsvp-chat::after {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background-image: url("/assets/photos/flores-cutout.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: saturate(0.95) contrast(0.98);
  mix-blend-mode: multiply;
  opacity: 0.18;
  pointer-events: none;
}

.rsvp-chat > * {
  position: relative;
  z-index: 1;
}

.chat-heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: clamp(1rem, 2vw, 1.25rem) clamp(1rem, 2.6vw, 1.45rem) 0.95rem;
  border-bottom: 1px solid rgba(79, 107, 120, 0.14);
  background: rgba(255, 253, 248, 0.62);
}

.chat-avatar {
  width: 4.1rem;
  height: 4.1rem;
  flex: 0 0 auto;
  background:
    url("/assets/icons/agent_icon.png") center 51% / 106% auto no-repeat,
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 243, 233, 0.92));
  border: 1px solid rgba(231, 189, 114, 0.48);
  border-radius: 8px;
  box-shadow:
    0 14px 32px rgba(54, 71, 78, 0.16),
    inset 0 0 0 4px rgba(255, 255, 255, 0.58);
  overflow: hidden;
}

.chat-heading h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 600;
}

.chat-heading p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.86rem;
  font-weight: 700;
}

.chat-log {
  position: relative;
  display: flex;
  min-height: 19rem;
  max-height: min(56svh, 30rem);
  flex-direction: column;
  gap: 0.75rem;
  overflow-anchor: none;
  overflow-y: auto;
  padding: clamp(1rem, 2.6vw, 1.35rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 253, 248, 0.64)),
    url("/assets/photos/flores-cutout.png") center / cover no-repeat,
    rgba(255, 253, 248, 0.44);
  isolation: isolate;
  scrollbar-color: rgba(111, 135, 150, 0.42) transparent;
}

@media (min-width: 861px) {
  .rsvp-section {
    height: var(--section-viewport);
    min-height: 0;
    grid-template-rows: auto minmax(0, auto);
    align-content: center;
    row-gap: clamp(0.7rem, 1.4svh, 1rem);
    overflow: hidden;
    padding-top: clamp(1.25rem, 2.4svh, 2.1rem);
    padding-bottom: clamp(1.25rem, 2.4svh, 2.1rem);
  }

  .rsvp-section .section-heading {
    margin-bottom: 0;
  }

  .rsvp-section .section-heading h2 {
    font-size: clamp(3rem, 5.4vw, 4.6rem);
  }

  .rsvp-chat {
    height: min(34rem, calc(var(--section-viewport) - clamp(7.6rem, 12.5svh, 9rem)));
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  }

  .chat-log {
    min-height: 0;
    max-height: none;
  }
}

.chat-message {
  position: relative;
  z-index: 1;
  display: flex;
}

.chat-message.is-user {
  justify-content: flex-end;
}

.chat-bubble {
  max-width: min(100%, 34rem);
  border: 1px solid rgba(79, 107, 120, 0.12);
  border-radius: 8px;
  padding: 0.82rem 0.95rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 10px 24px rgba(54, 71, 78, 0.08);
  font-family: var(--sans);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chat-message.is-user .chat-bubble {
  color: #fff;
  border-color: rgba(79, 107, 120, 0.18);
  background: linear-gradient(180deg, var(--envelope-blue), var(--envelope-blue-dark));
  box-shadow: 0 12px 26px rgba(79, 107, 120, 0.18);
}

.quick-replies {
  display: flex;
  min-height: 0;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0 1.35rem 0.85rem;
  background: rgba(255, 253, 248, 0.58);
}

.quick-replies:empty {
  display: none;
}

.quick-reply {
  flex: 0 0 auto;
  min-height: 2.25rem;
  border: 1px solid rgba(79, 107, 120, 0.2);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  color: var(--envelope-blue-dark);
  background: rgba(255, 255, 255, 0.76);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.quick-reply:hover {
  border-color: rgba(79, 107, 120, 0.38);
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-1px);
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
  padding: 0.95rem clamp(1rem, 2.6vw, 1.35rem) clamp(1rem, 2.6vw, 1.35rem);
  border-top: 1px solid rgba(79, 107, 120, 0.12);
  background: rgba(255, 253, 248, 0.8);
}

.chat-input-row textarea {
  width: 100%;
  min-height: 3rem;
  max-height: 9rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  outline: none;
  resize: none;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.chat-input-row textarea:focus {
  border-color: var(--wine);
  box-shadow: 0 0 0 4px rgba(111, 135, 150, 0.14);
}

.chat-input-row textarea:disabled {
  color: rgba(54, 60, 65, 0.62);
  background: rgba(244, 240, 232, 0.78);
  cursor: not-allowed;
}

.chat-send-button {
  min-width: 6.4rem;
  min-height: 3rem;
  box-shadow: 0 16px 32px rgba(79, 107, 120, 0.2);
}

.chat-send-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.form-status {
  min-height: 1.5rem;
  margin: 0;
  padding: 0 clamp(1rem, 2.6vw, 1.35rem) 1rem;
  color: var(--olive);
  font-family: var(--sans);
  font-weight: 800;
  background: rgba(255, 253, 248, 0.8);
}

.form-status.error {
  color: var(--wine);
}

.back-to-top {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 35;
  display: grid;
  width: 2.6rem;
  height: 2.6rem;
  place-items: center;
  color: var(--envelope-blue-dark);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(79, 107, 120, 0.18);
  border-radius: 50%;
  box-shadow: 0 14px 34px rgba(54, 71, 78, 0.16);
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.8rem);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    color 180ms ease;
}

.back-to-top svg {
  width: 1.3rem;
  height: 1.3rem;
}

.back-to-top path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.back-to-top:hover {
  color: var(--wine);
  transform: translateY(0.6rem);
}

body.show-back-to-top .back-to-top {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

@media (max-width: 860px) {
  :root {
    --header-height: 4.45rem;
  }

  .site-backdrop::before {
    inset: -4vh -18vw;
    background-position:
      center,
      calc(50% + var(--church-x)) calc(4.3rem + var(--church-y) + var(--church-scroll));
    background-size:
      auto,
      min(148vw, 38rem) auto;
    opacity: 0.76;
    mask-image: radial-gradient(ellipse at 50% 28%, #000 0 43%, rgba(0, 0, 0, 0.58) 62%, transparent 84%);
    -webkit-mask-image: radial-gradient(ellipse at 50% 28%, #000 0 43%, rgba(0, 0, 0, 0.58) 62%, transparent 84%);
  }

  .site-backdrop::after {
    background:
      radial-gradient(circle at 12% 18%, rgba(156, 196, 221, 0.18) 0 0.1rem, transparent 0.14rem),
      radial-gradient(circle at 15% 20%, rgba(242, 207, 131, 0.24) 0 0.09rem, transparent 0.13rem),
      radial-gradient(circle at 72% 62%, rgba(156, 196, 221, 0.14) 0 0.11rem, transparent 0.15rem),
      linear-gradient(90deg, rgba(255, 253, 248, 0.68), rgba(255, 253, 248, 0.18) 48%, rgba(255, 253, 248, 0.58)),
      linear-gradient(180deg, rgba(255, 253, 248, 0.52), rgba(255, 253, 248, 0.08) 42%, rgba(255, 253, 248, 0.88));
    background-size:
      12rem 12rem,
      12rem 12rem,
      16rem 16rem,
      auto,
      auto;
  }

  .site-header {
    padding: 0.8rem 1rem;
  }

  .hero {
    width: 100vw;
    max-width: 100vw;
    min-height: var(--viewport-height);
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
    padding: calc(var(--header-height) + 1rem) 1.1rem
      clamp(1.8rem, 4svh, 2.7rem);
    text-align: center;
  }

  .hero::after {
    height: 12rem;
    background: linear-gradient(180deg, transparent, rgba(255, 253, 248, 0.9));
  }

  #hero-canvas {
    opacity: 0.24;
  }

  .hero-content {
    width: min(100%, 21.6rem);
    max-width: 21.6rem;
    justify-items: center;
  }

  .hero-content::before {
    inset: -1.35rem -1.15rem -1.2rem;
    background: radial-gradient(ellipse at center, rgba(255, 253, 248, 0.9), rgba(255, 253, 248, 0) 74%);
  }

  h1 {
    font-size: clamp(2.95rem, 10.4vw, 4.25rem);
    line-height: 0.8;
  }

  .hero-actions {
    width: min(100%, 20.2rem);
    gap: 0.7rem;
    margin-top: 1.45rem;
  }

  .hero-actions .button {
    width: 100%;
    min-height: 3.15rem;
    padding: 0.78rem 0.95rem;
    font-size: 0.94rem;
  }

  .section {
    min-height: var(--section-viewport);
    padding: 1.6rem 1.1rem 2.5rem;
  }

  .rsvp-section {
    align-content: start;
    padding: clamp(0.85rem, 2.3svh, 1.2rem) 1rem 0.85rem;
  }

  .rsvp-section .section-heading {
    margin-bottom: 0.65rem;
  }

  .rsvp-section .section-heading h2 {
    font-size: clamp(2.25rem, 9vw, 3rem);
  }

  .agenda-map-section {
    display: block;
    min-height: auto;
    padding: 1.6rem 1.1rem 0;
  }

  .agenda-map-section .section-heading {
    margin-bottom: 0;
  }

  .timeline-item,
  .agenda-map-layout {
    grid-template-columns: 1fr;
  }

  .rsvp-chat {
    height: var(--rsvp-chat-height, auto);
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  }

  .rsvp-chat::after {
    background-size: cover;
    opacity: 0.16;
  }

  .chat-input-row {
    grid-template-columns: 1fr;
    gap: 0.7rem;
  }

  .chat-log {
    min-height: 0;
    max-height: none;
  }

  .chat-send-button {
    width: 100%;
  }

  .back-to-top {
    display: none;
  }

  .agenda-map-layout {
    width: 100%;
    height: auto;
    min-height: 0;
    gap: 0;
  }

  .timeline {
    min-height: calc(var(--section-viewport) - 8rem);
    align-content: center;
  }

  .leaflet-map-shell {
    min-height: var(--section-viewport);
    margin: 0 -1.1rem;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .photo-strip {
    grid-template-columns: 1fr 1fr;
  }

  .timeline-item {
    gap: 0.4rem;
  }

  .wedding-map {
    height: calc(var(--section-viewport) - 4rem);
    min-height: 0;
  }
}

@media (max-width: 860px) {
  .site-header {
    align-items: center;
    gap: 0.5rem;
  }

  .brand {
    width: 3rem;
    height: 2.65rem;
  }

  .brand svg {
    width: 2.75rem;
  }

  .menu-toggle {
    position: relative;
    z-index: 30;
    display: grid;
    flex: 0 0 auto;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: auto;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: pointer;
  }

  .menu-toggle span:not(.sr-only) {
    width: 1rem;
    height: 2px;
    background: var(--wine);
    border-radius: 999px;
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  body.menu-open .menu-toggle span:nth-child(2) {
    transform: translateY(0.45rem) rotate(45deg);
  }

  body.menu-open .menu-toggle span:nth-child(3) {
    opacity: 0;
  }

  body.menu-open .menu-toggle span:nth-child(4) {
    transform: translateY(-0.45rem) rotate(-45deg);
  }

  nav {
    position: absolute;
    top: calc(100% + 0.55rem);
    right: 1rem;
    display: grid;
    min-width: 12rem;
    gap: 0.15rem;
    padding: 0.55rem;
    background: rgba(255, 250, 245, 0.96);
    border: 1px solid rgba(37, 37, 41, 0.1);
    border-radius: 8px;
    box-shadow: 0 18px 44px rgba(37, 37, 41, 0.14);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-0.5rem);
    transition:
      opacity 180ms ease,
      transform 180ms ease;
  }

  body.menu-open nav {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  nav a {
    padding: 0.72rem 0.85rem;
    border-radius: 6px;
  }

  nav a:hover {
    background: rgba(111, 135, 150, 0.1);
  }
}

@media (max-width: 520px) {
  .hero {
    padding-top: calc(var(--header-height) + 0.7rem);
    padding-bottom: 2rem;
  }

  h1 {
    font-size: clamp(2.4rem, 11vw, 2.82rem);
    line-height: 0.84;
  }

  .hero-content {
    width: 100%;
    max-width: min(19.1rem, calc(100vw - 2.2rem));
  }

  .couple-title {
    width: min(100%, 18.8rem);
  }

  .hero-date {
    margin-top: 0.55rem;
  }

  .invitation-kicker {
    margin-bottom: 0.4rem;
    font-size: clamp(1.22rem, 5.4vw, 1.42rem);
  }

  .hero-copy {
    max-width: 19.2rem;
    margin-bottom: 0.9rem;
    font-size: clamp(1.03rem, 4.35vw, 1.17rem);
    line-height: 1.42;
  }

  .hero-actions {
    width: min(100%, 19.1rem);
  }

  .photo-strip {
    grid-template-columns: 1fr;
  }

  .photo-card.wide,
  .photo-card.tall {
    grid-column: auto;
    grid-row: auto;
  }

  .wedding-map {
    min-height: 28rem;
  }

  .rsvp-chat {
    margin-right: -0.2rem;
    margin-left: -0.2rem;
    padding: 0;
  }

  .rsvp-chat::after {
    background-size: cover;
    opacity: 0.14;
  }

  .chat-bubble {
    max-width: 100%;
    font-size: 0.9rem;
  }

  .chat-heading {
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .chat-avatar {
    width: 3.25rem;
    height: 3.25rem;
  }

  .chat-heading h3 {
    font-size: clamp(1.3rem, 6.6vw, 1.6rem);
    line-height: 1.05;
  }

  .chat-heading p {
    font-size: 0.8rem;
  }

  .chat-log {
    gap: 0.62rem;
    padding: 0.75rem;
  }

  .quick-replies {
    padding: 0 0.75rem 0.7rem;
  }

  .chat-input-row {
    padding: 0.75rem;
  }

  .form-status {
    padding: 0 0.75rem 0.75rem;
  }

}
