/* Hallmark · route: custom (bespoke) · structure: scroll-clock day over a fixed Burgundy landscape · idea: "scroll is the clock, sunrise to starry night"
 * paper: living sky, sunrise oklch(82% 0.042 245) to night oklch(18% 0.04 272) · accent: oklch(83% 0.145 85) sunflower gold, oklch(53% 0.17 33) invitation vermilion · ink: oklch(23% 0.035 268)
 * display: Bodoni Moda capitals, opsz 18 · body: EB Garamond · axes: light / high-contrast-serif / chromatic-amber · nav: N9 edge-aligned · footer: Ft6 letter close
 * enrichment: tier-B hand-built SVG landscape (vines at the centre, sunflowers at the sides), scroll-linked time of day, ambient sway, drifting clouds, birds, two swallows carrying a baguette · gates: all-pass · studied: no
 * contrast: pass (40, 41) · nav: N9 · footer: Ft6 · slop: pass (42 to 45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · mobile: pass (34, 49, 50 to 57)
 * revision 2026-10-26, the couple's first feedback: names on one line, one heading voice, rounded photos, the invitation's outline and vermilion for the reply card
 * revision 2026-10-26, later: the send button rides higher in the card on phones; two swallows fly a baguette across the sky
 */
/* Hallmark · pre-emit critique: P5 H4 E4 S5 R4 V5 */

