/* The Biscuit Barrel
   Layout: a gingham tablecloth masthead, a prize-rosette "Biscuit of the Day" table,
   then the open tin: a sticky search bar over a grid of biscuits on paper doilies. */
:root {
  --bg: #e4eeeb;          /* duck-egg tea-set blue */
  --surface: #f9fcfb;
  --surface-2: #d3e3de;
  --ink: #1c2640;         /* navy, like a willow-pattern plate */
  --muted: #536079;
  --jam: #b8263f;         /* Jammie Dodger red */
  --jam-ink: #ffffff;
  --custard: #f2c14e;     /* custard cream yellow */
  --line: rgba(28, 38, 64, 0.14);
  --doily: #ffffff;
  --doily-hole: #dbe7e3;
  --gingham: rgba(184, 38, 63, 0.42);
  --shadow: 0 1px 0 rgba(28, 38, 64, 0.06), 0 10px 24px -14px rgba(28, 38, 64, 0.35);
  --tea: #9a5f33;
  --cup: #fdfdfb;
  --cup-line: #c9d6e6;

  --font-display: "Shrikhand", "Cooper Black", Georgia, serif;
  --font-body: "Alegreya", "Iowan Old Style", Georgia, serif;
  --font-utility: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 4vw + 1rem, 3.1rem);
  --step-4: clamp(2.6rem, 7vw + 1rem, 5.4rem);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111a2b;
    --surface: #1a2540;
    --surface-2: #233154;
    --ink: #edf0f6;
    --muted: #a7b1c8;
    --jam: #ff6f86;
    --jam-ink: #1a0c12;
    --custard: #f5c95d;
    --line: rgba(237, 240, 246, 0.14);
    --doily: #2b3a60;
    --doily-hole: #1a2540;
    --gingham: rgba(255, 111, 134, 0.3);
    --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 28px -16px rgba(0, 0, 0, 0.8);
    --tea: #b9773f;
    --cup: #e9edf4;
    --cup-line: #9fb0c9;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111a2b;
  --surface: #1a2540;
  --surface-2: #233154;
  --ink: #edf0f6;
  --muted: #a7b1c8;
  --jam: #ff6f86;
  --jam-ink: #1a0c12;
  --custard: #f5c95d;
  --line: rgba(237, 240, 246, 0.14);
  --doily: #2b3a60;
  --doily-hole: #1a2540;
  --gingham: rgba(255, 111, 134, 0.3);
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.3), 0 12px 28px -16px rgba(0, 0, 0, 0.8);
  --tea: #b9773f;
  --cup: #e9edf4;
  --cup-line: #9fb0c9;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
a { color: inherit; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 10;
  background: var(--bg);
}
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.1; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--custard); outline-offset: 3px; border-radius: 6px; }

.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 50;
  background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: 8px;
}
.skip:focus { top: 12px; }

