/* Meal of the Week
   Layout: open page, no boxes. Left: a giant stacked question and a fill-in-the-blank order.
   Right: the menu, where each dish is set in type sized by its share of the votes.
   Colour: a triad anchored on tomato (oklch hue ~32): basil ground (+120), violet accent (+240). */

@font-face {
  font-family: "Gluten";
  src: url("/fonts/gluten.woff2") format("woff2");
  font-weight: 400 800;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ground: #eaf2d8;      /* basil, pale */
  --ground-2: #dfeac8;    /* basil, one step deeper (pressed / hover wash) */
  --tomato: #e2452b;      /* display + primary action */
  --tomato-deep: #b8321c; /* pressed */
  --violet: #4b3fb5;      /* selection, the leader, your votes */
  --ink: #2b2540;         /* running text */
  --ink-soft: #5d5873;    /* meta */
  --cream: #fff6e6;       /* text on colour blocks */

  --display: "Gluten", "Chalkboard SE", "Comic Sans MS", ui-rounded, cursive;

  /* motion tokens (motion-primitives/tokens.md) */
  --ease-out: cubic-bezier(.23, 1, .32, 1);        /* repeated action, 180ms */
  --ease-ui: cubic-bezier(.55, 0, .45, 1);         /* UI default, 233ms */
  --ease-morph: cubic-bezier(.57, 0, .43, 1);      /* morph, 350ms */
  --spring: cubic-bezier(.34, 1.56, .64, 1);       /* bounce-back overshoot */
  --r: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--display);
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--violet); outline-offset: 4px; border-radius: 4px; }

/* ---------- page ---------- */
.page {
  max-width: 1240px;
  margin: 0 auto;
  padding-block: max(28px, env(safe-area-inset-top, 0px)) max(40px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
}
@media (min-width: 920px) {
  .page { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; padding-top: 56px; }
  .order { position: sticky; top: 40px; align-self: start; }
  .foot { grid-column: 1 / -1; }
}

/* ---------- title ---------- */
.title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(60px, 23cqi, 148px);
  line-height: .8;
  letter-spacing: -0.04em;
  color: var(--tomato);
  display: flex;
  flex-direction: column;
}
.title span { display: block; white-space: nowrap; }
.title .t2 { color: var(--violet); font-size: .42em; letter-spacing: -0.02em; margin: .12em 0 .1em .12em; transform: rotate(-4deg); transform-origin: left; width: max-content; }
.title i { font-style: normal; display: inline-block; transform-origin: 50% 90%; animation: wobble 2.8s var(--ease-ui) 1.2s infinite; }
@keyframes wobble { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(14deg) translateY(-4px); } 88% { transform: rotate(-8deg); } }

.rules { margin: 22px 0 0; max-width: 34ch; font-size: 18px; color: var(--ink-soft); text-wrap: pretty; }
.rules b { color: var(--violet); font-weight: 700; }

/* ---------- fill-in-the-blank order ---------- */
.madlib { margin-top: 36px; display: flex; flex-direction: column; gap: 6px; }
.line { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .32em; font-size: clamp(30px, 6.4vw, 42px); font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; }
.word { color: var(--ink); white-space: nowrap; }
.grow { display: inline-grid; max-width: 100%; min-width: 4.5ch; position: relative; padding-bottom: 8px; }
.grow::after { content: attr(data-value) " "; visibility: hidden; white-space: pre; grid-area: 1 / 1; overflow: hidden; }
.grow input {
  grid-area: 1 / 1; width: 100%; min-width: 0;
  border: 0; background: transparent; padding: 0; margin: 0;
  color: var(--tomato); font-weight: 700; caret-color: var(--violet);
  outline: none;
}
.grow input::placeholder { color: var(--tomato); opacity: .32; }
/* the squiggle: a drawn underline that runs out on focus, never a box */
.grow::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='8' viewBox='0 0 24 8'%3E%3Cpath d='M0 4 Q6 0 12 4 T24 4' fill='none' stroke='%23e2452b' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x 0 50% / 24px 8px;
  opacity: .35;
  clip-path: inset(0 0 0 0);
  transition: opacity 233ms var(--ease-ui);
}
.grow:focus-within::before { opacity: 1; animation: squiggle-run .9s linear infinite; }
@keyframes squiggle-run { to { background-position-x: 24px; } }
.grow.shake { animation: shake 360ms var(--ease-out); }
@keyframes shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } 100% { transform: translateX(0); } }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 22px; }

