/* Hallmark · genre: editorial · macrostructure: custom bespoke (centred, single-purpose ordering site)
 * nav: N1b SaaS three-section · footer: Ft2 Inline single line
 * theme: custom (tuned) — RED field oklch(28% 0.15 24), GOLD ink oklch(80% 0.11 78), cream cards for dense info
 * pattern: hand-built 回纹 (huí wén) key-fret / nested-square meander, the traditional Chinese border motif — Tier-A SVG, not a generic lattice
 * display font: Domine (bold) — closest free match to the client's own carved-gold shopfront lettering (bracketed slab serifs, rounded bowls)
 * enrichment: E8 hero photography relocated to Find Us as tilted, overlapping prints (the "come see us" moment, not decoration with no job)
 * motion: hover-triggered gold shimmer + static grain/noise texture on primary buttons (Tier-A SVG feTurbulence, ported in spirit from Aceternity's noise-background)
 */

@import url("tokens.css");
@import url("https://fonts.googleapis.com/css2?family=Domine:wght@500;700&family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@500&display=swap");

/* ============ RESET ============ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: clip; scroll-behavior: smooth; }
body { overflow-x: clip; }
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; padding: 0; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* 回纹 key-fret pattern — hand-built nested-square meander, the traditional Chinese motif (not a generic lattice) */
body {
  background-color: var(--color-bg);
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='64'%20height='64'%20viewBox='0%200%2064%2064'%3E%3Cg%20fill='none'%20stroke='%23d9ae5c'%20stroke-width='1.2'%20opacity='0.19'%3E%3Crect%20x='22'%20y='22'%20width='20'%20height='20'/%3E%3Crect%20x='27'%20y='27'%20width='10'%20height='10'/%3E%3Cpath%20d='M32%2022V0M32%2042V64M22%2032H0M42%2032H64'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 64px 64px;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-text-stroke: 0.4px oklch(0% 0 0 / 0.55);
  paint-order: stroke fill;
}

/* text sitting on cream cards / gold-filled buttons doesn't need the outline — only the gold/cream writing on the red field does */
.menu-dish, .cart, .checkout, .order-item, .set-dinner, .menu-preview__card, .btn, .find-us__snaps figcaption {
  -webkit-text-stroke: 0;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; color: var(--color-gold); line-height: 1.08; margin: 0; letter-spacing: -0.005em; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--color-gold); outline-offset: 2px; }
.wrap { max-width: 72rem; margin-inline: auto; padding-inline: var(--page-gutter); }

/* ============ NAV — N1b SaaS three-section ============ */
.nav {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--space-md);
  padding: var(--space-sm) var(--page-gutter);
  background: color-mix(in oklch, var(--color-bg-2) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: var(--rule-hair) solid var(--color-gold-line);
}
.nav__mark {
  font-family: var(--font-display); font-weight: 700;
  font-size: var(--text-lg); color: var(--color-gold-bright);
  text-decoration: none; white-space: nowrap;
}
.nav__links { margin-inline: auto; display: flex; gap: var(--space-lg); }
.nav__links a {
  font-size: var(--text-sm); font-weight: 500; text-decoration: none;
  color: var(--color-text-muted); white-space: nowrap;
  padding-block: var(--space-3xs); border-bottom: 1.5px solid transparent;
  transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--color-gold); border-color: var(--color-gold-deep); }
.nav__cart { position: relative; }
.nav__cart-count {
  position: absolute; top: -8px; right: -8px;
  background: var(--color-bg-2); color: var(--color-gold-bright);
  border: 1px solid var(--color-gold-deep);
  font-family: var(--font-mono); font-size: 0.65rem;
  min-width: 18px; height: 18px; border-radius: 999px;
  display: grid; place-items: center; padding-inline: 3px;
}
.nav__cart-count:empty, .nav__cart-count[data-count="0"] { display: none; }

@media (max-width: 40rem) {
  .nav__links { gap: var(--space-sm); }
  .nav__links a { font-size: var(--text-xs); }
}
@media (max-width: 28rem) {
  .nav__links a.hide-xs { display: none; }
}

