/* A walk through a living forest: sunlit canopy fold → garden clearings → evening fireflies. */

:root {
  color-scheme: light;

  --color-canopy: oklch(26% 0.05 158);
  --color-canopy-deep: oklch(21% 0.046 160);
  --color-canopy-lift: oklch(32% 0.055 156);
  --color-paper: oklch(96.5% 0.016 128);
  --color-paper-2: oklch(93.5% 0.02 126);
  --color-ink: oklch(27% 0.022 148);
  --color-ink-2: oklch(42% 0.02 144);
  --color-mist: oklch(94% 0.014 128);
  --color-mist-2: oklch(79% 0.02 134);
  --color-rule: oklch(85% 0.018 130);
  --color-muted: oklch(44% 0.016 140);
  --color-leaf: oklch(52% 0.09 150);
  --color-leaf-deep: oklch(40% 0.08 152);
  --color-accent: oklch(76% 0.12 88);
  --color-accent-deep: oklch(40% 0.09 80);
  --color-accent-ink: oklch(24% 0.03 100);
  --color-accent-lift: oklch(80% 0.12 88);
  --color-focus: oklch(44% 0.11 150);
  --color-focus-canopy: oklch(76% 0.14 88);

  --font-display: "Didot", "Bodoni 72", "Bodoni MT", "Cochin", "Hoefler Text", Georgia, serif;
  --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-label: "Avenir Next", Avenir, "Segoe UI", "Gill Sans", system-ui, sans-serif;

  --text-micro: 0.6875rem;
  --text-label: 0.75rem;
  --text-sm: 0.9375rem;
  --text-body: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);
  --text-lede: clamp(1.25rem, 1.05rem + 0.8vw, 1.625rem);
  --text-title: clamp(1.375rem, 1.1rem + 1.1vw, 2rem);
  --text-section: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  --text-display: clamp(2.9rem, 1.5rem + 6vw, 5.25rem);

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --gutter: clamp(1.25rem, 6vw, 3rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;
  --dur-long: 420ms;
  --dur-bloom: 900ms;

  --z-base: 1;
  --z-raised: 10;
  --z-content: 20;

  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: clip;
  background: var(--color-canopy-deep);
}

body {
  min-height: 100%;
  margin: 0;
  overflow-x: clip;
  color: var(--color-ink);
  background: var(--color-paper);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.65;
}

.forest__defs {
  position: absolute;
}

.invite-frame {
  container: invite-frame / inline-size;
  width: 100%;
}

.forest {
  position: relative;
  width: 100%;
  background: var(--color-paper);
}

.forest::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: var(--z-base);
  background-image: var(--grain);
  opacity: 0.05;
  pointer-events: none;
}

.forest > * {
  position: relative;
  z-index: var(--z-raised);
}

/* ——— The canopy — the marquee fold ——— */

.forest__canopy {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--space-2xl) var(--gutter) var(--space-3xl);
  overflow: hidden;
  text-align: center;
  color: var(--color-mist);
  background:
    radial-gradient(90% 55% at 50% -8%, color-mix(in oklch, var(--color-canopy-lift) 85%, transparent) 0%, transparent 62%),
    radial-gradient(120% 80% at 50% 110%, var(--color-canopy-deep) 0%, transparent 55%),
    linear-gradient(168deg, var(--color-canopy-lift) 0%, var(--color-canopy) 46%, var(--color-canopy-deep) 100%);
}

.forest__rays {
  position: absolute;
  inset: -12% -20%;
  z-index: var(--z-base);
  pointer-events: none;
  background:
    conic-gradient(from 168deg at 24% -12%, transparent 0deg, color-mix(in oklch, var(--color-accent) 9%, transparent) 7deg, transparent 15deg, transparent 34deg, color-mix(in oklch, var(--color-accent) 6%, transparent) 40deg, transparent 48deg),
    conic-gradient(from 178deg at 74% -14%, transparent 0deg, color-mix(in oklch, var(--color-accent) 8%, transparent) 6deg, transparent 14deg);
  animation: forest-rays-drift 16s var(--ease-in-out) infinite alternate;
}