/* ---------- colour blocks (the only filled shapes on the page) ---------- */
.block {
  border: 0;
  border-radius: var(--r);
  background: var(--tomato);
  color: var(--cream);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0;
  padding: 14px 20px 12px;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 48px;
  transition: transform 180ms var(--ease-out), background-color 233ms var(--ease-ui), padding 350ms var(--ease-morph);
}
@supports (corner-shape: squircle) {
  .block, .tag { corner-shape: squircle; --r: 16px; }
}
.block .arrow { display: inline-block; transition: transform 233ms var(--spring); }
.block .label { transition: filter 200ms ease, opacity 200ms ease; }
.block:active { transform: scale(.95); background: var(--tomato-deep); }
@media (hover: hover) and (pointer: fine) {
  .block:hover .arrow { transform: translateX(5px); }
}
.block[data-state="sending"] .label { filter: blur(1.5px); opacity: .7; }
.block[data-state="sending"] .arrow { animation: stir 700ms linear infinite; }
@keyframes stir { to { transform: rotate(360deg); } }
.block[data-state="done"] { background: var(--violet); padding-inline: 26px; }
.block:disabled { cursor: progress; }

.link {
  border: 0; background: none; padding: 12px 2px; min-height: 44px;
  color: var(--ink-soft); font-size: 15px; font-weight: 600;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  transition: color 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.link:active { transform: scale(.95); }
@media (hover: hover) and (pointer: fine) { .link:hover { color: var(--tomato); } }

.shout { margin: 14px 0 0; min-height: 1.4em; font-size: 19px; font-weight: 700; color: var(--tomato); }
.shout.good { color: var(--violet); }
.shout:empty { min-height: 0; margin: 0; }

/* ---------- menu ---------- */
.menu { min-width: 0; }
.order { container-type: inline-size; min-width: 0; }
.menu-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.menu-head h2 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--violet); }
.tally { font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.loader { margin-top: 28px; font-size: 34px; font-weight: 800; color: var(--tomato); letter-spacing: -0.02em; display: flex; flex-wrap: wrap; }
.loader span { display: inline-block; animation: hop 900ms var(--ease-ui) infinite; }
.loader .sp { width: .3em; }
.page:not([data-state="loading"]) .loader { display: none; }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 25% { transform: translateY(-12px) rotate(-6deg); } 45% { transform: translateY(2px) scaleY(.9); } }

.dishes { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.dish-row { position: relative; }
.dish {
  display: block; width: 100%; text-align: left;
  border: 0; background: transparent; padding: 10px 0 12px; margin: 0;
  color: var(--ink);
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
  border-radius: var(--r);
}
.dish .rank { display: block; font-size: 14px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.dish .name {
  display: block;
  font-size: var(--s, 34px);
  font-weight: 800;
  line-height: .98;
  letter-spacing: -0.03em;
  color: var(--tomato);
  overflow-wrap: anywhere;
  transition: font-size 450ms var(--spring), color 180ms var(--ease-out);
  padding-top: .06em;
}
.dish .w { display: inline-block; white-space: nowrap; }
.dish .ch { display: inline-block; white-space: pre; }
.dish { transition: transform 420ms var(--spring); }
.dish:active { transform: scale(.975); transition-duration: 120ms; transition-timing-function: var(--ease-out); }
.dish .meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: 6px; font-size: 16px; color: var(--ink-soft); }
.dish .count { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; display: inline-flex; overflow: hidden; height: 1.3em; line-height: 1.3em; }
.dish .count .roll { display: inline-block; }
.dish .mine { color: var(--violet); font-weight: 700; }
.dish .hint { color: var(--ink-soft); opacity: 0; transition: opacity 180ms var(--ease-out); }
.dish:active .name { transform: none; }
.dish-row.lead .name { color: var(--violet); }
.dish-row.lead .rank { color: var(--violet); }

@media (hover: hover) and (pointer: fine) {
  .dish:hover .ch { animation: lean 420ms var(--spring) both; animation-delay: calc(var(--i) * 18ms); }
  .dish:hover .hint { opacity: 1; }
}
@keyframes lean { 40% { transform: translateY(-3px) rotate(-4deg); } 100% { transform: none; } }

.ch.jump { animation: jump var(--d, 520ms) var(--spring) both !important; animation-delay: calc(var(--i) * 16ms) !important; }
@keyframes jump {
  0% { transform: none; }
  30% { transform: translateY(var(--h, -14px)) rotate(var(--r, -6deg)) scale(1.06); }
  60% { transform: translateY(2px) scaleY(.92); }
  100% { transform: none; }
}

.pop { position: absolute; pointer-events: none; font-weight: 800; font-size: 22px; color: var(--violet); animation: pop-up 700ms var(--ease-out) forwards; }
@keyframes pop-up { 0% { opacity: 0; transform: translate(-50%, 4px) scale(.9); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -46px) rotate(var(--rot, 0deg)) scale(1.05); } }

.tag {
  display: inline-block; align-self: center;
  background: var(--violet); color: var(--cream);
  font-size: 13px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  padding: 7px 10px 5px; border-radius: var(--r);
  transform: rotate(4deg);
  animation: tag-in 467ms var(--spring) both;
  pointer-events: none;
}
@keyframes tag-in { from { opacity: 0; transform: rotate(14deg) scale(.9); } }

.chef-ctl { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; margin: -2px 0 8px; }
.chef-ctl .block { font-size: 14px; min-height: 44px; padding: 10px 14px 8px; background: var(--violet); }

