/* 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; }
[hidden] { display: none !important; }
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(4, 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(4, 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); }
}

/* ---------- phones: a menu button instead of the tab bar ---------- */
.menu-toggle, .menu { display: none; }
@media (max-width: 47.99em) {
  /* with script the tab bar gives way to the menu; without it the tab bar stays as the fallback */
  .js .tabbar { display: none; }
  .js .has-tabbar { padding-bottom: calc(env(safe-area-inset-bottom) + 1.5rem); }
  .js .has-tabbar.is-home { padding-bottom: 0; }
  /* "Kindly reply" rises with the screen's height as the login card does (--bottom-lift), and the envelope's front
     grows by half as much, so it stands a little taller without crowding the card */
  .js .hero__cue { bottom: calc(100lvh - 100svh + env(safe-area-inset-bottom) + 1.5rem + var(--bottom-lift)); }
  html.js { --env-skirt: calc(100lvh - 100svh + env(safe-area-inset-bottom) + var(--bottom-lift) * 0.5); }

  .js .menu-toggle {
    display: grid; place-content: center; gap: 7px;
    position: fixed; z-index: 41;
    top: calc(env(safe-area-inset-top) + 0.75rem); right: max(var(--margin), env(safe-area-inset-right));
    width: 2.875rem; height: 2.875rem; border-radius: 999px;
    background: rgba(250, 249, 247, 0.72);
    -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 0 0 0.5px var(--separator);
    view-transition-name: menu-toggle;
    transition: transform 160ms var(--spring), background-color 200ms ease;
  }
  .menu-toggle:active { transform: scale(0.92); }
  .menu-toggle__line {
    display: block; width: 1.25rem; height: 2px; border-radius: 2px; background: var(--ink);
    transition: transform 380ms var(--spring);
  }
  /* the two lines cross into an X */
  .menu-toggle[aria-expanded="true"] .menu-toggle__line:first-child { transform: translateY(4.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle__line:last-child { transform: translateY(-4.5px) rotate(-45deg); }
  .menu-toggle[aria-expanded="true"] { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }

  .js .menu { display: none; }
  .js .menu.is-shown {
    display: flex; flex-direction: column; justify-content: space-between;
    position: fixed; z-index: 40; inset: auto 0;
    top: calc(var(--bleed-top) * -1); height: calc(100lvh + var(--bleed-top) + var(--bleed-bottom));
    padding: calc(var(--bleed-top) + env(safe-area-inset-top) + 5.5rem) var(--margin) calc(var(--bleed-bottom) + env(safe-area-inset-bottom) + 2rem);
    background: rgba(241, 239, 236, 0.86);
    -webkit-backdrop-filter: saturate(160%) blur(24px); backdrop-filter: saturate(160%) blur(24px);
    visibility: hidden; opacity: 0;
    transition: opacity 280ms ease, visibility 0s linear 280ms;
  }
  .js .menu.is-shown.is-open { visibility: visible; opacity: 1; transition: opacity 280ms ease; }
  .menu__list { display: grid; gap: 0.5rem; }
  .menu__link {
    display: flex; align-items: center; gap: 0.75rem; min-height: 3.75rem;
    font-family: var(--serif); font-size: 2.75rem; line-height: 1.1; letter-spacing: -0.02em;
    color: var(--ink-soft); text-decoration: none;
    transform: translateY(14px); opacity: 0;
    transition: transform 520ms var(--spring), opacity 400ms ease, color 180ms ease;
  }
  .menu__link[aria-current="page"] { color: var(--ink); }
  .menu__link[aria-current="page"]::after { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--gold); }
  .menu__link:active { color: var(--ink); }
  .menu.is-open .menu__link { transform: none; opacity: 1; }
  .menu.is-open li:nth-child(2) .menu__link { transition-delay: 50ms; }
  .menu.is-open li:nth-child(3) .menu__link { transition-delay: 100ms; }
  .menu__date { color: var(--ink-soft); font-size: var(--step-small); }
}
@media (max-width: 47.99em) and (prefers-reduced-motion: reduce) {
  .menu-toggle__line, .menu__link { transition: none; }
}
::view-transition-old(menu-toggle), ::view-transition-new(menu-toggle) { animation: none; }

/* ---------- password page ---------- */
.gate-page { background: #cfc6b8; }
/* how far photo backgrounds run past the screen's edges on touch screens, under the status bar and Safari's toolbar */
:root { --bleed-top: calc(env(safe-area-inset-top) + 8rem); --bleed-bottom: calc(env(safe-area-inset-bottom) + 10rem); }
/* what sits at the foot of a photo page rises with the screen's height, clear of Safari's floating toolbar:
   none on a small phone, about 6.5rem on a Pro Max */
:root { --bottom-lift: clamp(0px, (100svh - 38rem) * 0.4, 7rem); }
.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%; }
/* touch screens: Safari 26 draws the page under its status bar and toolbar only while the page is scrolled and there is
   page there; otherwise it paints the page's background colour. So the page carries a band of photo above and below
   the screen, and js/edges.js keeps it scrolled just past the top band. The photo must not be position: fixed, or
   Safari paints a solid colour there instead. */
@media (hover: none) and (pointer: coarse) {
  /* the fallback colour, before the page is scrolled into place: the sky along the photo's top edge */
  html:has(body.gate-page), .gate-page { background: #cfd1d6; }
  .gate-page { padding-block: var(--bleed-top) var(--bleed-bottom); }
  /* a pull down is js/pull.js's pull to refresh, which moves the page down by --pull */
  .gate { height: 100lvh; overflow: visible; touch-action: pinch-zoom; translate: 0 var(--pull, 0px); }
  .is-pull-settling .gate { transition: translate 320ms var(--spring); }
  .gate__img { inset: auto 0; top: calc(var(--bleed-top) * -1); height: calc(100% + var(--bleed-top) + var(--bleed-bottom)); }
  .gate__sheet { bottom: calc(100lvh - 100svh + env(safe-area-inset-bottom) + var(--margin) + var(--bottom-lift)); }
}
.gate__sheet {
  position: absolute;
  left: var(--margin); right: var(--margin); bottom: calc(env(safe-area-inset-bottom) + var(--margin) + var(--bottom-lift));
  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; overflow: hidden; }
/* touch screens ("swipe mode", set by site.js): nothing is fixed or sticky, and a swipe on the screen drives the envelope
   instead of scrolling. As on the login, the page carries a band of photo above and below the screen and js/edges.js
   keeps it scrolled just past the top band, so Safari 26 draws the photo under its status bar and toolbar. */
html.is-swipe { overscroll-behavior: none; }
html.is-swipe body.is-home { padding-block: var(--bleed-top) var(--bleed-bottom); }
html.is-swipe .backdrop { position: absolute; inset: 0 0 auto; height: calc(100lvh + var(--bleed-top) + var(--bleed-bottom)); }
/* the fallback colour, before the page is scrolled into place: the grey along the photo's top edge */
html.is-swipe:has(body.is-home), html.is-swipe body.is-home { background: #a2a1a2; }
html.is-swipe .track { height: 100lvh; }
html.is-swipe .stage { position: relative; touch-action: pinch-zoom; }
/* Safari 26 shows the page below the screen's own height under its floating toolbar, so the envelope runs on down into
   the band below (--under-bar) instead of stopping short of the bottom edge with the photo showing beneath it */
html.is-swipe { --under-bar: var(--bleed-bottom); }
html.is-swipe .stage { overflow: visible; clip-path: inset(0 0 calc(var(--under-bar) * -1) 0); }
html.is-swipe .reply { bottom: calc(var(--under-bar) * -1); }
/* pull to refresh (js/pull.js): pulling down with the envelope closed moves the page down (--pull) under a spinner */
html.is-swipe .backdrop, html.is-swipe .track { translate: 0 var(--pull, 0px); }
html.is-swipe.is-pull-settling .backdrop, html.is-swipe.is-pull-settling .track { transition: translate 320ms var(--spring); }
/* the iOS activity indicator: eight spokes that appear one by one, clockwise from the top, as the page is pulled
   (js/pull.js), then turn in steps, each fading after the one ahead lights, while the page reloads */
.pull {
  position: absolute; z-index: 5; left: 50%;
  top: calc(var(--bleed-top) + env(safe-area-inset-top) + max(0.5rem, (var(--pull, 0px) - 1.375rem) / 2));   /* below the status bar, centred in the pull */
  width: 1.375rem; height: 1.375rem; margin-left: -0.6875rem;
  color: #6d6d72;
  pointer-events: none;
}
.pull svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pull line { stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; opacity: 0; }
.is-pull-settling .pull line { transition: opacity 200ms ease; }
.pull.is-spinning line { animation: pull-tick 800ms steps(8, end) infinite; animation-delay: calc(var(--i) * 100ms - 800ms); }
@keyframes pull-tick { from { opacity: 1; } to { opacity: 0.25; } }
/* behind everything, a grey taken from the photo, so no light strip can show at the screen's edges */
html:has(body.is-home), body.is-home { background: #e6e6e7; }
.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; }
/* the stage is as tall as the screen with Safari's bars tucked away, so its envelope reaches the very bottom */
.stage { position: sticky; top: 0; height: 100lvh; 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; --env-skirt: calc(var(--tabbar-space) - 1.5rem); }   /* envelope height, plus a skirt running down behind the tab bar on phones */
@media (min-width: 48em) { :root { --env-h: 14rem; --env-skirt: 0px; } }
.reply { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 var(--margin); }
/* the envelope's empty box sits over "Kindly reply" before it rises; only the card itself takes taps */
.reply, .scene { pointer-events: none; }
.modal { pointer-events: auto; }
.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 + var(--bottom-lift) + var(--under-bar, 0px)))) 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))));
  /* anything of the card below the envelope's bottom edge is cut away while it rises */
  clip-path: inset(-4rem -4rem max(0px, calc((100% - var(--env-o)) * (1 - var(--card)) - (var(--env-h) + var(--env-skirt) - var(--env-o)))) -4rem);
}
.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: calc(var(--env-h) + var(--env-skirt) + var(--under-bar, 0px)); 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, .envelope__seal-mount {
  position: absolute; left: 0; right: 0; top: 0; height: calc(var(--env-h) * 0.62);
  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));
  filter: brightness(calc(1 - var(--flap) * 0.09));
}
.envelope__flap { z-index: var(--flap-z); background: #e8e0d4; clip-path: polygon(0 0, 100% 0, 50% 100%); }
/* the wax seal is stuck to the outside of the flap's tip: the mount is the same box on the same hinge, so the seal
   swings over with the flap, and once the flap passes upright its outside faces away and the seal goes with it */
.envelope__seal-mount { z-index: calc(var(--flap-z) + 1); -webkit-backface-visibility: hidden; backface-visibility: hidden; pointer-events: none; }
.envelope__seal {
  position: absolute; left: 50%; top: 100%;
  width: clamp(4.25rem, 3.5rem + 2.5vw, 5.5rem); height: auto;
  translate: -50% -62%;
}
.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% calc(var(--env-h) * 0.35), 100% 0, 100% 100%, 0 100%); }
.envelope__pocket::after { content: ""; position: absolute; inset: 0; background: #f2ece3; clip-path: polygon(0 100%, 50% calc(var(--env-h) * 0.3), 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; }
/* a venue: its name links to the map, with the town underneath */
.list .list__venue { display: grid; justify-items: end; gap: 0.05rem; white-space: normal; text-wrap: balance; }
.list__venue .link { color: var(--ink); }
.list__venue span { font-size: var(--step-small); }
@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. It is fixed to the window, so it holds still while the page
   scrolls and while the form grows or shrinks; the form keeps the right-hand column. */
@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: fixed; top: 1rem; left: 1rem; z-index: 1;
    width: calc((100% - 1rem - 2 * var(--margin)) / 2); height: calc(100svh - 2rem);
    border-radius: 28px; overflow: hidden; background: var(--fill);
  }
  .split__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }
  .split .page { grid-column: 2; width: 100%; align-self: start; padding-top: clamp(3rem, 8vh, 6rem); }
}