.eyebrow {
  font-family: var(--font-utility);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Masthead ---------- */
.masthead { position: relative; overflow: hidden; }
.gingham {
  position: absolute; inset: 0;
  background-color: var(--surface);
  background-image:
    linear-gradient(90deg, var(--gingham) 50%, transparent 50%),
    linear-gradient(var(--gingham) 50%, transparent 50%);
  background-size: 36px 36px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0, #000 55%, transparent 100%);
}
.masthead-inner {
  position: relative;
  padding-block: 40px 28px;
  display: grid;
  gap: 18px;
}
.title-card {
  background: var(--bg);
  border-radius: 22px;
  padding: clamp(20px, 4vw, 40px);
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  max-width: 780px;
  border: 2px solid var(--line);
}
.title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-4);
  letter-spacing: -0.01em;
  color: var(--ink);
}
.title > span:not(.word) { color: var(--jam); display: inline-block; transform: rotate(-3deg); }
.lede { font-size: var(--step-1); max-width: 58ch; line-height: 1.45; }
.quick { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 2px solid var(--ink);
  background: transparent;
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.btn:hover { transform: translateY(-2px) rotate(-1deg); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--jam); border-color: var(--jam); color: var(--jam-ink); }
.btn.custard { background: var(--custard); border-color: var(--custard); color: #1c2640; }
.btn svg { width: 18px; height: 18px; }

/* ---------- Biscuit of the Day ---------- */
.today { padding-block: 24px 48px; }
.today-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: clamp(20px, 4vw, 48px);
  align-items: center;
  background: var(--surface);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 44px);
  box-shadow: var(--shadow);
  border: 2px solid var(--line);
}
.today-text { display: grid; gap: 14px; min-width: 0; }
.today-text h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--step-3);
}
.today-text .aka { font-style: italic; color: var(--muted); font-size: var(--step-1); }
.today-text .blurb { font-size: var(--step-1); line-height: 1.45; max-width: 52ch; }
.today-facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px; margin: 4px 0 0;
  border-top: 2px dotted var(--line); border-bottom: 2px dotted var(--line);
  padding-block: 12px;
}
.today-facts div { min-width: 0; }
.today-facts dt { font-family: var(--font-utility); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.today-facts dd { margin: 2px 0 0; font-weight: 700; }
.today-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.dunk-result { min-height: 1.6em; font-style: italic; color: var(--muted); }
.dunk-result strong { color: var(--ink); font-style: normal; }

.stage {
  position: relative;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 1;
  margin-inline: auto;
}
.stage .dunker {
  position: absolute;
  left: 12%; top: 4%;
  width: 64%;
  z-index: 2;
  transform-origin: 50% 50%;
}
.stage .dunker .biscuit-svg { width: 100%; height: auto; display: block; overflow: visible; }
.stage .plate-doily {
  position: absolute;
  left: 12%; top: 4%;
  width: 64%;
  z-index: 0;
}
.stage .plate-doily .biscuit-svg { width: 100%; height: auto; display: block; }
.stage .dunker .biscuit-svg { transition: filter 0.5s ease; }
.stage.soggy .dunker .biscuit-svg { filter: sepia(0.35) saturate(1.3) brightness(0.82); }
.stage .cup-back, .stage .cup-front {
  position: absolute; right: 0; bottom: 3%;
  width: 46%;
}
.stage .cup-back { z-index: 1; }
.stage .cup-front { z-index: 3; pointer-events: none; }
.stage .crumbs { position: absolute; right: 0; bottom: 3%; width: 46%; z-index: 4; opacity: 0; transition: opacity 0.6s ease; pointer-events: none; }
.stage.lost .crumbs { opacity: 1; }
.stage.lost .dunker { opacity: 0; }
.stage.dunking .dunker { animation: dunk 2.6s ease-in-out forwards; }
.stage.dunking.fail .dunker { animation: dunk-fail 2.6s ease-in-out forwards; }
.stage.dunking .tea-ripple { animation: ripple 1s ease-out 0.9s 2; }
.tea-ripple { transform-origin: 60px 22px; transform-box: view-box; opacity: 0; }

@keyframes dunk {
  0% { transform: none; }
  25% { transform: translate(49%, 17%) rotate(18deg) scale(0.48); }
  40%, 68% { transform: translate(49%, 55%) rotate(18deg) scale(0.48); }
  100% { transform: none; }
}
@keyframes dunk-fail {
  0% { transform: none; opacity: 1; }
  25% { transform: translate(49%, 17%) rotate(18deg) scale(0.48); opacity: 1; }
  40%, 70% { transform: translate(49%, 55%) rotate(18deg) scale(0.48); opacity: 1; }
  100% { transform: translate(49%, 68%) rotate(26deg) scale(0.4); opacity: 0; }
}
@keyframes ripple {
  0% { opacity: 0.8; transform: scale(0.4); }
  100% { opacity: 0; transform: scale(1.3); }
}

.rosette {
  position: absolute;
  left: -2%; top: -2%;
  width: 30%;
  z-index: 5;
  transform-origin: 50% 12%;
  animation: sway 5s ease-in-out infinite;
}
@keyframes sway {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(-3deg); }
}

/* ---------- The tin ---------- */
.tin { padding-bottom: 64px; }
.tin-head { display: grid; gap: 6px; padding-bottom: 12px; }
.tin-head h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-3); }
.tin-head p { color: var(--muted); max-width: 62ch; }

.searchbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 8;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--line);
}
.searchbar .wrap { padding-block: 14px; display: grid; gap: 12px; }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.search-box {
  flex: 1 1 280px;
  min-width: 0;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 0 8px 0 16px;
}
.search-box:focus-within { box-shadow: 0 0 0 4px color-mix(in srgb, var(--custard) 60%, transparent); }
.search-box svg { width: 20px; height: 20px; flex: none; color: var(--muted); }
.search-box input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  padding: 11px 0;
  font-size: var(--step-0);
}
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box kbd {
  font-family: var(--font-utility); font-size: 0.75rem;
  border: 1.5px solid var(--line); border-radius: 6px; padding: 1px 7px; color: var(--muted);
}
.clear-btn {
  border: 0; background: var(--surface-2); border-radius: 999px;
  width: 30px; height: 30px; cursor: pointer; font-size: 1rem; line-height: 1;
}
.sort {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-utility); font-size: 0.78rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.sort select {
  font-family: var(--font-body); font-size: var(--step-0); text-transform: none; letter-spacing: 0;
  color: var(--ink);
  background: var(--surface); border: 2px solid var(--ink); border-radius: 999px; padding: 9px 14px;
  cursor: pointer;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.chip {
  flex: none;
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: var(--step--1);
  font-weight: 700;
  cursor: pointer;
  display: inline-flex; gap: 6px; align-items: baseline;
}
.chip .n { font-family: var(--font-utility); font-weight: 500; font-size: 0.72rem; color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip[aria-pressed="true"] .n { color: inherit; opacity: 0.75; }
.chip:disabled { opacity: 0.45; cursor: default; }

.results-line {
  padding-block: 20px 14px;
  font-family: var(--font-utility); font-size: 0.8rem; letter-spacing: 0.06em; color: var(--muted);
}
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
.card {
  width: 100%; height: 100%;
  text-align: left;
  color: inherit;
  text-decoration: none;
  display: grid;
  grid-template-rows: auto 1fr;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: var(--shadow); }
.card .plate { background: var(--surface-2); padding: 14px 18px 6px; position: relative; }
.card .plate .biscuit-svg { width: 100%; height: auto; display: block; }
.card .biscuit { transform-origin: 100px 100px; transform-box: view-box; transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1); }
.card:hover .biscuit, .card:focus-visible .biscuit { transform: rotate(-12deg) scale(1.05); }
.card .today-flag {
  position: absolute; top: 10px; right: 10px;
  background: var(--jam); color: var(--jam-ink);
  font-family: var(--font-utility); font-size: 0.66rem; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px;
}
.card .body { padding: 14px 16px 16px; display: grid; gap: 6px; align-content: start; }
.card h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; letter-spacing: 0.005em; }
.card .meta { font-family: var(--font-utility); font-size: 0.72rem; letter-spacing: 0.05em; color: var(--muted); }
.card .blurb { font-size: 0.97rem; line-height: 1.45; }
.card .dunk-row { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 8px; }
mark { background: color-mix(in srgb, var(--custard) 70%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }

.cups { display: inline-flex; gap: 2px; color: var(--ink); }
.cups svg { width: 18px; height: 18px; }
.cups .off { opacity: 0.22; }
.dunk-label { font-family: var(--font-utility); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.empty {
  text-align: center;
  padding: 48px 16px;
  display: grid; gap: 10px; justify-items: center;
  background: var(--surface); border: 2px dashed var(--line); border-radius: var(--radius);
}
.empty h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); }
.empty svg { width: 120px; height: auto; }