.empty { margin: 28px 0 0; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; color: var(--tomato); }
.empty span { display: block; margin-top: 10px; font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink-soft); }

.past { margin-top: 56px; }
.past h3 { margin: 0 0 8px; font-size: 15px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--violet); }
.past ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.past li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; font-size: 18px; }
.past li b { font-weight: 700; color: var(--ink); }
.past li span { font-size: 15px; color: var(--ink-soft); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 8px; }
.foot p { margin: 0; max-width: 62ch; font-size: 14px; color: var(--ink-soft); }
.sound { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 800; font-size: 14px; letter-spacing: .03em; text-transform: uppercase; color: var(--ink); }
.bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; height: 100%; background: currentColor; border-radius: 1px; transform-origin: bottom; transform: scaleY(.35); }
.sound[aria-pressed="true"] .bars i { animation: eq 900ms ease-in-out infinite; }
.sound[aria-pressed="true"] .bars i:nth-child(2) { animation-delay: -300ms; }
.sound[aria-pressed="true"] .bars i:nth-child(3) { animation-delay: -600ms; }
@keyframes eq { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }

.chef {
  position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: var(--violet); color: var(--cream); border-radius: var(--r);
  padding: 4px 8px 4px 16px; font-weight: 800; font-size: 14px; letter-spacing: .03em; text-transform: uppercase;
}
@supports (corner-shape: squircle) { .chef { corner-shape: squircle; --r: 16px; } }
.chef .link { color: var(--cream); }
body:has(#chefBar:not([hidden])) .page { padding-bottom: max(112px, calc(env(safe-area-inset-bottom, 0px) + 96px)); } /* the fixed chef bar covered the footer text at the bottom of the page */

/* ---------- reduced motion: resting states, opacity only ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
  .pop { display: none; }
}
.still *, .still *::before, .still *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
.still .pop { display: none; }

/* ---------- footer on the page grid (aligned to both columns) ---------- */
.foot { margin-top: 24px; align-items: baseline; }
.foot p { text-wrap: pretty; }
@media (min-width: 920px) {
  .foot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 72px; align-items: baseline; }
  .foot .sound { justify-self: start; }
  .foot p { max-width: 52ch; }
}

/* ---------- illustrations: flat food, ink outline, slow ambient motion ---------- */
.order { position: relative; }
.ill { display: block; overflow: visible; }
.ill-tomato { position: absolute; width: clamp(64px, 17cqi, 104px); top: -6px; right: 0; }
.ill-bowl { position: absolute; width: clamp(56px, 15cqi, 96px); left: 48%; top: calc(min(23cqi, 148px) * .7); }
.title .t2 { display: flex; align-items: center; gap: .2em; }
.ill-chili { display: inline-block; width: 1.7em; height: auto; margin-top: .1em; }
.ill-egg { width: 120px; margin-bottom: 14px; }
.ill-loader { width: 96px; margin-bottom: 10px; }
.loader { flex-direction: row; align-items: flex-end; }
.loader .ill-loader { flex-basis: 100%; }

.bob { transform-box: fill-box; transform-origin: 50% 100%; animation: bob 3.2s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-6px) rotate(5deg); } }
.leaf { transform-box: fill-box; transform-origin: 50% 100%; animation: leaf 3.2s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes leaf { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }
.sway { transform-box: fill-box; transform-origin: 10% 30%; animation: sway 2.6s cubic-bezier(.45,0,.55,1) infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(6deg); } }
.steam path { stroke-dasharray: 40; animation: steam 2.4s linear infinite; opacity: 0; }
.steam .s2 { animation-delay: -.8s; }
.steam .s3 { animation-delay: -1.6s; }
@keyframes steam { 0% { stroke-dashoffset: 40; opacity: 0; transform: translateY(6px); } 30% { opacity: .9; } 100% { stroke-dashoffset: -40; opacity: 0; transform: translateY(-10px); } }
.yolk { transform-box: fill-box; transform-origin: center; animation: yolk 1.8s cubic-bezier(.34,1.56,.64,1) infinite; }
@keyframes yolk { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.12, .9); } 60% { transform: scale(.94, 1.06); } }
.pan { transform-box: fill-box; transform-origin: 40% 50%; }
.ill-loader .pan { animation: toss 900ms cubic-bezier(.55,0,.45,1) infinite; }
@keyframes toss { 0%, 100% { transform: rotate(0); } 30% { transform: rotate(-8deg) translateY(-4px); } 55% { transform: rotate(3deg); } }

