/* Jason & Jasmine — wedding site
   Mobile first, with an iOS feel: system text, soft rounded corners, grouped form rows,
   a segmented control and a frosted tab bar. Wider screens are layered on with min-width queries. */

/* ---------- tokens ---------- */
:root {
  /* colours taken from the engagement photographs and the monogram */
  --bg: #f1efec;          /* the overcast sky: the page */
  --card: #fcfbf9;        /* grouped rows sit on this */
  --fill: #e5e1db;        /* segmented control and stepper track */
  --ink: #2a201b;         /* his trousers */
  --ink-soft: #6b625b;    /* secondary labels */
  --ink-faint: #9a918a;   /* placeholders */
  --separator: rgba(60, 45, 35, 0.16);
  --gold: #b8924f;        /* the monogram foil: focus and selection */
  --error: #b3261e;
  --bar: rgba(250, 249, 247, 0.8);

  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Literata", Georgia, "Times New Roman", serif;

  --step-small: 0.8125rem;   /* 13px: footnotes and row labels */
  --step-body: 1.0625rem;    /* 17px: iOS body */
  --step-lead: clamp(1.125rem, 1.05rem + 0.4vw, 1.375rem);
  --step-head: clamp(2.25rem, 1.8rem + 2vw, 3.5rem);
  --step-display: clamp(3.25rem, 1.6rem + 8vw, 7.5rem);

  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 24px;

  --margin: clamp(1rem, 4vw, 3rem);
  --section: clamp(4.5rem, 3.5rem + 7vw, 9rem);
  --tabbar-h: 3.25rem;
  --tabbar-space: calc(var(--tabbar-h) + env(safe-area-inset-bottom));

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --ease-exit: cubic-bezier(0.55, 0.055, 0.675, 0.19);
  --spring: cubic-bezier(0.32, 0.72, 0, 1); /* the iOS sheet curve */

  interpolate-size: allow-keywords;
  color-scheme: light;
}