/* ---------- Detail dialog ---------- */
dialog.detail {
  width: min(980px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  border: 0;
  padding: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
  overflow: auto;
}
dialog.detail::backdrop { background: rgba(17, 26, 43, 0.55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
dialog.detail[open] { animation: pop 0.25s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop { from { transform: translateY(16px) scale(0.98); opacity: 0; } }
.detail-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 2px solid var(--line);
}
.detail-bar .nav { display: flex; gap: 8px; }
.icon-btn {
  border: 2px solid var(--line); background: var(--surface);
  border-radius: 999px; height: 38px; min-width: 38px; padding: 0 12px;
  cursor: pointer; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.icon-btn:hover { border-color: var(--ink); }
.detail-body { padding: clamp(18px, 4vw, 40px); display: grid; gap: 36px; }
.detail-top { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.2fr); gap: clamp(20px, 4vw, 44px); }
.detail-art { display: grid; gap: 18px; align-content: start; }
.detail-art .plate { background: var(--surface-2); border-radius: 20px; padding: 16px; }
.detail-art .biscuit-svg { width: 100%; height: auto; display: block; }
.stats { margin: 0; display: grid; gap: 0; border-top: 2px solid var(--ink); }
.stats div { display: grid; grid-template-columns: 9.5em minmax(0, 1fr); gap: 10px; padding: 9px 2px; border-bottom: 1px dotted var(--line); }
.stats dt { font-family: var(--font-utility); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); padding-top: 3px; }
.stats dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.detail-text { display: grid; gap: 16px; align-content: start; min-width: 0; }
.detail-text h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-3); }
.detail-text .aka { font-style: italic; color: var(--muted); font-size: var(--step-1); margin-top: -6px; }
.detail-text h3, .recipe h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); color: var(--jam); }
.detail-text p { max-width: 64ch; }
.fact {
  background: var(--surface-2);
  border-radius: 16px;
  padding: 16px 18px;
  display: grid; gap: 4px;
}
.fact .eyebrow { color: var(--ink); }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; }
.tag-list button {
  border: 1.5px solid var(--line); background: transparent; border-radius: 999px;
  padding: 2px 10px; font-size: 0.85rem; cursor: pointer; color: var(--muted);
}
.tag-list button:hover { border-color: var(--ink); color: var(--ink); }

.recipe {
  border: 2px solid var(--ink);
  border-radius: 20px;
  padding: clamp(18px, 3vw, 32px);
  display: grid; gap: 20px;
  background:
    repeating-linear-gradient(var(--surface) 0 31px, var(--line) 31px 32px);
}
.recipe-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: end; }
.recipe-head h3 { font-size: var(--step-2); color: var(--ink); }
.recipe-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  background: var(--custard); color: #1c2640;
  border-radius: 999px; padding: 3px 12px;
  font-family: var(--font-utility); font-size: 0.75rem; letter-spacing: 0.04em;
}
.recipe-cols { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(18px, 4vw, 40px); }
.recipe h4 {
  margin: 0 0 8px;
  font-family: var(--font-utility); font-size: 0.75rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
}
.ingredients { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ingredients label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 3px 0; }
.ingredients input { margin-top: 5px; accent-color: var(--jam); width: 17px; height: 17px; flex: none; }
.ingredients input:checked + span { text-decoration: line-through; text-decoration-color: var(--jam); color: var(--muted); }
.method { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 12px; }
.method li { counter-increment: step; display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 10px; }
.method li::before {
  content: counter(step);
  font-family: var(--font-display); font-size: 1.15rem; color: var(--jam-ink);
  background: var(--jam); border-radius: 50%;
  width: 2rem; height: 2rem; display: grid; place-items: center; line-height: 1;
}
.recipe-note { font-size: 0.9rem; color: var(--muted); font-style: italic; }

