:root {
  --bg: #181818;
  --bg-2: #222;
  --fg: #fff;
  --muted: #9e9e9e;
  --line: rgba(255, 255, 255, .12);
  --accent: #f2c14e;
  --top-h: 92px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--bg); color: var(--fg); overflow: hidden; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- header ---------- */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  padding: calc(env(safe-area-inset-top) + 10px) 0 8px;
  background: linear-gradient(rgba(0, 0, 0, .75), rgba(0, 0, 0, 0));
}
.mode-carta .top { background: var(--bg); }
.top-row { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 8px; }
.brand { font-weight: 800; letter-spacing: .3em; font-size: 15px; }
.mode { display: flex; background: rgba(255, 255, 255, .12); border-radius: 999px; padding: 3px; }
.mode button { padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.mode button[aria-selected="true"] { background: var(--fg); color: #000; }

.chips {
  display: flex; gap: 6px; overflow-x: auto; padding: 0 16px; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
          mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600;
  text-transform: capitalize; color: rgba(255, 255, 255, .75); background: rgba(255, 255, 255, .1);
  transition: background .2s, color .2s;
}
.chip.is-active { background: var(--fg); color: #000; }

/* ---------- feed ---------- */
.feed {
  height: 100dvh; overflow-y: scroll; scroll-snap-type: y mandatory; overscroll-behavior-y: contain;
  scrollbar-width: none;
}
.feed::-webkit-scrollbar { display: none; }

.card {
  position: relative; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always;
  overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end;
}

.card-photo .bg {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04); transform-origin: 50% 60%;
}
.card-photo.is-active .bg { animation: kenburns 9s ease-out forwards; }
.card-photo::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(rgba(0, 0, 0, .35) 0%, rgba(0, 0, 0, 0) 25%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, .9) 100%);
}
@keyframes kenburns {
  from { transform: scale(1.04) translate(0, 0); }
  to   { transform: scale(1.16) translate(-1.5%, -2%); }
}

.body { position: relative; z-index: 1; padding: 0 20px calc(env(safe-area-inset-bottom) + 28px); }
.card.is-active .reveal { animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.card.is-active .reveal:nth-child(2) { animation-delay: .06s; }
.card.is-active .reveal:nth-child(3) { animation-delay: .12s; }
.card.is-active .reveal:nth-child(4) { animation-delay: .18s; }
.card.is-active .reveal:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.kicker { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
.notes { color: rgba(255, 255, 255, .8); font-size: 13px; margin-bottom: 14px; }
.notes span + span::before { content: " · "; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; background: var(--accent); color: #000; padding: 3px 8px; border-radius: 4px; margin-bottom: 8px; }
.name { font-size: clamp(30px, 9vw, 44px); font-weight: 800; line-height: 1.02; letter-spacing: -.01em; }
.obs { color: rgba(255, 255, 255, .85); font-size: 15px; line-height: 1.4; margin-top: 8px; max-width: 34em; white-space: pre-line; }
.price { font-size: 22px; font-weight: 700; margin-top: 12px; }
.variants { margin-top: 6px; color: rgba(255, 255, 255, .85); font-size: 14px; }
.variants li { list-style: none; }
.variants b { font-weight: 700; color: var(--fg); }

.counter {
  position: fixed; z-index: 5; right: 10px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 5px;
}
.counter i { width: 4px; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .35); transition: height .2s, background .2s; }
.counter i.on { height: 14px; background: var(--fg); }

/* list + notes cards: no photo, typographic */
.card-list, .card-notes { justify-content: center; background: radial-gradient(120% 80% at 100% 0%, #2b2b2b, var(--bg) 60%); }
.card-list .body, .card-notes .body { padding-top: calc(var(--top-h) + env(safe-area-inset-top) + 8px); }
.section-title { font-size: clamp(28px, 8vw, 40px); font-weight: 800; line-height: 1.05; text-transform: uppercase; margin-bottom: 6px; }
.rows { list-style: none; margin-top: 14px; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row-name { font-weight: 650; font-size: 16px; }
.row-price { font-weight: 700; white-space: nowrap; }
.row-obs { grid-column: 1 / -1; color: var(--muted); font-size: 13px; line-height: 1.35; white-space: pre-line; }
.row-heading { padding: 14px 0 2px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.block { padding: 14px 0; border-bottom: 1px solid var(--line); }
.block:first-of-type { color: var(--accent); font-weight: 700; }
.block p:first-child { font-size: 18px; font-weight: 700; }
.block p + p { color: rgba(255, 255, 255, .8); }

/* ---------- carta (classic) ---------- */
.carta { height: 100dvh; overflow-y: auto; padding: calc(var(--top-h) + env(safe-area-inset-top) + 8px) 16px 48px; }
.carta section { scroll-margin-top: calc(var(--top-h) + 8px); margin-bottom: 28px; }
.carta h2 { font-size: 20px; font-weight: 800; letter-spacing: .04em; margin-bottom: 4px; }
.carta .notes { margin-bottom: 4px; }
.carta .row { cursor: pointer; }
.carta .row.has-photo .row-name::after { content: " ▸"; color: var(--accent); }

/* ---------- misc ---------- */
.state { height: 100dvh; display: grid; place-items: center; color: var(--muted); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--fg); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hint {
  position: fixed; inset: 38% 0 auto 0; z-index: 20; display: grid; justify-items: center; gap: 6px;
  pointer-events: none; animation: hint 3.2s ease forwards;
}
.hint p { background: rgba(0, 0, 0, .7); padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.hint .arrow { display: inline-block; font-weight: 800; margin-right: 6px; }
@keyframes hint { 0%, 75% { opacity: 1; } 100% { opacity: 0; } }

@media (min-width: 700px) {
  .feed, .carta { max-width: 480px; margin: 0 auto; }
  .top { max-width: 480px; margin: 0 auto; }
  .counter { right: calc(50% - 240px + 10px); }
}

@media (prefers-reduced-motion: reduce) {
  .card-photo.is-active .bg, .card.is-active .reveal, .hint { animation: none; }
}
