:root {
  --primary: #EA580C;
  --primary-hover: #C2410C;
  --primary-soft: #FFF1E7;
  --on-primary: #FFFFFF;
  --text: #1C1917;
  --muted: #78716C;
  --surface: #FFFFFF;
  --bg: #FAFAF9;
  --border: #E7E5E4;
  --success: #16A34A;
  --success-soft: #DCFCE7;
  --danger: #DC2626;
  --danger-soft: #FEE2E2;
  --warning: #D97706;
  --warning-soft: #FEF3C7;
  --skel: #EEEBE9;
  --shadow: 0 1px 2px rgb(28 25 23 / .06), 0 8px 24px rgb(28 25 23 / .06);
  --radius: 16px;
  --radius-sm: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #F97316;
    --primary-hover: #FB923C;
    --primary-soft: #2A1A10;
    --on-primary: #1C0F06;
    --text: #F5F5F4;
    --muted: #A8A29E;
    --surface: #1C1917;
    --bg: #0F0D0C;
    --border: #2E2A27;
    --success: #4ADE80;
    --success-soft: #0F2A19;
    --danger: #F87171;
    --danger-soft: #2E1414;
    --warning: #FBBF24;
    --warning-soft: #2B2110;
    --skel: #292524;
    --shadow: 0 1px 2px rgb(0 0 0 / .4);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); }
h1, h2 { line-height: 1.15; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: clamp(2rem, 7vw, 3.25rem); font-weight: 800; }
h2 { font-size: 1.375rem; font-weight: 750; margin-bottom: 16px; }
.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.skip {
  position: absolute; left: -9999px; top: 8px; z-index: 10;
  background: var(--surface); color: var(--text); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* Update banner */
.banner {
  background: var(--warning-soft);
  color: var(--text);
  border-bottom: 1px solid color-mix(in srgb, var(--warning) 35%, transparent);
  padding: 12px 16px;
  text-align: center;
  font-size: .95rem;
}
.banner strong { color: var(--warning); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 56px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; min-width: 0; }
.brand img { border-radius: 8px; flex: none; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 4px 10px; border-radius: 999px; font-size: .8125rem; font-weight: 650;
  background: var(--skel); color: var(--muted);
}
.badge .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge-open { background: var(--success-soft); color: var(--success); }
.badge-closed { background: var(--danger-soft); color: var(--danger); }
.badge-loading .dot { animation: pulse 1.2s ease-in-out infinite; }
.badge-partner { background: var(--primary-soft); color: var(--primary); }

/* Hero */
.hero {
  padding: 40px 0 32px;
  background:
    radial-gradient(120% 80% at 100% 0%, color-mix(in srgb, var(--primary) 16%, transparent) 0%, transparent 60%),
    var(--bg);
}
.eyebrow { margin: 0 0 8px; color: var(--primary); font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .08em; }
.lede { margin: 14px 0 24px; color: var(--muted); font-size: 1.0625rem; max-width: 34em; }

.download-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 56px; padding: 14px 20px;
  border-radius: var(--radius-sm); border: 0;
  font: inherit; font-size: 1.125rem; font-weight: 750; text-decoration: none; cursor: pointer;
  transition: background-color .15s, transform .05s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }
@media (min-width: 640px) { .btn { width: auto; display: inline-flex; min-width: 300px; } }

/* Build & Maintenance status banner */
.build-banner {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
}
.build-banner-maintenance {
  background: var(--danger-soft);
  border-color: color-mix(in srgb, var(--danger) 30%, transparent);
}
.build-banner-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.build-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 750;
  font-size: .875rem;
  color: var(--warning);
}
.build-banner-maintenance .build-badge {
  color: var(--danger);
}
.build-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1s infinite alternate;
}
.build-time {
  font-size: .8125rem;
  color: var(--muted);
}
.build-status-msg {
  margin: 0;
  font-size: .925rem;
  color: var(--text);
  line-height: 1.45;
}
.build-progress-wrap {
  margin-top: 10px;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--warning) 20%, transparent);
  overflow: hidden;
  position: relative;
}
.build-banner-maintenance .build-progress-wrap {
  display: none;
}
.build-progress-bar {
  width: 45%;
  height: 100%;
  border-radius: 999px;
  background: var(--warning);
  animation: build-indeterminate 1.8s ease-in-out infinite;
}
@keyframes build-indeterminate {
  0% { transform: translateX(-100%); width: 25%; }
  50% { transform: translateX(100%); width: 60%; }
  100% { transform: translateX(350%); width: 25%; }
}