/* ---------- Footer ---------- */
.site-foot {
  --foot-bg: #1c2640;
  --foot-ink: #edf0f6;
  --foot-muted: #b3bdd3;
  position: relative;
  margin-top: 40px;
  background: var(--foot-bg);
  color: var(--foot-muted);
  font-size: 0.97rem;
}
:root[data-theme="dark"] .site-foot { --foot-bg: #0a1120; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-foot { --foot-bg: #0a1120; } }
/* a scalloped, doily-like top edge */
.site-foot::before {
  content: "";
  position: absolute; left: 0; right: 0; top: -15px; height: 16px;
  background: radial-gradient(circle at 14px 16px, var(--foot-bg) 13px, transparent 13.5px) repeat-x;
  background-size: 28px 16px;
}
.foot-parade {
  display: flex; justify-content: center; flex-wrap: wrap; gap: clamp(8px, 2vw, 22px);
  padding-block: 26px 4px;
}
.foot-parade a { display: block; width: clamp(34px, 7vw, 64px); transition: transform 0.35s cubic-bezier(.3, 1.6, .5, 1); }
.foot-parade a:nth-child(odd) { transform: rotate(-8deg); }
.foot-parade a:nth-child(even) { transform: rotate(7deg) translateY(4px); }
.foot-parade a:hover, .foot-parade a:focus-visible { transform: rotate(0) translateY(-6px) scale(1.12); }
.foot-parade .biscuit-svg { width: 100%; height: auto; display: block; overflow: visible; }
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 44px);
  padding-block: 28px 32px;
}
.foot-grid > * { min-width: 0; display: grid; gap: 10px; align-content: start; }
.foot-title { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; color: var(--foot-ink); }
.foot-title span { color: #ff8095; display: inline-block; transform: rotate(-3deg); }
.foot-head {
  font-family: var(--font-utility); font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: #f2c14e;
}
.foot-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.foot-col button, .foot-today a {
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left;
  color: var(--foot-ink); text-decoration: underline; text-decoration-color: rgba(242, 193, 78, 0.5);
  text-underline-offset: 3px; text-decoration-thickness: 1.5px;
}
.foot-col button:hover, .foot-today a:hover { text-decoration-color: #f2c14e; }
.foot-col button .n { font-family: var(--font-utility); font-size: 0.72rem; color: var(--foot-muted); margin-left: 4px; }
.foot-today { font-style: italic; }
.foot-base {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  padding-block: 18px max(26px, env(safe-area-inset-bottom, 0px));
  border-top: 1px dashed rgba(237, 240, 246, 0.2);
  font-family: var(--font-utility); font-size: 0.78rem; letter-spacing: 0.04em;
}
.foot-top {
  color: var(--foot-bg); background: #f2c14e;
  border-radius: 999px; padding: 6px 16px;
  font-family: var(--font-body); font-weight: 700; font-size: 0.95rem; letter-spacing: 0;
  text-decoration: none;
}
.foot-top:hover { background: #ffd36b; }
.site-foot :focus-visible { outline-color: #f2c14e; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .today-card, .detail-top, .recipe-cols { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .foot-brand { grid-column: 1 / -1; }
  .stage { max-width: 380px; }
}
@media (max-width: 480px) {
  .today-facts { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .stats div { grid-template-columns: 7.5em minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .card .blurb { display: none; }
  .card h3 { font-size: 1.1rem; }
  .card .plate { padding: 10px 10px 2px; }
  .card .body { padding: 10px 12px 12px; }
  .search-box kbd { display: none; }
  .foot-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-bar .nav .label { display: none; }
}

/* ---------- Motion ---------- */
/* Every animation ends in the element's normal resting state, so the page is complete without them. */
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-70px) rotate(-24deg); }
  55% { opacity: 1; transform: translateY(6px) rotate(4deg); }
  75% { transform: translateY(-3px) rotate(-1deg); }
}
@keyframes pop-in {
  from { opacity: 0; transform: translateY(18px) rotate(-2.5deg) scale(0.95); }
}
@keyframes bob {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}
@keyframes hop {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px) rotate(-8deg); }
}
@keyframes steam {
  0% { stroke-dashoffset: 60; opacity: 0; transform: translateY(6px); }
  30% { opacity: 0.7; }
  100% { stroke-dashoffset: 0; opacity: 0; transform: translateY(-10px); }
}
@keyframes spin-in {
  from { opacity: 0; transform: rotate(-160deg) scale(0.5); }
  70% { opacity: 1; transform: rotate(8deg) scale(1.03); }
}

.title-card { animation: rise 0.7s cubic-bezier(.2, .8, .3, 1) both; }
.title .word { display: inline-block; white-space: nowrap; }
.title .ltr {
  display: inline-block;
  animation: drop-in 0.75s cubic-bezier(.3, 1.2, .5, 1) both;
  animation-delay: calc(var(--i) * 45ms + 250ms);
}
.title-card .lede { animation: rise 0.6s ease both 0.75s; }
.title-card .quick { animation: rise 0.6s ease both 0.9s; }
.today-card { animation: rise 0.7s cubic-bezier(.2, .8, .3, 1) both 0.35s; }

