/* Chow by H & F's — shared styles. Mobile first; the brand's printed menu is the reference. */

:root {
  --cocoa: #3B1D12;
  --cocoa-raised: #4A2618;
  --cocoa-line: #6B3E2A;
  --cream: #F6E3C1;
  --cream-deep: #EBD3A8;
  --toast: #E8A66A;
  --muted: #D9C2A0;
  --alert: #FFB08A;
  --ok: #B9E4A3;

  --font: 'Baloo 2', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --script: 'Caveat', 'Segoe Script', cursive;

  --gutter: 16px;
  --radius-lg: 28px;
  --radius: 16px;
  --radius-sm: 10px;
  --tap: 48px;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --ease-out: cubic-bezier(.2, .8, .2, 1);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cocoa);
  color: var(--cream);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

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

.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- masthead (the cream block from the menu) ---------- */
.mast {
  background: var(--cream);
  color: var(--cocoa);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: calc(env(safe-area-inset-top, 0px) + 28px) var(--gutter) 26px;
  text-align: center;
}
.wordmark {
  margin: 0;
  font-weight: 800;
  font-size: clamp(76px, 26vw, 128px);
  line-height: .82;
  letter-spacing: -0.02em;
}
.byline { margin: 6px 0 0; font-family: var(--script); font-weight: 600; font-size: 28px; line-height: 1; }
.tagline { margin: 12px 0 0; font-size: 13px; letter-spacing: .32em; font-weight: 600; opacity: .85; }
.shop-state {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 6px 14px; border-radius: 999px;
  background: var(--cocoa); color: var(--cream); font-size: 14px; font-weight: 600;
}
.shop-state::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.shop-state.closed::before { background: var(--alert); }

/* ---------- menu rows ---------- */
.menu { padding-top: 28px; padding-bottom: calc(120px + var(--safe-b)); }
.menu-section + .menu-section { margin-top: 28px; }
.section-title {
  margin: 0 0 4px; color: var(--toast);
  font-size: 22px; font-weight: 800; letter-spacing: .02em;
}
.row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--cocoa-line);
}
.row:last-child { border-bottom: 0; }
.row-name { font-weight: 700; font-size: 19px; line-height: 1.2; }
.row-note { display: block; font-weight: 500; font-size: 14px; color: var(--muted); }
.row-price { display: block; margin-top: 2px; color: var(--toast); font-weight: 700; font-size: 17px; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.row.sold-out .row-name, .row.sold-out .row-price { opacity: .45; }
.sold-tag { font-size: 13px; font-weight: 600; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 22px; border: 0; border-radius: 999px;
  font-weight: 700; font-size: 17px; text-decoration: none;
  background: var(--toast); color: var(--cocoa);
  transition: transform 90ms var(--ease-out), filter 120ms;
  touch-action: manipulation; user-select: none;
}
.btn:active { transform: scale(.96); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.block { width: 100%; }
.btn.cream { background: var(--cream); }
.btn.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 2px var(--cocoa-line); }
.btn.danger { background: transparent; color: var(--alert); box-shadow: inset 0 0 0 2px currentColor; }
.btn.small { min-height: 40px; padding: 0 16px; font-size: 15px; }

.add-btn {
  min-height: 40px; min-width: 76px; padding: 0 16px; border: 2px solid var(--toast); border-radius: 999px;
  background: transparent; color: var(--toast); font-weight: 700; font-size: 15px;
  transition: transform 90ms var(--ease-out);
  touch-action: manipulation;
}
.add-btn:active { transform: scale(.94); }

.stepper {
  display: inline-flex; align-items: center; border-radius: 999px; background: var(--toast); color: var(--cocoa);
}
.stepper button {
  width: 40px; height: 40px; border: 0; background: transparent; font-size: 22px; font-weight: 800; line-height: 1;
  border-radius: 50%; touch-action: manipulation; transition: transform 90ms var(--ease-out);
}
.stepper button:active { transform: scale(.85); }
.stepper output { min-width: 22px; text-align: center; font-weight: 800; }

/* ---------- sticky order bar ---------- */
.order-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px var(--gutter) calc(10px + var(--safe-b));
  background: linear-gradient(to top, var(--cocoa) 70%, rgba(59, 29, 18, 0));
  transform: translateY(0); transition: transform 280ms var(--ease-out);
}
.order-bar.hide { transform: translateY(110%); }
.order-bar .btn { width: 100%; max-width: 528px; margin: 0 auto; display: flex; justify-content: space-between; min-height: 56px; padding: 0 22px; }
.count-pill { background: var(--cocoa); color: var(--cream); border-radius: 999px; padding: 0 10px; font-size: 15px; min-width: 28px; }

