/* The Dinner Club: guest ballot
   A place set at the table: ivory linen, charcoal ink, Bordeaux for what commits. */

@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/BodoniModa-normal.woff2") format("woff2");
  font-weight: 400 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bodoni Moda";
  src: url("/fonts/BodoniModa-italic.woff2") format("woff2");
  font-weight: 400 900;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Jost";
  src: url("/fonts/Jost-normal.woff2") format("woff2");
  font-weight: 300 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --linen: #f4eee3;
  --linen-deep: #ebe2d3;
  --rule: #d8cbb6;
  --ink: #1f1c1a;
  --ink-soft: #574e47;
  --wine: #6e1a2c;
  --wine-hover: #84243a;
  --candle: #1b1517;
  --candle-ink: #f2e9da;
  --candle-soft: #c9b8a2;
  --danger: #8a1c1c;

  --serif: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --sans: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-press: cubic-bezier(0.34, 1.4, 0.64, 1);
  --t-screen: 520ms;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --dock-h: 5.25rem;

  /* The evening deepens as courses are set (see body[data-phase]). */
  --ground: var(--linen);
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  transition: background-color 900ms var(--ease-out), color 900ms var(--ease-out);
}
body[data-phase="1"] { --ground: #f3ece0; }
body[data-phase="2"] { --ground: #f1e8da; }
body[data-phase="3"] { --ground: #eee3d3; }
body[data-phase="4"] { --ground: #ebdecb; }
body[data-phase="night"] {
  --ground: var(--candle);
  --ink: var(--candle-ink);
  --ink-soft: var(--candle-soft);
  --rule: #4a3b3a;
  --wine: #d9a0a6;
  --wine-hover: #e9b8bd;
  color-scheme: dark;
}

::selection { background: var(--wine); color: var(--linen); }
body[data-phase="night"] ::selection { background: var(--candle-ink); color: var(--candle); }

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

img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
kbd {
  font-family: var(--sans);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.05em 0.4em;
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--ink); color: var(--linen);
  padding: 0.6rem 1rem; border-radius: 3px;
}
.skip:focus { top: 1rem; }

/* ── Type ─────────────────────────────────────────────────────────────── */

.display {
  font-family: var(--serif);
  font-weight: 500;
  font-optical-sizing: auto;
  font-size: clamp(3rem, 13vw, 5.75rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  margin: 0;
  text-wrap: balance;
}
.display em { font-style: italic; font-weight: 400; }

.question {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.05rem, 7.4vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin: 0;
  text-wrap: balance;
}
.question:focus { outline: none; }
.question em { font-style: italic; font-weight: 400; }

.lede {
  font-size: 1.0625rem;
  color: var(--ink-soft);
  max-width: 34rem;
  margin: 0.9rem 0 0;
  text-wrap: pretty;
}

.smallcaps {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3.25rem;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease, transform 180ms var(--ease-out);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn--wine { background: var(--wine); color: #fbf6ee; }
.btn--wine:hover { background: var(--wine-hover); }
body[data-phase="night"] .btn--wine { color: var(--candle); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn--ghost:hover { border-color: var(--ink-soft); }
.btn--lg { min-height: 3.6rem; padding: 0 2rem; font-size: 1.0625rem; }
.btn[disabled], .btn[aria-busy="true"] { cursor: progress; opacity: 0.75; }
.btn .spinner {
  width: 1rem; height: 1rem;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}
@keyframes spin { to { transform: rotate(1turn); } }

.link {
  background: none; border: 0; padding: 0;
  color: var(--wine);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  cursor: pointer;
}
.link:hover { color: var(--wine-hover); }

/* ── Chrome: top bar, dock ────────────────────────────────────────────── */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  padding: max(0.9rem, env(safe-area-inset-top)) var(--gutter) 0.85rem;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  transition: background-color 900ms var(--ease-out);
}
.topbar[hidden], .dock[hidden], .placecard[hidden] { display: none; }

.wordmark {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.courses {
  display: flex; gap: 0.9rem;
  margin: 0; padding: 0; list-style: none;
}
.courses li {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}
.courses li::before {
  content: "";
  width: 0.62rem; height: 0.62rem;
  border-radius: 50%;
  border: 1px solid currentColor;
  transition: background-color 400ms var(--ease-out), border-color 400ms var(--ease-out), transform 400ms var(--ease-press);
}
.courses li[data-set] { color: var(--ink); }
.courses li[data-set]::before { background: var(--wine); border-color: var(--wine); transform: scale(1.1); }
.courses li[data-current] .courses__label { text-decoration: underline; text-underline-offset: 0.35em; text-decoration-thickness: 1px; }
@media (max-width: 420px) {
  .courses { gap: 0.6rem; }
  .courses__label { display: none; }
  .courses li::before { width: 0.7rem; height: 0.7rem; }
}

.progress {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px;
  background: transparent;
}
.progress__fill {
  display: block; height: 100%;
  width: 100%;
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
  background: var(--wine);
  transition: transform 600ms var(--ease-out);
}

.dock {
  position: fixed; z-index: 20;
  left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.85rem var(--gutter) max(0.85rem, env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--ground) 94%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
  transition: background-color 900ms var(--ease-out);
}
.dock {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 15rem);
  row-gap: 0.6rem;
}
.dock .btn--wine { grid-column: 3; width: 100%; }
.dock__hint { grid-column: 2; justify-self: center; }
.trail {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem;
  margin: 0; padding: 0 0 0.6rem;
  border-bottom: 1px solid color-mix(in srgb, var(--rule) 70%, transparent);
}
.trail[hidden] { display: none; }
.trail div { min-width: 0; }
.trail dt { font-size: 0.72rem; font-weight: 500; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }
.trail dd {
  margin: 0.1rem 0 0;
  font-family: var(--serif); font-size: 0.92rem; line-height: 1.2;
  min-height: 2.4em;              /* room for two lines, so names are never cut */
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.trail dd[data-empty] { color: var(--ink-soft); font-style: italic; }
.trail dd.writing { animation: write 700ms var(--ease-out) both; }
@media (min-width: 1100px) { .trail { display: none; } }
.dock__hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  display: none;
}
@media (min-width: 900px) and (hover: hover) {
  .dock__hint { display: block; }
}

/* ── Layout ───────────────────────────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.stage {
  position: relative;
  min-height: calc(100svh - 3.5rem);
  outline: none;
}

@media (min-width: 1100px) {
  body.has-card .layout {
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: clamp(2rem, 4vw, 4rem);
    padding-right: var(--gutter);
  }
}

.screen {
  padding: clamp(1.75rem, 6vw, 4rem) var(--gutter) calc(var(--dock-h) + 2.5rem);
  max-width: 80rem;
  margin: 0;
}
body:not(.has-card) .screen { margin: 0 auto; }
.screen--narrow > * { max-width: 44rem; }
.screen--center {
  min-height: 70svh;
  display: flex; flex-direction: column; justify-content: center;
}

/* Screen transitions: a short, vertical "next card" motion. */
.screen[data-enter] { animation: enter-up var(--t-screen) var(--ease-out) both; }
.screen[data-enter="back"] { animation-name: enter-down; }
.screen[data-leave] {
  position: absolute; inset: 0 0 auto 0;
  animation: leave-up 260ms ease-in both;
  pointer-events: none;
}
.screen[data-leave="back"] { animation-name: leave-down; }
@keyframes enter-up { from { opacity: 0; transform: translateY(1.75rem); filter: blur(2px); } }
@keyframes enter-down { from { opacity: 0; transform: translateY(-1.75rem); filter: blur(2px); } }
@keyframes leave-up { to { opacity: 0; transform: translateY(-1.25rem); } }
@keyframes leave-down { to { opacity: 0; transform: translateY(1.25rem); } }

.screen__head { max-width: 44rem; margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

/* ── Welcome ──────────────────────────────────────────────────────────── */

.welcome {
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.welcome__photo {
  position: relative;
  height: 44svh;
  min-height: 15rem;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 55%, transparent);
  mask-image: linear-gradient(#000 55%, transparent);
}
.welcome__photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
  animation: settle 2400ms var(--ease-out) both;
}
@keyframes settle { from { transform: scale(1.08); opacity: 0.4; } }

.welcome__text {
  padding: 0 var(--gutter) max(2.5rem, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; justify-content: center;
  max-width: 36rem;
}
.welcome__mark {
  position: absolute; z-index: 1;
  top: max(1.1rem, env(safe-area-inset-top)); left: var(--gutter);
  margin: 0;
  font-family: var(--serif); font-style: italic;
  font-size: 1.15rem;
  color: #f6eee2;
  text-shadow: 0 1px 12px rgb(0 0 0 / 0.5);
}
.welcome__courses {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 5.2vw, 1.75rem);
  line-height: 1.3;
  margin: 1.4rem 0 0;
}
.welcome__courses span { display: block; }
.welcome__say { margin: 1rem 0 0; color: var(--ink-soft); font-size: 1.0625rem; }
.welcome__cta { margin-top: 2rem; align-self: flex-start; }
.welcome__meta {
  margin: 1.4rem 0 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.welcome__meta a { color: inherit; }

@media (max-width: 899px) {
  .welcome__photo { height: 26svh; min-height: 9.5rem; }
  .welcome__text { padding-top: 0; }
  .welcome__card {
    position: relative;
    margin-top: -2.5rem;
    padding: 2rem 1.5rem 2.25rem;
    background: #fbf7f0;
    color: #1f1c1a;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 26px 40px -26px rgb(60 30 20 / 0.5);
  }
  .welcome__card::before {
    content: ""; position: absolute; inset: 0.55rem;
    border: 1px solid #d8cbb6; border-radius: 2px; pointer-events: none;
  }
  .welcome__card .welcome__say { color: #574e47; }
  .welcome__card .welcome__cta { align-self: center; }
  .welcome__text { align-items: stretch; }
}
.welcome__to {
  margin: 0.6rem 0 0;
  font-family: var(--serif); font-style: italic;
  font-size: 1.2rem;
  color: var(--wine);
}
.welcome__card .rule { margin: 1.25rem auto 0; width: 3rem; border-color: #d8cbb6; }
.welcome__card { display: flex; flex-direction: column; }
.welcome__meta { text-align: inherit; }

/* Staggered reveal of the invitation lines. */
.reveal > * { animation: rise 900ms var(--ease-out) both; }
.reveal > *:nth-child(2) { animation-delay: 90ms; }
.reveal > *:nth-child(3) { animation-delay: 180ms; }
.reveal > *:nth-child(4) { animation-delay: 270ms; }
.reveal > *:nth-child(5) { animation-delay: 360ms; }
.reveal > *:nth-child(6) { animation-delay: 450ms; }
@keyframes rise { from { opacity: 0; transform: translateY(0.9rem); } }

@media (min-width: 900px) {
  .welcome {
    grid-template-rows: none;
    grid-template-columns: minmax(0, 45%) minmax(0, 1fr);
  }
  .welcome__photo {
    height: 100svh;
    -webkit-mask-image: none; mask-image: none;
    border-radius: 0 50vw 0 0 / 0 22vw 0 0;
  }
  .welcome__text {
    justify-content: center;
    padding: 4rem clamp(3rem, 7vw, 7rem);
    max-width: 44rem;
  }
}

/* ── Text answers ─────────────────────────────────────────────────────── */

.field { margin-top: 2rem; max-width: 36rem; }
.field__label { display: block; margin-bottom: 0.5rem; color: var(--ink-soft); }
.field__input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1.5px solid var(--rule);
  padding: 0.35rem 0 0.55rem;
  font-family: var(--serif);
  font-size: clamp(1.75rem, 6.5vw, 2.5rem);
  line-height: 1.2;
  border-radius: 0;
  transition: border-color 200ms ease;
  caret-color: var(--wine);
}
.field__input::placeholder { color: color-mix(in srgb, var(--ink-soft) 55%, transparent); font-style: italic; }
.field__input:focus { outline: none; border-bottom-color: var(--wine); }
.field__input[aria-invalid="true"] { border-bottom-color: var(--danger); }

.field__textarea {
  width: 100%;
  min-height: 7.5rem;
  resize: vertical;
  background: color-mix(in srgb, var(--linen-deep) 55%, transparent);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 0.85rem 1rem;
  font-size: 1.0625rem;
  line-height: 1.5;
  caret-color: var(--wine);
}
body[data-phase="night"] .field__textarea { background: transparent; }
.field__textarea::placeholder { color: color-mix(in srgb, var(--ink-soft) 75%, transparent); }
.field__textarea:focus { outline: none; border-color: var(--wine); box-shadow: 0 0 0 3px color-mix(in srgb, var(--wine) 18%, transparent); }
.field__textarea[aria-invalid="true"] { border-color: var(--danger); }
.field__hint { margin: 0.6rem 0 0; font-size: 0.875rem; color: var(--ink-soft); }
.field__count { float: right; font-variant-numeric: tabular-nums; }

.error {
  display: flex; gap: 0.5rem; align-items: baseline;
  margin: 0.9rem 0 0;
  color: var(--danger);
  font-size: 0.95rem;
}
.error[hidden] { display: none; }
.error::before {
  content: "";
  flex: none;
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  transform: translateY(-0.1rem);
}
.shake { animation: shake 360ms ease; }
@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}

/* Name step: a tented place card you write your name on */
.namecard {
  position: relative;
  max-width: 30rem;
  margin-top: 2rem;
  padding: 1.6rem 1.5rem 1.75rem;
  background: #fbf7f0;
  color: #1f1c1a;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 26px 36px -26px rgb(60 30 20 / 0.55);
  transform: perspective(900px) rotateX(6deg);
  transform-origin: bottom center;
}
.namecard::before {
  content: ""; position: absolute; inset: 0.55rem;
  border: 1px solid #d8cbb6; border-radius: 2px; pointer-events: none;
}
.namecard__club { margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 500; letter-spacing: 0.22em; text-transform: uppercase; color: #6e1a2c; }
.namecard .field__input { text-align: center; border-bottom-color: #e3d8c6; }
.namecard .field__input:focus { border-bottom-color: #6e1a2c; }
.namecard .error { justify-content: center; }

/* Allergy quick-picks */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.75rem 0 1.25rem; max-width: 40rem; }
.chip {
  min-height: 2.6rem;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  cursor: pointer;
  font-size: 0.95rem;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.chip:hover { border-color: var(--ink-soft); }
.chip[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); color: #fbf6ee; }

.private-note {
  display: flex; gap: 0.55rem; align-items: center;
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

/* ── Choices: diet ────────────────────────────────────────────────────── */

.choices { display: grid; max-width: 40rem; margin: 0; padding: 0; border: 0; border-top: 1px solid var(--rule); }
.choice {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 1.1rem;
  align-items: center;
  padding: 1.15rem 0.25rem;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:focus-visible) { outline: 2px solid var(--wine); outline-offset: 2px; }
.choice:hover .choice__title { color: var(--wine); }
.choice .stamp { top: 50%; left: auto; right: 0; margin-top: -0.9rem; }
.choice:has(input:checked) .stamp { opacity: 1; transform: rotate(-9deg) scale(1); }
.choice__key {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 1.9rem; height: 1.9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  font-size: 0.8rem; font-weight: 500;
  color: var(--ink-soft);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.choice:has(input:checked) .choice__key { background: var(--wine); border-color: var(--wine); color: #fbf6ee; }
.choice__title { font-family: var(--serif); font-size: 1.45rem; line-height: 1.2; transition: color 200ms ease; }
.choice__desc { font-size: 0.95rem; color: var(--ink-soft); }

/* ── Choices: dishes ──────────────────────────────────────────────────── */

.vegan-note {
  max-width: 44rem;
  margin: -0.75rem 0 2rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 8px;
  font-size: 0.975rem;
  color: var(--ink);
  background: color-mix(in srgb, var(--linen-deep) 60%, transparent);
}
.vegan-note strong { font-weight: 500; }

.menu { margin: 0; padding: 0; border: 0; min-width: 0; }
.menu__group {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 1rem;
  margin: 1.25rem 0 0.25rem;
  color: var(--ink-soft);
}
.menu__group::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }

.dishes {
  display: grid;
  gap: 0;
}

.dish {
  position: relative;
  display: grid;
  grid-template-columns: 6.75rem minmax(0, 1fr);
  gap: 1.1rem;
  align-items: center;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dish:first-child { border-top: 1px solid var(--rule); }
.dish input { position: absolute; opacity: 0; pointer-events: none; }

.dish__plate {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: 999px 999px 6px 6px;
  overflow: hidden;
  background: var(--linen-deep);
  box-shadow: 0 10px 24px -14px rgb(45 25 20 / 0.55);
  transition: box-shadow 400ms var(--ease-out);
}
.dish__plate img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 700ms var(--ease-out), filter 500ms ease;
}
.dish:hover .dish__plate img { transform: scale(1.06); }
.dish:has(input:checked) .dish__plate { box-shadow: 0 0 0 2px var(--ground), 0 0 0 3.5px var(--wine), 0 14px 28px -14px rgb(45 25 20 / 0.6); }
.menu:has(input:checked) .dish:not(:has(input:checked)) .dish__plate img { filter: saturate(0.55) brightness(0.96); }

.dish__zoom {
  position: absolute; right: 0.3rem; bottom: 0.3rem;
  display: grid; place-items: center;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  border: 0;
  background: rgb(251 246 238 / 0.9);
  color: var(--ink);
  cursor: zoom-in;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.18);
  opacity: 0.92;
  transition: transform 200ms var(--ease-out), opacity 200ms ease;
}
.dish__zoom::after { content: ""; position: absolute; inset: -0.4rem; } /* 44px touch target */
.dish__zoom svg { width: 15px; height: 15px; }
.dish__zoom:hover { transform: scale(1.08); opacity: 1; }
@media (min-width: 720px) {
  .dish__zoom { width: 2.6rem; height: 2.6rem; right: 0.6rem; bottom: 0.6rem; }
  .dish__zoom svg { width: 18px; height: 18px; }
}

.dish__body { min-width: 0; }
.dish__key {
  display: inline-grid; place-items: center;
  width: 1.5rem; height: 1.5rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-size: 0.72rem; font-weight: 500;
  color: var(--ink-soft);
  transition: background-color 200ms ease, color 200ms ease, border-color 200ms ease;
}
.dish:has(input:checked) .dish__key { background: var(--wine); border-color: var(--wine); color: #fbf6ee; }
.dish:has(input:focus-visible) .dish__plate { outline: 2px solid var(--wine); outline-offset: 4px; }
.dish__name {
  display: block;
  font-family: var(--serif);
  font-size: 1.32rem;
  line-height: 1.15;
  font-weight: 500;
  text-wrap: balance;
}
.dish__desc { display: block; margin-top: 0.3rem; font-size: 0.95rem; line-height: 1.45; color: var(--ink-soft); text-wrap: pretty; }
.dish__for {
  display: block; margin-top: 0.45rem;
  font-size: 0.875rem; line-height: 1.4;
  color: var(--wine);
}
.dish__flag {
  display: flex; gap: 0.4rem; align-items: baseline;
  margin-top: 0.45rem;
  font-size: 0.875rem; line-height: 1.4; font-weight: 500;
  color: var(--danger);
}
.dish__flag svg { flex: none; transform: translateY(0.15rem); }
.dish__allergens { display: block; margin-top: 0.45rem; font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); }

/* The stamp: a choice leaves ink. */
.stamp {
  position: absolute;
  z-index: 2;
  top: 0.6rem; left: -0.35rem;
  padding: 0.28rem 0.55rem 0.22rem;
  border: 1.5px solid var(--wine);
  outline: 1px solid var(--wine);
  outline-offset: 2px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  color: var(--wine);
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.24em; text-transform: uppercase;
  transform: rotate(-9deg) scale(1.6);
  opacity: 0;
  pointer-events: none;
  transition: transform 280ms var(--ease-press), opacity 160ms ease;
}
.dish:has(input:checked) .stamp { opacity: 1; transform: rotate(-9deg) scale(1); }

/* Vegan "separate plate" option: an empty arch, chef's choice. */
.dish__plate--empty {
  display: grid; place-items: center;
  background: transparent;
  border: 1px dashed var(--ink-soft);
  box-shadow: none;
  text-align: center;
  padding: 1rem 0.5rem 0.5rem;
}
.dish__plate--empty svg { color: var(--wine); }

@media (min-width: 720px) {
  .dishes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.25rem 1.75rem;
  }
  .dish, .dish:first-child {
    grid-template-columns: none;
    align-content: start;
    align-items: start;
    border: 0;
    padding: 0;
    gap: 1rem;
  }
  .dish__plate { width: 100%; }
  .dish__name { font-size: 1.45rem; }
  .stamp { top: 1.25rem; left: -0.6rem; font-size: 0.72rem; }
  .menu__group { margin: 2rem 0 0.25rem; }
}

@media (min-width: 1100px) {
  /* One row per course: as many columns as dishes (3 to 5). */
  .dishes { grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 2.5rem 1.5rem; }
}

/* ── Review: the printed menu card ────────────────────────────────────── */

.review { display: grid; gap: 2.5rem; }
@media (min-width: 960px) {
  .review { grid-template-columns: minmax(0, 27rem) minmax(0, 1fr); align-items: start; gap: 4rem; }
}

.menucard {
  position: relative;
  padding: 2.25rem 1.75rem 2rem;
  background: #fbf7f0;
  color: #1f1c1a;
  border-radius: 4px;
  text-align: center;
  box-shadow: 0 1px 0 rgb(0 0 0 / 0.04), 0 22px 40px -24px rgb(60 30 20 / 0.45);
}
.menucard::before {
  content: "";
  position: absolute; inset: 0.6rem;
  border: 1px solid #d8cbb6;
  border-radius: 2px;
  pointer-events: none;
}
.menucard__club { margin: 0; color: #6e1a2c; }
.menucard__for {
  font-family: var(--serif); font-style: italic;
  font-size: 1.15rem;
  margin: 0.6rem 0 1.25rem;
}
.menucard__course { padding: 1.1rem 0; border-top: 1px solid #e3d8c6; }
.menucard__course dt { color: #6b6058; margin-bottom: 0.4rem; }
.menucard__course dd { margin: 0; }
.menucard__dish { display: block; font-family: var(--serif); font-size: 1.4rem; line-height: 1.2; font-weight: 500; }
.menucard__desc { display: block; margin-top: 0.25rem; font-size: 0.9rem; color: #5a504a; }
.menucard__change { margin-top: 0.5rem; font-size: 0.875rem; color: #6e1a2c; }
.menucard__diet {
  margin: 0.4rem 0 0;
  padding-top: 1.1rem;
  border-top: 1px solid #e3d8c6;
  font-size: 0.875rem; color: #5a504a;
}
.menucard dl { margin: 0; }

.disclaimer {
  margin: 0 0 1.75rem;
  padding-left: 1rem;
  border-left: 1px solid var(--wine);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  line-height: 1.5;
  max-width: 34rem;
}
.submit-row { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.25rem; margin-top: 1.75rem; }
.alert {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
  border-radius: 6px;
  background: color-mix(in srgb, var(--danger) 6%, transparent);
  color: var(--danger);
  font-size: 0.95rem;
  max-width: 36rem;
}
.alert[hidden] { display: none; }

/* ── Desktop place card (live) ────────────────────────────────────────── */

.placecard {
  display: none;
}
@media (min-width: 1100px) {
  body.has-card .placecard {
    display: block;
    position: sticky;
    top: 6.5rem;
    align-self: start;
    margin-top: clamp(1.75rem, 6vw, 4rem);
    padding: 1.75rem 1.5rem 1.5rem;
    background: #fbf7f0;
    color: #1f1c1a;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 22px 40px -26px rgb(60 30 20 / 0.45);
    animation: rise 700ms var(--ease-out) both;
  }
}
.placecard__club { margin: 0; font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0.22em; text-transform: uppercase; color: #6e1a2c; font-weight: 500; }
.placecard__for { margin: 0.5rem 0 1rem; font-family: var(--serif); font-style: italic; font-size: 1.05rem; }
.placecard .rule { border-color: #e3d8c6; }
.placecard__courses { margin: 0; }
.placecard__courses > div { padding: 0.85rem 0; border-bottom: 1px solid #e3d8c6; }
.placecard__courses dt { font-size: 0.72rem; letter-spacing: 0.2em; text-transform: uppercase; color: #6b6058; }
.placecard__courses dd { margin: 0.3rem 0 0; font-family: var(--serif); font-size: 1.1rem; line-height: 1.25; }
.placecard__courses dd[data-empty] { color: #6b6058; font-style: italic; font-size: 0.95rem; }
.placecard__courses dd.writing { animation: write 700ms var(--ease-out) both; }
@keyframes write { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ── Confirmation: candlelight ────────────────────────────────────────── */

.done { text-align: center; max-width: 38rem; margin: 0 auto; }
.done__flame { display: block; margin: 0 auto 1.75rem; color: #e9b77a; }
.done__flame path { transform-origin: 50% 100%; animation: flicker 3.2s ease-in-out infinite; }
@keyframes flicker {
  0%, 100% { transform: scale(1, 1) rotate(0deg); }
  30% { transform: scale(0.96, 1.04) rotate(-1.5deg); }
  60% { transform: scale(1.03, 0.97) rotate(1deg); }
}
.done .display { font-size: clamp(2.75rem, 11vw, 5rem); }
.done__list {
  margin: 2.25rem auto 0;
  padding: 0;
  list-style: none;
  font-family: var(--serif);
  font-size: 1.3rem;
  line-height: 1.4;
}
.done__list li { padding: 0.75rem 0; border-top: 1px solid var(--rule); }
.done__list li:last-child { border-bottom: 1px solid var(--rule); }
.done__list .smallcaps { display: block; color: var(--ink-soft); margin-bottom: 0.15rem; }
.done__foot { margin-top: 2rem; color: var(--ink-soft); }

/* ── Lightbox ─────────────────────────────────────────────────────────── */

.lightbox {
  width: min(56rem, calc(100vw - 1.5rem));
  max-height: calc(100svh - 1.5rem);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: #fbf7f0;
  color: #1f1c1a;
  box-shadow: 0 30px 80px -20px rgb(20 10 10 / 0.55);
  overflow: auto;
}
.lightbox::backdrop { background: rgb(27 21 23 / 0.62); backdrop-filter: blur(3px); }
.lightbox[open] { animation: pop 380ms var(--ease-out) both; }
@keyframes pop { from { opacity: 0; transform: translateY(1rem) scale(0.98); } }
.lightbox__inner { display: grid; }
.lightbox__figure { margin: 0; background: #ebe2d3; }
.lightbox__figure img { width: 100%; height: 100%; max-height: 58svh; object-fit: cover; }
.lightbox__text { padding: 1.5rem 1.5rem 1.75rem; }
.lightbox__title { font-family: var(--serif); font-weight: 500; font-size: 2rem; line-height: 1.1; margin: 0; }
.lightbox__desc { margin: 0.6rem 0 0; color: #574e47; }
.lightbox__diet { margin: 0.75rem 0 0; color: #6e1a2c; font-size: 0.95rem; }
.lightbox__diet:empty, .lightbox__allergens:empty { display: none; }
.lightbox__allergens { margin: 0.75rem 0 0; font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: #574e47; }
.lightbox__credit { margin: 1.25rem 0 0; font-size: 0.75rem; color: #6b6058; }
.lightbox__credit a { color: inherit; }
.lightbox__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.lightbox .btn--ghost { color: #1f1c1a; border-color: #d8cbb6; }
@media (min-width: 760px) {
  .lightbox__inner { grid-template-columns: 1.1fr 1fr; }
  .lightbox__figure img { max-height: none; min-height: 30rem; }
  .lightbox__text { padding: 2.5rem 2.25rem; align-self: center; }
}

/* ── Status screens ───────────────────────────────────────────────────── */

.loading {
  min-height: 100svh;
  display: grid; place-items: center;
  color: var(--ink-soft);
}
.loading .smallcaps { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.4; } }

/* ── Reduced motion ───────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
  }
  .dish:hover .dish__plate img { transform: none; }
}

/* ── Credits page ─────────────────────────────────────────────────────── */
.credits .question { margin-top: 1.5rem; }
.credits__list { list-style: none; margin: 2rem 0 0; padding: 0; }
.credits__list li { padding: 0.9rem 0; border-top: 1px solid var(--rule); font-size: 0.95rem; color: var(--ink-soft); }
.credits__list .smallcaps { display: block; color: var(--ink); margin-bottom: 0.2rem; }
.credits__list a { color: var(--wine); text-underline-offset: 0.2em; }
.login__submit { margin-top: 1.75rem; }
body:has(.trail:not([hidden])) { --dock-h: 9.75rem; }
@media (min-width: 1100px) { body:has(.trail:not([hidden])) { --dock-h: 5.25rem; } }
@media (min-width: 900px) { .welcome__card .rule { margin-left: 0; } }
