/* Menubora - the motion menu a guest opens from the QR code on the table.
 *
 * It wears the restaurant's own colours and type (here Hatch Kitchen's printed menu), not Menubora's.
 * Phone first: one column, thumb-sized controls, sheets that rise from the bottom. Motion is slow and
 * quiet - a photograph drifting, steam over a hot bowl - and stops for anyone who asks for less motion.
 */

:root {
  --paper: #f4ecdf; --card: #fffaf2; --ink: #1d1a17; --ink-2: #4b443d; --soft: #8a7f72; --rule: #e3d8c7;
  --brand: #e4512a; --brand-deep: #c4411d; --leaf: #6f8f4e;
  --ui: "Archivo", "Hiragino Sans", "Noto Sans CJK JP", "Noto Sans CJK KR", "Microsoft YaHei", "Malgun Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
body.locked { overflow: hidden; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- header */

.mm-top { position: sticky; top: 0; z-index: 4; background: var(--paper); border-bottom: 1px solid var(--rule); padding: 16px 16px 10px; }
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.brand h1 { font-weight: 900; font-stretch: 85%; font-size: 30px; line-height: 0.88; letter-spacing: -0.03em; color: var(--brand); }
.brand .place { font-size: 13px; color: var(--soft); text-align: right; }
.langs { margin: 12px -16px 0; padding: 0 16px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.langs::-webkit-scrollbar { display: none; }
.langs button {
  flex: none; border: 1px solid var(--rule); background: transparent; border-radius: 999px;
  padding: 6px 12px; font-size: 14px; color: var(--ink-2);
}
.langs button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- help choosing */

.first { margin: 14px 16px 0; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--rule); }
.first p { font-size: 14px; color: var(--ink-2); }
.first .picks { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; }
.first .picks button { border: 0; border-radius: 999px; background: var(--brand); color: #fff; padding: 7px 13px; font-size: 14px; font-weight: 700; }

.filters { display: flex; gap: 6px; overflow-x: auto; padding: 14px 16px 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button { flex: none; border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: 14px; color: var(--ink-2); }
.filters button[aria-pressed="true"] { border-color: var(--brand); color: var(--brand-deep); background: #fbe3d9; font-weight: 600; }

/* ---------------------------------------------------------------- the menu */

main { padding: 6px 16px 120px; }
.sec-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 12px; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.sec-title::after { content: ""; flex: 1; height: 2px; background: var(--brand); opacity: 0.35; }

.card { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; margin-bottom: 14px; }
.card .open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; }
.media { position: relative; overflow: hidden; aspect-ratio: 16 / 10; background: #e8dccb; }
.media img, .media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media img { animation: drift 18s ease-in-out infinite alternate paused; transform-origin: 50% 55%; }
.media.on img, .media.on .steam path { animation-play-state: running; }
.media.has-loop img { animation: none; }
@keyframes drift { from { transform: scale(1.03) translate(0, 0); } to { transform: scale(1.13) translate(-2%, -1.5%); } }
.steam { position: absolute; left: 50%; top: 4%; width: 34%; transform: translateX(-50%); pointer-events: none; opacity: 0.85; }
.steam path { fill: none; stroke: rgb(255 255 255 / 0.75); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 60 140; animation: rise 4.2s linear infinite paused; filter: blur(1.2px); }
.steam path:nth-child(2) { animation-delay: -1.4s; }
.steam path:nth-child(3) { animation-delay: -2.8s; }
@keyframes rise { from { stroke-dashoffset: 200; opacity: 0; } 30% { opacity: 1; } to { stroke-dashoffset: 0; opacity: 0; } }

.media { display: block; }
.body { display: block; padding: 0 16px 16px; }
.body.top { padding: 14px 16px 0; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.name { display: block; font-weight: 800; font-size: 18px; line-height: 1.2; }
.price { flex: none; font-weight: 700; font-size: 18px; color: var(--brand-deep); }
.gloss { display: block; margin-top: 2px; font-size: 14px; color: var(--soft); }
.what { margin-top: 8px; font-size: 15px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--soft); }
.tag { display: inline-flex; align-items: center; gap: 4px; }
.chilli { width: 14px; height: 14px; color: var(--brand); }
.veg { color: var(--leaf); font-weight: 700; }
.add {
  flex: none; border: 0; border-radius: 999px; background: var(--ink); color: var(--paper);
  padding: 9px 16px; font-size: 14px; font-weight: 700; min-width: 76px;
}
.add.in { background: var(--brand); }

.line { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.line .open { display: grid; grid-template-columns: 52px 1fr; gap: 12px; align-items: center; text-align: left; border: 0; background: none; padding: 0; }
.line img.draw { width: 52px; height: 52px; border-radius: 12px; background: #f4eee2; }
.line .name { font-size: 16px; }
.line .what { -webkit-line-clamp: 2; margin-top: 2px; font-size: 13.5px; }
.line .side { display: grid; justify-items: end; gap: 6px; }
.line .price { font-size: 16px; }
.line .add { padding: 7px 12px; min-width: 64px; font-size: 13px; }

.mm-foot { padding: 0 16px 120px; display: grid; gap: 6px; font-size: 13px; color: var(--soft); }
.mm-foot .by a { color: var(--ink-2); }

/* ---------------------------------------------------------------- the order bar */

.bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 5;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  border: 0; border-radius: 16px; background: var(--ink); color: var(--paper);
  padding: 14px 18px; font-size: 16px; font-weight: 700; box-shadow: 0 10px 30px rgb(0 0 0 / 0.25);
}
.bar .count { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 14px; margin-right: 8px; }

/* ---------------------------------------------------------------- sheets */

.scrim { position: fixed; inset: 0; z-index: 6; background: rgb(20 15 10 / 0.45); }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 7; max-height: 92vh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; padding-bottom: calc(24px + env(safe-area-inset-bottom));
  animation: up 260ms cubic-bezier(0.22, 0.8, 0.3, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.sheet .media { aspect-ratio: 4 / 3; border-radius: 22px 22px 0 0; }
.sheet .media.drawn { aspect-ratio: 16 / 9; background: #f4eee2; display: grid; place-items: center; }
.sheet .media.drawn img { position: static; width: 38%; height: auto; animation: none; }
/* the dish, from more than one side (see stage() in motion.js) */
.stage { position: relative; }
.stage .clip { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 22px 22px 0 0; background: #000; }
.stage[data-view-now="ing"] .media img { filter: brightness(0.7) saturate(0.95); animation-play-state: paused; transition: filter 300ms ease; }
.stage[data-view-now="ing"] .steam { opacity: 0; }
.callouts { position: absolute; inset: 0; pointer-events: none; visibility: hidden; }
.stage[data-view-now="ing"] .callouts { visibility: visible; }
.stage[data-clip] .callouts { visibility: hidden; }
.callout { position: absolute; display: flex; flex-direction: column; align-items: center; transform: translate(-50%, calc(-100% + 6px)); }
.callout .pill {
  position: relative; margin-bottom: 9px; padding: 5px 11px; border-radius: 999px; white-space: nowrap;
  background: rgb(255 255 255 / 0.95); color: var(--ink); font-size: 13px; font-weight: 700;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
}
.callout .pill::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1.5px; height: 9px; background: #fff; }
.callout .pin { width: 12px; height: 12px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px rgb(255 255 255 / 0.35); }
.stage[data-view-now="ing"]:not([data-clip]) .callout { animation: pop 420ms cubic-bezier(0.22, 0.8, 0.3, 1) both; animation-delay: calc(var(--i) * 220ms + 150ms); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, calc(-100% + 14px)) scale(0.92); } to { opacity: 1; transform: translate(-50%, calc(-100% + 6px)); } }
.views { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.views::-webkit-scrollbar { display: none; }
.views button {
  flex: none; border: 0; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 700;
  background: rgb(20 15 10 / 0.55); color: #fff; backdrop-filter: blur(8px);
}
.views button[aria-selected="true"] { background: #fff; color: var(--ink); }
.replay { position: absolute; left: 12px; top: 12px; width: 38px; height: 38px; border-radius: 999px; border: 0; background: rgb(255 255 255 / 0.92); font-size: 20px; line-height: 1; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); }

.close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 38px; height: 38px; border-radius: 999px; border: 0; background: rgb(255 255 255 / 0.92); font-size: 22px; line-height: 1; box-shadow: 0 2px 8px rgb(0 0 0 / 0.15); }
.sheet .inner { padding: 18px 18px 0; }
.sheet .name { font-size: 24px; }
.sheet .price { font-size: 22px; }
.sheet h3 { margin-top: 20px; font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); }
.sheet p.text { margin-top: 6px; font-size: 16px; color: var(--ink-2); }
.chips { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { border-radius: 999px; background: var(--card); border: 1px solid var(--rule); padding: 5px 11px; font-size: 14px; }
.chips.allergens li { background: #fde8de; border-color: #f2c2ad; color: #8c2d10; font-weight: 600; }
.sheet .wide { display: block; width: calc(100% - 36px); margin: 22px 18px 0; padding: 15px; font-size: 16px; border-radius: 14px; }

.order-head { padding: 22px 18px 6px; display: flex; justify-content: space-between; align-items: center; }
.order-head h2 { font-size: 22px; font-weight: 800; }
.order-head .close { position: static; }
.items li { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--rule); }
.items .n { display: block; font-weight: 700; line-height: 1.25; }
.items .g { display: block; font-size: 13px; color: var(--soft); }
.qty { display: inline-flex; align-items: center; gap: 10px; }
.qty button { width: 32px; height: 32px; border-radius: 999px; border: 1px solid var(--rule); background: var(--card); font-size: 18px; line-height: 1; }
.sum { display: flex; justify-content: space-between; padding: 16px 18px 0; font-weight: 800; font-size: 18px; }
.note { padding: 4px 18px 0; font-size: 13px; color: var(--soft); }
.empty { padding: 18px; color: var(--soft); }

/* ---------------------------------------------------------------- staff view: big, plain, in the kitchen's language */

.staff { position: fixed; inset: 0; z-index: 8; background: #fff; overflow-y: auto; padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); }
.staff h2 { font-size: 30px; font-weight: 900; letter-spacing: -0.02em; }
.staff .guest { margin-top: 6px; font-size: 15px; color: var(--soft); }
.staff ul { margin-top: 18px; }
.staff li { display: flex; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 2px solid #eee; font-size: 24px; font-weight: 800; line-height: 1.2; }
.staff li .q { min-width: 52px; color: var(--brand-deep); }
.staff .sum { padding: 18px 0 0; font-size: 20px; }
.staff .wide { width: 100%; margin: 26px 0 0; }

@media (min-width: 700px) {
  body { max-width: 560px; margin: 0 auto; box-shadow: 0 0 0 1px var(--rule); min-height: 100vh; }
  .bar { left: 50%; right: auto; width: 536px; transform: translateX(-50%); }
  .sheet { left: 50%; right: auto; width: 560px; transform: translateX(-50%); }
  @keyframes up { from { transform: translate(-50%, 40px); opacity: 0.4; } to { transform: translateX(-50%); opacity: 1; } }
}

@media (prefers-reduced-motion: reduce) {
  .media img, .steam path, .sheet, .callout { animation: none !important; }
  .steam { display: none; }
}