/* ======================================================================== fonts */
@font-face {
  font-family: "Bodoni Moda";
  src: url("../fonts/bodoni-moda-latin.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "EB Garamond";
  src: url("../fonts/eb-garamond-italic-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}
/* metric-matched fallbacks keep the layout still while the web fonts arrive */
@font-face {
  font-family: "Bodoni Moda Fallback";
  src: local("Georgia");
  size-adjust: 95%;
  ascent-override: 106%;
  descent-override: 26%;
  line-gap-override: 0%;
}
@font-face {
  font-family: "EB Garamond Fallback";
  src: local("Georgia");
  size-adjust: 88%;
  ascent-override: 102%;
  descent-override: 31%;
  line-gap-override: 0%;
}

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

[hidden] {
  display: none !important;
}

html {
  overflow-x: clip;
  scroll-padding-top: calc(var(--bar-h) + var(--space-lg));
  scroll-padding-bottom: var(--land-reading);
  background: var(--color-sky-fallback);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: color-mix(in oklab, var(--color-ink) 45%, transparent) transparent;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  html.has-smooth-wheel {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  overflow-x: clip;
  min-height: 100svh;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: var(--leading-body);
  color: var(--color-ink);
  font-kerning: normal;
  font-variant-numeric: proportional-nums;
  font-variation-settings: "opsz" var(--display-opsz); /* only Bodoni Moda has the axis; Garamond ignores it */
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: var(--color-gold-soft);
  color: var(--color-ink);
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
ol,
ul,
figure,
address {
  margin: 0;
}

ol,
ul {
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

a {
  color: inherit;
}

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Scene colours before the script blends them: the sunrise palette */
.sky,
.land,
.bar,
.veil {
  --tod-sky-top: var(--tod-sunrise-sky-top);
  --tod-sky-low: var(--tod-sunrise-sky-low);
  --tod-glow: var(--tod-sunrise-glow);
  --tod-sun: var(--tod-sunrise-sun);
  --tod-cloud: var(--tod-sunrise-cloud);
  --tod-far: var(--tod-sunrise-far);
  --tod-haze: var(--tod-sunrise-haze);
  --tod-cote: var(--tod-sunrise-cote);
  --tod-vine: var(--tod-sunrise-vine);
  --tod-wood: var(--tod-sunrise-wood);
  --tod-plain: var(--tod-sunrise-plain);
  --tod-meadow: var(--tod-sunrise-meadow);
  --tod-stone: var(--tod-sunrise-stone);
  --tod-roof: var(--tod-sunrise-roof);
  --tod-field: var(--tod-sunrise-field);
  --tod-petal: var(--tod-sunrise-petal);
  --tod-disc: var(--tod-sunrise-disc);
  --tod-ink: var(--tod-sunrise-ink);
}

/* ======================================================================== sky (behind the words) */
/* paper grain, shared by the sky and the reply card so the browser draws it once */
:root {
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .075 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

.sky {
  position: fixed;
  inset: 0;
  z-index: var(--z-sky);
  overflow: hidden;
  pointer-events: none;
  background:
    var(--grain),
    linear-gradient(to bottom, var(--tod-sky-top) 0%, var(--tod-sky-low) 74%);
}

.sky__stars {
  position: absolute;
  inset: 0 0 18% 0;
  background: url("../img/stars.svg") center top / cover no-repeat;
  opacity: 0;
}

.sky__moon {
  --moon: clamp(26px, 3.6vmin, 40px);
  position: absolute;
  top: 17svh;
  left: 15vw;
  width: var(--moon);
  aspect-ratio: 1;
  border-radius: 50%;
  box-shadow: inset calc(var(--moon) * -0.3) calc(var(--moon) * -0.1) 0 0 var(--color-moon);
  rotate: -18deg;
  opacity: 0;
}

.sky__sun,
.sky__halo,
.sky__horizon {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 50%;
  will-change: transform;
}

.sky__sun {
  --sun: clamp(40px, 5.4vmin, 68px);
  width: var(--sun);
  height: var(--sun);
  margin: calc(var(--sun) / -2) 0 0 calc(var(--sun) / -2);
  background: radial-gradient(circle, var(--tod-sun) 0 56%, transparent 72%);
}

.sky__halo {
  --halo: clamp(360px, 70vmax, 1100px);
  width: var(--halo);
  height: var(--halo);
  margin: calc(var(--halo) / -2) 0 0 calc(var(--halo) / -2);
  background: radial-gradient(circle, color-mix(in oklab, var(--tod-glow) 72%, transparent) 0, transparent 58%);
  opacity: 0.6;
}

.sky__horizon {
  width: 170vw;
  height: 54svh;
  margin: -27svh 0 0 -85vw;
  background: radial-gradient(closest-side, var(--tod-glow) 0, transparent 100%);
  opacity: 0.5;
}

.sky__clouds {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.sky__cloud {
  position: absolute;
  height: var(--h);
  width: var(--w);
  top: var(--y);
  left: var(--x);
  border-radius: 50%;
  background: radial-gradient(closest-side, color-mix(in oklab, var(--tod-cloud) 80%, transparent), transparent);
  opacity: 0.75;
}

.sky__cloud::after {
  content: "";
  position: absolute;
  inset: -40% 18% 30% 30%;
  border-radius: 50%;
  background: inherit;
}

.sky__cloud--1 { --x: 6vw; --y: 24svh; --w: 34vw; --h: 3.2svh; --drift: 6vw; --drift-t: 96s; }
.sky__cloud--2 { --x: 50vw; --y: 33svh; --w: 46vw; --h: 2.6svh; --drift: -5vw; --drift-t: 124s; }
.sky__cloud--3 { --x: 68vw; --y: 14svh; --w: 24vw; --h: 2svh; --drift: 4vw; --drift-t: 82s; }

/* birds cross the sky now and then during the day (main.js); far ones are smaller and hazier */
.sky__birds {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.flock {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.flock__bob {
  position: relative;
  animation: bob var(--bob-t, 5s) var(--ease-in-out) infinite alternate;
}

.bird {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  width: var(--bs);
  aspect-ratio: 24 / 10;
  color: color-mix(in oklab, var(--tod-wood) var(--bk, 80%), var(--tod-sky-top));
}

.bird svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  max-width: none;
  transform-origin: 50% 70%;
  animation: flap var(--flap-t, 0.5s) var(--ease-in-out) var(--flap-d, 0s) infinite alternate;
}

/* the first flight of a visit, and every fourth after it, is two swallows carrying a baguette (main.js):
   seen side on, they take turns to heave, the loaf tips between them, and its crust takes the hour's
   sunflower colours */
.carry {
  --tilt: 4.6deg; /* the loaf's tip when one bird is up by --heave and the other down */
  position: absolute;
}

.carry .bird {
  aspect-ratio: 2;
  animation: heave var(--heave-t, 1s) var(--ease-in-out) infinite alternate;
}

.carry .bird + .bird {
  animation-direction: alternate-reverse;
}

.carry .bird svg {
  position: absolute;
  inset: 0;
}

.carry .bird__body {
  animation: none;
}

.carry .bird__wing {
  transform-origin: 47% 40%; /* the shoulder */
}

/* legs, trailing behind the flight */
.carry .bird::after {
  content: "";
  position: absolute;
  left: 45%;
  top: 62%;
  width: max(1px, calc(var(--bs) * 0.035));
  height: calc(var(--bs) * 0.3);
  background: currentColor;
  transform: skewX(-32deg);
  transform-origin: top;
}

.loaf {
  --loaf: color-mix(in oklch, var(--tod-petal) 58%, var(--tod-disc));
  --loaf-lo: color-mix(in oklch, var(--tod-petal) 34%, var(--tod-disc));
  --loaf-score: color-mix(in oklch, var(--tod-stone) 58%, var(--tod-petal));
  position: absolute;
  left: calc(var(--lw) * -0.5);
  top: calc(var(--lw) / -12);
  width: var(--lw);
  height: calc(var(--lw) / 6);
  max-width: none;
  overflow: visible;
  animation: tilt var(--heave-t, 1s) var(--ease-in-out) infinite alternate;
}

/* ======================================================================== land (in front of the words) */
.land {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--land-h);
  z-index: var(--z-land);
  pointer-events: none;
  will-change: transform;
}

.land__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
}

.land__flowers {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.flower {
  position: absolute;
  bottom: -3%;
  left: var(--fx);
  height: var(--fh);
  aspect-ratio: 240 / 700;
  transform-origin: 50% 100%;
  rotate: calc(var(--ft) + var(--lean, 0) * 3.5deg);
}

.flower svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  max-width: none;
  transform-origin: 50% 100%;
}

.flower--1 { --fx: -7%; --fh: 74%; --ft: 5deg; --fd: -1.5s; }
.flower--2 { --fx: 7%; --fh: 56%; --ft: -3deg; --fd: -4s; }
.flower--3 { --fx: 17%; --fh: 40%; --ft: 2deg; --fd: -6.2s; display: none; }
.flower--4 { --fx: 78%; --fh: 42%; --ft: -2deg; --fd: -2.4s; display: none; }
.flower--5 { --fx: 84%; --fh: 62%; --ft: 3deg; --fd: -5.1s; }
.flower--6 { --fx: 95%; --fh: 50%; --ft: -5deg; --fd: -0.6s; display: none; }

.veil {
  position: fixed;
  inset: 0 0 auto 0;
  height: calc(var(--bar-h) + var(--space-lg));
  z-index: var(--z-veil);
  pointer-events: none;
  background: linear-gradient(to bottom, var(--tod-sky-top) 0 52%, transparent);
  transition: opacity var(--dur-short) var(--ease-out);
}

/* over the hero the bar is empty, so the veil waits too */
.js .veil:not(.is-past-hero) {
  opacity: 0;
}

/* while the reply card passes under it, the bar steps aside */
.bar.is-over-card,
.veil.is-over-card {
  opacity: 0;
  visibility: hidden;
}

/* ======================================================================== bar (N9 edge-aligned) */
.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: var(--z-bar);
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
  color: var(--tod-ink);
  pointer-events: none;
  transition: color var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out), visibility 0s linear;
}

.bar a {
  pointer-events: auto;
}

.bar__mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-inline-start: calc(var(--space-2xs) * -1);
  border-radius: 50%;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-short) var(--ease-out), visibility 0s linear var(--dur-short);
}

.bar__mark svg {
  width: 38px;
  height: 38px;
}

.bar.is-past-hero .bar__mark {
  opacity: 1;
  visibility: visible;
  transition: opacity var(--dur-long) var(--ease-out), visibility 0s;
}

.bar__rsvp {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-md);
  border: 1px solid color-mix(in oklab, currentColor 55%, transparent);
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), opacity var(--dur-long) var(--ease-out), translate var(--dur-long) var(--ease-out), visibility 0s linear;
}

/* with the script running, the pill only shows while neither the hero's RSVP nor the reply card is on screen */
.js .bar__rsvp {
  opacity: 0;
  visibility: hidden;
  translate: 0 -6px;
  transition-delay: 0s, 0s, 0s, 0s, 0s, var(--dur-long);
}

.js .bar.show-rsvp .bar__rsvp {
  opacity: 1;
  visibility: visible;
  translate: none;
  transition-delay: 0s;
}

@media (hover: hover) and (pointer: fine) {
  .bar__rsvp:hover {
    border-color: var(--color-vermilion-2);
    background: var(--color-vermilion-2);
    color: var(--color-paper);
  }
}

.bar__rsvp:active {
  border-color: var(--color-vermilion-2);
  background: var(--color-vermilion-2);
  color: var(--color-paper);
  transform: translateY(1px);
}

/* ======================================================================== shared pieces */
main {
  position: relative;
}

/* main.js fades the words out just above the ridge line (a mask on main), so the hills never slice a sentence */

/* every heading speaks in the same voice as the names: Bodoni capitals, generously spaced */
.hero__names,
.section-title,
.day__name,
.event__title,
.venue__name,
.route__name,
.card__title,
.thanks__title,
.close__line {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
}

.section-title {
  font-size: var(--text-2xl);
  line-height: var(--leading-head);
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-width: 0;
}

.link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
  text-decoration-color: color-mix(in oklab, currentColor 45%, transparent);
  white-space: nowrap;
  cursor: pointer;
  transition: text-decoration-color var(--dur-short) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .link:hover {
    text-decoration-color: currentColor;
    text-decoration-thickness: 2px;
  }
}