/* ---------- the order key: a service bell set into a keycap ---------- */
.key {
  --lip: 6px;
  position: relative; border: 0; padding: 0 0 var(--lip); background: transparent;
  border-radius: 14px; min-height: 60px;
}
@supports (corner-shape: squircle) { .key, .key .cap, .key::before { corner-shape: squircle; border-radius: 26px; } }
.key::before { /* the lip the cap presses into */
  content: ""; position: absolute; inset: var(--lip) 0 0; border-radius: 14px; background: var(--tomato-deep);
}
.key .cap {
  position: relative; display: inline-flex; align-items: center; gap: 12px;
  padding: 15px 24px 13px 18px; border-radius: 14px;
  background: var(--tomato); color: var(--cream);
  font-weight: 800; font-size: 19px; letter-spacing: -0.01em;
  transform: translateY(0);
  transition: transform 420ms var(--spring), background-color 233ms var(--ease-ui);
}
.key .bell { width: 30px; height: 25px; color: var(--cream); overflow: visible; flex: none; }
.key .bell-body { transform-box: fill-box; transform-origin: 50% 100%; }
.key .ring { opacity: 0; }
.key .label { transition: filter 200ms ease, opacity 200ms ease; }
@media (hover: hover) and (pointer: fine) {
  .key:hover .cap { transform: translateY(-2px) rotate(-1.2deg); }
  .key:hover .bell-body { animation: wiggle 520ms var(--spring); }
}
.key:active .cap { transform: translateY(var(--lip)) scale(1.02, .96); transition: transform 90ms var(--ease-out); }
.key:active .ring, .key.dinged .ring { animation: ring 420ms var(--ease-out); }
.key.dinged .bell-body { animation: wiggle 520ms var(--spring); }
@keyframes wiggle { 0% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } 100% { transform: rotate(0); } }
@keyframes ring { 0% { opacity: 0; transform: scale(.8); } 30% { opacity: 1; } 100% { opacity: 0; transform: scale(1.25); } }
.key[data-state="sending"] .label { filter: blur(1.5px); opacity: .7; }
.key[data-state="sending"] .bell-body { animation: wiggle 520ms linear infinite; }
.key[data-state="done"] .cap { background: var(--violet); }
.key[data-state="done"]::before { background: #33298a; }
.key:disabled { cursor: progress; }

@media (max-width: 600px) {
  .ill-tomato { width: 64px; top: -4px; }
  .ill-bowl { width: 72px; }
}

/* ---------- illustrations v2: ink line over offset colour, one per purpose ---------- */
.title .t2 { display: block; }
.ill-pot, .ill-plate { display: block; overflow: visible; }
.kitchen { width: clamp(150px, 42cqi, 210px); margin-top: 36px; }
.ill-loader { width: 120px; }
.ill-plate { width: 170px; margin-bottom: 16px; }
.lid { transform-box: view-box; transform-origin: 115px 86px; }
.kitchen .lid { animation: simmer 2.4s var(--ease-ui) infinite; }
@keyframes simmer { 0%, 82%, 100% { transform: none; } 86% { transform: translateY(-5px) rotate(-3deg); } 91% { transform: translateY(0) rotate(1deg); } 95% { transform: translateY(-2px) rotate(-1deg); } }
.ill-loader .lid { animation: rattle 520ms var(--ease-ui) infinite; }
@keyframes rattle { 0%, 100% { transform: none; } 30% { transform: translateY(-7px) rotate(-4deg); } 60% { transform: translateY(-2px) rotate(3deg); } }
.kitchen.boil .lid { animation: pop-lid 700ms var(--spring); }
@keyframes pop-lid { 0% { transform: none; } 35% { transform: translateY(-30px) rotate(-14deg); } 70% { transform: translateY(2px) rotate(3deg); } 100% { transform: none; } }
.flames path { transform-box: fill-box; transform-origin: 50% 100%; animation: flame 900ms ease-in-out infinite alternate; }
.flames .f2 { animation-delay: -300ms; animation-duration: 760ms; }
.flames .f3 { animation-delay: -600ms; }
@keyframes flame { from { transform: scale(.85, .8) rotate(-4deg); } to { transform: scale(1.05, 1.12) rotate(4deg); } }
.kitchen.boil .flames path { animation-duration: 260ms; }
.cutlery { animation: none; }

/* ---------- the title as a logo: one tilted lockup with an offset-print shadow ---------- */
.title {
  width: max-content; max-width: 100%;
  font-size: clamp(56px, 20cqi, 132px);
  line-height: .74;
  transform: rotate(-6deg);
  transform-origin: 0 100%;
  margin: 18px 0 8px 4px;
  text-shadow: .045em .04em 0 var(--violet);
  transition: transform 520ms var(--spring);
}
.title .t1 { position: relative; z-index: 1; }
.title .t2 {
  position: relative; z-index: 2;
  margin: -.02em 0 -.06em .9em;
  font-size: .34em; letter-spacing: -0.01em;
  color: var(--violet); text-shadow: none;
  transform: rotate(-8deg);
}
.title .t3 { position: relative; z-index: 1; }
.title i { text-shadow: inherit; }
@media (hover: hover) and (pointer: fine) {
  .title:hover { transform: rotate(-3deg) translateY(-3px); }
}
.rules { margin-top: 34px; }

/* ---------- people ---------- */
.who { display: inline-block; vertical-align: middle; line-height: 0; flex: none; }
.who .pp { width: 100%; height: 100%; overflow: visible; }
.who.sm { width: 26px; height: 26px; margin: -6px 6px -4px 0; }
.who.lg { width: 58px; height: 58px; }
.who .eyes { transform-box: fill-box; transform-origin: center; animation: blink var(--blink, 3.4s) steps(1) infinite; }
@keyframes blink { 0%, 94%, 100% { transform: none; } 96% { transform: scaleY(.1); } }
.who.hop { animation: face-hop 520ms var(--spring); }
@keyframes face-hop { 30% { transform: translateY(-8px) rotate(-10deg) scale(1.12); } 65% { transform: translateY(1px) rotate(4deg); } }
.who.pop-in { animation: face-in 520ms var(--spring) both; }
@keyframes face-in { from { opacity: 0; transform: scale(.6) rotate(-20deg) translateY(10px); } }
.me { display: inline-flex; align-self: center; min-width: 0; }
.dish .by { display: inline-flex; align-items: center; }
.wk-who { display: inline-flex; align-items: center; }
@media (hover: hover) and (pointer: fine) {
  .dish:hover .who { animation: face-hop 520ms var(--spring); }
}

/* ---------- view switch: the block slides under the active word ---------- */
.views { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.views .slider {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 7px;
  background: var(--violet);
  transition: transform 420ms var(--spring), width 420ms var(--spring);
}
@supports (corner-shape: squircle) { .views .slider { corner-shape: squircle; border-radius: 14px; } }
.view {
  position: relative; z-index: 1; border: 0; background: none;
  padding: 9px 12px 7px; min-height: 44px; /* 44px touch target */
  font-size: 15px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
  color: var(--violet); transition: color 233ms var(--ease-ui), transform 160ms var(--ease-out);
}
.view[aria-pressed="true"] { color: var(--cream); }
.view:active { transform: scale(.95); }
.count-badge { opacity: .75; }

/* ---------- album ---------- */
.album { margin-top: 18px; }
.wk { margin-bottom: 34px; }
.wk-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 10px; }
.wk-no { font-size: 14px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--violet); }
.wk-dish { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; line-height: 1.05; color: var(--tomato); flex-basis: 100%; }
.wk-who { font-size: 15px; color: var(--ink-soft); }
.wk-row { display: flex; gap: 6px; margin-bottom: 6px; }
.thumb {
  position: relative; flex: none; padding: 0; border: 0; overflow: hidden;
  border-radius: 10px; background: var(--ground-2);
  transition: transform 420ms var(--spring);
}
@supports (corner-shape: squircle) { .thumb { corner-shape: squircle; border-radius: 22px; } }
.thumb::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%) 0 0 / 220% 100%; animation: shimmer 1.2s linear infinite; }
.thumb.in::before { display: none; }
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transform: scale(1.04); transition: opacity 317ms cubic-bezier(.167,.167,.43,1), transform 600ms var(--ease-out); }
.thumb.in img { opacity: 1; transform: none; }
.thumb:active { transform: scale(.97); transition-duration: 120ms; }
@media (hover: hover) and (pointer: fine) { .thumb:hover img { transform: scale(1.05); } }