/* ============ BUTTONS — gold, popped, grain + shimmer ============ */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 44px; padding: 0.85rem 1.6rem; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-weight: 700; font-size: var(--text-sm);
  text-decoration: none; white-space: nowrap; isolation: isolate; overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:active { transform: translateY(1px); }

.btn--primary {
  background: linear-gradient(180deg, var(--color-gold-bright), var(--color-gold-deep));
  color: var(--color-bg-2);
  box-shadow: 0 0 0 1.5px var(--color-gold-line), 0 0 1.6rem color-mix(in oklch, var(--color-gold) 55%, transparent), 0 0.8rem 1.4rem -0.8rem oklch(0% 0 0 / 0.6);
}
.btn--primary:hover { box-shadow: 0 0 0 1.5px var(--color-gold-line), 0 0 2.2rem color-mix(in oklch, var(--color-gold) 75%, transparent), 0 0.8rem 1.4rem -0.8rem oklch(0% 0 0 / 0.6); }
.btn--primary:disabled { background: var(--color-bg-3); color: var(--color-text-muted); box-shadow: none; cursor: not-allowed; }

/* static gold grain — Tier-A SVG feTurbulence, ported in spirit from Aceternity's noise-background */
.btn--primary::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='80'%20height='80'%3E%3Cfilter%20id='n'%3E%3CfeTurbulence%20type='fractalNoise'%20baseFrequency='0.9'%20numOctaves='2'%20stitchTiles='stitch'/%3E%3C/filter%3E%3Crect%20width='100%25'%20height='100%25'%20filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay; opacity: 0.35;
}
/* hover/focus shimmer sweep — one-shot, not an ambient loop */
.btn--primary::after {
  content: ""; position: absolute; inset: -50% -70%; border-radius: inherit; pointer-events: none;
  background: conic-gradient(from -60deg, transparent 0deg, color-mix(in oklch, white 70%, var(--color-gold)) 16deg, transparent 38deg);
  opacity: 0; transform: rotate(-90deg);
}
@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover::after, .btn--primary:focus-visible::after { animation: btn-shimmer 750ms var(--ease-out) 1; }
}
@keyframes btn-shimmer { 0% { opacity: 0; transform: rotate(-100deg); } 18% { opacity: 1; } 100% { opacity: 0; transform: rotate(100deg); } }
@media (prefers-reduced-motion: reduce) { .btn--primary::after { display: none; } }

.btn--ghost { background: transparent; border: 1.5px solid var(--color-gold-deep); color: var(--color-gold); }
.btn--ghost:hover { background: color-mix(in oklch, var(--color-gold) 14%, transparent); }
.btn--sm { padding: 0.55rem 1.1rem; font-size: var(--text-xs); min-height: 36px; }

/* buttons that sit on cream cards (menu / order pages) need dark-on-gold to stay legible — same treatment, ink text */
.btn--primary { color: var(--color-bg-2); }

/* ============ SECTION SCAFFOLDING ============ */
.section { padding-block: var(--space-2xl); }
.section--band { background: color-mix(in oklch, var(--color-bg-2) 100%, transparent); border-block: var(--rule-hair) solid var(--color-gold-line); }
.section-head { max-width: 34rem; margin-block-end: var(--space-lg); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head h2 { font-size: var(--text-display-s); }
.section-head p { color: var(--color-text-muted); font-size: var(--text-md); margin-block-start: var(--space-2xs); }

@supports (animation-timeline: view()) {
  .reveal { animation: fade-up linear both; animation-timeline: view(); animation-range: entry 0% cover 25%; }
}
@keyframes fade-up { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) { .reveal { animation: none; } }

/* ============ HERO — centred, text-led, one CTA (photos moved to Find Us) ============ */
.hero { padding-block: var(--space-2xl) var(--space-2xl); text-align: center; }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 0.5em;
  font-family: var(--font-mono); font-size: var(--text-xs); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-gold-deep); margin-block-end: var(--space-sm);
}
.hero__title { font-size: var(--text-display); max-width: 24ch; margin-inline: auto; }
.hero__lede { color: var(--color-text); opacity: 0.9; font-size: var(--text-md); max-width: 42ch; margin: var(--space-sm) auto 0; }
.hero__ctas { display: flex; justify-content: center; gap: var(--space-sm); margin-block-start: var(--space-lg); flex-wrap: wrap; }