/* ---------- rsvp: find the invitation, then answer for the family ---------- */
[data-step2] { margin-top: 0; }
[data-step2].is-open { margin-top: 2.5rem; }
.family-form__hello { text-align: center; }
.family-form__hello h2 { font-size: var(--step-head); }
.family { display: grid; gap: 1rem; }
.member { margin: 0; padding: 0; border: 0; min-width: 0; transition: box-shadow 180ms ease; }
.member__head { padding-block: 0.85rem 0.35rem; }
.member__name { font-size: var(--step-lead); font-weight: 600; }
.member .segmented { margin-block: 0.15rem 0.35rem; }
.member.is-invalid { box-shadow: inset 3px 0 0 var(--error); }
/* the meal choices open below "Attending" and fold away for "Not attending" */
.member__meal { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows 420ms var(--spring), opacity 280ms ease; }
.member__meal.is-open { grid-template-rows: 1fr; opacity: 1; }
.member__meal-inner { min-height: 0; overflow: hidden; }
.member__meal .form__item { gap: 0.4rem; }
.member__meal .form__item::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--separator); }
.member__meal .segmented { margin-block: 0.1rem 0.35rem; }
.family-form__again { justify-self: center; color: var(--ink-soft); }

/* 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; }

/* ---------- registry: gift cards, the fund, and the give sheet ---------- */
.registry { max-width: 64rem; margin: 0 auto; padding: calc(env(safe-area-inset-top) + clamp(2rem, 6vw, 3.5rem)) var(--margin) 2.5rem; }
.registry__lede { max-width: 34ch; }
.registry__status { margin-top: 2rem; text-align: center; color: var(--ink-soft); }
.registry__notice {
  max-width: 30rem; margin: 2rem auto 0; padding: 1.25rem 1.25rem 1.1rem;
  border-radius: var(--radius); background: var(--card); text-align: center;
  box-shadow: inset 0 0 0 1.5px color-mix(in oklab, var(--gold) 55%, transparent);
}
.registry__notice:focus { outline: none; }
.registry__notice-title { font-size: 1.5rem; }
.registry__notice p { margin-top: 0.35rem; color: var(--ink-soft); }
.registry__secure { margin-top: 2rem; text-align: center; color: var(--ink-soft); }