.uploader { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 4px 0 28px; }
.up-week { display: flex; align-items: baseline; gap: 8px; font-size: 18px; font-weight: 700; }
.up-week b { color: var(--tomato); font-size: 22px; }
.up-week .link:disabled { opacity: .35; cursor: default; }
.up-key { cursor: pointer; display: inline-block; }
.up-key .plus { font-size: 26px; line-height: .6; transition: transform 420ms var(--spring); }
@media (hover: hover) and (pointer: fine) { .up-key:hover .plus { transform: rotate(90deg); } }
.up-key[data-state="sending"] .plus { animation: stir 700ms linear infinite; }
.up-key[data-state="done"] .cap { background: var(--violet); }
.up-key:active .cap { transform: translateY(var(--lip)) scale(1.02, .96); transition: transform 90ms var(--ease-out); }
.uploader:has(#fileIn:focus-visible) .up-key { outline: 3px solid var(--violet); outline-offset: 4px; } /* ring only for keyboard focus on the file input, not any click inside the uploader */
.up-dish { margin: 0; flex-basis: 100%; font-size: 15px; color: var(--ink-soft); }

/* ---------- lightbox ---------- */
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 50; }
.lb-scrim { position: absolute; inset: 0; background: rgba(28, 24, 44, .92); }
.lb-img { position: absolute; object-fit: cover; border-radius: 6px; touch-action: pan-y; user-select: none; -webkit-user-drag: none; cursor: grab; transform-origin: 0 0; }
.lb-bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px max(16px, env(safe-area-inset-right, 0px)) max(16px, env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 18px; color: var(--cream);
}
.lb-cap { margin: 0; font-size: 18px; font-weight: 700; min-width: 0; }
.lb-ctl { display: flex; align-items: center; gap: 4px 14px; flex-wrap: wrap; }
.lb-btn { border: 0; background: none; color: var(--cream); font-weight: 800; font-size: 15px; letter-spacing: .03em; text-transform: uppercase; padding: 12px 4px; min-height: 44px; transition: color 180ms var(--ease-out), transform 160ms var(--ease-out); }
.lb-btn:active { transform: scale(.94); }
@media (hover: hover) and (pointer: fine) { .lb-btn:hover { color: var(--butter, #f2c14e); } }
.lb-del { color: #ff8a73; }
.lb-pos { font-size: 14px; opacity: .7; font-variant-numeric: tabular-nums; }
.who.sm { width: 34px; height: 34px; margin: -8px 6px -6px -2px; }
.dish .meta { align-items: center; }
.wk-who .who.sm { width: 28px; height: 28px; }

/* ---------- vote heart with rolled bursts (X-style like) ---------- */
.yum { position: relative; display: inline-flex; width: 22px; height: 22px; align-self: center; margin-right: -8px; }
.yum svg { width: 100%; height: 100%; overflow: visible; }
.yum path { fill: transparent; stroke: var(--ink-soft); stroke-width: 2; transition: fill 180ms var(--ease-out), stroke 180ms var(--ease-out); }
.yum.on path { fill: var(--tomato); stroke: var(--tomato); }
.yum.beat svg { animation: heart-beat 520ms var(--spring); }
@keyframes heart-beat { 0% { transform: scale(.4); } 45% { transform: scale(1.3); } 70% { transform: scale(.92); } 100% { transform: scale(1); } }
.yum > span { position: absolute; left: 50%; top: 50%; pointer-events: none; }
.b-ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%; background: radial-gradient(circle, transparent 52%, var(--c) 54%, var(--c) 66%, transparent 68%); animation: b-ring 520ms var(--ease-out) forwards; }
@keyframes b-ring { from { transform: scale(.2); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.b-dot { width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); border-radius: 50%; background: var(--c); animation: b-dot 620ms var(--ease-out) 60ms both; }
@keyframes b-dot { from { transform: translate(0, 0) scale(1.2); opacity: 1; } 70% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(0); opacity: 0; } }
.b-spark { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--c); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: b-spark 820ms var(--ease-out) var(--delay) both; }
@keyframes b-spark { from { transform: translate(0, 0) scale(.3) rotate(0); opacity: 1; } 60% { opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1) rotate(var(--rot)); opacity: 0; } }
.b-food { width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; background: var(--c); animation: b-food-x 900ms linear both, b-food-y 900ms cubic-bezier(.3,0,.7,1) both; }
.b-food.pea { border-radius: 50%; }
.b-food.slice { width: 10px; height: 6px; border-radius: 10px 10px 2px 2px; }
.b-food.crumb { border-radius: 2px 5px 3px 6px; }
@keyframes b-food-x { to { translate: var(--dx) 0; rotate: var(--rot); opacity: 0; } }
@keyframes b-food-y { 0% { transform: translateY(0); } 40% { transform: translateY(var(--up)); } 100% { transform: translateY(26px); } }
.b-mega { position: absolute; right: 4%; top: 6px; z-index: 3; pointer-events: none; font-weight: 800; font-size: clamp(34px, 7vw, 56px); letter-spacing: -0.03em; color: var(--tomato); text-shadow: .05em .05em 0 var(--violet); animation: b-mega 1000ms var(--spring) both; }
@keyframes b-mega { 0% { transform: rotate(var(--rot)) scale(2.2); opacity: 0; } 25% { transform: rotate(var(--rot)) scale(.95); opacity: 1; } 70% { opacity: 1; } 100% { transform: rotate(var(--rot)) scale(1) translateY(-14px); opacity: 0; } }
.shake-row { animation: row-shake 380ms var(--ease-out); }
@keyframes row-shake { 20% { transform: translateX(-6px) rotate(-.6deg); } 45% { transform: translateX(5px) rotate(.4deg); } 70% { transform: translateX(-2px); } }

/* ---------- her ground: radial #FFFCF4 → #EAF9FE ---------- */
:root { --ground: #fffcf4; --ground-2: #e4eef1; --ink-faint: #9a97a6; }
html { background: #eaf9fe; min-height: 100%; }
body { background: radial-gradient(ellipse at 50% 40%, #fffcf4 0%, #eaf9fe 100%) fixed; min-height: 100vh; }
@supports (-webkit-touch-callout: none) { body { background-attachment: scroll; } }

/* intro copy: one quiet grey, no emphasis colour */
.rules, .rules b { color: var(--ink-faint); }
.rules b { font-weight: inherit; }

/* no rank labels, no "cooking this" tag: size and colour already say who leads */
.dish .rank, .tag { display: none; }
/* removed on request: dish/vote tally and the "already cooked" list */
#tally, #pastBox { display: none !important; }

/* ---------- her logo SVG, tilted, with the eating creature ---------- */
.title.has-logo { font-size: 0; line-height: 0; text-shadow: none; width: min(100%, 470px); margin: 22px 0 6px 14px; display: block; }
.logo { width: 100%; height: auto; overflow: visible; cursor: pointer; display: block; }
.logo .lg-burp text { font-family: var(--display); font-weight: 800; font-size: 11px; fill: #22202b; letter-spacing: -0.02em; }
.logo .lg-t, .logo .lg-n, .logo .lg-apos, .logo .lg-burp { transform-box: view-box; }
@media (max-width: 919px) { .title.has-logo { width: min(100% - 14px, 420px); margin-top: 30px; } }

/* ---------- responsive audit fixes ---------- */
.view { min-height: 44px; padding-block: 11px 9px; }
.grow input { min-height: 44px; }
.page { max-width: min(1480px, 92vw); }
@media (min-width: 760px) and (max-width: 919px) {
  .page { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 40px; padding-top: 40px; }
  .order { position: sticky; top: 24px; align-self: start; }
  .foot { grid-column: 1 / -1; }
}
.title.has-logo { transform: rotate(-2.2deg); }
.logo .lg-eyeball { transform-box: view-box; }
@media (hover: hover) and (pointer: fine) { .title.has-logo:hover { transform: rotate(-1deg) translateY(-2px); } }

/* sound toggle floats in the bottom-right corner */
.foot .sound { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); z-index: 20; }
/* intro copy on two lines */
.rules { max-width: 64ch; }

/* removed on request: personal vote count */
.dish .mine { display: none; }

/* left column: centred in the viewport on wide screens */
@media (min-width: 920px) {
  .order { top: 0; min-height: calc(100vh - 112px); display: flex; flex-direction: column; justify-content: center; }
}
/* contrast: intro grey to >=3:1 on the new ground, placeholders a touch stronger */
:root { --ink-faint: #827f92; }
.grow input::placeholder { opacity: .5; }
/* menu column sits further right on wide screens */
@media (min-width: 920px) { .menu { padding-left: clamp(24px, 6vw, 120px); } }

/* menu column centred vertically too */
@media (min-width: 920px) {
  .menu { min-height: calc(100vh - 112px); display: flex; flex-direction: column; justify-content: center; }
}

/* ---------- the order button: a cloche over a plate ---------- */
.cloche {
  position: relative; border: 0; background: none; padding: 30px 0 0; margin: 0;
  display: inline-flex; flex-direction: column; align-items: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cloche .dome {
  position: relative; z-index: 2; display: block;
  background: var(--tomato); color: var(--cream);
  padding: 26px 40px 14px;
  border-radius: 999px 999px 10px 10px / 140px 140px 10px 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.01em; line-height: 1.1; white-space: nowrap;
  transform-origin: 92% 100%;
  box-shadow: inset 0 -6px 0 var(--tomato-deep), inset 10px 10px 0 -4px rgba(255, 246, 230, .18);
  transition: transform 520ms var(--spring), background-color 233ms var(--ease-ui), box-shadow 233ms var(--ease-ui);
}
.cloche .knob {
  position: absolute; left: 50%; top: -11px; width: 18px; height: 14px; margin-left: -9px;
  background: var(--tomato); border-radius: 9px 9px 3px 3px;
  transition: background-color 233ms var(--ease-ui);
}
.cloche .label { display: inline-block; transition: filter 200ms ease, opacity 200ms ease; }
.cloche .plate {
  position: relative; z-index: 3; display: block; width: calc(100% + 28px); height: 12px; margin-top: -2px;
  background: var(--violet); border-radius: 12px;
  transition: transform 420ms var(--spring);
}
.cloche .steam { position: absolute; left: 50%; bottom: 16px; z-index: 1; width: 60px; height: 40px; margin-left: -30px; pointer-events: none; }
.cloche .steam i {
  position: absolute; bottom: 0; width: 4px; height: 22px; border-radius: 4px;
  background: var(--ink-faint); opacity: 0; transform-origin: bottom;
}
.cloche .steam i:nth-child(1) { left: 14px; } .cloche .steam i:nth-child(2) { left: 28px; } .cloche .steam i:nth-child(3) { left: 42px; }
.cloche .rings { position: absolute; left: 50%; top: 10px; width: 0; height: 0; pointer-events: none; }
.cloche .rings i { position: absolute; width: 4px; height: 12px; border-radius: 4px; background: var(--violet); opacity: 0; top: -6px; }
.cloche .rings i:nth-child(1) { left: -40px; transform: rotate(-35deg); }
.cloche .rings i:nth-child(2) { left: 36px; transform: rotate(35deg); }

@media (hover: hover) and (pointer: fine) {
  /* peek: the dome tips open from the right, steam escapes, the plate shows */
  .cloche:hover .dome { transform: translateY(-10px) rotate(-7deg); }
  .cloche:hover .steam i { animation: puff 900ms var(--ease-out) infinite; }
  .cloche:hover .steam i:nth-child(2) { animation-delay: 150ms; }
  .cloche:hover .steam i:nth-child(3) { animation-delay: 300ms; }
}
@keyframes puff { 0% { opacity: 0; transform: translateY(6px) scaleY(.4) rotate(0); } 30% { opacity: .7; } 100% { opacity: 0; transform: translateY(-22px) scaleY(1) rotate(8deg); } }

/* press: slam shut, squash, ring */
.cloche:active .dome { transform: translateY(3px) scale(1.03, .9); transition-duration: 90ms; transition-timing-function: var(--ease-out); }
.cloche:active .plate { transform: scaleX(1.04); transition-duration: 90ms; }
.cloche:active .rings i, .cloche.dinged .rings i { animation: ding 460ms var(--ease-out); }
@keyframes ding { 0% { opacity: 0; translate: 0 6px; } 30% { opacity: 1; } 100% { opacity: 0; translate: 0 -10px; } }

/* sending: the lid rattles while the order goes in */
.cloche[data-state="sending"] .dome { animation: rattle-lid 240ms linear infinite; }
.cloche[data-state="sending"] .label { filter: blur(1.2px); opacity: .75; }
@keyframes rattle-lid { 0%, 100% { transform: rotate(0); } 25% { transform: translateY(-3px) rotate(-2deg); } 75% { transform: translateY(-1px) rotate(2deg); } }
/* done: the lid lifts off and turns violet */
.cloche[data-state="done"] .dome { background: var(--violet); box-shadow: inset 0 -6px 0 #33298a; transform: translateY(-8px) rotate(-4deg); }
.cloche[data-state="done"] .knob { background: var(--violet); }
.cloche[data-state="done"] .steam i { animation: puff 900ms var(--ease-out) 2; }
.cloche:disabled { cursor: progress; }
.cloche:focus-visible { outline: none; }
.cloche:focus-visible .dome { outline: 3px solid var(--violet); outline-offset: 4px; }
/* the logo keeps still on hover; the dino is its only motion */
.title.has-logo, .title.has-logo:hover { transform: rotate(-2.2deg); transition: none; }
/* hover: the lid lifts straight up a little, the knob wiggles, steam escapes. no tipping */
@media (hover: hover) and (pointer: fine) {
  .cloche:hover .dome { transform: translateY(-7px); }
  .cloche:hover .knob { animation: knob-wiggle 520ms var(--spring); }
}
@keyframes knob-wiggle { 30% { transform: rotate(-18deg); } 60% { transform: rotate(10deg); } 100% { transform: none; } }
.cloche[data-state="done"] .dome { transform: translateY(-9px); }

/* ---------- view switch: two wobbly blob pills, fixed at the bottom centre ---------- */
.page { padding-bottom: max(110px, calc(env(safe-area-inset-bottom, 0px) + 96px)); }
.views {
  position: fixed; z-index: 30; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); display: flex; gap: 10px; align-items: center;
}
.views .slider { display: none; }
.view {
  --violet-soft: #e2defc;
  min-height: 50px; padding: 14px 24px 12px;
  background: var(--violet-soft); color: var(--violet);
  border-radius: 56% 44% 52% 48% / 48% 58% 42% 52%;
  animation: blob 5.2s ease-in-out infinite alternate;
  transition: background-color 233ms var(--ease-ui), color 233ms var(--ease-ui), transform 420ms var(--spring);
}
.view + .view { animation-duration: 6.1s; animation-delay: -2.3s; }
.view[aria-pressed="true"] { background: var(--violet); color: var(--cream); }
@keyframes blob {
  0% { border-radius: 56% 44% 52% 48% / 48% 58% 42% 52%; }
  33% { border-radius: 44% 56% 46% 54% / 56% 44% 58% 42%; }
  66% { border-radius: 52% 48% 58% 42% / 42% 52% 48% 58%; }
  100% { border-radius: 48% 52% 44% 56% / 54% 46% 52% 48%; }
}
@media (hover: hover) and (pointer: fine) {
  .view:hover { transform: translateY(-3px) rotate(-2deg); animation-duration: 1.6s; }
}
.view:active { transform: scale(.92); transition-duration: 90ms; }
/* chef mode moves to the bottom left so the pills own the centre */
.chef { left: max(16px, env(safe-area-inset-left, 0px)); transform: none; }
@media (max-width: 600px) {
  .view { padding: 13px 18px 11px; font-size: 14px; }
  .foot .sound #soundLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .foot .sound { min-width: 44px; justify-content: center; }
}

/* underline: mostly straight, with uneven little wobbles */
.grow::before {
  height: 10px; bottom: -1px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='10' viewBox='0 0 300 10'%3E%3Cpath d='M0 5H38q3-4 6 0t6 0H96q2-3 4 0H150q3-5 7 0t7 0t7 0H222q2.5 3.5 5 0H262q2-3 4 0t4 0H300' fill='none' stroke='%23e2452b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") repeat-x 0 50% / 300px 10px;
}
.grow:focus-within::before { animation: squiggle-run-long 7s linear infinite; }
@keyframes squiggle-run-long { to { background-position-x: 300px; } }