/* ---------- page to page: content crossfades, the tab bar stays put ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-leave 200ms var(--ease-exit) both; }
::view-transition-new(root) { animation: vt-arrive 380ms var(--spring) 40ms both; }
::view-transition-group(mark) { animation-duration: 520ms; animation-timing-function: var(--spring); }
::view-transition-old(tabbar), ::view-transition-new(tabbar) { animation: none; }
/* the highlight behind the current tab slides to the tab just chosen */
::view-transition-group(tab-pill) { animation-duration: 420ms; animation-timing-function: var(--spring); }
@keyframes vt-leave { to { opacity: 0; } }
@keyframes vt-arrive { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: var(--step-body);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, p, figure, ul, dl, dd { margin: 0; }
ul[class] { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
a, button, label, input, textarea { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--gold); color: var(--ink); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; line-height: 1.05; text-wrap: balance; }
p { text-wrap: pretty; }
.nums { font-variant-numeric: tabular-nums lining-nums; }
.small { font-size: var(--step-small); line-height: 1.4; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip {
  position: absolute; left: var(--margin); top: calc(env(safe-area-inset-top) + 0.75rem); z-index: 30;
  padding: 0.6rem 1rem; border-radius: var(--radius-sm);
  background: var(--ink); color: var(--bg); text-decoration: none;
  transform: translateY(-300%);
}
.skip:focus-visible { transform: none; }

/* ---------- controls ---------- */
.pill-button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 1.5rem;
  border-radius: var(--radius);
  background: var(--ink); color: var(--bg);
  font-size: var(--step-body); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--spring), opacity 160ms ease;
}
.pill-button:active { transform: scale(0.97); opacity: 0.85; }
.pill-button:disabled { opacity: 0.55; cursor: default; }
.pill-button--block { width: 100%; }
.text-button {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: 0 0.5rem;
  color: var(--ink); font-weight: 500; text-decoration: none;
  transition: opacity 160ms ease;
}
.text-button:active { opacity: 0.5; }
.link {
  text-decoration: underline; text-underline-offset: 0.25em; text-decoration-thickness: 0.06em;
  text-decoration-color: color-mix(in oklab, currentColor 45%, transparent);
  transition: text-decoration-color 180ms ease, opacity 160ms ease;
}
.link:active { opacity: 0.6; }
@media (hover: hover) and (pointer: fine) {
  .pill-button:not(:disabled):hover { opacity: 0.88; }
  .text-button:hover { opacity: 0.7; }
  .link:hover { text-decoration-color: currentColor; }
}

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: repeat(3, 1fr);
  height: var(--tabbar-space); padding-bottom: env(safe-area-inset-bottom);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 -0.5px 0 var(--separator);
  view-transition-name: tabbar;
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.15rem;
  color: #8e867f; text-decoration: none;
  font-size: 0.6875rem; font-weight: 500; letter-spacing: 0.01em;
  transition: color 180ms ease, transform 160ms var(--spring);
}
.tabbar__item svg { width: 1.6rem; height: 1.6rem; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.tabbar__item[aria-current="page"] { color: var(--ink); }
.tabbar__item[aria-current="page"] svg { fill: color-mix(in oklab, var(--ink) 12%, transparent); }
.tabbar__item:active { transform: scale(0.92); }
.tabbar__item:focus-visible { outline-offset: -4px; border-radius: var(--radius-sm); }
.tabbar__item { position: relative; isolation: isolate; }
.tabbar__pill {
  position: absolute; z-index: -1;
  inset: 0.3rem calc(50% - 2.4rem);
  border-radius: var(--radius);
  background: rgba(42, 32, 27, 0.08);
  view-transition-name: tab-pill;
}
.has-tabbar { padding-bottom: var(--tabbar-space); }

/* wider screens: the bar floats as a pill at the bottom centre */
@media (min-width: 48em) {
  .tabbar {
    inset: auto auto calc(env(safe-area-inset-bottom) + 1.25rem) 50%;
    translate: -50% 0;
    height: auto; padding: 0.3rem;
    grid-template-columns: repeat(3, auto); gap: 0.2rem;
    border-radius: 999px;
    box-shadow: 0 0 0 0.5px var(--separator), 0 8px 30px rgba(42, 32, 27, 0.12);
  }
  .tabbar__item { flex-direction: row; gap: 0.45rem; padding: 0.55rem 1.1rem; border-radius: 999px; font-size: 0.875rem; }
  .tabbar__item svg { width: 1.2rem; height: 1.2rem; }
  .tabbar__pill { inset: 0; border-radius: 999px; }
  .has-tabbar { padding-bottom: 6rem; }
}
@media (min-width: 48em) and (hover: hover) and (pointer: fine) {
  .tabbar__item:not([aria-current="page"]):hover { color: var(--ink); }
}

/* ---------- password page ---------- */
.gate-page { background: #3b3a36; }
.gate { position: relative; height: 100svh; min-height: 34rem; overflow: clip; display: grid; place-items: center; }
.gate__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
.gate__sheet {
  position: absolute;
  left: var(--margin); right: var(--margin); bottom: calc(env(safe-area-inset-bottom) + var(--margin));
  max-width: 24rem; margin-inline: auto;
  padding: 1.75rem 1.25rem 1.25rem;
  border-radius: 28px;
  background: rgba(250, 249, 247, 0.84);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 10px 40px rgba(20, 15, 10, 0.18);
  text-align: center;
}
.gate__mark { width: 2.75rem; margin-inline: auto; }
.gate__title { margin-top: 0.75rem; font-size: 2.25rem; }
.gate__date { margin-top: 0.25rem; color: var(--ink-soft); }

/* "Enter now" opens the password box inside the same card, iOS-sheet style */
.gate__open {
  display: none;
  margin: 1.1rem auto 0; min-height: 2.75rem; padding: 0 1rem;
  align-items: center; gap: 0.4rem;
  color: var(--ink); font-size: var(--step-body); font-weight: 600;
  transition: opacity 200ms ease, transform 160ms var(--spring);
}
.gate__open:active { transform: scale(0.96); opacity: 0.6; }
.gate__open span { display: inline-block; transition: transform 200ms var(--spring); }
@media (hover: hover) and (pointer: fine) { .gate__open:hover span { transform: translateX(3px); } }
.js .gate__open { display: inline-flex; }
.js .gate__panel { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 520ms var(--spring), opacity 320ms ease 80ms; }
.js .gate__sheet.is-open .gate__panel { grid-template-rows: 1fr; opacity: 1; }
.js .gate__sheet.is-open .gate__open { display: none; }
.gate__panel-inner { min-height: 0; overflow: hidden; }
.gate__form { padding-top: 1.5rem; display: grid; gap: 0.625rem; }
.gate__input {
  width: 100%; min-height: 3.25rem; padding: 0 1rem;
  border: 0; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  font-size: var(--step-body); text-align: center;
  transition: box-shadow 180ms ease;
}
.gate__input::placeholder { color: var(--ink-faint); }
.gate__input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.gate__input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--error); }
.gate__error { color: var(--error); font-size: var(--step-small); font-weight: 500; }
.gate__form.is-shaking { animation: shake 420ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }

