/* Jacob & Jasmin. Ivory paper, navy ink, pale blue washes and hydrangeas. */

:root {
  /* the ground: cool white paper, read in navy ink */
  --sc-canvas:     #f2f4f7;
  --sc-surface:    #e6eaf0;
  --sc-ink:        #1d2b45;
  --sc-ink-soft:   #525e76;
  --sc-accent:     #46699a;   /* the text-strength blue: links, focus, selection (4.9:1) */
  --sc-accent-ink: #fffdf9;
  --pale:          #c7d8ea;   /* the soft blue: fills and washes, never text */
  --sc-font-display: "Bodoni Moda", Georgia, serif;
  --sc-font-text:    "Geist", system-ui, sans-serif;
  --sc-shadow-color: 222 35% 22%;

  /* the card stock: brighter than the ground, so a white card reads on ivory
     through edge and shadow. Navy is the press ink and the wax. */
  --paper:      #ffffff;
  --paper-2:    #f1f3f7;
  --paper-ink:  #1d2b45;
  --paper-soft: #525e76;
  --press:      #26385a;
  --press-deep: #131d33;
  --error:      #a33a3a;   /* brick: 6.4:1 on white */

  /* The floor keeps the card's text from overflowing at high zoom on short windows. */
  --card-w: min(30rem, 84vw, max(calc(78svh * 0.7), 16rem));
  --r: 3px;
  /* The two section headings sit on pale paper away from the card; Bodoni's
     hairlines fade there, so they get a sturdier Caslon at bold weight. */
  --heading-font: "Libre Caslon Text", "Bodoni Moda", Georgia, serif;
}

body { background: var(--sc-canvas); }
html { scroll-padding-top: 5rem; } /* keep focused things clear of the fixed bar */

/* The linen. Fixed behind everything, so the whole page is one table. */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(ellipse 80% 70% at 50% 40%, rgb(255 255 255 / 0.55), transparent 70%),
    repeating-linear-gradient(90deg, rgb(29 43 69 / 0.018) 0 1px, transparent 1px 5px),
    var(--sc-canvas);
}

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

/* ------------------------------------------------------------- chrome -- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--sc-z-chrome);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: clamp(0.75rem, 2vw, 1.25rem) var(--sc-gutter);
  pointer-events: none;
}
/* Content scrolls under the bar, so the bar carries a little of the table
   with it: a fade, never a hard strip. */
.bar::before {
  content: ""; position: absolute; inset: 0 0 -1.5rem; z-index: -1;
  background: linear-gradient(to bottom, var(--sc-canvas) 45%, transparent);
  opacity: 0; transition: opacity var(--sc-d-base) var(--sc-ease-out);
}
.is-scrolled .bar::before { opacity: 0.94; }
.bar > * { pointer-events: auto; }
.bar__cta { flex: none; }

/* A folded place card with the guest's names on it. Upper half catches the
   light, lower half sits in the fold's shadow. */
.placecard { position: relative; min-width: 0; flex: 0 1 auto; }
.placecard summary {
  border: 1px solid rgb(29 43 69 / 0.08);
  list-style: none; cursor: pointer;
  display: flex; align-items: baseline; gap: 0.5rem;
  max-width: min(22rem, 100%);
  padding: 0.55rem 0.95rem 0.6rem;
  color: var(--paper-ink);
  background: linear-gradient(to bottom, #ffffff 0 52%, #eef1f6 52% 100%);
  border-radius: 2px;
  box-shadow: 0 1px 1px hsl(var(--sc-shadow-color) / 0.3), 0 8px 18px -6px hsl(var(--sc-shadow-color) / 0.55);
  transition: transform var(--sc-d-fast) var(--sc-ease-out);
}
.placecard summary::-webkit-details-marker { display: none; }
.placecard__chev {
  flex: none; width: 0.75rem; height: 0.75rem; align-self: center; color: var(--paper-soft);
  transition: transform var(--sc-d-fast) var(--sc-ease-out);
}
.placecard[open] .placecard__chev { transform: rotate(180deg); }
.placecard summary:active { transform: translateY(1px); }
.placecard__for {
  font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper-soft);
}
.placecard__name {
  min-width: 0;
  font-family: var(--sc-font-display); font-style: italic; font-size: 1.05rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.placecard__menu {
  position: absolute; top: calc(100% + 0.4rem); left: 0; min-width: 12rem;
  display: grid; padding: 0.4rem;
  background: var(--paper); border-radius: 2px; box-shadow: var(--sc-e3);
}
.placecard__menu a {
  padding: 0.65rem 0.75rem; color: var(--paper-ink); text-decoration: none; border-radius: 2px;
}
.placecard__menu a:hover { background: var(--paper-2); }
.placecard :focus-visible { outline-color: var(--press); }

.bar__cta {
  padding: 0.62rem 1.1rem; border-radius: var(--r);
  background: var(--pale); color: var(--sc-ink);
  font-weight: 500; font-size: 0.92rem; text-decoration: none; white-space: nowrap;
  box-shadow: var(--sc-e2);
  transition: background-color var(--sc-d-fast) var(--sc-ease-out), transform var(--sc-d-fast) var(--sc-ease-out);
}
.bar__cta:hover { background: #b5cbe4; }
.bar__cta:active { transform: scale(0.97); }

/* -------------------------------------------------------------- table -- */
.table { display: grid; place-items: center; }
/* Washes and flowers run past the stage's lower edge; on a pale ground that
   edge would show as a line as the next section arrives, so the floor fades
   into the paper. */
.table::after {
  content: ""; position: absolute; inset: auto 0 0; height: 16vh; z-index: 7; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--sc-canvas));
}
.table > * { grid-area: 1 / 1; }

