/* ==========================================================================
   Dumpling shop — tap arrival experience
   Committed dark world. Tokens are declared ONCE here and only used through
   var(). No literal colour or font stack appears below :root.
   ========================================================================== */

:root {
  /* colour */
  --ink: #17100E;
  --broth: #241813;
  --edge: #3A2A22;
  --gold: #E8B04B;
  --gold-dim: #A9803A;
  --chili: #C4432A;
  --steam: #F0E7DA;
  --bamboo: #9A8A6E;

  /* type — system stacks only, no webfonts */
  --face-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --face-body: Optima, Candara, "Gill Sans MT", "Trebuchet MS", sans-serif;
  --face-mono: ui-monospace, Menlo, "SF Mono", monospace;

  /* rhythm */
  --gap-xs: 0.35rem;
  --gap-s: 0.6rem;
  --gap-m: 1rem;
  --gap-l: clamp(1.4rem, 5vw, 2rem);
  --gap-xl: clamp(2rem, 8vw, 3rem);
  --radius: 0.75rem;
  --radius-card: 1.15rem;
  --hair: 1px solid var(--edge);
  --shell: 30rem;

  color-scheme: dark;
}

/* --- base ---------------------------------------------------------------- */

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

html {
  background: var(--ink);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--broth) 70%, transparent) 0%, transparent 70%),
    var(--ink);
  color: var(--steam);
  font-family: var(--face-body);
  font-size: clamp(1rem, 0.95rem + 0.4vw, 1.09rem);
  line-height: 1.55;
  min-height: 100svh;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul { padding: 0; list-style: none; }

a { color: var(--gold); }

:where(a, button):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: var(--radius);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- shell --------------------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding: clamp(1.5rem, 7vw, 2.75rem) clamp(1.1rem, 5vw, 1.6rem) var(--gap-xl);
  display: flex;
  flex-direction: column;
  gap: var(--gap-xl);
  min-width: 0;
}

.main {
  display: flex;
  flex-direction: column;
  gap: var(--gap-xl);
  min-width: 0;
}

/* --- celebration layer --------------------------------------------------- */

.fx-layer {
  position: fixed;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.fx-canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 1;
  transition: opacity 320ms linear;
}

.fx-canvas[data-out] { opacity: 0; }

/* --- reveal stagger ------------------------------------------------------
   Content is in the DOM and visible by default. The .fx class (set by the
   inline head script) is what hides it, so a JS failure can never blank the
   page. Steps are driven by --step, set per element, so there is one rule. */

.fx .reveal {
  opacity: 0;
  transform: translateY(0.85rem);
}

.fx .reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 520ms ease, transform 620ms cubic-bezier(0.22, 0.68, 0.24, 1);
}

/* --- banner -------------------------------------------------------------- */

.banner {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  text-align: center;
}

.banner__name {
  font-family: var(--face-display);
  font-weight: 400;
  font-size: clamp(2.15rem, 1.4rem + 6vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--steam);
}

.banner__tagline {
  font-family: var(--face-display);
  font-style: italic;
  font-size: clamp(1.02rem, 0.95rem + 0.7vw, 1.2rem);
  color: var(--gold);
  text-wrap: balance;
}

.banner__city {
  font-family: var(--face-mono);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bamboo);
}

/* --- shared section furniture ------------------------------------------- */

.sec__h {
  font-family: var(--face-mono);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bamboo);
  padding-bottom: var(--gap-s);
  border-bottom: var(--hair);
}

.notice {
  font-size: 0.95rem;
  color: var(--bamboo);
  padding: var(--gap-m);
  border: var(--hair);
  border-radius: var(--radius);
  background: var(--broth);
}

.notice a { color: var(--gold); }

/* --- loyalty pass -------------------------------------------------------- */

.pass { position: relative; }

/* the wallet "card behind the card" */
.pass::before {
  content: "";
  position: absolute;
  inset: -0.55rem 0.9rem auto 0.9rem;
  height: 2.2rem;
  border: var(--hair);
  border-bottom: 0;
  border-radius: var(--radius-card) var(--radius-card) 0 0;
  background: color-mix(in srgb, var(--broth) 55%, var(--ink));
}

.pass__card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--gap-m);
  padding: clamp(1.15rem, 5vw, 1.5rem);
  border: var(--hair);
  border-radius: var(--radius-card);
  background:
    radial-gradient(140% 90% at 50% -20%, color-mix(in srgb, var(--gold) 9%, transparent), transparent 60%),
    var(--broth);
  box-shadow: 0 1.5rem 3rem -1.5rem var(--ink);
}

.pass__eyebrow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--gap-s);
  font-family: var(--face-mono);
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bamboo);
}

.pass__kind { color: var(--gold-dim); }

.pass__h {
  font-family: var(--face-display);
  font-weight: 400;
  font-size: clamp(1.35rem, 1.1rem + 1.6vw, 1.6rem);
  line-height: 1.15;
  color: var(--steam);
}

/* One row of stamps, always. Columns cap at a sensible dot size but may
   shrink, so the row never wraps however many stamps the shop requires.
   --needed is set by app.js from shop.json. */
.pass__dots {
  display: grid;
  grid-template-columns: repeat(var(--needed, 10), minmax(0, 1.15rem));
  align-items: center;
  gap: clamp(0.3rem, 1.7vw, 0.5rem);
}