/* landscape: the photo fills the screen, framed from the treeline down so their faces sit in the upper third */
@media (min-width: 48em) and (min-aspect-ratio: 1/1) {
  .gate__img { object-position: 50% 30%; }
  .gate__sheet { left: 50%; right: auto; translate: -50% 0; width: 24rem; margin: 0; bottom: clamp(2.5rem, 7vh, 4rem); padding: 1.75rem 1.75rem 1.5rem; }
}

/* ---------- home: the ring stays put; one screen holds still while the scroll opens the envelope ---------- */
.backdrop { position: fixed; inset: 0; z-index: 0; height: 100lvh; background: #e9e9ea; overflow: hidden; }
.backdrop__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 0%; }
/* darkens behind the card as it comes out, the way iOS dims behind a sheet; site.js sets --dim */
.backdrop__dim { position: absolute; inset: 0; background: #140f0b; opacity: calc(var(--dim, 0) * 0.38); }
.has-tabbar.is-home { padding-bottom: 0; }

/* the track is the scroll distance; the stage sticks to the screen for all of it */
.track { position: relative; z-index: 1; height: 260svh; }
.stage { position: sticky; top: 0; height: 100svh; min-height: 20rem; overflow: clip; }
.hero { position: absolute; inset: 0; }
.hero__text { position: relative; padding: calc(env(safe-area-inset-top) + clamp(1.5rem, 4vh, 2.75rem)) var(--margin) 0; }
.hero__title { font-size: var(--step-display); line-height: 0.98; letter-spacing: -0.03em; max-width: 8ch; }
.hero__date { margin-top: 0.75rem; font-family: var(--serif); font-size: var(--step-lead); }
.hero__cue {
  position: absolute; left: 50%; bottom: calc(var(--tabbar-space) + 1.25rem);
  translate: -50% 0;
  display: inline-flex; align-items: center; gap: 0.5rem;
  min-height: 2.75rem; padding: 0 1.25rem;
  border-radius: 999px;
  background: rgba(250, 249, 247, 0.75);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  color: var(--ink); font-size: 0.9375rem; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: transform 160ms var(--spring);
}
.hero__cue:active { transform: scale(0.96); }
.hero__arrow { display: inline-block; }
@media (min-width: 48em) { .hero__cue { bottom: 6.5rem; } }
/* the names and the cue fade as the envelope comes up; site.js sets --fade */
[data-fade] { opacity: calc(1 - var(--fade, 0)); }
.js .hero__cue { pointer-events: var(--cue-events, auto); }

/* phones, tablets and square windows get the portrait crop: the words sit in the open sky, top left */
@media (max-aspect-ratio: 1/1) {
  .backdrop__img { object-position: 30% 50%; }
}
/* landscape: the top-left of the frame is open sky, above her hair */
@media (min-aspect-ratio: 1/1) {
  .hero__text { padding-top: calc(env(safe-area-inset-top) + clamp(1.5rem, 4.5vh, 2.75rem)); }
  .hero__title { font-size: clamp(2.5rem, 0.5rem + 4.4vw, 5.5rem); }
  .hero__date { margin-top: 0.6rem; }
}
/* a phone held sideways: little height, so the words go small */
@media (min-aspect-ratio: 1/1) and (max-height: 30em) {
  .hero__text { padding-top: calc(env(safe-area-inset-top) + 1rem); padding-left: max(var(--margin), env(safe-area-inset-left)); }
  .hero__title { font-size: clamp(2rem, 9vh, 3rem); }
  .hero__date { margin-top: 0.4rem; font-size: var(--step-body); }
}

/* ---------- home: the reply card, drawn out of an envelope by the scroll ---------- */
:root { --env-h: 11rem; }   /* envelope height: on phones it rests just above the tab bar, on wider screens it runs behind it */
@media (min-width: 48em) { :root { --env-h: 14rem; } }
.reply { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--margin) calc(var(--tabbar-space) - 1.5rem); }
@media (min-width: 48em) { .reply { padding-bottom: 0; } }
.scene {
  --env-o: calc(var(--env-h) * 0.4);   /* how far the card sits down inside it */
  /* site.js drives these from the scroll (0 = sealed, 1 = card all the way out); without script it shows open */
  --rise: 1; --flap: 1; --card: 1; --flap-z: 0; --fit: 1;
  position: relative; width: 100%; max-width: 34rem; margin: 0 auto;
  /* --rise brings it up from below the screen before it opens */
  transform: translateY(calc((1 - var(--rise)) * (var(--env-h) + 3rem))) scale(var(--fit)); transform-origin: bottom center;
}
.modal {
  position: relative; z-index: 2;
  margin-inline: 0.75rem;
  padding: 1.75rem 1.1rem calc(var(--env-o) + 1rem);
  border-radius: 28px;
  background: #faf9f7;
  box-shadow: 0 -8px 40px rgba(20, 15, 10, 0.18);
  text-align: center;
  transform: translateY(calc((100% - var(--env-o)) * (1 - var(--card))));
}
.reply__mark { width: 3rem; margin-inline: auto; view-transition-name: mark; }
.reply h2 { margin-top: 1rem; font-size: clamp(2rem, 1.7rem + 1.5vw, 2.75rem); }
.reply__lede { margin: 0.6rem auto 0; max-width: 28ch; color: var(--ink-soft); }
.reply__actions { margin-top: 1.25rem; display: grid; gap: 0.25rem; justify-items: center; }
.reply__actions .pill-button { margin-bottom: 0.4rem; }
.reply__count { color: var(--ink-soft); min-height: 1.4em; }