.link:active,
.hero__index a:active,
.close__top:active,
.bar__mark:active {
  transform: translateY(1px);
}

.link--small {
  font-size: var(--text-sm);
}

.link__icon {
  flex: none;
  width: 1.15em;
  height: 1.15em;
}

.link--wa::after {
  content: none !important;
}

.link[target="_blank"]::after {
  content: "";
  width: 0.62em;
  height: 0.62em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1h6v6M9 1 1 9' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M3 1h6v6M9 1 1 9' fill='none' stroke='%23000' stroke-width='1.2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  min-height: 48px;
  padding: 0 var(--space-xl);
  border: 0;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}

.btn:active {
  transform: translateY(1px);
}

/* the RSVP buttons blush to the invitation's vermilion; the card's gold button turns to cream */
.btn--ink {
  background: var(--color-ink);
  color: var(--color-paper);
}

.btn--gold {
  background: var(--color-gold);
  color: var(--color-gold-ink);
}

@media (hover: hover) and (pointer: fine) {
  .btn--ink:hover {
    background: var(--color-vermilion-2);
  }
  .btn--gold:not([disabled]):hover {
    background: var(--color-paper);
    color: var(--color-vermilion-ink);
  }
}

.btn--ink:active {
  background: var(--color-vermilion-2);
}

.btn--gold:not([disabled]):active {
  background: var(--color-paper);
  color: var(--color-vermilion-ink);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn__spinner {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.15rem;
  height: 1.15rem;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0;
}

.btn[aria-busy="true"] {
  cursor: progress;
}

.btn[aria-busy="true"] .btn__label {
  opacity: 0;
}

.btn[aria-busy="true"] .btn__spinner {
  opacity: 1;
  animation: spin 800ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

/* visible placeholders: copy the couple still has to write */
.tbd {
  padding: 0 var(--space-3xs);
  border-radius: var(--radius-sm);
  background: color-mix(in oklab, var(--color-tbd) 10%, transparent);
  color: var(--color-tbd);
  font-style: italic;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* ======================================================================== sections */
.hero,
.story,
.weekend,
.travel,
.stay,
.rsvp,
.close {
  padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right));
}

.story,
.weekend,
.travel,
.stay,
.rsvp {
  margin-top: clamp(9rem, 34svh, 18rem);
}

/* ---------------------------------------------------------------- hero */
.hero {
  --i: 0;
  container-type: inline-size;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--bar-h) + var(--space-md));
  padding-bottom: calc(max(var(--land-h) * 0.6, 12.8vw) + var(--space-md));
  text-align: center;
}

/* the names set the measure: everything under them spans exactly their width */
.hero__inner {
  display: grid;
  justify-items: center;
  width: max-content;
  max-width: 100%;
}

.hero__mark {
  width: clamp(3.25rem, min(3rem + 6vw, 10svh), 6.5rem);
  height: auto;
  aspect-ratio: 1;
  margin-bottom: clamp(1rem, 3.2svh, 2.25rem);
  color: var(--color-ink);
}

.hero__names {
  font-size: var(--text-names);
  line-height: var(--leading-display);
  white-space: nowrap;
  padding-inline-start: var(--tracking-caps); /* balances the spacing after the last letter */
}

/* the ampersand in the invitation's colour, an italic from the text face */
.hero__amp {
  display: inline-block;
  margin-inline: -0.12em -0.04em;
  font-family: var(--font-body);
  font-size: 1.06em;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-vermilion-2);
}

.hero__lede {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-self: stretch;
  margin-top: clamp(0.85rem, 2.4svh, 1.6rem);
  font-size: var(--text-md);
  font-style: italic;
  letter-spacing: 0.01em;
  color: var(--color-ink-2);
}

.hero__lede::before,
.hero__lede::after {
  content: "";
  flex: 1;
  height: var(--rule-hair);
  background: var(--color-rule);
}

.hero__when {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-self: stretch;
  margin-top: var(--space-xs);
  font-size: var(--text-md);
  line-height: 1.4;
}

.hero__when time {
  font-weight: 500;
}

.hero__dot {
  display: none;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-gold-2);
}

.hero__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  justify-self: stretch;
  margin-top: clamp(1rem, 3svh, 2.25rem);
}

.hero__index {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  column-gap: clamp(0.75rem, 3.4vw, 1.5rem); /* all four links on one line from 360px */
}

.hero__index a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--text-sm);
  color: var(--color-ink-2);
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(currentColor, currentColor) 0 calc(50% + 0.75em) / 0 1px no-repeat;
  transition: background-size var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}

