:root {
  --bg: #fbf4e6;
  --paper: #fffaf0;
  --ink: #2b1a12;
  --muted: #7a6455;
  --red: #a8261d;
  --red-ink: #fff6e3;
  --gold: #e9a63a;
  --crust: #c3742a;
  --line: #ead9bd;
  --shadow: 0 10px 30px -12px rgba(90, 45, 10, .25);
  --radius: 18px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, sans-serif;
  --zh: "Noto Serif TC", "Songti TC", serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c130e;
    --paper: #261a13;
    --ink: #f6e9d6;
    --muted: #bba48f;
    --red: #d7463a;
    --line: #3c2a1f;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--red); }
h1, h2, h3 { font-family: var(--serif); line-height: 1.1; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.4rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.zh { font-family: var(--zh); color: var(--red); font-weight: 600; }
h2 .zh { font-size: .6em; vertical-align: middle; margin-left: .3em; }
.muted { color: var(--muted); }
section { padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem); max-width: 1200px; margin: 0 auto; }

/* Nav */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 1.5rem;
  padding: .8rem clamp(1rem, 5vw, 4rem);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .6rem; font: 700 1.15rem var(--serif); color: var(--ink); text-decoration: none; }
.nav nav { display: flex; gap: 1.4rem; margin-left: auto; }
.nav nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.nav nav a:hover { color: var(--red); }
.basket-link {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .45rem .9rem; border-radius: 99px;
  background: var(--red); color: var(--red-ink); text-decoration: none; font-weight: 700;
}
.count { background: var(--red-ink); color: var(--red); border-radius: 99px; min-width: 1.5em; text-align: center; font-size: .85em; }
.count.bump { animation: bump .35s; }
@keyframes bump { 50% { transform: scale(1.4); } }

/* Buttons */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  padding: .9rem 1.5rem; border-radius: 99px;
  font: 700 1rem var(--sans); text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn.primary { background: var(--red); color: var(--red-ink); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* Hero */
.hero { display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 2rem; padding-top: clamp(2rem, 6vw, 4rem); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.status {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .35rem .85rem; border-radius: 99px;
  background: var(--paper); border: 1px solid var(--line); font-weight: 500; font-size: .95rem;
}
.dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--muted); }
.status.open .dot { background: #3fa45b; box-shadow: 0 0 0 0 rgba(63, 164, 91, .6); animation: pulse 2s infinite; }
.status.closed .dot { background: var(--red); }
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(63, 164, 91, 0); } 100% { box-shadow: 0 0 0 0 rgba(63, 164, 91, 0); } }

.hero-art {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 55%, #f7d48a 0, #f0b85a 45%, transparent 46%),
              repeating-conic-gradient(var(--red) 0 10deg, #b8342a 10deg 20deg);
  display: grid; place-items: center;
  box-shadow: var(--shadow);
}
.tart { width: 70%; filter: drop-shadow(0 14px 10px rgba(90, 40, 0, .3)); animation: bob 4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-1deg); } }
.steam { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; }
.steam span { width: 8px; height: 46px; border-radius: 8px; background: rgba(255, 255, 255, .7); filter: blur(4px); animation: steam 3s ease-in-out infinite; }
.steam span:nth-child(2) { animation-delay: .6s; }
.steam span:nth-child(3) { animation-delay: 1.2s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(20px) scaleY(.6); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-30px) scaleY(1.2); } }
.stamp {
  position: absolute; right: 2%; bottom: 8%;
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; text-align: center; line-height: 1.05;
  background: var(--gold); color: var(--ink); font: 500 .8rem var(--serif);
  transform: rotate(-12deg); box-shadow: var(--shadow);
}
.stamp b { font-size: 1.4rem; }

/* Ticker */
.ticker { max-width: none; padding: 0; overflow: hidden; background: var(--red); color: var(--red-ink); }
.ticker-track { display: flex; gap: 3rem; width: max-content; padding: .9rem 0; animation: scroll 40s linear infinite; font: 600 1.1rem var(--serif); }
.ticker-track span::after { content: "✦"; margin-left: 3rem; color: var(--gold); }
@keyframes scroll { to { transform: translateX(-50%); } }

/* Story */
.story { display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 4vw, 3rem); }
.story-num { font: 700 clamp(4rem, 12vw, 9rem)/.8 var(--serif); color: var(--gold); }
.story p { max-width: 62ch; }
.facts { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 2.5rem; }
.facts b { display: block; font: 700 2.2rem var(--serif); color: var(--red); }
.facts span { color: var(--muted); }

/* Menu */
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.section-head p { max-width: 48ch; margin: 0; }
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; }
.tabs button {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: .45rem 1rem; border-radius: 99px; cursor: pointer; font: 500 .95rem var(--sans);
}
.tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.2rem; }
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem; display: flex; flex-direction: column; gap: .5rem;
  transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card .emoji { font-size: 2.4rem; line-height: 1; }
.card h3 { font-size: 1.25rem; margin: .3rem 0 0; }
.card .zh { font-size: .95rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; flex: 1; }
.card footer { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; padding: 0; border: 0; }
.price { font: 700 1.2rem var(--serif); }
.add { border: 0; cursor: pointer; background: var(--gold); color: var(--ink); font: 700 .9rem var(--sans); padding: .5rem 1rem; border-radius: 99px; }
.add:active { transform: scale(.95); }

/* Oven timeline */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; }
.timeline li { position: relative; padding: 1.1rem; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.timeline time { display: block; font: 700 1.6rem var(--serif); color: var(--crust); }
.timeline li.done { opacity: .5; }
.timeline li.next { border-color: var(--red); box-shadow: 0 0 0 2px var(--red); }
.timeline li.next::before { content: "Next up"; position: absolute; top: -.7rem; right: .8rem; background: var(--red); color: var(--red-ink); font-size: .75rem; font-weight: 700; padding: .1rem .55rem; border-radius: 99px; }

/* Order */
.order-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.basket, .form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.basket ul { list-style: none; padding: 0; margin: 0; }
.basket li { display: flex; align-items: center; gap: .6rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.basket li .name { flex: 1; }
.qty { display: inline-flex; align-items: center; gap: .4rem; }
.qty button { width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); color: var(--ink); cursor: pointer; font-weight: 700; }
.total { display: flex; justify-content: space-between; margin: 1rem 0 0; font-size: 1.1rem; }
.form { display: grid; gap: .9rem; }
.form label { display: grid; gap: .3rem; font-weight: 500; font-size: .95rem; }
.form input, .form textarea {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem;
}
.form input:focus, .form textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }
.form-msg { margin: 0; min-height: 1.5em; font-weight: 500; }
.form-msg.ok { color: #2f8a4a; }
.form-msg.err { color: var(--red); }

/* Visit */
.visit { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; align-items: start; }
.addr { font: 500 1.5rem/1.3 var(--serif); }
.hours { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border-radius: var(--radius); border: 1px solid var(--line); }
.hours caption { text-align: left; font: 700 1.1rem var(--serif); padding: 0 0 .6rem .2rem; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours th, .hours td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.hours th { font-weight: 500; }
.hours tr.today { background: color-mix(in srgb, var(--gold) 25%, transparent); font-weight: 700; }

footer { text-align: center; padding: 2rem 1rem 3rem; color: var(--muted); border-top: 1px solid var(--line); }

/* 404 */
.lost { min-height: 70vh; display: grid; place-content: center; text-align: center; gap: 1rem; }

@media (max-width: 820px) {
  .nav nav { display: none; }
  .basket-link { margin-left: auto; }
  .hero, .order-wrap, .visit { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; margin: 0 auto; }
  .story { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