/* fixed-width columns, as many as fit: the empty ones collapse, so a first row that isn't full sits in the middle,
   while a later row that isn't full stays on the left under the cards above */
.gifts {
  --cols: 1; --gap: 1rem;
  margin-top: 2.25rem; display: grid; gap: var(--gap); justify-content: center;
  grid-template-columns: repeat(auto-fit, calc((100% - (var(--cols) - 1) * var(--gap)) / var(--cols) - 0.1px));
}
@media (min-width: 40em) { .gifts { --cols: 2; } }
@media (min-width: 64em) { .gifts { --cols: 3; } }
.gift { display: flex; flex-direction: column; gap: 0.9rem; padding: 0.75rem 0.75rem 1rem; border-radius: 22px; background: var(--card); }
.gift__img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 14px; background: var(--fill); }
.gift__img--fund { display: grid; place-items: center; background: linear-gradient(145deg, #f3ece0, #e7dccb); }
.gift__img--fund img { width: 26%; }
.gift__img--blank img { opacity: 0.4; }
.gift__body { flex: 1; display: grid; align-content: start; gap: 0.3rem; padding-inline: 0.25rem; }
.gift__name { font-size: 1.375rem; }
.gift__text { color: var(--ink-soft); }
.gift__raised { margin-top: 0.4rem; font-size: var(--step-small); }
.gift__suggested { color: var(--ink-soft); }
.gift__give { margin-inline: 0.25rem; }
.gift__done { margin-inline: 0.25rem; padding: 0.7rem; border-radius: 999px; background: var(--fill); text-align: center; font-weight: 500; color: var(--ink-soft); }
.gift.is-done .gift__img { filter: saturate(0.6); opacity: 0.85; }

.give__for { padding-inline: 0.25rem; font-family: var(--serif); font-size: 1.375rem; text-align: center; }
.give__amount { display: flex; align-items: baseline; gap: 0.25rem; font-size: 1.75rem; }
.give__amount span { color: var(--ink-soft); }
.give__amount .input { font-size: 1.75rem; min-height: 2.6rem; }
.form__item:has(.give__amount .input[aria-invalid="true"]) { box-shadow: inset 3px 0 0 var(--error); }
.give__optional { color: var(--ink-faint); }
.give .chips { margin: -0.25rem 0 0; }
.give__secure { margin-top: -0.4rem; text-align: center; color: var(--ink-soft); }

/* 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; }
/* stacked: one choice per row, for lists like the meals */
.segmented--stack { grid-template-columns: 1fr; }
.segmented--stack .segmented__option span { justify-content: flex-start; padding-inline: 0.9rem; text-align: left; }
.segmented[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--error); }
/* with script, one white highlight slides to whichever option is picked (site.js places it) */
.segmented { position: relative; }
.segmented__option { z-index: 1; }
.segmented__thumb {
  position: absolute; left: 0; top: 0;
  width: var(--thumb-w, 0); height: var(--thumb-h, 0);
  transform: translate(var(--thumb-x, 0), var(--thumb-y, 0));
  border-radius: 8px; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 1px rgba(0, 0, 0, 0.04);
  opacity: 0; pointer-events: none;
  transition: transform 420ms var(--spring), width 420ms var(--spring), height 420ms var(--spring), opacity 200ms ease;
}
.segmented.has-pick .segmented__thumb { opacity: 1; }
.segmented.is-still .segmented__thumb { transition: opacity 200ms ease; }
.segmented:has(> .segmented__thumb) .segmented__option input:checked + span { background: transparent; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .segmented__thumb { transition: none; } }

/* 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; width: 100%; padding: 1rem; border: 0; border-radius: var(--radius); background: var(--card);
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: transform 160ms var(--spring), box-shadow 220ms ease;
}
.tile:active { transform: scale(0.98); }
/* the status tile whose filter is on */
.tile.is-active { box-shadow: inset 0 0 0 2px var(--gold); }
.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); }