@media (max-width: 40rem) {
  .hero__ctas .btn { width: 100%; }
  .hero__ctas { flex-direction: column; align-items: stretch; }
}

/* ============ TRUST STRIP ============ */
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-md) var(--space-xl); }
.trust__item {
  display: flex; align-items: center; gap: 0.5em;
  font-size: var(--text-sm); color: var(--color-text); white-space: nowrap;
}
.trust__item svg { width: 18px; height: 18px; color: var(--color-gold); flex-shrink: 0; }

/* ============ MENU PREVIEW (home) ============ */
.menu-preview__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: var(--space-md); }
.menu-preview__card {
  background: var(--color-surface); border: 1.5px solid var(--color-gold-line); border-radius: var(--radius-md);
  padding: var(--space-md); text-align: center; transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.menu-preview__card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.menu-preview__card h3 { color: var(--color-ink); font-size: var(--text-lg); }
.menu-preview__card p { color: var(--color-ink-muted); font-size: var(--text-sm); margin-block-start: var(--space-3xs); }

/* ============ FIND US ============ */
.find-us__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--space-2xl); align-items: start; }
.find-us__row { margin-block-end: var(--space-md); }
.find-us__label { font-family: var(--font-mono); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-gold-deep); margin-block-end: var(--space-3xs); }
.find-us__value { font-size: var(--text-md); color: var(--color-text); }
.find-us__value a { text-decoration: underline; text-underline-offset: 3px; color: var(--color-gold); }
.hours-table { width: 100%; border-collapse: collapse; margin-block-start: var(--space-2xs); }
.hours-table td { padding-block: var(--space-3xs); font-size: var(--text-sm); color: var(--color-text); border-bottom: var(--rule-hair) dashed var(--color-gold-line); }
.hours-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.hours-table tr.is-today td { color: var(--color-gold-bright); font-weight: 600; }
.find-us__map { border-radius: var(--radius-md); overflow: hidden; border: 1.5px solid var(--color-gold-line); aspect-ratio: 4/3; }
.find-us__map iframe { width: 100%; height: 100%; border: 0; }

/* tilted photo pair — the "come see us" moment; the only place the interior/exterior shots earn a job */
.find-us__snaps { position: relative; height: clamp(11rem, 22vw, 15rem); margin-block-end: var(--space-lg); }
.find-us__snaps figure {
  position: absolute; margin: 0; padding: 0.5rem 0.5rem 1.1rem; background: var(--color-surface);
  box-shadow: 0 1.2rem 2rem -0.8rem oklch(0% 0 0 / 0.55);
  border-radius: 2px; transition: transform var(--dur-slow) var(--ease-out), z-index var(--dur-fast);
}
.find-us__snaps img { width: 100%; height: 100%; object-fit: cover; display: block; }
.find-us__snaps figcaption { font-family: var(--font-mono); font-size: 0.62rem; color: var(--color-ink-muted); text-align: center; margin-block-start: 0.4rem; }
.find-us__snaps figure:nth-child(1) { left: 0; top: 0.5rem; width: 58%; aspect-ratio: 4/3; transform: rotate(-5deg); z-index: 1; }
.find-us__snaps figure:nth-child(2) { right: 0; top: 0; width: 52%; aspect-ratio: 4/3; transform: rotate(4deg); z-index: 2; }
.find-us__snaps:hover figure:nth-child(1) { transform: rotate(-8deg) translateY(-3px); }
.find-us__snaps:hover figure:nth-child(2) { transform: rotate(7deg) translateY(-3px); }

@media (max-width: 56rem) {
  .find-us__grid { grid-template-columns: 1fr; }
  .find-us__map { aspect-ratio: 16/10; }
  .find-us__snaps { height: clamp(10rem, 55vw, 13rem); max-width: 22rem; margin-inline: auto; }
}

