:root {
  --ink: #3b3d40;
  --ink-soft: #5d6166;
  --paper: #f4f4f2;
  --sage: #7f9384;
  --slate: #8e96ab;
  --card: rgba(247, 247, 245, 0.72);
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --script: "Mrs Saint Delafield", "Snell Roundhand", cursive;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* The mist behind the invite spills past the right edge on phones; without
     this the page gets wider than the screen and can be zoomed out off-center */
  overflow-x: hidden;
  overflow-x: clip;
}

.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background: var(--paper) url("images/bg.jpg") center top / cover no-repeat;
  background-image: image-set(url("images/bg.webp") type("image/webp"), url("images/bg.jpg") type("image/jpeg"));
}

main {
  width: min(100% - 32px, 620px);
  margin: 0 auto;
}

a { color: inherit; }

.card {
  position: relative;
  text-align: center;
}

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

.invite {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 40vh 0 18vh;
}

.invite {
  /* Height of the "twenty" lettering; its width follows the SVG's aspect ratio */
  --tw-h: clamp(420px, 78vh, 700px);
  --tw-w: calc(var(--tw-h) * 378 / 1267);
  --tw-gutter: calc(var(--tw-w) * 0.66 + 12px);
}

.invite .content {
  position: relative;
  text-align: right;
  padding-left: var(--tw-gutter);
  text-shadow: 0 0 2px var(--paper), 0 0 6px var(--paper), 0 0 14px var(--paper);
}

/* Darker than the other italics: this line sits right over the darkest trees */
.invite .script-line { color: var(--ink); }

/* Soft mist behind the text so it stays legible over the trees */
.invite .content::before {
  content: "";
  position: absolute;
  inset: -12% 0;
  /* Start near the text, not at the far left where the "twenty" lettering sits */
  left: calc(var(--tw-gutter) - 40px);
  /* Extend past the text on the right, but never past the edge of the screen */
  right: calc(-1 * min(18%, max(16px, 50vw - 326px)));
  z-index: -1;
  background: radial-gradient(closest-side, rgba(244, 244, 242, 0.62) 45%, rgba(244, 244, 242, 0));
  pointer-events: none;
}

.twenty {
  font-family: var(--script);
  font-weight: 400;
  color: #1f2022;
  margin: 0;
  line-height: 1;
}

/* Sits just left of the text so the "y" loop clears the names */
.invite .twenty-art {
  position: absolute;
  left: calc(var(--tw-gutter) - var(--tw-w) - 6px);
  bottom: -0.3em;
  height: var(--tw-h);
  width: auto;
  pointer-events: none;
}

.names {
  font-weight: 500;
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 -0.22em 0.2em 0; /* offset trailing letter-spacing */
  line-height: 1.2;
}

.script-line,
.blurb,
.rsvp-note {
  font-style: italic;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin: 0;
}

.script-line { font-size: 1.3rem; line-height: 1.35; }
.script-line sup { font-size: 0.6em; }

.dates {
  margin: 1.6em 0 0.1em;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.venue {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.venue a,
.rsvp-note a,
.text-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color 0.2s;
}

.venue a:hover,
.rsvp-note a:hover,
.text-link:hover { color: var(--sage); }

.blurb { margin-top: 1.6em; font-size: 1.1rem; line-height: 1.5; }

.rsvp-note { margin-top: 1.6em; font-size: 1.15rem; }

.scroll-cue {
  position: absolute;
  bottom: 4vh;
  left: 50%;
  translate: -50% 0;
  color: var(--ink-soft);
  opacity: 0.7;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  50% { transform: translateY(6px); }
}

/* ---------- Itinerary & RSVP ---------- */

.itinerary,
.rsvp {
  background: var(--card);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 2px;
  padding: 56px 32px;
  margin-bottom: 48px;
  box-shadow: 0 1px 40px rgba(60, 70, 80, 0.06);
}

h2 {
  font-weight: 400;
  font-size: 1.9rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin: 0 -0.3em 1.2em 0;
}

h3 {
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin: 0 0 0.4em;
}

.day + .day { margin-top: 2em; }

.day ul {
  list-style: none;
  margin: 0;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.05rem;
}

.day li { line-height: 1.8; }

.time::after { content: " – "; }

.dress {
  margin: 0.3em 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rsvp p { margin: 0 0 1.4em; font-size: 1.2rem; }

.button {
  display: inline-block;
  padding: 0.75em 2.2em;
  border: 1px solid var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 0.95rem;
  transition: background 0.25s, color 0.25s;
}

.button:hover,
.button:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.venue-block {
  margin-top: 3em;
  padding-top: 2.4em;
  border-top: 1px solid rgba(59, 61, 64, 0.15);
}

.venue-block p { margin-bottom: 0.6em; }
.venue-block .dress { font-size: 0.8rem; margin-bottom: 1.2em; }

.text-link {
  font-style: italic;
  letter-spacing: 0.08em;
}

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

footer {
  text-align: center;
  padding: 16px 16px 56px;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
}

footer p { margin: 0; }
footer .twenty.small { font-size: 3.4rem; color: var(--ink); margin-bottom: 0.1em; }

/* ---------- Small screens ---------- */

@media (max-width: 560px) {
  .invite { padding-top: 34vh; }
  /* Tall enough that the "y" loop rises above the names, so the lettering can tuck in beside the text */
  .invite { --tw-h: clamp(540px, 70vh, 620px); --tw-gutter: 100px; }
  /* On phones the right-aligned line ends sit over the dark trees at the screen edge,
     so center the mist further right; the screen edge hides where it's cut off */
  .invite .content::before {
    background: radial-gradient(ellipse 72% 56% at 68% 50%, rgba(244, 244, 242, 0.62) 45%, rgba(244, 244, 242, 0));
  }
  .invite .twenty-art { left: calc(var(--tw-gutter) - var(--tw-w) * 0.64 - 4px); }
  .names { font-size: 1.5rem; letter-spacing: 0.12em; margin-right: -0.12em; white-space: nowrap; }
  .script-line { font-size: 1.1rem; letter-spacing: 0.08em; }
  .dates { font-size: 1.1rem; letter-spacing: 0.1em; }
  .venue { font-size: 0.95rem; letter-spacing: 0.06em; }
  .blurb, .rsvp-note { font-size: 1rem; letter-spacing: 0.08em; }
  .itinerary, .rsvp { padding: 44px 20px; }
  h2 { font-size: 1.6rem; letter-spacing: 0.22em; margin-right: -0.22em; }
  .day ul { font-size: 0.95rem; }
}

@media (max-width: 380px) {
  .invite { --tw-gutter: 84px; }
}

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