.table__light {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 55% 60% at 50% 50%, rgb(255 255 255 / 0.5), transparent 72%);
}
/* The hush: the room narrows onto the card. app.js drives --dim. */
.table__light::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse 48% 58% at 50% 50%, transparent 40%, rgb(120 150 195 / 0.38) 100%);
  opacity: var(--dim, 0);
}

/* Watercolour washes on the paper (generated, assets/wash.webp). Multiply lets
   the painting's white paper vanish into the ivory ground. */
.leaves {
  position: absolute; inset: -12%; width: 124%; height: 124%; max-width: none;
  pointer-events: none; mix-blend-mode: multiply;
  background: url("/assets/wash.webp") center / cover no-repeat;
  animation: sway 17s var(--sc-ease-in-out) infinite alternate;
}
.leaves--back { opacity: 0.9; }
/* A second, larger pass of the same wash, mirrored: it drifts faster than the
   first, which is what puts air between the two. */
.leaves--front { opacity: 0.28; inset: -30%; width: 160%; height: 160%; transform: scaleX(-1); z-index: 1; animation-duration: 13s; animation-direction: alternate-reverse; }
@keyframes sway {
  from { rotate: -1.4deg; scale: 1; }
  to   { rotate: 1.6deg;  scale: 1.035; }
}
.is-offscreen .leaves { animation-play-state: paused; }

.sprig {
  position: absolute; z-index: 2; pointer-events: none; max-width: none;
  width: clamp(12rem, 22vw, 22rem); height: auto;
  mix-blend-mode: multiply; /* painted on white: the paper drops out */
}
.sprig--a { left: calc(50% - var(--card-w) / 2 - clamp(9rem, 15vw, 15rem)); top: calc(50% - var(--card-w) * 0.7 - 2rem); rotate: -8deg; }
.sprig--b { left: calc(50% + var(--card-w) / 2 - clamp(5rem, 7vw, 8rem)); top: calc(50% + var(--card-w) * 0.05); rotate: 170deg; scale: -1 1; }

.hush {
  position: absolute; z-index: 3; margin: 0;
  left: max(var(--sc-gutter), calc(50% - var(--card-w) / 2 - 20rem));
  width: min(17rem, calc(50% - var(--card-w) / 2 - 3rem));
  text-wrap: balance;
  font-family: var(--sc-font-display); font-style: italic; font-size: var(--sc-t-xl); line-height: 1.2;
  color: var(--sc-ink);
  opacity: 0;
}