/* ---------- sheets ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 30; background: rgba(20, 8, 4, .6);
  opacity: 0; transition: opacity 250ms;
}
.sheet-backdrop.open { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--cream); color: var(--cocoa);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 10px var(--gutter) calc(20px + var(--safe-b));
  transform: translateY(100%); transition: transform 320ms var(--ease-out);
}
.sheet.open { transform: translateY(0); }
.sheet-inner { max-width: 528px; margin: 0 auto; }
.grabber { width: 44px; height: 5px; border-radius: 3px; background: var(--cocoa); opacity: .25; margin: 0 auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { margin: 0; font-size: 26px; font-weight: 800; }
.icon-btn {
  width: var(--tap); height: var(--tap); border: 0; border-radius: 50%; background: var(--cream-deep);
  font-size: 22px; font-weight: 700; display: grid; place-items: center; color: var(--cocoa);
}
.sheet .stepper { background: var(--cocoa); color: var(--cream); }

.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed rgba(59, 29, 18, .25); }
.line-name { font-weight: 700; line-height: 1.2; }
.line-sub { display: block; font-size: 14px; font-weight: 500; opacity: .7; }
.totals { margin: 14px 0 6px; }
.totals div { display: flex; justify-content: space-between; font-weight: 600; }
.totals .grand { font-size: 22px; font-weight: 800; margin-top: 4px; }

/* ---------- forms ---------- */
.field { display: block; margin-top: 14px; }
.field > span { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field small { font-weight: 500; opacity: .7; }
.input {
  width: 100%; min-height: var(--tap); padding: 10px 14px;
  border: 2px solid rgba(59, 29, 18, .25); border-radius: var(--radius-sm);
  background: #FFF8EA; color: var(--cocoa); font-size: 17px; /* 17px avoids iOS zoom-on-focus */
}
.input:focus { border-color: var(--cocoa); outline: none; }
textarea.input { min-height: 72px; resize: vertical; }
.on-dark .input { background: var(--cocoa-raised); color: var(--cream); border-color: var(--cocoa-line); }
.on-dark .input:focus { border-color: var(--toast); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.two .field { margin-top: 14px; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.seg label {
  position: relative; display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: var(--tap); padding: 6px 10px; border-radius: var(--radius-sm);
  border: 2px solid rgba(59, 29, 18, .25); font-weight: 700; font-size: 15px; line-height: 1.2;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + span { color: var(--cream); }
.seg label:has(input:checked) { background: var(--cocoa); border-color: var(--cocoa); color: var(--cream); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--toast); outline-offset: 2px; }
.seg label:has(input:disabled) { opacity: .4; }

.fulfil { border: 0; padding: 0; margin: 18px 0 0; min-width: 0; }
.fulfil legend { font-weight: 700; font-size: 15px; padding: 0; }
.btn.place { margin-top: 14px; min-height: 56px; background: var(--cocoa); color: var(--cream); }
.hint { font-size: 14px; opacity: .7; margin: 10px 0 0; text-align: center; }

.hint.left { text-align: left; margin-top: 8px; }
.seg-sub { display: block; font-size: 13px; font-weight: 600; opacity: .75; }
.seg label > span { display: block; }
.muted { color: var(--muted); margin: 0 0 6px; font-size: 15px; }
.sheet .muted { color: inherit; opacity: .7; }
.schedule { margin: 12px auto 0; max-width: 300px; font-size: 15px; font-weight: 600; line-height: 1.3; }
.btn.big { min-height: 56px; margin-top: 14px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* chat */
.chat h2 { font-size: 20px; }
.chat-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 12px; max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain; }
.chat-empty { margin: 0; color: var(--muted); font-size: 15px; }
.bubble { max-width: 85%; padding: 8px 12px 6px; border-radius: 18px; }
.bubble p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.35; }
.bubble-who { display: block; font-size: 12px; font-weight: 800; opacity: .7; }
.bubble time { display: block; font-size: 12px; opacity: .65; text-align: right; margin-top: 2px; }
.bubble.mine { align-self: flex-end; background: var(--toast); color: var(--cocoa); border-bottom-right-radius: 6px; }
.bubble.theirs { align-self: flex-start; background: var(--cream); color: var(--cocoa); border-bottom-left-radius: 6px; }
.chat-form { display: flex; gap: 8px; align-items: flex-end; }
.chat-form .input { flex: 1; min-height: 48px; resize: none; background: var(--cocoa); color: var(--cream); border-color: var(--cocoa-line); }
.chat-form .input:focus { border-color: var(--toast); }
.chat-form .send { flex: none; min-height: 48px; padding: 0 18px; }

.form-error { margin: 12px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: #F3C9B0; color: #6A1E05; font-weight: 600; font-size: 15px; }

/* ---------- order tracking page ---------- */
.track { padding-top: 24px; padding-bottom: calc(32px + var(--safe-b)); }
.track h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.1; }
.track .lead { margin: 6px 0 0; color: var(--muted); }

.pay-card {
  margin-top: 20px; padding: 22px 20px; border-radius: var(--radius-lg);
  background: var(--toast); color: var(--cocoa); text-align: center;
}
.pay-amount { font-size: 15px; font-weight: 600; }
.pay-amount strong { display: block; font-size: 40px; font-weight: 800; line-height: 1.05; }
.pay-bank { margin-top: 14px; font-weight: 800; letter-spacing: .14em; font-size: 15px; }
.pay-number {
  display: block; width: 100%; margin: 2px 0 0; padding: 0; border: 0; background: none; color: inherit;
  font-weight: 800; font-size: clamp(34px, 11vw, 48px); letter-spacing: .02em; line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.pay-name { font-weight: 700; }
.pay-copy { margin-top: 12px; }
.pay-copy .btn { background: var(--cocoa); color: var(--cream); }
.pay-note { margin-top: 16px; padding-top: 14px; border-top: 2px dashed rgba(59, 29, 18, .35); font-weight: 600; font-size: 15px; }
.pay-note code { font-family: var(--font); font-size: 22px; font-weight: 800; background: var(--cream); padding: 0 10px; border-radius: 8px; }

.steps { list-style: none; margin: 24px 0 0; padding: 0; }
.steps li { position: relative; display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding-bottom: 18px; color: var(--muted); }
.steps li::before {
  content: counter(step); counter-increment: step;
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--cocoa-line); font-weight: 800; font-size: 15px; background: var(--cocoa);
}
.steps { counter-reset: step; }
.steps li:not(:last-child)::after { content: ''; position: absolute; left: 15px; top: 34px; bottom: 2px; width: 2px; background: var(--cocoa-line); }
.steps li.done { color: var(--cream); }
.steps li.done::before { content: '✓'; background: var(--toast); border-color: var(--toast); color: var(--cocoa); }
.steps li.now { color: var(--cream); }
.steps li.now::before { border-color: var(--toast); color: var(--toast); }
.steps b { display: block; font-size: 18px; }
.steps span { font-size: 15px; }

.panel { margin-top: 20px; padding: 16px; border-radius: var(--radius); background: var(--cocoa-raised); }
.panel h2 { margin: 0 0 4px; font-size: 18px; }
.panel .line { border-bottom-color: var(--cocoa-line); }
.contact { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }

.notice { margin-top: 20px; padding: 14px 16px; border-radius: var(--radius); background: var(--cocoa-raised); border-left: 4px solid var(--toast); }
.notice.bad { border-left-color: var(--alert); }
a.notice { display: block; color: var(--cream); text-decoration: none; margin: 0 0 20px; }
.menu > .notice:first-child { margin-top: 0; }
.spaced { margin-top: 20px; }
.track .btn.cream#claimBtn { margin-top: 14px; min-height: 56px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0;
  background: var(--cream); color: var(--cocoa); padding: 10px 18px; border-radius: 999px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); transition: transform 250ms var(--ease-out), opacity 250ms;
  max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.foot { text-align: center; padding: 8px 0 0; color: var(--muted); font-family: var(--script); font-size: 24px; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.loading { padding: 40px 0; text-align: center; color: var(--muted); }

/* the one orchestrated moment: the wordmark settles in on first load */
@media (prefers-reduced-motion: no-preference) {
  .wordmark { animation: settle 620ms var(--ease-out) both; }
  .byline { animation: settle 620ms 120ms var(--ease-out) both; }
  @keyframes settle { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

@media (min-width: 600px) {
  .sheet { left: 50%; right: auto; width: 560px; transform: translate(-50%, 100%); }
  .sheet.open { transform: translate(-50%, 0); }
}