/* the envelope: back, flap and front pocket; no stacking context of its own, so the card slots between them */
.envelope { position: relative; height: var(--env-h); margin-top: calc(var(--env-o) * -1); }
.envelope__back { position: absolute; inset: 0; z-index: 1; background: #d9d0c3; border-radius: 8px 8px 0 0; }
.envelope__flap {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--env-h) * 0.62); z-index: var(--flap-z);
  transform-origin: top center;
  /* 0deg is sealed, pointing down over the pocket; 180deg is folded back, pointing up behind the card */
  transform: perspective(1200px) rotateX(calc(var(--flap) * 180deg));
  background: #e8e0d4;
  filter: brightness(calc(1 - var(--flap) * 0.09));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* the wax seal sits over the tip of the closed flap and lifts away as the flap starts to open */
.envelope__seal {
  position: absolute; z-index: 5; left: 50%; top: calc(var(--env-h) * 0.62);
  width: clamp(4.25rem, 3.5rem + 2.5vw, 5.5rem); height: auto;
  translate: -50% -62%;
  transform: scale(calc(1 + var(--flap) * 0.25));
  opacity: calc(1 - var(--flap) * 3);
  pointer-events: none;
}
.envelope__front { position: absolute; inset: 0; z-index: 3; filter: drop-shadow(0 -1px 3px rgba(40, 28, 20, 0.14)); }
.envelope__pocket { position: absolute; inset: 0; background: #ece5da; clip-path: polygon(0 0, 50% 35%, 100% 0, 100% 100%, 0 100%); }
.envelope__pocket::after { content: ""; position: absolute; inset: 0; background: #f2ece3; clip-path: polygon(0 100%, 50% 30%, 100% 100%); }

@media (min-width: 48em) {
  .scene { max-width: 42rem; }
  .modal { margin-inline: 4.5rem; padding: 2.25rem 2rem calc(var(--env-o) + 1.25rem); }
}

/* an iOS inset grouped list */
.list {
  margin-top: 1.5rem; width: 100%;
  background: rgba(42, 32, 27, 0.05); border-radius: var(--radius); overflow: hidden; text-align: left;
}
.list__row { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.9rem; padding: 0.7rem 1rem; }
.list__row + .list__row::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--separator); }
.list dt { color: var(--ink); }
.list dd { color: var(--ink-soft); text-align: right; white-space: nowrap; }
@media (max-width: 26em) { .list { font-size: 0.9375rem; } .list__row { padding-inline: 0.85rem; } }