.dot {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1px solid var(--gold-dim);
  background: transparent;
}

.dot[data-filled] {
  background: var(--gold-dim);
  border-color: var(--gold-dim);
}

.dot[data-newest] {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 0 0.28rem color-mix(in srgb, var(--gold) 22%, transparent);
  animation: pop 620ms cubic-bezier(0.2, 1.5, 0.3, 1) 120ms both;
}

@keyframes pop {
  0% { transform: scale(0.55); }
  60% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

.pass__count {
  font-family: var(--face-mono);
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.6rem, 1.2rem + 2.4vw, 2rem);
  letter-spacing: 0.04em;
  color: var(--steam);
}

.pass__count .of { color: var(--bamboo); }

.pass__perf {
  height: 0;
  border-top: 1px dashed var(--edge);
}

.pass__copy { color: var(--steam); text-wrap: pretty; }

/* The reward stays in body-text steam so the one chili accent below is the
   only colour that pops in this sentence. */
.pass__copy .reward {
  font-family: var(--face-display);
  font-style: italic;
  color: var(--steam);
}

/* the single use of --chili in the whole sheet */
.pass__copy .free { color: var(--chili); font-style: normal; }

.pass__note {
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--bamboo);
}

/* --- buttons ------------------------------------------------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-s);
  width: 100%;
  min-height: 3rem;
  padding: 0.8rem 1.1rem;
  border: var(--hair);
  border-radius: var(--radius);
  font-family: var(--face-body);
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.btn--wallet {
  background: color-mix(in srgb, var(--steam) 6%, transparent);
  color: var(--bamboo);
}

.btn--wallet:disabled {
  cursor: not-allowed;
  opacity: 1;
}

.btn__mark { font-size: 1.05em; color: var(--gold-dim); }

.btn--call {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-size: clamp(1.02rem, 0.95rem + 0.6vw, 1.15rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  min-height: 3.4rem;
}

.btn--call .tel {
  font-family: var(--face-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.btn--call:hover { background: color-mix(in srgb, var(--gold) 88%, var(--steam)); }

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

.menu, .order {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  min-width: 0;
}

.menu__body {
  display: flex;
  flex-direction: column;
  gap: var(--gap-l);
  min-width: 0;
}

.menu__sec {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  min-width: 0;
}

.menu__sec-h {
  font-family: var(--face-display);
  font-weight: 400;
  font-size: clamp(1.2rem, 1.05rem + 1.2vw, 1.4rem);
  color: var(--gold);
}

.items {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  row-gap: var(--gap-s);
  column-gap: var(--gap-m);
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: var(--gap-m);
  align-items: baseline;
  padding-bottom: var(--gap-s);
  border-bottom: var(--hair);
}

/* one shared grid so every price column lines up across every row */
@supports (grid-template-columns: subgrid) {
  .item {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    column-gap: 0;
  }
}

.item:last-child { border-bottom: 0; padding-bottom: 0; }

.item__name {
  grid-column: 1;
  min-width: 0;
  text-wrap: pretty;
}

.item__price {
  grid-column: 2;
  justify-self: end;
  text-align: right;
  font-family: var(--face-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
  color: var(--steam);
  white-space: nowrap;
}

.item__note {
  grid-column: 1 / -1;
  font-size: 0.85rem;
  line-height: 1.4;
  color: var(--bamboo);
  text-wrap: pretty;
}

.mark {
  font-family: var(--face-mono);
  font-size: 0.7em;
  color: var(--gold-dim);
  padding-inline-start: 0.35em;
  font-variant-emoji: text;
}

/* No text-transform here: uppercasing would turn the vegetarian mark into a
   different glyph than the one printed beside the items. */
.menu__legend {
  font-family: var(--face-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--bamboo);
}

/* --- order handoff + hours ---------------------------------------------- */

.order__lede { color: var(--steam); text-wrap: pretty; }

.hours {
  display: flex;
  flex-direction: column;
  gap: var(--gap-s);
  padding: var(--gap-m);
  border: var(--hair);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--broth) 60%, transparent);
  min-width: 0;
}

.hours__h {
  font-family: var(--face-mono);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bamboo);
}

.hours__status {
  font-size: 0.98rem;
  color: var(--gold);
  text-wrap: pretty;
}

.hours__status[data-shut] { color: var(--bamboo); }

.hours__list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  row-gap: var(--gap-xs);
  column-gap: var(--gap-m);
  font-size: 0.9rem;
  color: var(--bamboo);
}

.hours__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  column-gap: var(--gap-m);
}

@supports (grid-template-columns: subgrid) {
  .hours__row {
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    column-gap: 0;
  }
}

.hours__row[data-today] { color: var(--steam); }

.hours__day { grid-column: 1; min-width: 0; }

.hours__time {
  grid-column: 2;
  justify-self: end;
  font-family: var(--face-mono);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  white-space: nowrap;
}

/* --- footer -------------------------------------------------------------- */

.foot {
  font-family: var(--face-mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--bamboo);
  text-align: center;
  padding-top: var(--gap-l);
  border-top: var(--hair);
}

/* --- reduced motion -----------------------------------------------------
   No stagger, no transitions, no pop. The celebration becomes a single
   static gold radial, painted once by app.js. */

@media (prefers-reduced-motion: reduce) {
  .fx .reveal,
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .fx-canvas { transition: none; }

  .dot[data-newest] { animation: none; }

  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