.forest__rays::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(38% 26% at 30% 22%, color-mix(in oklch, var(--color-accent) 16%, transparent) 0%, transparent 70%);
  animation: forest-pool-breathe 11s var(--ease-in-out) infinite alternate;
}

@keyframes forest-rays-drift {
  from { transform: translate3d(-2.5%, 0, 0) rotate(-0.6deg); opacity: 0.85; }
  to { transform: translate3d(2.5%, 1.5%, 0) rotate(0.8deg); opacity: 1; }
}

@keyframes forest-pool-breathe {
  from { opacity: 0.45; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 1; transform: translate3d(4%, 6%, 0) scale(1.12); }
}

.forest__frond {
  position: absolute;
  top: -1rem;
  z-index: var(--z-base);
  width: clamp(6rem, 18vw, 11rem);
  height: auto;
  color: color-mix(in oklch, var(--color-leaf) 34%, transparent);
  pointer-events: none;
}

.forest__frond--left {
  left: -1.5rem;
  transform: rotate(24deg) scaleY(-1);
}

.forest__frond--right {
  right: -1.5rem;
  transform: rotate(-24deg) scaleY(-1) scaleX(-1);
}

.forest__leaves {
  position: absolute;
  inset: 0;
  z-index: var(--z-raised);
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.forest__canopy .hero,
.forest__canopy .forest__cue {
  position: relative;
  z-index: var(--z-content);
}

.hero {
  display: grid;
  justify-items: center;
  gap: var(--space-md);
  width: 100%;
  max-width: 40rem;
  container-type: inline-size;
}

.hero__eyebrow { order: 1; }
.hero__names { order: 2; }
.hero__date { order: 3; }
.hero__cover-photo { order: 4; }
.hero__welcome { order: 5; }

.hero__eyebrow {
  margin: 0;
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-accent);
}

/* Sized from the hero's own inline size, not the viewport: vw is drawn at full
   desktop scale inside the demo's narrow device-preview frame, which snapped a
   long name mid-word ("Sundar/a"). cqw tracks the column the name actually has
   in both. The coefficient is tuned to land on the same size as the old 6vw at
   a full-width hero. */
.hero__names {
  margin: 0;
  max-width: 14ch;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: clamp(2.9rem, 1.4rem + 9.8cqw, 5.25rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.01em;
  color: var(--color-mist);
  text-wrap: balance;
}

.hero__separator {
  color: var(--color-accent);
  font-size: 0.6em;
  vertical-align: 0.12em;
}

.hero__date {
  display: block;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-mist-2);
}

.hero__welcome {
  max-width: 30rem;
  margin: 0;
  font-size: var(--text-lede);
  line-height: 1.55;
  color: var(--color-mist-2);
}

/* The cap has to stay in proportion to the 40rem hero column, or the portrait
   reads as a thumbnail pinned under display type four times its size. Sized
   against the column rather than the viewport: vw cannot see the demo page's
   device-preview frame, so a vw cap wider than that frame overflows it and
   drags the whole hero -- names and welcome included -- out with it. */
.hero__cover-photo {
  display: block;
  width: min(88%, 26rem);
  aspect-ratio: 4 / 5;
  margin-top: var(--space-sm);
  object-fit: cover;
  border-radius: 10rem 10rem 0.9rem 0.9rem;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--color-accent) 45%, transparent),
    0 1.5rem 3.5rem color-mix(in oklch, var(--color-canopy-deep) 55%, transparent);
}

.forest__cue {
  display: grid;
  justify-items: center;
  gap: var(--space-xs);
  margin: var(--space-lg) 0 0;
}

.forest__cue-word {
  font-family: var(--font-label);
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--color-mist-2);
}

.forest__cue-leaf {
  width: 0.8rem;
  height: 2rem;
  color: var(--color-accent);
  animation: forest-cue-fall 4.5s var(--ease-in-out) infinite;
}

@keyframes forest-cue-fall {
  0%, 100% { transform: translate3d(0, -0.2rem, 0) rotate(-6deg); opacity: 0.55; }
  50% { transform: translate3d(0.15rem, 0.35rem, 0) rotate(8deg); opacity: 1; }
}

/* ——— The sundial — countdown plate ——— */

