/* QinChuan — warm restaurant palette + subtle grid */
:root {
  /* Shared brand tokens */
  --accent: #e8913a;
  --accent-soft: rgba(232, 145, 58, 0.15);
  --accent-hot: #ff6b35;
  --ok: #5cba7a;
  --warn: #e8c43a;
  --danger: #e85a5a;
  --on-accent: #1a1008;
  --radius: 14px;
  --font-sans: "Aleo", Georgia, serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  /* Header — always light & warm (logo reads on cream) */
  --header-bg: rgba(249, 243, 237, 0.94);
  --header-ink: #2a1f16;
  --header-ink-muted: #6b5a4a;
  --header-line: rgba(42, 31, 22, 0.1);
  --header-accent-soft: rgba(232, 145, 58, 0.14);
  --header-shadow: 0 1px 0 rgba(42, 31, 22, 0.05);
}

/* Night — cozy dark dining room */
:root,
[data-theme="night"] {
  --bg-deep: #1a1410;
  --bg-panel: #241c16;
  --bg-card: #2e241c;
  --ink: #f4ebe3;
  --ink-muted: #c9b8a8;
  --line: rgba(244, 235, 227, 0.08);
  --grid: rgba(232, 145, 58, 0.06);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --input-bg: rgba(0, 0, 0, 0.2);
  --surface-inset: rgba(0, 0, 0, 0.15);
  --body-glow-a: rgba(232, 145, 58, 0.18);
  --body-glow-b: rgba(255, 107, 53, 0.12);
  --msg-success-fg: #c6f0d2;
  --msg-error-fg: #ffb4b4;
  --msg-warning-fg: #ffe9a8;
  --badge-seated-fg: #9dc4ff;
}

[data-theme="night"] body {
  color-scheme: dark;
}

/* Day — sunlit warm interior */
[data-theme="day"] {
  --bg-deep: #fdf8f3;
  --bg-panel: #f5ebe0;
  --bg-card: #fff9f2;
  --ink: #2a1f16;
  --ink-muted: #6b5a4a;
  --line: rgba(42, 31, 22, 0.1);
  --grid: rgba(232, 145, 58, 0.07);
  --shadow: 0 20px 50px rgba(42, 31, 22, 0.08);
  --input-bg: rgba(42, 31, 22, 0.04);
  --surface-inset: rgba(42, 31, 22, 0.05);
  --body-glow-a: rgba(232, 145, 58, 0.14);
  --body-glow-b: rgba(255, 107, 53, 0.08);
  --msg-success-fg: #1f5c38;
  --msg-error-fg: #8f2e2e;
  --msg-warning-fg: #6b4f12;
  --badge-seated-fg: #2a5a9e;
}

[data-theme="day"] body {
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--bg-deep);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    radial-gradient(ellipse 120% 80% at 50% -20%, var(--body-glow-a), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 100%, var(--body-glow-b), transparent 45%);
  background-size: 48px 48px, 48px 48px, 100% 100%, 100% 100%;
  line-height: 1.55;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.shell {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(12px);
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-line);
  box-shadow: var(--header-shadow);
  color-scheme: light;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--header-ink);
  text-decoration: none;
}
.brand:hover {
  text-decoration: none;
  color: var(--accent);
}

.brand__mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--bg-deep);
  box-shadow: 0 8px 24px rgba(232, 145, 58, 0.35);
}