@media (hover: hover) and (pointer: fine) {
  .hero__index a:hover {
    color: var(--color-ink);
    background-size: 100% 1px;
  }
}

/* ---------------------------------------------------------------- story */
.story {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 68rem;
  margin-inline: auto;
  align-items: center;
}

.story__photo {
  --gap: clamp(0.5rem, 2.2vw, 0.75rem);
  position: relative;
  justify-self: center;
  width: min(80vw, 22rem);
  padding: var(--gap);
}

.frame {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-photo);
  background: var(--color-ink);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 46% 0;
}

/* a fine line around the photo, like a mount */
.story__photo::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in oklab, var(--color-ink) 42%, transparent);
  border-radius: calc(var(--radius-photo) + var(--gap));
  pointer-events: none;
}

.story__text {
  max-width: 34rem;
}

.story__lede {
  margin-top: var(--space-lg);
  font-size: var(--text-md);
  line-height: 1.5;
}

.story__text p + p {
  margin-top: var(--space-md);
}

/* ---------------------------------------------------------------- weekend */
.weekend {
  max-width: 76rem;
  margin-inline: auto;
}

.weekend__sub {
  margin-top: var(--space-sm);
  max-width: 34rem;
  color: var(--color-ink-2);
}

.days {
  display: grid;
  gap: var(--space-2xl);
  margin-top: var(--space-2xl);
}

.day__title {
  font-weight: 400;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.day__name,
.card__title,
.close__line,
.thanks__title,
.route__name,
.venue__name {
  overflow-wrap: anywhere;
  min-width: 0;
}

.day__name {
  font-size: var(--text-xl);
  line-height: 1.1;
}

.day__date {
  font-size: var(--text-md);
  font-style: italic;
  color: var(--color-ink-2);
}

.day__list {
  display: grid;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
}

.event {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  column-gap: var(--space-md);
  align-items: baseline;
}

.event__time {
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-variant-numeric: tabular-nums lining-nums;
  text-align: end;
  white-space: nowrap;
}

.ampm {
  margin-inline-start: var(--space-3xs);
  font-family: var(--font-body);
  font-size: 0.62em;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-ink-2);
}

.event__what {
  font-size: var(--text-base);
}

.event__note {
  display: block;
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

.event__title {
  display: block;
  font-size: var(--text-caps);
  line-height: 1.25;
}

.event__note .link {
  display: flex;
  width: fit-content;
  min-height: 36px;
}

.event--key .event__time {
  position: relative;
}

.event--key .event__time::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -0.25rem;
  width: 9px;
  height: 9px;
  margin-top: -6px;
  border-radius: 50%;
  background: var(--color-gold-2);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-gold) 35%, transparent);
}

/* ---------------------------------------------------------------- travel */
.travel {
  display: grid;
  gap: var(--space-2xl);
  max-width: 76rem;
  margin-inline: auto;
}

.venue__address {
  margin-top: var(--space-lg);
  font-size: var(--text-md);
  line-height: 1.45;
}

.venue__name {
  display: block;
  margin-bottom: var(--space-2xs);
  font-size: var(--text-caps);
  line-height: 1.2;
}

.venue__note {
  margin-top: var(--space-md);
  max-width: 30rem;
  color: var(--color-ink-2);
}

.venue .link {
  margin-top: var(--space-xs);
}

.venue__photos {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.62fr);
  align-items: end;
  max-width: 34rem;
}

.venue__photo,
.stay__photo img {
  filter: saturate(0.86) contrast(0.97);
}

.venue__photo {
  width: 100%;
  height: auto;
  object-fit: cover;
}

.venue__photo--main {
  grid-column: 1 / 2;
  grid-row: 1;
  aspect-ratio: 604 / 800;
  border-radius: var(--radius-photo);
  box-shadow: 0 18px 40px -24px color-mix(in oklab, var(--color-ink) 70%, transparent);
}

.venue__photo--tower {
  grid-column: 2 / 3;
  grid-row: 1;
  margin: 0 0 -12% -26%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-photo);
  object-position: 50% 30%;
  box-shadow: 0 18px 40px -22px color-mix(in oklab, var(--color-ink) 75%, transparent);
}

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

.route {
  padding-top: var(--space-md);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.route__name {
  font-size: var(--text-caps);
  line-height: 1.25;
  text-wrap: balance;
}

.route__or {
  font-family: var(--font-body);
  font-size: 0.85em;
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-ink-2);
}

.route__why {
  margin-top: var(--space-xs);
  color: var(--color-ink-2);
}

.route__best {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  margin-inline-end: var(--space-2xs);
  font-weight: 500;
  color: var(--color-ink);
}

.route__best::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--color-gold-2);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--color-gold) 35%, transparent);
}

.route__far {
  margin-top: var(--space-2xs);
}

.num {
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------------------------------------------------------------- stay */
.stay {
  display: grid;
  gap: clamp(2rem, 5vw, 4.5rem);
  max-width: 72rem;
  margin-inline: auto;
  align-items: center;
}

.stay__photo {
  align-self: end;
}

.stay__photo img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--radius-photo);
  box-shadow: 0 18px 40px -24px color-mix(in oklab, var(--color-ink) 70%, transparent);
}

.stay__text {
  max-width: 32rem;
}

.stay__text > p + p,
.stay__lead {
  margin-top: var(--space-md);
}

.stay__lead {
  font-size: var(--text-md);
  line-height: 1.45;
}

.stay__price {
  padding-block: var(--space-md);
  border-block: var(--rule-hair) solid var(--color-rule);
}

.stay__amount {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  font-variant-numeric: lining-nums;
}

.stay .link {
  margin-top: var(--space-xs);
}

/* ---------------------------------------------------------------- RSVP: the reply card */
.rsvp {
  display: grid;
  justify-items: center;
  max-width: 76rem;
  margin-inline: auto;
}