/* ---------- rsvp and contact pages ---------- */
.split__photo { display: none; margin: 0; }
.page { max-width: 30rem; margin: 0 auto; padding: calc(env(safe-area-inset-top) + clamp(2rem, 6vw, 3.5rem)) var(--margin) 2.5rem; }
.page__head, .page__thanks { text-align: center; }
.page h1 { margin-top: 1rem; font-size: var(--step-head); }
.page__lede { margin: 0.75rem auto 0; max-width: 30ch; color: var(--ink-soft); }
.page__head .reply__mark { view-transition-name: mark; }
.page__thanks .reply__mark { view-transition-name: none; }
.page__thanks:focus { outline: none; }
.page [data-state] { animation: vt-arrive 480ms var(--spring) backwards; }

/* wide screens: a rounded photograph beside the form */
@media (min-width: 64em) {
  .split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--margin); padding-inline: 1rem var(--margin); }
  .split__photo {
    display: block; position: sticky; top: 1rem;
    height: calc(100svh - 2rem); margin-block: 1rem;
    border-radius: 28px; overflow: hidden; background: var(--fill);
  }
  .split__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
  .split .page { width: 100%; align-self: start; padding-top: clamp(3rem, 8vh, 6rem); }
}

/* the contact form's spam trap, kept off screen */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__error--send { text-align: center; }

/* the sign out button at the foot of the contact page */
.sign-out { margin-top: 3rem; padding-top: 1.5rem; display: flex; justify-content: center; box-shadow: 0 -0.5px 0 var(--separator); }
.sign-out__button { color: var(--error); font-weight: 500; }

/* ---------- forms: iOS grouped rows ---------- */
.form { margin-top: 2.25rem; display: grid; gap: 1.75rem; }
.form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.form__section { display: grid; gap: 0.4rem; }
.form legend { padding: 0 1rem; margin-bottom: 0.5rem; font-size: var(--step-small); color: var(--ink-soft); }
.form__hint, .form__error { padding: 0 1rem; font-size: var(--step-small); }
.form__hint { color: var(--ink-soft); }
.form__error { color: var(--error); font-weight: 500; }

.group { background: var(--card); border-radius: var(--radius); overflow: hidden; }
.group:empty { display: none; }
.form__item { position: relative; display: grid; gap: 0.1rem; padding: 0.65rem 1rem 0.7rem; transition: box-shadow 180ms ease; }
.form__item + .form__item::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--separator); }
.form__item label, .form__item .label { font-size: var(--step-small); color: var(--ink-soft); }
.form__item:focus-within label { color: var(--ink); }
.form__item:has(.input:focus-visible) { box-shadow: inset 3px 0 0 var(--gold); }
.form__item--inline { grid-template-columns: 1fr auto; align-items: center; gap: 1rem; min-height: 3.25rem; }
.form__item--inline .label { font-size: var(--step-body); color: var(--ink); }

.input {
  width: 100%; min-height: 1.9rem; padding: 0;
  border: 0; border-radius: 0; background: transparent;
  font-size: max(16px, var(--step-body)); line-height: 1.4;
}
.input::placeholder { color: var(--ink-faint); }
.input:focus-visible { outline: none; }
textarea.input { resize: vertical; min-height: 5.5rem; padding-top: 0.2rem; }
.form__item:has(.input[aria-invalid="true"]) { box-shadow: inset 3px 0 0 var(--error); }