.brand__logo {
  height: 38px;
  width: auto;
  display: block;
  border-radius: 10px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav a {
  color: var(--header-ink-muted);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
}
.nav a:hover {
  color: var(--header-ink);
  background: var(--header-accent-soft);
  border-color: rgba(232, 145, 58, 0.25);
  text-decoration: none;
}

.nav a.is-active {
  color: var(--on-accent);
  background: linear-gradient(135deg, var(--accent), #f0a060);
  border-color: transparent;
}

.nav__cart {
  position: relative;
}
.nav__cart-badge {
  position: absolute;
  top: -6px;
  right: 2px;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent-hot);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--header-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  color: var(--header-ink-muted);
  cursor: pointer;
  color-scheme: only light;
  appearance: none;
  -webkit-appearance: none;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.theme-toggle:hover {
  color: var(--header-ink);
  background: var(--header-accent-soft);
  border-color: rgba(232, 145, 58, 0.3);
}
.theme-toggle svg {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  flex-shrink: 0;
}
.theme-toggle svg path {
  fill: var(--header-ink-muted);
}
.theme-toggle:hover svg path {
  fill: var(--header-ink);
}
.theme-toggle .theme-toggle__icon--day {
  display: block;
}
.theme-toggle .theme-toggle__icon--night {
  display: none;
}
[data-theme="day"] .theme-toggle .theme-toggle__icon--day {
  display: block !important;
}
[data-theme="day"] .theme-toggle .theme-toggle__icon--night {
  display: none !important;
}
[data-theme="night"] .theme-toggle .theme-toggle__icon--day {
  display: none;
}
[data-theme="night"] .theme-toggle .theme-toggle__icon--night {
  display: block;
}
[data-theme="night"] .site-header .theme-toggle,
[data-theme="night"] .site-header .theme-toggle svg path {
  color: #6b5a4a !important;
  fill: #6b5a4a !important;
}
[data-theme="night"] .site-header .theme-toggle:hover,
[data-theme="night"] .site-header .theme-toggle:hover svg path {
  color: #2a1f16 !important;
  fill: #2a1f16 !important;
}

.site-header .btn--ghost {
  color: var(--header-ink-muted);
  border-color: var(--header-line);
}
.site-header .btn--ghost:hover {
  color: var(--header-ink);
  border-color: rgba(232, 145, 58, 0.45);
  background: var(--header-accent-soft);
}

main {
  padding: 2.5rem 0 4rem;
}

.hero {
  display: grid;
  gap: 2rem;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  padding: 2rem 0 3rem;
}

@media (max-width: 880px) {
  .hero {
    grid-template-columns: 1fr;
  }
}

.hero__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.25rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
}

.hero__lead {
  color: var(--ink-muted);
  font-size: 1.1rem;
  max-width: 36ch;
  margin: 0 0 1.5rem;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.hero__panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero__panel::before {
  content: "";
  position: absolute;
  inset: -40% -20%;
  background: radial-gradient(circle at 30% 30%, rgba(232, 145, 58, 0.12), transparent 55%);
  pointer-events: none;
}

.hero__stat {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.hero__stat strong {
  color: var(--ink);
  font-size: 1.05rem;
  font-family: var(--font-sans);
  letter-spacing: -0.02em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn--primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  color: var(--on-accent);
  box-shadow: 0 12px 32px rgba(255, 107, 53, 0.28);
}
.btn--primary:hover {
  color: var(--on-accent);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  border-color: rgba(232, 145, 58, 0.45);
  color: var(--accent);
}

.section {
  margin-top: 3rem;
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.section__head h2 {
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.section__head p {
  margin: 0.35rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

.tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

.panel__title {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
}
.panel__sub {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
}

.form-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
  margin-bottom: 0.35rem;
}

.input,
select.input,
textarea.input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--ink);
  font: inherit;
}
.input:focus {
  outline: 2px solid rgba(232, 145, 58, 0.45);
  outline-offset: 1px;
}

.errorlist {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  color: var(--danger);
  font-size: 0.8rem;
}

.nonfield {
  padding: 0.75rem 1rem;
  background: rgba(232, 90, 90, 0.12);
  border: 1px solid rgba(232, 90, 90, 0.35);
  border-radius: 10px;
  color: var(--msg-error-fg);
  margin-bottom: 1rem;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 0.5rem;
}

.slot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.35rem;
  border-radius: 10px;
  border: 2px solid var(--line);
  background: var(--surface-inset);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, transform 0.12s;
}
.slot-btn:hover:not(:disabled) {
  border-color: rgba(232, 145, 58, 0.5);
}
.slot-btn.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: scale(1.02);
}
.slot-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.slot-btn__time {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.85rem;
}
.slot-btn__meta {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.slot-btn__meta--ok {
  color: var(--ok);
}
.slot-btn__meta--warn {
  color: var(--warn);
}
.slot-btn__meta--bad {
  color: var(--ink-muted);
}

.callout {
  display: flex;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(90, 160, 255, 0.25);
  background: rgba(90, 160, 255, 0.08);
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.callout strong {
  color: var(--ink);
}

.messages {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.messages li {
  padding: 0.65rem 1rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}
.messages .success {
  background: rgba(92, 186, 122, 0.15);
  border: 1px solid rgba(92, 186, 122, 0.35);
  color: var(--msg-success-fg);
}
.messages .error {
  background: rgba(232, 90, 90, 0.12);
  border: 1px solid rgba(232, 90, 90, 0.35);
  color: var(--msg-error-fg);
}
.messages .warning {
  background: rgba(232, 196, 58, 0.12);
  border: 1px solid rgba(232, 196, 58, 0.35);
  color: var(--msg-warning-fg);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-family: var(--font-mono);
}
.badge--pending {
  background: rgba(232, 196, 58, 0.2);
  color: var(--warn);
}
.badge--confirmed {
  background: rgba(92, 186, 122, 0.2);
  color: var(--ok);
}
.badge--seated {
  background: rgba(90, 160, 255, 0.15);
  color: var(--badge-seated-fg);
}
.badge--expired,
.badge--cancelled {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink-muted);
}

.table-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-inset);
  margin-bottom: 0.75rem;
}

.price {
  font-family: var(--font-mono);
  color: var(--accent);
  font-weight: 600;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: center;
}

.mono {
  font-family: var(--font-mono);
}

/* Checkout (shop basket) */
#checkout-form fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.15rem 1.15rem;
  margin: 0 0 1.25rem;
}
#checkout-form fieldset legend {
  padding: 0 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-muted);
}
#checkout-form .checkout-field {
  margin-bottom: 1.1rem;
}
#checkout-form .checkout-field:last-of-type {
  margin-bottom: 0;
}
#checkout-form ul {
  list-style: none;
  padding: 0;
  margin: 0.35rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
#checkout-form ul li label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
  font-size: 0.95rem;
}
#checkout-form ul li input[type="radio"] {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}
#checkout-form textarea.input {
  resize: vertical;
  min-height: 5rem;
}
.checkout-divider {
  margin: 1.75rem 0 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.checkout-divider h2 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.checkout-divider p {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.boss-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
.boss-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.boss-table th,
.boss-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.boss-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--surface-inset);
}
.boss-table tbody tr:last-child td {
  border-bottom: none;
}
.boss-table tbody tr:hover td {
  background: rgba(232, 145, 58, 0.06);
}