/* ============ FOOTER — Ft2 inline single line ============ */
.foot {
  padding: var(--space-lg) var(--page-gutter);
  border-top: var(--rule-hair) solid var(--color-gold-line);
  background: var(--color-bg-2);
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: var(--space-sm);
  font-size: var(--text-sm); color: var(--color-text-muted);
}
.foot a { color: var(--color-text-muted); }
.foot a:hover { color: var(--color-gold); }
.foot__wordmark { font-family: var(--font-display); font-weight: 700; color: var(--color-gold); }

/* ============ MENU PAGE — dynamic category tabs ============ */
.menu-tabs {
  position: sticky; top: 3.75rem; z-index: 20;
  display: flex; gap: var(--space-2xs); overflow-x: auto; scrollbar-width: none;
  padding-block: var(--space-sm); background: color-mix(in oklch, var(--color-bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: var(--rule-hair) solid var(--color-gold-line);
}
.menu-tabs::-webkit-scrollbar { display: none; }
.menu-tabs button {
  flex-shrink: 0; padding: 0.5rem 1rem; border-radius: var(--radius-pill);
  font-size: var(--text-xs); font-weight: 600; letter-spacing: 0.02em;
  border: 1.5px solid var(--color-gold-line); color: var(--color-text-muted);
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.menu-tabs button.is-active { background: var(--color-gold); border-color: var(--color-gold); color: var(--color-bg-2); }
.menu-tabs button:hover:not(.is-active) { border-color: var(--color-gold); color: var(--color-gold); }

.menu-cat { padding-block: var(--space-2xl) var(--space-md); scroll-margin-top: 8rem; }
.menu-cat h2 { color: var(--color-gold); }
.menu-cat__note { color: var(--color-text-muted); font-size: var(--text-sm); font-style: italic; margin-block-start: -0.25rem; margin-block-end: var(--space-sm); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: var(--space-sm); }
.menu-dish {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--color-surface); border: var(--rule-hair) solid var(--color-rule-card); border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md); display: flex; justify-content: space-between; gap: var(--space-sm);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.menu-dish:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); }
.menu-dish::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px;
  background: conic-gradient(from 0deg, transparent 0 85%, var(--color-gold) 92%, var(--color-bg) 96%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--dur-fast) var(--ease-out);
  animation: beam-spin 2.4s linear infinite paused; pointer-events: none;
}
.menu-dish:hover::after { opacity: 1; animation-play-state: running; }
@keyframes beam-spin { to { transform: rotate(360deg); } }
.menu-dish__name { font-weight: 600; font-size: var(--text-sm); color: var(--color-ink); }
.menu-dish__code { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--color-ink-muted); margin-inline-end: 0.4em; }
.menu-dish__tag { font-size: var(--text-xs); color: var(--color-ink-muted); font-style: italic; }
.menu-dish__price { font-family: var(--font-mono); font-weight: 700; color: var(--color-bg); white-space: nowrap; font-variant-numeric: tabular-nums; }

.set-dinner {
  background: var(--color-surface); border: 1.5px solid var(--color-gold-line); border-radius: var(--radius-md);
  padding: var(--space-md); margin-block-end: var(--space-sm);
}
.set-dinner__head { display: flex; align-items: baseline; gap: var(--space-2xs); margin-block-end: var(--space-2xs); }
.set-dinner__letter { font-family: var(--font-display); font-weight: 700; color: var(--color-bg); font-size: var(--text-lg); }
.set-dinner__name { font-weight: 600; color: var(--color-ink); }
.set-dinner__prices { display: flex; gap: var(--space-md); flex-wrap: wrap; margin-block-end: var(--space-2xs); font-family: var(--font-mono); font-size: var(--text-sm); color: var(--color-bg); font-weight: 700; }
.set-dinner__dishes { color: var(--color-ink-muted); font-size: var(--text-sm); }

@media (prefers-reduced-motion: reduce) { .menu-dish::after { animation: none; } }