/* --------------------------------------------------------------- card -- */
.card {
  position: relative; z-index: 4;
  width: var(--card-w); aspect-ratio: 5 / 7;
  container-type: inline-size;
  will-change: transform;
}
.card__shadow {
  position: absolute; inset: 1%; z-index: -1;
  background: hsl(var(--sc-shadow-color) / 0.28);
  filter: blur(18px);
  transform: translate(10px, 22px);
}
.card__paper {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 9cqi 8cqi 7cqi;
  color: var(--paper-ink);
  background:
    radial-gradient(ellipse 120% 90% at 30% 20%, rgb(255 255 255 / 0.5), transparent 60%),
    linear-gradient(160deg, #ffffff, var(--paper) 50%, #f5f7fa);
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgb(29 43 69 / 0.06), 0 1px 1px hsl(var(--sc-shadow-color) / 0.18);
}
.card__paper > p, .card__paper > h1 { margin: 0; }
.card__kicker {
  font-size: max(0.72rem, 2.5cqi); font-weight: 500;
  letter-spacing: 0.32em; text-transform: uppercase; color: var(--paper-soft);
  padding-left: 0.32em;
}
.card__paper > .card__names {
  margin-top: 6cqi;
  font-family: var(--sc-font-display); font-style: italic; font-weight: 400;
  font-size: 15.5cqi; line-height: 0.98; letter-spacing: -0.02em;
  text-wrap: balance;
}
.card__names span { display: inline-block; }
.card__amp { font-size: 0.62em; color: #4f74a3; padding-inline: 0.06em; } /* pale-blue family, 4.8:1 on white */
.card__paper > .card__line {
  margin-top: 2.6cqi;
  font-family: var(--sc-font-display); font-size: 4.6cqi; letter-spacing: 0.01em;
}

.card__panel {
  position: relative;
  width: 100%; margin-top: 7cqi; height: 24cqi;
  display: grid; place-items: center;
}
/* Register marks: where the plate will land. */
.card__panel::before {
  --m: color-mix(in oklab, var(--paper-soft) 70%, transparent);
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(var(--m), var(--m)) 0 0 / 4cqi 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 0 / 1px 4cqi no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 4cqi 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 0 / 1px 4cqi no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 4cqi 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 0 100% / 1px 4cqi no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 4cqi 1px no-repeat,
    linear-gradient(var(--m), var(--m)) 100% 100% / 1px 4cqi no-repeat;
  opacity: var(--marks, 0);
}

/* The impression. Ink in a dent: shadow on the upper lip of each stroke,
   light catching the lower lip. */
.impression {
  margin: 0;
  font-family: var(--sc-font-display); font-weight: 500;
  font-size: 17.5cqi; line-height: 1; letter-spacing: -0.015em;
  font-variant-numeric: lining-nums;
  color: var(--press);
  text-shadow:
    0 -0.012em 0 rgb(10 18 34 / 0.55),
    0 0.018em 0 rgb(255 255 255 / 0.85),
    0 0.03em 0.04em rgb(255 255 255 / 0.4);
}
.impression i { font-style: normal; font-weight: 400; color: var(--paper-soft); margin-inline: 0.04em; }
/* The paper around the type is squeezed too: a faint bruise. */
.card__panel::after {
  content: ""; position: absolute; inset: 14% 6%; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse at 50% 45%, rgb(40 60 100 / 0.07), transparent 70%);
  opacity: var(--ink, 1);
}

.plate, .plate-shadow { position: absolute; pointer-events: none; opacity: 0; }
.plate-shadow {
  inset: -2% -1%;
  background: hsl(var(--sc-shadow-color) / 0.45);
  filter: blur(16px);
  border-radius: 6px;
}
.plate {
  inset: -9% -4%;
  display: grid; place-items: center;
  border-radius: 3px;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 0.35), transparent 22%),
    repeating-linear-gradient(100deg, rgb(255 255 255 / 0.06) 0 2px, transparent 2px 5px),
    linear-gradient(145deg, #c9ced6, #9aa2ae 55%, #b4bac4);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.7),
    inset 0 -3px 0 rgb(40 50 70 / 0.35),
    inset 3px 0 0 rgb(255 255 255 / 0.2),
    inset -3px 0 0 rgb(40 50 70 / 0.2);
}
.plate__type {
  /* Type on a printing plate reads backwards. Raised, freshly inked: a wet
     highlight on the upper edge of each stroke, a shadow under it. */
  transform: scaleX(-1);
  font-family: var(--sc-font-display); font-weight: 500;
  font-size: 17.5cqi; line-height: 1; letter-spacing: -0.015em;
  font-variant-numeric: lining-nums;
  color: #1f3156;
  text-shadow:
    0 -0.02em 0 rgb(200 215 240 / 0.6),
    0 0.03em 0 rgb(10 18 34 / 0.45),
    0 0.06em 0.08em rgb(10 18 34 / 0.35);
}
.plate__type i { font-style: normal; color: #4d6286; }

.card__after { margin-top: 3cqi; }
.card__after p { margin: 0; }
.card__when { font-family: var(--sc-font-display); font-size: 5cqi; font-style: italic; }
.card__after .card__where {
  margin-top: 1.6cqi;
  font-size: max(0.72rem, 2.5cqi); letter-spacing: 0.22em; text-transform: uppercase; color: var(--paper-soft);
  text-wrap: balance;
}
.card__paper > .card__foot {
  margin-top: auto;
  font-family: var(--sc-font-display); font-style: italic; font-size: max(0.8rem, 3.6cqi); color: var(--paper-soft);
}

/* A vellum belly band around the card, printed with the guest's names. */
.vellum {
  position: absolute; z-index: 5;
  width: calc(var(--card-w) + 3.5rem);
  min-height: calc(var(--card-w) * 0.34);
  padding-block: 1rem;
  translate: 0 calc(var(--card-w) * 0.16);
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgb(226 235 246 / 0.7), rgb(214 227 242 / 0.62));
  -webkit-backdrop-filter: blur(5px) saturate(0.8);
  backdrop-filter: blur(5px) saturate(0.8);
  border-block: 1px solid rgb(255 255 255 / 0.8);
  box-shadow: 0 10px 24px -12px hsl(var(--sc-shadow-color) / 0.3);
  color: var(--paper-ink);
  opacity: 0;
  will-change: transform, opacity;
}
.vellum p { margin: 0; display: grid; justify-items: center; gap: 0.3rem; padding-inline: 1.5rem; text-align: center; }
[data-guest-label] { transition: opacity var(--sc-d-base) var(--sc-ease-out); }
.is-loading-guest [data-guest-label] { opacity: 0; }
.vellum__for { font-size: 0.7rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-soft); padding-left: 0.3em; }
.vellum__name {
  font-family: var(--sc-font-display); font-style: italic;
  font-size: clamp(1.4rem, calc(var(--card-w) * 0.085), 2.6rem); line-height: 1.1;
  text-wrap: balance; overflow-wrap: anywhere;
}