/* Disabled button states */
.btn.btn-disabled,
a.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .75;
  pointer-events: none;
  box-shadow: none;
}
.btn.btn-building {
  background: color-mix(in srgb, var(--warning) 18%, var(--surface));
  color: var(--warning);
  border: 1.5px solid color-mix(in srgb, var(--warning) 45%, transparent);
}
.btn.btn-maintenance {
  background: color-mix(in srgb, var(--danger) 18%, var(--surface));
  color: var(--danger);
  border: 1.5px solid color-mix(in srgb, var(--danger) 45%, transparent);
}
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
  flex: none;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.release-meta { margin: 12px 0 0; color: var(--muted); font-size: .9rem; min-height: 1.4em; }
.release-meta b { color: var(--text); font-weight: 650; }

.notes { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 12px; }
.notes summary { cursor: pointer; font-weight: 650; }
.notes-body { margin-top: 8px; color: var(--muted); font-size: .95rem; white-space: pre-line; }

.note {
  margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--primary-soft); font-size: .95rem;
}
/* White tile keeps the QR scannable in dark mode. */
.note .qr {
  display: block; width: 180px; height: 180px; margin-top: 10px; padding: 8px;
  border-radius: 12px; background: #fff; border: 1px solid var(--border);
}
.note code {
  display: block; margin-top: 6px; padding: 8px 10px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem;
  word-break: break-all; user-select: all;
}

/* Sections */
.section { padding: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 12px; }
.steps li {
  counter-increment: step; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px 14px 60px;
}
.steps li::before {
  content: counter(step);
  position: absolute; left: 14px; top: 14px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary); font-weight: 800;
}
.steps strong { display: block; }
.tip {
  margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--success-soft); border: 1px solid color-mix(in srgb, var(--success) 25%, transparent);
}
.tip strong { color: var(--success); }

/* Menu */
.menu-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 640px) { .menu-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.menu-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  overflow: hidden; display: flex; flex-direction: column;
}
.menu-img-wrap { position: relative; width: 100%; aspect-ratio: 4 / 3; overflow: hidden; background: var(--skel); }
.menu-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.menu-img.placeholder { background: var(--primary-soft); display: grid; place-items: center; color: var(--muted); font-size: 2rem; width: 100%; height: 100%; }
.menu-watermark {
  position: absolute; bottom: 6px; left: 6px; z-index: 2;
  background: rgba(15, 12, 10, 0.78); backdrop-filter: blur(4px);
  color: #fef08a; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 2px 6px; border-radius: 4px;
  pointer-events: none; user-select: none; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.menu-body { padding: 10px 12px 12px; display: grid; gap: 4px; }
.menu-name { font-weight: 650; font-size: .95rem; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.menu-price { color: var(--primary); font-weight: 750; }
.menu-rating { color: var(--muted); font-size: .8125rem; }

/* Skeletons */
.skel { display: block; background: var(--skel); border-radius: 6px; animation: pulse 1.4s ease-in-out infinite; }
.skel-line { height: .9em; width: 70%; }
.skel-line.short { width: 40%; }
.release-meta .skel-line { width: 55%; display: inline-block; vertical-align: middle; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* Footer */
.footer { border-top: 1px solid var(--border); padding: 24px 0 calc(24px + env(safe-area-inset-bottom)); margin-top: 16px; }
.footer-inner p { margin: 4px 0; }
.footer a { font-weight: 650; }

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