.forest__sundial {
  position: relative;
  z-index: var(--z-content);
  width: min(100% - 2 * var(--gutter), 32rem);
  margin: var(--space-sm) auto 0;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
  color: var(--color-ink);
  background: var(--color-paper);
  border: 1px solid color-mix(in oklch, var(--color-accent) 50%, transparent);
  border-radius: 999px 999px 1.25rem 1.25rem / 6rem 6rem 1.25rem 1.25rem;
  box-shadow: 0 1.25rem 3rem color-mix(in oklch, var(--color-canopy-deep) 28%, transparent);
}

.forest__sundial-label {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.forest__sundial .countdown__remaining {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.375rem);
  line-height: 1.15;
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

.forest__sundial .countdown__remaining--source {
  display: none;
}

.forest-countdown__units {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-xs);
}

.forest-countdown__unit {
  display: grid;
  justify-items: center;
  gap: var(--space-2xs);
}

.forest-countdown__unit + .forest-countdown__unit {
  border-inline-start: 1px solid var(--color-rule);
}

.forest-countdown__value {
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 1.1rem + 2vw, 2.25rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}

.forest-countdown__value.is-changing {
  animation: forest-countdown-tick var(--dur-bloom, 0.6s) var(--ease-out) both;
}

@keyframes forest-countdown-tick {
  0% {
    opacity: 0.5;
    transform: translateY(0.15em);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.forest-countdown__label {
  color: var(--color-accent-deep);
  font-family: var(--font-label);
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.forest-countdown__status {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 1.2rem + 2vw, 2.375rem);
  line-height: 1.15;
  color: var(--color-ink);
}

/* ——— Clearings — the garden walk ——— */

.forest__clearing {
  padding: var(--space-3xl) var(--gutter) 0;
}

.forest__clearing > * {
  max-width: 44rem;
  margin-inline: auto;
}

.forest__head {
  margin-bottom: var(--space-xl);
}

.forest__heading {
  margin: 0;
  max-width: 22ch;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: var(--text-section);
  font-weight: 400;
  line-height: 1.1;
  color: var(--color-ink);
}

.forest__sprig {
  display: block;
  width: 1.35rem;
  height: 3.4rem;
  margin-top: var(--space-sm);
  margin-left: 0.2rem;
  color: var(--color-leaf);
  transform: rotate(158deg);
}

.forest__head--evening .forest__heading {
  color: var(--color-mist);
}

.forest__head--evening .forest__sprig {
  color: var(--color-accent);
}

/* Story — the path */

.story__introduction {
  max-width: 36rem;
  font-size: var(--text-lede);
  line-height: 1.6;
  color: var(--color-ink-2);
}

.story__introduction p {
  margin: 0 0 var(--space-md);
}

.story__introduction p:last-child {
  margin-bottom: 0;
}

.story__introduction a {
  color: var(--color-leaf-deep);
  text-underline-offset: 0.2em;
}

.story__milestones {
  position: relative;
  display: grid;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
  padding-left: var(--space-xl);
}

.story__milestones::before {
  content: "";
  position: absolute;
  top: 0.5rem;
  bottom: 0.5rem;
  left: 0.45rem;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--color-leaf), color-mix(in oklch, var(--color-leaf) 25%, transparent));
}

.story__milestone {
  position: relative;
}

.story__milestone::before {
  content: "";
  position: absolute;
  left: calc(-1 * var(--space-xl) + 0.12rem);
  top: 0.55rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--color-accent);
  border-radius: 50% 50% 50% 4%;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 3px var(--color-paper);
}

.story__milestone-date {
  display: block;
  margin-bottom: var(--space-2xs);
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.story__milestone-title {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-ink);
}

.story__milestone-photo {
  display: block;
  width: min(100%, 13rem);
  aspect-ratio: 4 / 5;
  margin-bottom: var(--space-md);
  object-fit: cover;
  border-radius: 8rem 8rem 0.75rem 0.75rem;
  box-shadow: 0 0.75rem 2rem color-mix(in oklch, var(--color-canopy) 22%, transparent);
}

.story__milestone-description {
  max-width: 34rem;
  color: var(--color-ink-2);
}

.story__milestone-description p {
  margin: 0 0 var(--space-sm);
}