/* -------------------------------------------------------------- place -- */
.place {
  padding: clamp(4rem, 10vh, 8rem) var(--sc-gutter) clamp(3rem, 8vh, 6rem);
}
.place__grid {
  max-width: 80rem; margin-inline: auto;
  display: grid; grid-template-columns: minmax(16rem, 24rem) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.place__title {
  margin: 0;
  font-family: var(--heading-font); font-weight: 700;
  font-size: var(--sc-t-3xl); line-height: 1; letter-spacing: -0.015em;
}
.place__title + .place__lede { margin-top: var(--sc-6); }
.place__lede { margin-block: 0; font-size: var(--sc-t-lg); line-height: 1.45; color: var(--sc-ink); text-wrap: pretty; }
.place__body { margin-block-end: 0; color: var(--sc-ink-soft); text-wrap: pretty; }
.link {
  color: var(--sc-accent); text-decoration: underline; text-underline-offset: 0.25em;
  background: none; border: 0; padding: 0; cursor: pointer; font: inherit;
}
.link:hover { text-decoration-thickness: 2px; }

.mapcard {
  margin: 0; position: relative;
  padding: clamp(0.6rem, 1.6vw, 1.4rem) clamp(0.6rem, 1.6vw, 1.4rem) 0.8rem;
  background: linear-gradient(160deg, #ffffff, var(--paper) 50%, #f5f7fa);
  color: var(--paper-ink);
  border-radius: 2px;
  rotate: 1.2deg;
  box-shadow: var(--sc-e3);
}
.map { display: block; width: 100%; height: auto; overflow: hidden; } /* the phone crop must not draw past the card */
.map :is(.m-frame, .m-sea, .m-coast, .m-river, .m-road) { fill: none; stroke: var(--paper-ink); }
.map [pathLength] { stroke-dasharray: 1 1; stroke-dashoffset: calc(1 - var(--d, 1)); }
.m-frame { stroke-width: 1.2; }
.m-frame rect:last-child { stroke-width: 0.5; }
.m-sea { stroke-width: 0.6; opacity: 0.55; }
.m-coast { stroke-width: 1.8; stroke-linecap: round; }
.m-river { stroke-width: 1.4; stroke-linecap: round; opacity: 0.75; }
.m-road { stroke-width: 0.9; opacity: 0.6; }
.m-runway { stroke-width: 4; opacity: 0.8; }
.m-labels text {
  font-family: var(--sc-font-text); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  fill: var(--paper-soft);
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; /* a paper halo where a line passes */
}
.m-labels .m-river-label, .m-labels .m-sea-label {
  font-family: var(--sc-font-display); font-style: italic; text-transform: none; letter-spacing: 0.02em; font-size: 14px;
}
.m-compass path { fill: var(--paper-ink); }
.m-pin__label {
  font-family: var(--sc-font-display); font-style: italic; font-size: 22px; fill: var(--paper-ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: 5px; stroke-linejoin: round;
}
.m-pin__drop { transform-box: fill-box; transform-origin: center; }
.mapcard figcaption {
  margin-top: 0.4rem; text-align: right;
  font-family: var(--sc-font-display); font-style: italic; font-size: 0.85rem; color: var(--paper-soft);
}

/* A hydrangea tucked behind a corner of a card, so the painted world carries
   on past the hero. It sits on the ground under the paper, never over text. */
.place, .close { overflow-x: clip; }
.tucked { position: relative; }
.tucked > :not(.tuck) { position: relative; z-index: 1; }
.tuck {
  position: absolute; z-index: 0; pointer-events: none; max-width: none; height: auto;
  width: clamp(9rem, 16vw, 15rem);
  /* The painting's paper is 252, not 255: lifted to pure white so it vanishes
     on the plain ground instead of leaving a faint rectangle. */
  filter: brightness(1.03);
  mix-blend-mode: multiply;
}
.tucked--map .tuck { right: clamp(-5rem, -5vw, -2rem); bottom: clamp(-6rem, -7vw, -3rem); rotate: 160deg; }
.tucked--reply .tuck { left: clamp(-5.5rem, -6vw, -2.5rem); bottom: clamp(-5rem, -5vw, -2.5rem); rotate: 200deg; scale: -1 1; }

/* -------------------------------------------------------------- close -- */
.close { padding: clamp(4rem, 10vh, 8rem) var(--sc-gutter) 0; }
/* The hero's wash, pooled behind the reply card only, so the ending sits in
   the same painted room while the text beside it stays on plain paper. */
.tucked--reply::before {
  content: ""; position: absolute; inset: -4rem -5rem; z-index: -1; pointer-events: none;
  background: url("/assets/wash.webp") 0 0 / 250% auto no-repeat; /* the painting's corner bloom */
  mix-blend-mode: multiply; opacity: 0.85;
  -webkit-mask-image: radial-gradient(closest-side, #000 50%, transparent);
  mask-image: radial-gradient(closest-side, #000 50%, transparent);
}
.close__grid {
  max-width: 72rem; margin-inline: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(19rem, 30rem);
  gap: clamp(2rem, 6vw, 6rem); align-items: center;
}
.close__title {
  margin: 0;
  font-family: var(--heading-font); font-weight: 700;
  font-size: var(--sc-t-3xl); line-height: 1; letter-spacing: -0.015em; text-wrap: balance;
}
.close__title + .close__lede { margin-top: var(--sc-6); }
.close__lede { margin-block: 0; font-size: var(--sc-t-lg); line-height: 1.45; }
.close__body { margin-block-end: 0; color: var(--sc-ink-soft); max-width: 40ch; text-wrap: pretty; }
.close__count {
  margin: 0; padding-top: 0.5rem;
  font-family: var(--sc-font-display); font-style: italic; color: var(--sc-accent); font-size: var(--sc-t-lg);
  font-variant-numeric: lining-nums;
}

.reply {
  position: relative;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  background: linear-gradient(160deg, #ffffff, var(--paper) 50%, #f5f7fa);
  color: var(--paper-ink);
  border-radius: 2px;
  rotate: -1deg;
  box-shadow: var(--sc-e3);
}
/* A tilted form blurs its text: the card only leans when there is nothing to fill in. */
.reply:has(form) { rotate: 0deg; }
.reply :focus-visible { outline-color: var(--press); }
.reply__seal {
  position: absolute; top: -1.8rem; right: -1.4rem; width: 5.6rem; height: 5.6rem;
  opacity: 0; pointer-events: none;
  filter: drop-shadow(2px 4px 3px hsl(var(--sc-shadow-color) / 0.45));
}
.is-sealed .reply__seal { opacity: 1; transform: rotate(-8deg); }
.reply__body > * + * { margin-top: 1rem; }
.reply__body p { margin: 0; }
.reply__kicker { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.28em; text-transform: uppercase; color: var(--paper-soft); }
.reply__body > .reply__title {
  margin-top: 0.5rem;
  font-family: var(--sc-font-display); font-style: italic; font-size: var(--sc-t-xl); line-height: 1.15;
}
.reply__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.25rem; padding-top: 0.5rem; }
.reply .link { color: var(--press); }
.reply__note { font-size: var(--sc-t-sm); color: var(--paper-soft); }
.reply__body > [hidden] { display: none; }
.reply__body > .reply__change { margin-top: 1.75rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 2.9rem; padding: 0.75rem 1.35rem;
  border: 0; border-radius: var(--r);
  background: var(--press); color: var(--paper);
  font-weight: 500; font-size: 0.95rem; letter-spacing: 0.02em; text-decoration: none; white-space: nowrap;
  cursor: pointer;
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.2) inset, 0 2px 6px -2px hsl(var(--sc-shadow-color) / 0.45);
  transition: background-color var(--sc-d-fast) var(--sc-ease-out), transform var(--sc-d-fast) var(--sc-ease-out);
}
.btn:hover { background: var(--press-deep); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.55; cursor: progress; }

/* ---------------------------------------------------------------- form -- */
.form { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
.field { display: grid; gap: 0.35rem; }
.field__label { font-size: var(--sc-t-sm); color: var(--paper-soft); }
.field__label em { font-style: normal; }
.field input, .field textarea {
  width: 100%; padding: 0.55rem 0.1rem;
  border: 0; border-bottom: 1px solid var(--paper-soft); /* the only edge of the field: 5.4:1 */
  border-radius: 0; background: transparent; color: var(--paper-ink);
  font-size: 1rem; /* 16px floor: below it iOS zooms on focus */
  transition: border-color var(--sc-d-fast) var(--sc-ease-out);
}
.field textarea {
  resize: vertical; min-height: 4.5rem; padding: 0.55rem 0.7rem;
  border: 1px solid var(--paper-soft); border-radius: var(--r);
}
.field ::placeholder, .field input::placeholder { color: var(--paper-soft); opacity: 1; }
/* Transparent, not none: forced-colors mode paints it, so the ring survives High Contrast. */
.field input:focus, .field textarea:focus { outline: 2px solid transparent; border-bottom-color: var(--press); box-shadow: 0 1px 0 var(--press); }
.field textarea:focus { border-color: var(--press); box-shadow: 0 0 0 1px var(--press); }
.form__error { margin: 0; color: var(--error); font-size: var(--sc-t-sm); font-weight: 500; }
/* Kept in the accessibility tree while empty so its first message is announced. */
.form__error:empty { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.guest { border: 0; margin: 0; padding: 1rem 0 0; border-top: 1px solid color-mix(in oklab, var(--paper-ink) 14%, transparent); display: grid; gap: 0.6rem; }
.guest:first-child { border-top: 0; padding-top: 0; }
.guest + .guest { margin-top: 1rem; }
/* Floated, the legend leaves the border, so the rule sits above the name with
   the padding between them instead of running through it. */
.guest__name { float: left; width: 100%; padding: 0; font-family: var(--sc-font-display); font-style: italic; font-size: 1.3rem; }
.guest__name small { font-family: var(--sc-font-text); font-style: normal; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-soft); margin-left: 0.5rem; }
/* As many columns as fit whole answers; one column once they don't. */
.guest__choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0.5rem; }
.choice {
  position: relative; display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0.45rem 0.9rem;
  border: 1px solid color-mix(in oklab, var(--paper-ink) 25%, transparent); border-radius: var(--r);
  cursor: pointer; font-size: 0.95rem;
  transition: background-color var(--sc-d-fast) var(--sc-ease-out), border-color var(--sc-d-fast) var(--sc-ease-out);
}
.choice input { accent-color: var(--press); margin: 0; width: 1rem; height: 1rem; }
.choice:has(input:checked) { border-color: var(--press); background: rgb(199 216 234 / 0.45); }
.choice:has([aria-invalid="true"]) { border-color: var(--error); box-shadow: inset 0 0 0 1px var(--error); }
.choice:has(:focus-visible) { outline: 2px solid var(--press); outline-offset: 2px; }
.choice input:focus-visible { outline: 2px solid transparent; } /* the label carries the ring; forced colors paints this one too */
.guest__diet[hidden] { display: none; }

.summary { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; gap: 0.4rem; }
.summary li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px dotted color-mix(in oklab, var(--paper-ink) 25%, transparent); padding-bottom: 0.35rem; }
.summary span:last-child { color: var(--paper-soft); font-style: italic; font-family: var(--sc-font-display); }

/* ------------------------------------------------------------- footer -- */
.foot {
  max-width: 72rem; margin: clamp(4rem, 10vh, 7rem) auto 0;
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.5rem 0 calc(1.5rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--sc-hairline);
  font-size: var(--sc-t-sm); color: var(--sc-ink-soft);
}
.foot__mark { font-family: var(--sc-font-display); font-style: italic; font-size: 1.1rem; color: var(--sc-ink); }

/* ------------------------------------------------------------- phones -- */
@media (max-width: 860px) {
  :root { --card-w: min(30rem, 86vw, calc(64svh * 0.7)); }
  .hush {
    left: 0; right: 0; width: auto; text-align: center;
    top: calc(50% - var(--card-w) * 0.7 - 3.6rem);
    font-size: var(--sc-t-lg);
  }
  .sprig { width: clamp(8rem, 36vw, 12rem); }
  /* Portrait gets the same painting turned a quarter, so its corner blooms
     land in the phone's corners instead of being cropped away. */
  .leaves { background-image: url("/assets/wash-m.webp"); }
  .sprig--a { left: -1.5rem; top: calc(50% - var(--card-w) * 0.7 - 4.5rem); rotate: -20deg; }
  .sprig--b { left: auto; right: -1.5rem; top: calc(50% + var(--card-w) * 0.35); }
  .vellum { width: calc(var(--card-w) + 2rem); }
  .place__grid, .close__grid { grid-template-columns: minmax(0, 1fr); }
  .mapcard { rotate: 0.6deg; margin-inline: calc(var(--sc-gutter) * -0.5); }
  /* The phone crop shows the middle of the sheet, so the outer towns go and the
     rest of the lettering grows to stay above 11px on screen. */
  .m-labels .m-far { display: none; }
  .m-labels text { font-size: 19px; }
  .m-labels .m-river-label, .m-labels .m-sea-label { font-size: 21px; }
  .m-pin__label { font-size: 30px; stroke-width: 7px; }
  .plate { inset: -9% 0; }
  .reply { rotate: 0deg; }
  .reply__seal { right: -0.4rem; width: 4.6rem; height: 4.6rem; }
  .tucked--reply::before { inset: -1.5rem -2rem -3rem; background-image: url("/assets/wash-m.webp"); background-size: 200% auto; }
  .tuck { width: clamp(7rem, 30vw, 10rem); }
  .tucked--map .tuck { right: -1.75rem; bottom: -3rem; }
  .tucked--reply .tuck { left: -1.75rem; bottom: -2.5rem; }
}

/* ----------------------------------------------------- reduced motion -- */
/* Short phones: the quiet line moves under the card instead of under the bar. */
@media (max-width: 860px) and (max-height: 700px) {
  .hush { top: calc(50% + var(--card-w) * 0.7 + 1rem); }
}

@media (prefers-reduced-motion: reduce) {
  .leaves { animation: none; }
  /* The vellum never slides off here, so it waits under the card instead,
     smaller, with the guest's name still on it. The card shrinks to make room. */
  :root { --card-w: min(30rem, 84vw, max(calc(62svh * 0.7), 14rem)); }
  /* Card and band are centred as one group (the band adds ~4rem below), so
     on a short window the band doesn't drop off the stage's lower edge. */
  .card { translate: 0 -2rem; }
  .vellum {
    z-index: 8; min-height: 0; padding-block: 0.6rem; opacity: 1;
    translate: 0 calc(var(--card-w) * 0.7 + 0.6rem);
  }
  .vellum p { grid-auto-flow: column; align-items: baseline; gap: 0.6rem; }
  .vellum__name { font-size: clamp(1.1rem, calc(var(--card-w) * 0.06), 1.6rem); }
}