.stage .dunker .biscuit-svg { animation: bob 4.5s ease-in-out infinite; }
.stage.dunking .dunker .biscuit-svg { animation-play-state: paused; }
.stage .steam {
  position: absolute; left: 64.5%; top: 40%; width: 22%;
  z-index: 1; overflow: visible; pointer-events: none;
}
.stage .steam path {
  fill: none; stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 60; opacity: 0;
  animation: steam 3.2s ease-out infinite;
}
.stage .steam path:nth-child(2) { animation-delay: 1.1s; }
.stage .steam path:nth-child(3) { animation-delay: 2.1s; }

.grid > li {
  animation: pop-in 0.5s cubic-bezier(.3, 1.4, .5, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}
.card:hover .cups > span:not(.off) { animation: hop 0.45s ease both; animation-delay: calc(var(--c) * 60ms); }
.cups > span { display: inline-flex; }

.empty svg { animation: bob 3s ease-in-out infinite; }

dialog.detail[open] .detail-art .biscuit {
  transform-origin: 100px 100px; transform-box: view-box;
  animation: spin-in 0.9s cubic-bezier(.3, 1.3, .5, 1) both 0.05s;
}
dialog.detail[open] .detail-text > *,
dialog.detail[open] .stats > div,
dialog.detail[open] .method li,
dialog.detail[open] .ingredients li { animation: rise 0.45s ease both; }
dialog.detail[open] .detail-text > :nth-child(1) { animation-delay: 0.05s; }
dialog.detail[open] .detail-text > :nth-child(2) { animation-delay: 0.1s; }
dialog.detail[open] .detail-text > :nth-child(3) { animation-delay: 0.15s; }
dialog.detail[open] .detail-text > :nth-child(4) { animation-delay: 0.2s; }
dialog.detail[open] .detail-text > :nth-child(5) { animation-delay: 0.25s; }
dialog.detail[open] .detail-text > :nth-child(6) { animation-delay: 0.3s; }
dialog.detail[open] .detail-text > :nth-child(7) { animation-delay: 0.35s; }
dialog.detail[open] .detail-text > :nth-child(8) { animation-delay: 0.4s; }
dialog.detail[open] .stats > div { animation-delay: 0.2s; }
dialog.detail[open] .method li:nth-child(1), dialog.detail[open] .ingredients li:nth-child(1) { animation-delay: 0.3s; }
dialog.detail[open] .method li:nth-child(2), dialog.detail[open] .ingredients li:nth-child(2) { animation-delay: 0.36s; }
dialog.detail[open] .method li:nth-child(3), dialog.detail[open] .ingredients li:nth-child(3) { animation-delay: 0.42s; }
dialog.detail[open] .method li:nth-child(4), dialog.detail[open] .ingredients li:nth-child(4) { animation-delay: 0.48s; }
dialog.detail[open] .method li:nth-child(5), dialog.detail[open] .ingredients li:nth-child(5) { animation-delay: 0.54s; }
dialog.detail[open] .method li:nth-child(6), dialog.detail[open] .ingredients li:nth-child(6) { animation-delay: 0.6s; }
dialog.detail[open] .method li:nth-child(n+7), dialog.detail[open] .ingredients li:nth-child(n+7) { animation-delay: 0.66s; }
.method li::before { transition: transform 0.3s cubic-bezier(.3, 1.6, .5, 1); }
.method li:hover::before { transform: rotate(-12deg) scale(1.12); }
.ingredients input:checked + span { animation: hop 0.35s ease; display: inline-block; }

.foot-parade .biscuit-svg { animation: bob 3.6s ease-in-out infinite; animation-delay: calc(var(--i, 0) * -0.45s); }

.particle {
  position: fixed; z-index: 1000; pointer-events: none;
  border-radius: 2px;
}
.particle.drop { border-radius: 50%; }
.roller {
  position: fixed; z-index: 1000; pointer-events: none;
  left: -180px; bottom: max(24px, env(safe-area-inset-bottom, 0px));
  width: 110px;
}
.roller .biscuit-svg { width: 100%; height: auto; display: block; overflow: visible; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.search-box input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