/* filter chips under the guest search; the chosen one turns white like the switch's highlight */
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; }
.chip {
  min-height: 2.25rem; padding: 0 0.9rem; border: 0; border-radius: 999px;
  background: var(--fill); color: var(--ink-soft); font: inherit; font-size: 0.9375rem; font-weight: 500; cursor: pointer;
  transition: background-color 220ms var(--spring), color 220ms ease, box-shadow 220ms ease, transform 160ms var(--spring);
}
.chip:active { transform: scale(0.96); }
.chip[aria-pressed="true"] { 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); }
.chips__clear { margin-left: auto; min-height: 2.25rem; padding: 0 0.25rem; border: 0; background: none; font: inherit; font-size: 0.9375rem; color: var(--ink-soft); cursor: pointer; }
@media (hover: hover) and (pointer: fine) { .chips__clear:hover { color: var(--ink); text-decoration: underline; } }

.admin__switch { margin: 1.75rem 0 0; border: 0; min-width: 0; }
.segmented.admin__switch--five { grid-template-columns: repeat(5, 1fr); }
.admin__switch--five .segmented__option span { font-size: 0.8125rem; padding-inline: 0.15rem; }
@media (min-width: 40em) { .admin__switch--five .segmented__option span { font-size: 0.875rem; } }