/* card-shape:start (generated by tools/card/card_shape.py) */
.card {
  --cap: 55cqw; /* height of each cap: the invitation's proportions */
  --line-x: 2.1cqw;
  --line-w: 0.2cqw;
  --cap-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='549.8' viewBox='0 0 1000 549.8'%3E%3Cpath d='M500 0C470.5 65.5 419.8 85.7 399.7 91.3C274.7 125.8 272.4 205.2 272.4 208.4C154.9 208.4 121.4 305.3 121.4 359.2L121.4 384.9C121.4 384.9 0 418.1 0 549.8L0 549.8L1000 549.8L1000 549.8C1000 418.1 878.6 384.9 878.6 384.9L878.6 359.2C878.6 305.3 845.1 208.4 727.6 208.4C727.6 205.2 725.3 125.8 600.3 91.3C580.2 85.7 529.5 65.5 500 0Z'/%3E%3C/svg%3E");
  --cap-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='549.8' viewBox='0 0 1000 549.8'%3E%3Cpath d='M500 549.8C470.5 484.3 419.8 464.1 399.7 458.5C274.7 424 272.4 344.6 272.4 341.4C154.9 341.4 121.4 244.5 121.4 190.6L121.4 164.9C121.4 164.9 0 131.7 0 0L0 0L1000 0L1000 0C1000 131.7 878.6 164.9 878.6 164.9L878.6 190.6C878.6 244.5 845.1 341.4 727.6 341.4C727.6 344.6 725.3 424 600.3 458.5C580.2 464.1 529.5 484.3 500 549.8Z'/%3E%3C/svg%3E");
  --ring-top: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='549.8' viewBox='0 0 1000 549.8'%3E%3CclipPath id='c'%3E%3Cpath d='M500 0C470.5 65.5 419.8 85.7 399.7 91.3C274.7 125.8 272.4 205.2 272.4 208.4C154.9 208.4 121.4 305.3 121.4 359.2L121.4 384.9C121.4 384.9 0 418.1 0 549.8L0 749.8L1000 749.8L1000 549.8C1000 418.1 878.6 384.9 878.6 384.9L878.6 359.2C878.6 305.3 845.1 208.4 727.6 208.4C727.6 205.2 725.3 125.8 600.3 91.3C580.2 85.7 529.5 65.5 500 0Z'/%3E%3C/clipPath%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='-300' y='-300' width='1600' height='1200'%3E%3Crect x='-300' y='-300' width='1600' height='1200' fill='%23fff'/%3E%3Cpath d='M500 0C470.5 65.5 419.8 85.7 399.7 91.3C274.7 125.8 272.4 205.2 272.4 208.4C154.9 208.4 121.4 305.3 121.4 359.2L121.4 384.9C121.4 384.9 0 418.1 0 549.8L0 749.8L1000 749.8L1000 549.8C1000 418.1 878.6 384.9 878.6 384.9L878.6 359.2C878.6 305.3 845.1 208.4 727.6 208.4C727.6 205.2 725.3 125.8 600.3 91.3C580.2 85.7 529.5 65.5 500 0Z' fill='none' stroke='%23000' stroke-width='41.6' stroke-linejoin='round'/%3E%3C/mask%3E%3Cpath d='M500 0C470.5 65.5 419.8 85.7 399.7 91.3C274.7 125.8 272.4 205.2 272.4 208.4C154.9 208.4 121.4 305.3 121.4 359.2L121.4 384.9C121.4 384.9 0 418.1 0 549.8L0 749.8L1000 749.8L1000 549.8C1000 418.1 878.6 384.9 878.6 384.9L878.6 359.2C878.6 305.3 845.1 208.4 727.6 208.4C727.6 205.2 725.3 125.8 600.3 91.3C580.2 85.7 529.5 65.5 500 0Z' fill='none' stroke='%23000' stroke-width='46.4' stroke-linejoin='round' clip-path='url(%23c)' mask='url(%23m)'/%3E%3C/svg%3E");
  --ring-bottom: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1000' height='549.8' viewBox='0 0 1000 549.8'%3E%3CclipPath id='c'%3E%3Cpath d='M500 549.8C470.5 484.3 419.8 464.1 399.7 458.5C274.7 424 272.4 344.6 272.4 341.4C154.9 341.4 121.4 244.5 121.4 190.6L121.4 164.9C121.4 164.9 0 131.7 0 0L0 -200L1000 -200L1000 0C1000 131.7 878.6 164.9 878.6 164.9L878.6 190.6C878.6 244.5 845.1 341.4 727.6 341.4C727.6 344.6 725.3 424 600.3 458.5C580.2 464.1 529.5 484.3 500 549.8Z'/%3E%3C/clipPath%3E%3Cmask id='m' maskUnits='userSpaceOnUse' x='-300' y='-300' width='1600' height='1200'%3E%3Crect x='-300' y='-300' width='1600' height='1200' fill='%23fff'/%3E%3Cpath d='M500 549.8C470.5 484.3 419.8 464.1 399.7 458.5C274.7 424 272.4 344.6 272.4 341.4C154.9 341.4 121.4 244.5 121.4 190.6L121.4 164.9C121.4 164.9 0 131.7 0 0L0 -200L1000 -200L1000 0C1000 131.7 878.6 164.9 878.6 164.9L878.6 190.6C878.6 244.5 845.1 341.4 727.6 341.4C727.6 344.6 725.3 424 600.3 458.5C580.2 464.1 529.5 484.3 500 549.8Z' fill='none' stroke='%23000' stroke-width='41.6' stroke-linejoin='round'/%3E%3C/mask%3E%3Cpath d='M500 549.8C470.5 484.3 419.8 464.1 399.7 458.5C274.7 424 272.4 344.6 272.4 341.4C154.9 341.4 121.4 244.5 121.4 190.6L121.4 164.9C121.4 164.9 0 131.7 0 0L0 -200L1000 -200L1000 0C1000 131.7 878.6 164.9 878.6 164.9L878.6 190.6C878.6 244.5 845.1 341.4 727.6 341.4C727.6 344.6 725.3 424 600.3 458.5C580.2 464.1 529.5 484.3 500 549.8Z' fill='none' stroke='%23000' stroke-width='46.4' stroke-linejoin='round' clip-path='url(%23c)' mask='url(%23m)'/%3E%3C/svg%3E");
}
/* card-shape:end */