/* ============ ORDER PAGE — interactive cart ============ */
.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: var(--space-2xl); align-items: start; }
.order-cat { margin-block-end: var(--space-xl); scroll-margin-top: 8rem; }
.order-cat h2 { font-size: var(--text-xl); margin-block-end: var(--space-sm); color: var(--color-gold); }
.order-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md); border: var(--rule-hair) solid var(--color-rule-card); border-radius: var(--radius-md);
  background: var(--color-surface); margin-block-end: var(--space-2xs);
}
.order-item__name { font-weight: 600; font-size: var(--text-sm); color: var(--color-ink); }
.order-item__price { font-family: var(--font-mono); color: var(--color-bg); font-size: var(--text-sm); }
.order-item__add {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  border: 1.5px solid var(--color-bg); color: var(--color-bg);
  display: grid; place-items: center; font-size: 1.2rem; line-height: 1;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.order-item__add:hover { background: var(--color-bg); color: var(--color-gold-bright); transform: scale(1.08); }
.order-item__stepper { display: flex; align-items: center; gap: var(--space-2xs); flex-shrink: 0; }
.order-item__stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--color-bg); color: var(--color-bg);
  display: grid; place-items: center; font-size: 1rem;
}
.order-item__stepper span { min-width: 1.5em; text-align: center; font-family: var(--font-mono); font-weight: 600; color: var(--color-ink); }

.cart { position: sticky; top: 5.5rem; background: var(--color-surface); border: 1.5px solid var(--color-gold-line); border-radius: var(--radius-md); padding: var(--space-md); box-shadow: var(--shadow-card); }
.cart h2 { font-size: var(--text-lg); margin-block-end: var(--space-sm); color: var(--color-bg); }
.cart__empty { color: var(--color-ink-muted); font-size: var(--text-sm); text-align: center; padding-block: var(--space-md); }
.cart__list { display: grid; gap: var(--space-2xs); margin-block-end: var(--space-sm); max-height: 22rem; overflow-y: auto; }
.cart__row { display: flex; justify-content: space-between; gap: var(--space-2xs); font-size: var(--text-sm); align-items: baseline; color: var(--color-ink); }
.cart__row-name { min-width: 0; }
.cart__row-qty { color: var(--color-ink-muted); font-family: var(--font-mono); }
.cart__row-price { font-family: var(--font-mono); white-space: nowrap; }
.cart__total { display: flex; justify-content: space-between; font-weight: 700; font-size: var(--text-md); color: var(--color-ink); padding-block-start: var(--space-sm); border-top: var(--rule-hair) solid var(--color-rule-card); margin-block-end: var(--space-sm); }
.cart .btn { width: 100%; }

.checkout {
  position: fixed; inset: 0; z-index: 100; background: color-mix(in oklch, var(--color-bg-2) 70%, transparent);
  display: grid; place-items: center; padding: var(--space-md);
  opacity: 0; pointer-events: none; transition: opacity var(--dur-base) var(--ease-out);
}
.checkout.is-open { opacity: 1; pointer-events: auto; }
.checkout__card {
  background: var(--color-surface); border-radius: var(--radius-md); padding: var(--space-xl);
  max-width: 26rem; width: 100%; text-align: center; border: 1.5px solid var(--color-gold-line);
}
.checkout__card h2 { font-size: var(--text-xl); margin-block-end: var(--space-2xs); color: var(--color-bg); }
.checkout__card p { color: var(--color-ink-muted); font-size: var(--text-sm); }
.checkout__ref { font-family: var(--font-mono); font-size: var(--text-lg); color: var(--color-bg); font-weight: 700; margin-block: var(--space-sm); }
.checkout__note { font-size: var(--text-xs); color: var(--color-ink-muted); margin-block-start: var(--space-md); }
.checkout__actions { display: grid; gap: var(--space-2xs); margin-block-start: var(--space-lg); }
.checkout__actions .btn--ghost { border-color: var(--color-bg); color: var(--color-bg); }
.checkout__actions .btn--ghost:hover { background: color-mix(in oklch, var(--color-bg) 10%, transparent); }

@media (max-width: 56rem) {
  .order-layout { grid-template-columns: 1fr; }
  .cart { position: static; }
}