/* segmented control */
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; padding: 2px; border-radius: var(--radius-sm); background: var(--fill); }
.segmented__option { position: relative; display: block; cursor: pointer; }
.segmented__option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.segmented__option span {
  display: flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0.4rem 0.5rem;
  border-radius: 8px; font-size: 0.9375rem; font-weight: 500; text-align: center; color: var(--ink-soft);
  transition: background-color 220ms var(--spring), color 220ms ease, box-shadow 220ms ease, transform 160ms var(--spring);
}
.segmented__option:active span { transform: scale(0.97); }
.segmented__option input:checked + span { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04); }
.segmented__option input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 1px; }

/* the attending questions open only after "Joyfully accepts"; closed, they give back the form's row gap */
.reveal-group { display: grid; grid-template-rows: 0fr; margin-top: -1.75rem; opacity: 0; transition: grid-template-rows 480ms var(--spring), margin-top 480ms var(--spring), opacity 360ms ease; }
.reveal-group.is-open { grid-template-rows: 1fr; margin-top: 0; opacity: 1; }
.reveal-group__inner { overflow: hidden; min-height: 0; display: grid; gap: 1.75rem; }
.reveal-group.is-open .reveal-group__inner { overflow: visible; }

/* stepper */
.stepper { display: inline-grid; grid-template-columns: 2.75rem 2.25rem 2.75rem; align-items: center; border-radius: var(--radius-sm); background: var(--fill); }
.stepper__btn { height: 2.25rem; font-size: 1.25rem; line-height: 1; border-radius: var(--radius-sm); transition: background-color 160ms ease, transform 160ms var(--spring); }
.stepper__btn:active { background: rgba(42, 32, 27, 0.1); transform: scale(0.94); }
.stepper__btn:disabled { color: #b5aca4; cursor: default; }
.stepper__value { text-align: center; font-weight: 600; }
.guests .form__item { animation: rise 420ms var(--spring) backwards; }

.stub { font-family: var(--serif); font-style: italic; text-align: center; color: var(--ink); font-size: var(--step-body); line-height: 1.5; }
.stub.is-blank { color: var(--ink-soft); }
.page__thanks .stub { margin-top: 1.75rem; }
.thanks__actions { margin-top: 2.25rem; display: grid; justify-items: center; gap: 0.75rem; }

/* ---------- admin dashboard ---------- */
.admin-bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(env(safe-area-inset-top) + 0.5rem) var(--margin) 0.5rem;
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--separator);
}
.admin-bar__mark { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.admin-bar__mark img { width: 1.5rem; }
.admin-bar__out { color: var(--error); }
.admin { max-width: 64rem; margin: 0 auto; padding: 1.5rem var(--margin) 4rem; }
.admin__head h1 { font-size: var(--step-head); }
.admin__lede { margin-top: 0.4rem; color: var(--ink-soft); }
.admin__note { margin-top: 0.75rem; display: inline-block; padding: 0.35rem 0.7rem; border-radius: 999px; background: rgba(184, 146, 79, 0.16); color: #6b5226; }

.tiles { margin-top: 1.5rem; display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.tile { display: grid; gap: 0.15rem; padding: 1rem; border-radius: var(--radius); background: var(--card); }
.tile__value { font-family: var(--serif); font-size: 2.25rem; line-height: 1.05; }
.tile__label { font-size: var(--step-small); color: var(--ink-soft); }

.admin__controls { margin-top: 1.75rem; display: grid; gap: 0.75rem; }
.admin__switch { margin: 0; border: 0; min-width: 0; }
.admin__switch b { font-weight: 500; color: var(--ink-soft); margin-left: 0.2rem; }
.search { position: relative; display: block; }
.search svg { position: absolute; left: 0.7rem; top: 50%; translate: 0 -50%; width: 1.1rem; height: 1.1rem; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; }
.search__input {
  width: 100%; min-height: 2.5rem; padding: 0 0.85rem 0 2.25rem;
  border: 0; border-radius: var(--radius-sm); background: var(--fill);
  font-size: max(16px, var(--step-body));
}
.search__input::placeholder { color: var(--ink-faint); }
.search__input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.admin__lists { margin-top: 1.25rem; display: grid; gap: 1.5rem; align-items: start; }
.admin__panel { display: none; }
.admin__panel.is-shown { display: block; }
.admin__panel-title { margin: 0 0 0.5rem 1rem; font-family: var(--ui); font-size: var(--step-small); font-weight: 400; color: var(--ink-soft); letter-spacing: 0; }
.admin__empty { padding: 1rem; color: var(--ink-soft); }

.admin-row { position: relative; }
.admin-row + .admin-row::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--separator); }
.admin-row summary {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  min-height: 3.5rem; padding: 0.6rem 2.25rem 0.6rem 1rem; position: relative;
  list-style: none; cursor: pointer;
  transition: background-color 160ms ease;
}
.admin-row summary::-webkit-details-marker { display: none; }
.admin-row summary::after {
  content: ""; position: absolute; right: 1rem; top: 50%; width: 0.5rem; height: 0.5rem;
  border-right: 2px solid var(--ink-faint); border-bottom: 2px solid var(--ink-faint);
  transform: translateY(-70%) rotate(45deg); transition: transform 240ms var(--spring);
}
.admin-row[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.admin-row summary:active { background: rgba(42, 32, 27, 0.05); }
.admin-row summary:focus-visible { outline-offset: -3px; }
.admin-row__main { display: grid; min-width: 0; }
.admin-row__main b { font-weight: 600; }
.admin-row__main span { font-size: var(--step-small); color: var(--ink-soft); }
.admin-row__preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row__date { flex: none; font-size: var(--step-small); color: var(--ink-soft); }
.status { flex: none; padding: 0.2rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status--yes { background: var(--ink); color: var(--bg); }
.status--no { background: var(--fill); color: var(--ink-soft); }
.admin-row__body { margin: 0; padding: 0 1rem 0.9rem; display: grid; gap: 0.5rem; }
.admin-row__detail { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; font-size: 0.9375rem; }
.admin-row__detail dt { color: var(--ink-soft); }
.admin-row__detail dd { margin: 0; overflow-wrap: anywhere; }
.admin-row::details-content { block-size: 0; overflow: hidden; transition: block-size 320ms var(--ease-out), content-visibility 320ms allow-discrete; }
.admin-row[open]::details-content { block-size: auto; }
@media (hover: hover) and (pointer: fine) { .admin-row summary:hover { background: rgba(42, 32, 27, 0.04); } }

@media (min-width: 48em) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .admin__controls { grid-template-columns: 1fr minmax(0, 20rem); align-items: center; }
}
/* wide screens: both lists side by side, so the switch is not needed */
@media (min-width: 64em) {
  .admin__switch { display: none; }
  .admin__controls { grid-template-columns: minmax(0, 22rem); justify-content: end; }
  .admin__lists { grid-template-columns: 1fr 1fr; }
  .admin__panel { display: block; }
}

/* ---------- motion: content stays visible without script ---------- */
@media (prefers-reduced-motion: no-preference) {
  .backdrop__img, .gate__img { animation: settle 2400ms var(--ease-soft) both; }
  .hero__arrow { animation: bob 2200ms ease-in-out 1800ms infinite; }
  .js [data-rise] { animation: rise 900ms var(--spring) backwards; animation-delay: calc(var(--i, 0) * 100ms + 200ms); }
  .js [data-reveal] { opacity: 0; transform: translateY(20px); transition: opacity 700ms var(--ease-out), transform 900ms var(--spring); transition-delay: calc(var(--i, 0) * 80ms); }
  .js [data-reveal].is-in { opacity: 1; transform: none; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes settle { from { transform: scale(1.06); opacity: 0.6; } }
@keyframes bob { 0%, 100% { transform: none; } 50% { transform: translateY(4px); } }