.story__milestone-description p:last-child {
  margin-bottom: 0;
}

/* Events — greenhouse plates */

.event-schedule {
  display: grid;
  gap: var(--space-lg);
}

.event-schedule__event {
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  text-align: center;
  background: var(--color-paper-2);
  border: 1px solid var(--color-rule);
  border-radius: 7rem 7rem 1.1rem 1.1rem / 3.5rem 3.5rem 1.1rem 1.1rem;
}

.event-schedule__event::before {
  content: "";
  display: block;
  width: 0.55rem;
  height: 0.55rem;
  margin: 0 auto var(--space-md);
  background: var(--color-accent);
  border-radius: 50% 50% 50% 4%;
  transform: rotate(-45deg);
}

.event-schedule__title {
  margin: 0 0 var(--space-xs);
  font-family: var(--font-display);
  font-size: var(--text-title);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-ink);
}

.event-schedule__time {
  display: inline;
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.event-schedule__time-separator {
  color: var(--color-muted);
}

.event-schedule__location {
  margin-top: var(--space-md);
}

.event-schedule__venue {
  margin: 0;
  font-size: var(--text-lede);
  color: var(--color-ink);
}

.event-schedule__address {
  margin: var(--space-2xs) 0 0;
  font-size: var(--text-sm);
  color: var(--color-muted);
}

.event-schedule__dress-code {
  margin: var(--space-md) 0 0;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

.event-schedule__dress-code span {
  display: block;
  font-size: var(--text-micro);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.event-schedule__description {
  margin-top: var(--space-md);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

.event-schedule__description p {
  margin: 0 0 var(--space-sm);
}

.event-schedule__description p:last-child {
  margin-bottom: 0;
}

.event-schedule__directions {
  display: inline-block;
  margin-top: var(--space-lg);
  padding: 0.75rem 1.75rem;
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
  color: var(--color-leaf-deep);
  text-decoration: none;
  background: transparent;
  border: 1px solid var(--color-leaf);
  border-radius: 999px;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.event-schedule__directions:hover {
  color: var(--color-paper);
  background: var(--color-leaf-deep);
}

.event-schedule__directions:active {
  transform: translateY(1px);
}

.event-schedule__directions:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Party — the grove */

/* Couple — the two of us */

.couple {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  gap: var(--space-xl) var(--space-lg);
}

.couple__partner {
  text-align: center;
}

.couple__portrait {
  display: block;
  width: min(78%, 11rem);
  aspect-ratio: 1;
  margin: 0 auto var(--space-md);
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--color-accent) 55%, transparent),
    0 1.1rem 2.2rem color-mix(in oklch, var(--color-canopy) 22%, transparent);
}

.couple__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 5vw, 2.25rem);
  font-weight: 400;
  line-height: 1.15;
  color: var(--color-ink);
}

.couple__label {
  margin: var(--space-2xs) 0 0;
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.couple__bio {
  max-width: 22rem;
  margin: var(--space-sm) auto 0;
  font-size: var(--text-sm);
  line-height: 1.7;
  color: var(--color-ink-2);
}

.couple__bio > :first-child { margin-top: 0; }
.couple__bio > :last-child { margin-bottom: 0; }

.wedding-party {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: var(--space-xl) var(--space-lg);
}

.wedding-party__person {
  text-align: center;
}

.wedding-party__photo {
  display: block;
  width: min(62%, 8.5rem);
  aspect-ratio: 1;
  margin: 0 auto var(--space-md);
  object-fit: cover;
  border-radius: 50%;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--color-accent) 55%, transparent),
    0 0.9rem 1.8rem color-mix(in oklch, var(--color-canopy) 20%, transparent);
}

.wedding-party__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--text-lede);
  font-weight: 400;
  color: var(--color-ink);
}