/* the history: a plain table of the messages rows; it scrolls sideways inside its card on narrow screens */
.log { overflow-x: auto; border-radius: var(--radius); background: var(--card); -webkit-overflow-scrolling: touch; }
.log__table { width: 100%; border-collapse: collapse; font-size: 0.875rem; line-height: 1.4; }
.log__table th, .log__table td { padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; white-space: nowrap; }
.log__table th { font-weight: 600; font-size: 0.75rem; color: var(--ink-soft); letter-spacing: 0.02em; box-shadow: inset 0 -0.5px 0 var(--separator); }
.log__table tbody tr + tr td { box-shadow: inset 0 0.5px 0 var(--separator); }
.log__table .log__message { white-space: normal; min-width: 14rem; max-width: 26rem; overflow-wrap: anywhere; }
.log__type { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; background: var(--fill); font-size: 0.75rem; font-weight: 500; }
/* wide screens: the history reaches past the dashboard's column toward the window's edges, and long subjects wrap,
   so the whole table shows at once; it still scrolls sideways when even that is too narrow */
@media (min-width: 64em) {
  .admin__panel[data-panel="history"] {
    --log-width: min(90rem, 100vw - 4rem);
    width: var(--log-width);
    margin-inline: min(0px, (100% - var(--log-width)) / 2);
  }
  .log__table td:nth-child(3) { white-space: normal; min-width: 10rem; max-width: 18rem; overflow-wrap: anywhere; }
  .log__table .log__message { max-width: none; }
}
.search { position: relative; display: block; margin-bottom: 0.9rem; }
.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__panel { margin-top: 1.25rem; }
.panel-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.panel-bar__title { font-size: 1.75rem; }
.panel-bar--sub { margin-top: 2rem; }
.panel-bar__total { color: var(--ink-soft); font-size: var(--step-small); }
.panel-bar__title span { font-family: var(--ui); font-size: var(--step-small); color: var(--ink-soft); letter-spacing: 0; margin-left: 0.25rem; }
.pill-button--small { min-height: 2.25rem; padding: 0 1rem; font-size: 0.9375rem; }
.admin__empty { padding: 1rem; color: var(--ink-soft); }