/* the reply card is the invitation itself: its cusped-dome outline, its vermilion watercolour, a fine gold line inside */
.card {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  width: 100%;
  max-width: 50rem;
  color: var(--color-paper);
  caret-color: var(--color-gold);
}

.card__paper,
.card__line {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.card__paper {
  z-index: -2;
  background:
    var(--grain) 0 0 / 180px 180px,
    url("../img/card-wash.webp") 0 0 / 720px 720px,
    radial-gradient(30cqw 18cqw at 50% 13cqw, color-mix(in oklab, var(--color-card-glow) 90%, transparent), transparent),
    radial-gradient(30cqw 50cqw at 3% 64cqw, color-mix(in oklab, var(--color-card-bloom) 88%, transparent), transparent),
    radial-gradient(28cqw 46cqw at 97% 74cqw, color-mix(in oklab, var(--color-card-bloom) 80%, transparent), transparent),
    radial-gradient(28cqw 44cqw at 3% calc(100% - 60cqw), color-mix(in oklab, var(--color-card-bloom) 78%, transparent), transparent),
    radial-gradient(26cqw 42cqw at 97% calc(100% - 82cqw), color-mix(in oklab, var(--color-card-bloom) 70%, transparent), transparent),
    radial-gradient(28cqw 16cqw at 50% calc(100% - 10cqw), color-mix(in oklab, var(--color-card-glow) 70%, transparent), transparent),
    linear-gradient(to bottom, var(--color-card-glow) 0, var(--color-card) 27cqw, var(--color-card) calc(100% - 30cqw), color-mix(in oklab, var(--color-card) 60%, var(--color-card-glow)) 100%);
  -webkit-mask:
    var(--cap-top) top / 100% auto no-repeat,
    var(--cap-bottom) bottom / 100% auto no-repeat,
    linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--cap) + 2px) no-repeat;
  mask:
    var(--cap-top) top / 100% auto no-repeat,
    var(--cap-bottom) bottom / 100% auto no-repeat,
    linear-gradient(#000 0 0) center / 100% calc(100% - 2 * var(--cap) + 2px) no-repeat;
}