.wedding-party__role {
  margin: var(--space-2xs) 0 0;
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.wedding-party__group {
  margin: var(--space-2xs) 0 0;
  font-family: var(--font-label);
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.wedding-party__bio {
  max-width: 15rem;
  margin: var(--space-xs) auto 0;
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

/* Gallery — the meadow */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-md);
}

.gallery__item {
  margin: 0;
  transition: transform var(--dur-long) var(--ease-out);
}

.gallery__item:nth-child(4n + 1) { transform: rotate(-2deg); }
.gallery__item:nth-child(4n + 2) { transform: rotate(1.6deg) translateY(var(--space-sm)); }
.gallery__item:nth-child(4n + 3) { transform: rotate(-1.2deg); }
.gallery__item:nth-child(4n + 4) { transform: rotate(2.2deg) translateY(var(--space-xs)); }

@media (hover: hover) and (pointer: fine) {
  .gallery__item:hover {
    transform: rotate(0deg) translateY(-0.25rem);
  }
}

.gallery__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 5rem 5rem 0.65rem 0.65rem;
  box-shadow: 0 0.75rem 1.75rem color-mix(in oklch, var(--color-canopy) 20%, transparent);
}

/* The viewer the runtime opens on a pressing. It only ever exists when the
   runtime has run, so none of this affects the served page. */
.forest-js .gallery__item {
  cursor: zoom-in;
}

.forest-viewer-open {
  overflow: hidden;
}

.forest__viewer {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 5vw, 3rem);
  background: color-mix(in oklch, var(--color-canopy-deep) 94%, transparent);
  opacity: 0;
  transition: opacity var(--dur-long) var(--ease-out);
}

.forest__viewer.is-open {
  opacity: 1;
}

/* display: grid above beats the [hidden] attribute's default display: none, so
   without this the closed overlay still covers the page and eats every click. */
.forest__viewer[hidden] {
  display: none;
}

.forest__viewer-figure {
  display: grid;
  gap: var(--space-sm);
  justify-items: center;
  margin: 0;
  max-width: min(100%, 60rem);
}

/* contain, not cover: the whole point is seeing the frame the arch crops away. */
.forest__viewer-image {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 0.65rem;
  box-shadow: 0 2rem 4rem color-mix(in oklch, var(--color-canopy-deep) 70%, transparent);
}

.forest__viewer-caption {
  color: var(--color-mist);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  text-align: center;
  text-wrap: balance;
}

.forest__viewer-close,
.forest__viewer-prev,
.forest__viewer-next {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid color-mix(in oklch, var(--color-mist) 35%, transparent);
  border-radius: 50%;
  background: color-mix(in oklch, var(--color-canopy) 70%, transparent);
  color: var(--color-mist);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--dur-short) var(--ease-out);
}

.forest__viewer-close:hover,
.forest__viewer-prev:hover,
.forest__viewer-next:hover {
  background: color-mix(in oklch, var(--color-leaf) 55%, transparent);
}

.forest__viewer-close { top: clamp(0.75rem, 3vw, 1.5rem); right: clamp(0.75rem, 3vw, 1.5rem); }
.forest__viewer-prev { left: clamp(0.5rem, 3vw, 1.5rem); }
.forest__viewer-next { right: clamp(0.5rem, 3vw, 1.5rem); }

.gallery__caption {
  margin-top: var(--space-xs);
  font-family: var(--font-label);
  font-size: var(--text-micro);
  letter-spacing: 0.04em;
  color: var(--color-muted);
}

/* Field guide */

.guest-information {
  display: grid;
  gap: var(--space-2xl);
}

.guest-information__faqs,
.guest-information__travel,
.guest-information__gifts {
  display: grid;
  gap: 0;
}

.guest-information__faqs::before,
.guest-information__travel::before,
.guest-information__gifts::before {
  display: block;
  margin-bottom: var(--space-md);
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--color-accent-deep);
}

.guest-information__faqs::before { content: "Questions"; }
.guest-information__travel::before { content: "Getting there"; }
.guest-information__gifts::before { content: "Gifts"; }

.guest-information__faq {
  border-bottom: 1px solid var(--color-rule);
}

.guest-information__faq:first-child {
  border-top: 1px solid var(--color-rule);
}

.guest-information__question {
  margin: 0;
}

.guest-information__question-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  width: 100%;
  padding: var(--space-md) 0;
  font: inherit;
  font-family: var(--font-display);
  font-size: var(--text-lede);
  text-align: left;
  color: var(--color-ink);
  background: none;
  border: none;
  cursor: pointer;
}