.families { display: grid; gap: 1.25rem; }
.family-group__title { margin: 0 0 0.4rem 1rem; font-family: var(--ui); font-size: var(--step-small); font-weight: 500; color: var(--ink-soft); letter-spacing: 0; line-height: 1.4; }

/* a tappable row that opens the edit sheet */
.admin-item {
  position: relative; width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  min-height: 3.5rem; padding: 0.6rem 2.25rem 0.6rem 1rem;
  text-align: left; color: inherit;
  transition: background-color 160ms ease;
}
.admin-item + .admin-item::before { content: ""; position: absolute; top: 0; left: 1rem; right: 0; height: 0.5px; background: var(--separator); }
.admin-item::after {
  content: ""; position: absolute; right: 1.1rem; top: 50%; width: 0.45rem; height: 0.45rem;
  border-right: 2px solid var(--ink-faint); border-top: 2px solid var(--ink-faint);
  transform: translateY(-50%) rotate(45deg);
}
.admin-item:active { background: rgba(42, 32, 27, 0.05); }
.admin-item:focus-visible { outline-offset: -3px; }
.admin-item__main { display: grid; gap: 0.1rem; min-width: 0; flex: 1; }
.admin-item__main b { font-weight: 600; }
.admin-item__main > span { font-size: var(--step-small); color: var(--ink-soft); }
.admin-item--gift { justify-content: flex-start; }
.admin-item__thumb { flex: none; width: 3rem; height: 3rem; border-radius: var(--radius-sm); background: var(--fill); object-fit: cover; }
.progress { display: block; height: 6px; margin-top: 0.35rem; border-radius: 999px; background: var(--fill); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--gold); }
@media (hover: hover) and (pointer: fine) { .admin-item:hover { background: rgba(42, 32, 27, 0.04); } }

.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); }
.status--wait { background: rgba(184, 146, 79, 0.18); color: #6b5226; }
.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__switch { max-width: 32rem; }
}

/* the add / edit sheet: a bottom sheet on phones, a centred card on wider screens */
.sheet {
  width: 100%; max-width: 100%; max-height: 92svh;
  margin: auto 0 0; padding: 0;
  border: 0; border-radius: 22px 22px 0 0;
  background: var(--bg); color: var(--ink);
  box-shadow: 0 -10px 40px rgba(20, 15, 10, 0.2);
  overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(20, 15, 10, 0.38); }
.sheet[open] { animation: sheet-up 380ms var(--spring); }
.sheet[open]::backdrop { animation: fade-in 280ms ease; }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet__form { margin: 0; gap: 1rem; padding: 0 var(--margin) calc(env(safe-area-inset-bottom) + 1.25rem); }
.sheet__bar {
  position: sticky; top: 0; z-index: 1;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  margin: 0 calc(var(--margin) * -1); padding: 0.4rem var(--margin);
  background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0.5px 0 var(--separator);
}
.sheet__bar .text-button:first-child { justify-self: start; }
.sheet__title { font-family: var(--ui); font-size: var(--step-body); font-weight: 600; letter-spacing: 0; }
.sheet__save { justify-self: end; font-weight: 600; }
.sheet__body { display: grid; gap: 1rem; }
.sheet__body .form__hint { margin-top: -0.6rem; }
.sheet__fieldset { margin: 0.25rem 0 0; padding: 0; border: 0; min-width: 0; }
.sheet__fieldset legend { padding: 0 1rem; margin-bottom: 0.5rem; font-size: var(--step-small); color: var(--ink-soft); }
.sheet__error { text-align: center; }
.sheet__delete { justify-self: center; color: var(--error); }
.sheet__delete.is-confirming { font-weight: 700; }
.segmented--three { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 40em) {
  .sheet { width: min(32rem, calc(100% - 2rem)); margin: auto; border-radius: 22px; box-shadow: 0 20px 60px rgba(20, 15, 10, 0.28); }
  @keyframes sheet-up { from { transform: translateY(24px) scale(0.98); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) { .sheet[open], .sheet[open]::backdrop { animation: none; } }

/* a native select that looks like the other fields */
.select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 1.75rem;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%236b625b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.25rem center / 0.75rem;
}

/* ---------- 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); } }