.card__line {
  z-index: -1;
  background: var(--color-card-line);
  -webkit-mask:
    var(--ring-top) top / 100% auto no-repeat,
    var(--ring-bottom) bottom / 100% auto no-repeat,
    linear-gradient(#000 0 0) left var(--line-x) center / var(--line-w) calc(100% - 2 * var(--cap) + 2px) no-repeat,
    linear-gradient(#000 0 0) right var(--line-x) center / var(--line-w) calc(100% - 2 * var(--cap) + 2px) no-repeat;
  mask:
    var(--ring-top) top / 100% auto no-repeat,
    var(--ring-bottom) bottom / 100% auto no-repeat,
    linear-gradient(#000 0 0) left var(--line-x) center / var(--line-w) calc(100% - 2 * var(--cap) + 2px) no-repeat,
    linear-gradient(#000 0 0) right var(--line-x) center / var(--line-w) calc(100% - 2 * var(--cap) + 2px) no-repeat;
}

/* the monogram sits in the top dome and the button in the bottom one's shoulders, as on the invitation */
.card__body {
  /* the button's centre, measured up from the bottom tip: the narrower the card, the larger the button
     is against the dome, so it rides higher, into the wide step of the shoulders */
  --foot-y: calc(24cqw + 2.75rem);
  display: grid;
  min-height: calc(2 * var(--cap) + 4rem);
  padding: 9cqw max(7cqw, 1.4rem) max(calc(var(--foot-y) - 1.5rem), 4.5rem);
}

.card ::selection {
  background: var(--color-gold);
  color: var(--color-gold-ink);
}

.card :focus-visible {
  outline-color: var(--color-focus-card);
}

.card .tbd {
  background: color-mix(in oklab, var(--color-gold) 14%, transparent);
  color: var(--color-gold);
}

.card__mark {
  width: clamp(3.25rem, 15cqw, 7rem);
  height: auto;
  aspect-ratio: 1;
  margin-inline: auto;
  color: var(--color-gold);
}

.card__title {
  max-width: 13em; /* two lines: "Répondez," then "s'il vous plaît", inside the dome's shoulders */
  margin: 5.5cqw auto 0;
  padding-inline-start: var(--tracking-caps);
  text-align: center;
  font-size: clamp(1.25rem, 5.4cqw, 2.75rem);
  line-height: 1.18;
}

.nowrap {
  white-space: nowrap;
}

.card__lede {
  margin-top: var(--space-xs);
  text-align: center;
  font-style: italic;
  color: var(--color-card-text-2);
}

.form {
  display: grid;
  gap: var(--space-lg);
  margin-top: max(5cqw, var(--space-lg));
}

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

.form__row {
  display: grid;
  gap: var(--space-lg);
  min-width: 0;
}

/* the follow-up question under the dietary chips */
.field--follow {
  margin-top: var(--space-sm);
}

@container (min-width: 34rem) {
  .form__pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-md);
  }
}

/* on a wide card the guests' questions sit in pairs, which keeps the card closer to the invitation's proportions */
@container (min-width: 42rem) {
  .form__row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: var(--space-xl);
    align-items: start;
  }
}

.form__more {
  display: grid;
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.form__more[hidden],
.field[hidden],
.thanks[hidden] {
  display: none;
}

.field,
.choice {
  display: grid;
  gap: var(--space-2xs);
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field__label {
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-paper);
}

.field__opt {
  margin-inline-start: var(--space-xs);
  font-weight: 400;
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-card-text-2);
}

.field__input {
  width: 100%;
  min-height: 48px;
  padding: var(--space-xs) var(--space-sm);
  border: 1px solid var(--color-card-rule);
  border-radius: var(--radius-md);
  outline: 2px solid transparent;
  outline-offset: 1px;
  background: var(--color-card-2);
  color: var(--color-paper);
  font-family: var(--font-body);
  font-size: max(16px, var(--text-base));
  line-height: 1.35;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.field__input--area {
  min-height: 6.5rem;
  resize: vertical;
}

@media (hover: hover) and (pointer: fine) {
  .field__input:hover {
    background-color: color-mix(in oklab, var(--color-card-2) 86%, var(--color-paper));
  }
}

.field__input:focus-visible {
  outline: 2px solid var(--color-focus-card);
  border-color: color-mix(in oklab, var(--color-paper) 60%, transparent);
}

.field__input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.field__msg:empty {
  display: none;
}

.field__msg {
  font-size: var(--text-sm);
  color: var(--color-card-text-2);
}

.is-invalid .field__msg {
  font-weight: 500;
  color: var(--color-error-card);
}

.is-invalid .field__input,
.is-invalid .pill span {
  border-color: var(--color-error-card);
  box-shadow: inset 0 0 0 1px var(--color-error-card);
}

.is-invalid .field__msg::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-inline-end: 0.4em;
  vertical-align: -0.08em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M8 4v5' stroke='%23000' stroke-width='1.8'/%3E%3Ccircle cx='8' cy='11.6' r='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='7' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3Cpath d='M8 4v5' stroke='%23000' stroke-width='1.8'/%3E%3Ccircle cx='8' cy='11.6' r='1.1'/%3E%3C/svg%3E") center / contain no-repeat;
}

.choice__help {
  font-size: var(--text-sm);
  color: var(--color-card-text-2);
}

/* yes or no: two wide pills; dietary preferences: smaller chips. The checked one fills with gold. */
.pills,
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.pill,
.chip {
  position: relative;
  display: flex;
  cursor: pointer;
}

.pill {
  flex: 1 1 11.5rem;
}

.pill input,
.chip input {
  position: absolute;
  z-index: 1; /* stays above its label, even while the label is pressed */
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pill span,
.chip span {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  border: 1px solid var(--color-card-rule);
  border-radius: var(--radius-pill);
  text-align: center;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}

.pill span {
  min-height: 52px;
  padding: var(--space-xs) var(--space-lg);
  font-size: var(--text-base);
}

.chip span {
  min-height: 44px;
  padding: var(--space-2xs) var(--space-md);
  font-size: var(--text-base);
}

/* a small check appears inside the chosen chip, so the choice never rests on colour alone */
.pill span::before,
.chip span::before {
  content: "";
  width: 0;
  height: 0.8em;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0;
  scale: 0.4;
  transition: opacity var(--dur-short) var(--ease-out), scale var(--dur-short) var(--ease-out);
}

.pill input:checked + span,
.chip input:checked + span {
  border-color: var(--color-gold);
  background: var(--color-gold);
  color: var(--color-gold-ink);
}

.pill input:checked + span::before,
.chip input:checked + span::before {
  width: 0.8em;
  opacity: 1;
  scale: 1;
}

.pill:active span,
.chip:active span {
  transform: translateY(1px);
}

.pill input:disabled + span,
.chip input:disabled + span {
  opacity: 0.55;
  cursor: not-allowed;
}

.pill input:focus-visible + span,
.chip input:focus-visible + span {
  outline: 2px solid var(--color-focus-card);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .pill:hover input:not(:checked) + span,
  .chip:hover input:not(:checked) + span {
    border-color: color-mix(in oklab, var(--color-paper) 70%, transparent);
    background: color-mix(in oklab, var(--color-paper) 9%, transparent);
  }
}

.choice__row,
.choice__col {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-lg);
  margin-top: var(--space-2xs);
}

.choice__col {
  flex-direction: column;
  gap: 0;
}

.opt {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  cursor: pointer;
}

/* radios and checkboxes drawn in the card's own cream and gold */
.opt input {
  flex: none;
  display: grid;
  place-content: center;
  width: 1.3rem;
  height: 1.3rem;
  margin: 0;
  border: 1.5px solid color-mix(in oklab, var(--color-paper) 78%, transparent);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}

.opt input[type="checkbox"] {
  border-radius: var(--radius-md);
}

.opt input:checked {
  border-color: var(--color-gold);
}

.opt input[type="radio"]:checked {
  background: radial-gradient(circle, var(--color-gold) 0 0.3rem, transparent calc(0.3rem + 0.5px));
}

.opt input[type="checkbox"]:checked {
  background: var(--color-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5 6.5 11.5 12.5 4.5' fill='none' stroke='%23232848' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 0.9rem no-repeat;
}

.opt input:focus-visible {
  outline: 2px solid var(--color-focus-card);
  outline-offset: 3px;
}

/* number of guests: a counter with large minus and plus buttons */
.stepper {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  justify-self: start;
}

.stepper__btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--color-card-rule);
  border-radius: 50%;
  background: transparent;
  color: var(--color-paper);
  cursor: pointer;
  transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), opacity var(--dur-short) var(--ease-out);
}

.stepper__btn svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

@media (hover: hover) and (pointer: fine) {
  .stepper__btn:not(:disabled):hover {
    border-color: color-mix(in oklab, var(--color-paper) 70%, transparent);
    background: color-mix(in oklab, var(--color-paper) 10%, transparent);
  }
}

.stepper__btn:not(:disabled):active {
  transform: scale(0.96);
}