.guest-information__question-button::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.2rem;
  border-right: 2px solid var(--color-leaf);
  border-bottom: 2px solid var(--color-leaf);
  transform: rotate(45deg);
  transition: transform var(--dur-short) var(--ease-out);
}

.guest-information__question-button[aria-expanded="true"]::after {
  transform: rotate(-135deg);
}

@media (hover: hover) and (pointer: fine) {
  .guest-information__question-button:hover {
    color: var(--color-leaf-deep);
  }
}

.guest-information__question-button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.guest-information__answer-wrap {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows var(--dur-long) var(--ease-in-out), visibility 0s linear 0s;
}

.guest-information__answer-wrap[data-collapsed] {
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows var(--dur-long) var(--ease-in-out), visibility 0s linear var(--dur-long);
}

.guest-information__answer {
  overflow: hidden;
  min-height: 0;
  color: var(--color-ink-2);
}

.guest-information__answer p {
  margin: 0 0 var(--space-md);
}

.guest-information__travel-item {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-rule);
}

/* A small clearing of its own, marked by the same leaf-drop the story
   timeline uses — a found thing, not another row in the field guide. */
.guest-information__gifts {
  gap: var(--space-md);
}

.guest-information__gift {
  position: relative;
  padding: var(--space-md) var(--space-md) var(--space-md) calc(var(--space-md) + 0.9rem);
  background: var(--color-paper-2);
  border-radius: 0.75rem;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--color-accent) 35%, transparent),
    0 0.6rem 1.75rem color-mix(in oklch, var(--color-canopy-deep) 14%, transparent);
}

.guest-information__gift::before {
  content: "";
  position: absolute;
  left: var(--space-md);
  top: 1.6rem;
  width: 0.7rem;
  height: 0.7rem;
  background: var(--color-accent);
  border-radius: 50% 50% 50% 4%;
  transform: rotate(-45deg);
  box-shadow: 0 0 0 3px var(--color-paper-2);
}

.guest-information__travel-title,
.guest-information__gift-title {
  margin: 0 0 var(--space-2xs);
  font-family: var(--font-display);
  font-size: var(--text-lede);
  font-weight: 400;
  color: var(--color-ink);
}

.guest-information__travel-description,
.guest-information__gift-description {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

.guest-information__travel-link,
.guest-information__gift-link {
  display: inline-block;
  margin-top: var(--space-xs);
  font-family: var(--font-label);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-leaf-deep);
  text-underline-offset: 0.22em;
}

.guest-information__travel-link:focus-visible,
.guest-information__gift-link:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

/* Evening — the close under fireflies */

.forest__evening {
  position: relative;
  margin-top: var(--space-3xl);
  padding: var(--space-3xl) var(--gutter) var(--space-2xl);
  overflow: hidden;
  color: var(--color-mist);
  background:
    radial-gradient(80% 40% at 50% 0%, color-mix(in oklch, var(--color-canopy-lift) 70%, transparent) 0%, transparent 60%),
    linear-gradient(175deg, var(--color-canopy) 0%, var(--color-canopy-deep) 70%);
}

.forest__evening > *:not(.forest__leaves) {
  position: relative;
  z-index: var(--z-content);
  max-width: 44rem;
  margin-inline: auto;
}

.forest__evening .forest__head {
  margin-bottom: var(--space-lg);
}

.rsvp-widget {
  display: grid;
  gap: var(--space-md);
  max-width: 27rem;
  margin-inline: auto;
}

.rsvp-widget__title {
  margin: 0;
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-align: center;
  color: var(--color-accent);
}

.rsvp-widget__form {
  display: grid;
  gap: var(--space-lg);
}

.rsvp-widget__field {
  display: grid;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  border: none;
}

.rsvp-widget__label {
  font-family: var(--font-label);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-mist-2);
}

.rsvp-widget__input {
  width: 100%;
  min-height: 2.9rem;
  padding: 0.75rem 1rem;
  font: inherit;
  font-size: var(--text-body);
  color: var(--color-ink);
  background: var(--color-mist);
  border: 1px solid transparent;
  border-radius: 0.85rem;
  outline: 2px solid transparent;
  outline-offset: 1px;
}

textarea.rsvp-widget__input {
  min-height: 6rem;
  resize: vertical;
}

.rsvp-widget__input::placeholder {
  color: var(--color-muted);
}

@media (hover: hover) and (pointer: fine) {
  .rsvp-widget__input:hover {
    background: var(--color-paper);
  }
}

.rsvp-widget__input:focus-visible {
  outline-color: var(--color-focus-canopy);
}

.rsvp-widget__choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm) var(--space-lg);
}

.rsvp-widget__choice {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-label);
  font-size: var(--text-body);
  color: var(--color-mist);
  cursor: pointer;
}

.rsvp-widget__choice input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--color-accent);
}

.rsvp-widget__choice input:focus-visible {
  outline: 2px solid var(--color-focus-canopy);
  outline-offset: 2px;
}

.rsvp-widget__submit {
  justify-self: center;
  min-height: 2.9rem;
  margin-top: var(--space-sm);
  padding: 0.75rem 2.75rem;
  font-family: var(--font-label);
  font-size: var(--text-body);
  font-weight: 600;
  letter-spacing: 0.08em;
  white-space: nowrap;
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.rsvp-widget__submit:hover {
  background: var(--color-accent-lift);
  transform: translateY(-1.5px);
}

.rsvp-widget__submit:active {
  transform: translateY(1px);
}

.rsvp-widget__submit:focus-visible {
  outline: 2px solid var(--color-focus-canopy);
  outline-offset: 3px;
}

.forest__close {
  margin-top: var(--space-2xl);
  text-align: center;
}

.forest__sprig--close {
  width: 1.1rem;
  height: 2.75rem;
  margin: 0 auto var(--space-md);
  color: var(--color-accent);
  transform: none;
  opacity: 0.85;
}

.forest__close-line {
  margin: 0;
  font-size: var(--text-lede);
  line-height: 1.5;
  color: var(--color-mist-2);
}

/* ——— Empty blocks collapse ——— */

.forest__pair:not(:has(.couple__partner)),
.forest__sundial:not(:has(.countdown *)),
.forest__path:not(:has(.story__introduction, .story__milestone)),
.forest__gather:not(:has(.event-schedule__event)),
.forest__grove:not(:has(.wedding-party__person)),
.forest__meadow:not(:has(.gallery__item)),
.forest__guide:not(:has(.guest-information *)) {
  display: none;
}

/* ——— Bloom reveal (runtime only) ——— */

.forest-js [data-bloom] {
  opacity: 0;
  transform: translate3d(0, 1.4rem, 0);
}

.forest-js [data-bloom].is-in-bloom {
  opacity: 1;
  transform: none;
  transition:
    opacity var(--dur-bloom) var(--ease-out),
    transform var(--dur-bloom) var(--ease-out);
  transition-delay: calc(var(--bloom-index, 0) * 90ms);
}

/* ——— Wider frames ——— */

@container invite-frame (min-width: 44rem) {
  .event-schedule {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .story__milestone {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: 0 var(--space-lg);
    align-items: start;
  }

  .story__milestone:nth-child(even) {
    grid-template-columns: minmax(0, 1fr) 13rem;
  }

  .story__milestone-photo {
    grid-column: 1;
    grid-row: 1 / span 4;
    margin-bottom: 0;
  }

  .story__milestone-date,
  .story__milestone-title,
  .story__milestone-description {
    grid-column: 2;
  }

  .story__milestone:nth-child(even) .story__milestone-photo {
    grid-column: 2;
  }

  .story__milestone:nth-child(even) .story__milestone-date,
  .story__milestone:nth-child(even) .story__milestone-title,
  .story__milestone:nth-child(even) .story__milestone-description {
    grid-column: 1;
  }
}

/* ——— Reduced motion ——— */

@media (prefers-reduced-motion: reduce) {
  .forest__rays,
  .forest__rays::after,
  .forest__cue-leaf {
    animation: none;
  }

  .gallery__item,
  .event-schedule__directions,
  .rsvp-widget__submit,
  .guest-information__question-button::after,
  .guest-information__answer-wrap {
    transition-duration: 150ms;
  }

  .forest-js [data-bloom],
  .forest-js [data-bloom].is-in-bloom {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