.stepper__btn:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.stepper__input {
  width: 4.25rem;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper__input::-webkit-inner-spin-button,
.stepper__input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.no-js .stepper__btn {
  display: none;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* the foot fills the bottom dome's shoulders, so every field above it stays between the straight sides */
.form__foot {
  display: grid;
  align-content: end;
  justify-items: center;
  gap: var(--space-md);
  min-height: calc(var(--cap) - var(--foot-y) + 0.5rem);
  text-align: center;
}

.form__status {
  max-width: min(28rem, 68cqw); /* narrow enough for the bottom dome's shoulders */
  font-size: var(--text-sm);
  color: var(--color-card-text-2);
}

.form__status:empty {
  display: none;
}

.form__status[data-tone="error"] {
  font-weight: 500;
  color: var(--color-error-card);
}

.form__status a {
  color: inherit;
  text-underline-offset: 0.22em;
}

.thanks {
  display: grid;
  justify-items: center;
  gap: var(--space-sm);
  margin-top: max(5cqw, var(--space-lg));
  text-align: center;
  outline: none;
}

.thanks__title {
  padding-inline-start: var(--tracking-caps);
  font-size: clamp(1.2rem, 4.6cqw, 1.9rem);
  line-height: 1.2;
}

.thanks__body {
  max-width: 28rem;
  color: var(--color-card-text-2);
}

/* ---------------------------------------------------------------- close (Ft6 letter close, at night) */
.close {
  position: relative;
  min-height: 100svh;
  color: var(--color-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: clamp(8rem, 30svh, 16rem);
  padding-bottom: calc(max(var(--land-h) * 0.62, 13.2vw) + var(--space-xl));
  text-align: center;
}

.scene-on .close {
  color: var(--color-paper);
}

.scene-on .close :focus-visible {
  outline-color: var(--color-focus-card);
}

.close__mark {
  color: var(--color-ink);
}

.close__mark {
  width: 4.5rem;
  height: auto;
  aspect-ratio: 1;
}

.scene-on .close__mark {
  color: var(--color-gold);
}

.close__line {
  margin-top: var(--space-lg);
  padding-inline-start: var(--tracking-caps);
  font-size: var(--text-2xl);
  line-height: var(--leading-head);
  text-wrap: balance;
}

.close__sign {
  margin-top: var(--space-sm);
  font-size: var(--text-md);
}

.close__meta {
  margin-top: var(--space-2xs);
  font-size: var(--text-sm);
  color: var(--color-ink-2);
}

.scene-on .close__meta {
  color: var(--color-paper-2);
}

.close__top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: var(--space-md);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-color: color-mix(in oklab, currentColor 40%, transparent);
  text-underline-offset: 0.4em;
}

/* ======================================================================== wider screens */
@media (min-width: 40rem) {
  .hero__when {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-md);
  }

  .hero__when > time {
    justify-self: start;
  }

  .hero__when > span:last-child {
    justify-self: end;
  }

  .hero__dot {
    display: block;
  }

  .hero__actions {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
  }

  .hero__index {
    justify-content: flex-end;
  }

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

  .day--main {
    grid-column: 1 / -1;
    grid-row: 1;
  }

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

  .flower--6 {
    display: block;
  }
}

@media (min-width: 60rem) {
  .story {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .story__photo {
    width: min(100%, 25rem);
  }

  .days {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr) minmax(0, 1fr);
    gap: var(--space-2xl) clamp(2rem, 4vw, 4rem);
  }

  .day--main {
    grid-column: auto;
    grid-row: auto;
  }

  .travel {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
    align-items: center;
    column-gap: clamp(2rem, 5vw, 5rem);
  }

  .venue__photos {
    justify-self: end;
    width: 100%;
  }

  .routes {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(2rem, 6vw, 6rem);
  }

  .stay {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  }

  .stay__photo {
    order: 2;
  }

  .flower--3,
  .flower--4 {
    display: block;
  }

  .flower--1 { --fh: 96%; }
  .flower--2 { --fh: 74%; }
  .flower--5 { --fh: 84%; }
  .flower--6 { --fh: 66%; }
}

@media (min-width: 90rem) {
  .flower--1 { --fx: -3%; }
  .flower--2 { --fx: 6%; }
  .flower--3 { --fx: 13.5%; }
  .flower--4 { --fx: 81%; }
  .flower--5 { --fx: 88%; }
  .flower--6 { --fx: 96%; }
}

@media (max-width: 40rem) {
  .rsvp,
  .hero {
    padding-inline: max(0.75rem, env(safe-area-inset-left)) max(0.75rem, env(safe-area-inset-right));
  }

  /* on a phone the one line of names must still be the largest thing on the page */
  .hero__names {
    --tracking-caps: 0.045em;
    font-size: clamp(1.35rem, min(8.8cqi, 11.5svh), 5.75rem);
    font-weight: 500;
  }
}

/* short phones: keep the names, date, place and RSVP above the hills; the section index can wait */
@media (max-width: 40rem) and (max-height: 46rem) {
  :root {
    --land-h: 36svh;
  }

  .hero__index {
    display: none;
  }
}

@media (max-height: 34rem) {
  :root {
    --land-h: 30svh;
  }

  .hero__mark,
  .hero__index {
    display: none;
  }

  /* the bar is empty over the hero, so the names may start near the top */
  .hero {
    padding-top: var(--space-lg);
  }
}

/* ======================================================================== motion */
@media (prefers-reduced-motion: no-preference) {
  .flower svg {
    animation: sway var(--dur-sway) var(--ease-in-out) var(--fd) infinite alternate;
  }

  .sky__cloud {
    animation: drift var(--drift-t) var(--ease-in-out) infinite alternate;
  }

  .js .hero__mark,
  .js .hero__names,
  .js .hero__lede,
  .js .hero__when,
  .js .hero__actions {
    animation: rise 1100ms var(--ease-out) both;
    animation-delay: calc(var(--i) * 110ms + 380ms);
  }

  .js .hero__names { --i: 1; }
  .js .hero__lede { --i: 2; }
  .js .hero__when { --i: 3; }
  .js .hero__actions { --i: 4; }
}

@keyframes sway {
  from {
    transform: rotate(-1.1deg);
  }
  to {
    transform: rotate(1.4deg);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
}

@keyframes drift {
  to {
    transform: translateX(var(--drift));
  }
}

@keyframes flap {
  to {
    transform: scaleY(-0.5);
  }
}

@keyframes bob {
  from {
    transform: translateY(-4px);
  }
  to {
    transform: translateY(5px);
  }
}

@keyframes heave {
  from {
    transform: translateY(calc(var(--heave) * -1));
  }
  to {
    transform: translateY(var(--heave));
  }
}

@keyframes tilt {
  from {
    transform: rotate(var(--tilt));
  }
  to {
    transform: rotate(calc(var(--tilt) * -1));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }

  .btn[aria-busy="true"] .btn__spinner {
    animation: spin 1.6s linear infinite !important;
  }

  .sky__birds {
    display: none;
  }
}

@media print {
  .sky,
  .land,
  .veil,
  .bar {
    display: none;
  }
}

[tabindex="-1"]:focus {
  outline: none;
}
