/* Mirrors packages/shared/src/tokens.ts and apps/merchant/style.css — no
 * bundler here either, so the tokens are duplicated by hand, same rule. */

:root {
  --sun: #ffc93c;
  --tomato: #f2452f;
  --grape: #5b2ecc;
  --mint: #12c48b;
  --ink: #1b1414;
  --surface: #fffbf0;
  --mute: #6e5230;

  /* Text color for anything sitting on a solid --grape background (active
   * chips/pills, primary buttons). Deliberately not --surface: --surface
   * flips dark in dark mode, but --grape itself never darkens to match, so
   * reusing --surface here would put near-black text on medium purple. */
  --on-grape: #fffbf0;

  --outline: 2px;
  --offset: 4px;
  --radius-card: 12px;
  --radius-chip: 999px;

  /* Single source of truth for the side inset — every section (header,
   * hero, filter chips, slider headers/tracks, the bottom CTA) uses this,
   * not its own clamp(), so their content lines up pixel-for-pixel. */
  --gutter: clamp(20px, 4vw, 64px);

  --font-display: 'Gabarito', system-ui, sans-serif;
  --font-body: 'Onest', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --tomato: #ff6b55;
    --ink: #fff6e6;
    --surface: #2a2020;
    --mute: #c9b08a;
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--sun);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.03em;
  margin: 0;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
}

/* ---------- sticker mechanics: ink outline + solid offset layer ---------- */

.sticker {
  position: relative;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-card);
  background: var(--surface);
}

.sticker::after {
  content: '';
  position: absolute;
  inset: var(--offset) calc(var(--offset) * -1) calc(var(--offset) * -1) var(--offset);
  background: var(--ink);
  border-radius: var(--radius-card);
  z-index: -1;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-chip);
  padding: 8px 14px;
  font-weight: 700;
  font-size: 13.5px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
}

.chip.active {
  background: var(--grape);
  color: var(--on-grape);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-card);
  padding: 11px 20px;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
  box-shadow: var(--offset) var(--offset) 0 var(--ink);
  transition: transform 0.08s ease;
}

.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-primary {
  background: var(--grape);
  color: var(--on-grape);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
}

/* ---------- layout ---------- */

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header.site {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px var(--gutter);
  flex-wrap: wrap;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  white-space: nowrap;
}

.logo strong {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.logo .tomato {
  color: var(--tomato);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Below this width, logo + actions no longer fit on one line. Rather than
 * let `justify-content: space-between` scatter them into a ragged wrap,
 * force two clean centered rows: logo, then the actions group. */
@media (max-width: 560px) {
  header.site {
    justify-content: center;
  }

  .header-actions {
    width: 100%;
    justify-content: center;
  }
}

/* ---------- hero: full-bleed photo carousel, same slide-swap mechanism as
   .showcase (setupCarousel), persistent tagline overlaid on top instead of
   a per-slide caption. Sits on var(--sun) between the header and .content,
   so it needs its own top/bottom borders to read as a distinct band. ---- */

.hero-carousel {
  position: relative;
  height: min(62vh, 560px);
  min-height: 380px;
  overflow: hidden;
  border-top: var(--outline) solid var(--ink);
  border-bottom: var(--outline) solid var(--ink);
}

.hero-track {
  position: absolute;
  inset: 0;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-slide.active {
  opacity: 1;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(27, 20, 20, 0.32) 0%, rgba(27, 20, 20, 0.1) 38%, rgba(27, 20, 20, 0.82) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 var(--gutter) 48px;
}

.hero-content h1 {
  color: var(--surface);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  max-width: 760px;
}

.hero-content p {
  color: rgba(255, 251, 240, 0.9);
  font-size: 17px;
  line-height: 1.5;
  max-width: 520px;
  margin: 12px 0 0;
}

.hero-stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.hero-stat {
  background: rgba(255, 251, 240, 0.14);
  border: 1.5px solid rgba(255, 251, 240, 0.55);
  color: var(--surface);
  border-radius: var(--radius-chip);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.hero-cta {
  margin-top: 22px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.hero-dots {
  position: absolute;
  bottom: 20px;
  right: var(--gutter);
  z-index: 3;
  display: flex;
  gap: 6px;
}

.hero-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 251, 240, 0.5);
  border: 1.5px solid var(--ink);
  cursor: pointer;
}

.hero-dots span.active {
  background: var(--surface);
}

.content {
  background: var(--surface);
  border-top: var(--outline) solid var(--ink);
  flex: 1;
  padding: 32px 0 64px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.slider-section[hidden] {
  display: none;
}

.slider-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.how-it-works {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 0 var(--gutter);
}

.step-card {
  position: relative;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.step-num {
  position: absolute;
  top: -14px;
  left: -14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--tomato);
  border: var(--outline) solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--surface);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-8deg);
}

.step-icon {
  font-size: 34px;
  line-height: 1;
}

.step-card h3 {
  font-size: 17px;
  margin-top: 4px;
}

.step-card p {
  font-size: 13.5px;
  color: var(--mute);
  line-height: 1.5;
  margin: 0;
}

.slider-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 var(--gutter);
}

.slider-header .mute {
  font-size: 13px;
  color: var(--mute);
  font-weight: 700;
}

.slider-track {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  /* scroll-snap-align:start on the cards makes the browser snap the
   * *first card* flush to the scrollport edge at rest, which skips right
   * past this padding — scroll-padding is what tells the snap algorithm
   * to treat the scrollport as inset by the gutter instead. Both are
   * needed together; padding alone (or a flex spacer instead of it)
   * still gets snapped past. */
  scroll-padding-inline: var(--gutter);
  padding: 4px var(--gutter) 12px;
  scrollbar-width: thin;
}

.venue-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.venue-photo {
  height: 150px;
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 8px;
  overflow: hidden;
}

.venue-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.venue-photo .initial {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 72px;
  color: var(--ink);
  opacity: 0.15;
}

.venue-badge {
  position: relative;
  transform: rotate(-6deg);
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  padding: 5px 9px;
  text-align: center;
  max-width: 130px;
}

.venue-badge .punch {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 17px;
  line-height: 1;
  color: var(--ink);
}

.venue-badge.locked .punch {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.venue-body {
  padding: 12px 14px 14px;
}

.venue-body h3 {
  font-size: 19px;
}

.venue-body .meta {
  font-size: 13px;
  color: var(--mute);
}

.meta-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
}

.venue-rating {
  flex: none;
  font-weight: 800;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.google-attr {
  font-weight: 600;
  font-size: 9.5px;
  color: var(--mute);
}

.venue-open {
  position: absolute;
  left: 10px;
  bottom: 10px;
  background: var(--surface);
  color: var(--ink);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-chip);
  padding: 3px 10px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.venue-open.is-open {
  background: var(--mint);
}

.venue-caveat {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mute);
  margin-top: 6px;
}

.empty-note {
  padding: 0 var(--gutter);
  color: var(--mute);
  font-size: 14px;
}

/* ---------- download showcase: a slide-swapping "hero" strip, since no
   venue has a real photo yet (fb-2 is a business task) — see app.js
   showcaseSlideHtml for why it uses the same placeholder tone+initial as
   the venue cards, ready to swap to real photos the day they exist. ---- */

.showcase {
  position: relative;
  margin-top: 8px;
  height: 380px;
  border-top: var(--outline) solid var(--ink);
  border-bottom: var(--outline) solid var(--ink);
  overflow: hidden;
}

.showcase-track {
  position: absolute;
  inset: 0;
}

.showcase-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.showcase-slide.active {
  opacity: 1;
}

.showcase-initial {
  font-family: var(--font-display);
  font-size: 160px;
  color: var(--ink);
  opacity: 0.15;
}

.showcase-caption {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-chip);
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 700;
}

.showcase-dots {
  position: absolute;
  bottom: 18px;
  right: var(--gutter);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.showcase-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 251, 240, 0.5);
  border: 1.5px solid var(--ink);
  cursor: pointer;
}

.showcase-dots span.active {
  background: var(--surface);
}

.showcase-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: 28px var(--gutter);
  background: linear-gradient(0deg, rgba(27, 20, 20, 0.82) 0%, rgba(27, 20, 20, 0.35) 55%, rgba(27, 20, 20, 0) 100%);
}

.showcase-overlay h2 {
  color: var(--surface);
  font-size: 26px;
  max-width: 480px;
}

.showcase-overlay p {
  color: rgba(255, 251, 240, 0.8);
  margin: 0;
  font-size: 14px;
  max-width: 440px;
}

.showcase-overlay .store-badges {
  margin-top: 8px;
}

.store-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.store-badge {
  border: var(--outline) solid rgba(255, 251, 240, 0.4);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  color: rgba(255, 251, 240, 0.6);
}

.store-badge .soon {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  color: var(--mint);
  margin-top: 2px;
}

/* ---------- venue sign-up: businesses asking to join, not a guest flow —
   deliberately plain (no carousel, no stickers-on-stickers) so it reads as
   the "serious" moment on an otherwise playful page. ---------- */

.venue-signup {
  padding: 8px var(--gutter) 0;
}

.venue-signup-inner {
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.venue-signup-copy h2 {
  font-size: 26px;
  max-width: 380px;
}

.venue-signup-copy p {
  font-size: 14.5px;
  color: var(--mute);
  line-height: 1.55;
  margin-top: 10px;
  max-width: 380px;
}

.venue-signup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.venue-signup-form input,
.venue-signup-form textarea {
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-card);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
  resize: vertical;
}

.venue-signup-form button {
  align-self: flex-start;
  margin-top: 4px;
}

.signup-success {
  color: var(--mint);
  font-weight: 700;
  font-size: 13.5px;
  margin: 0;
}

@media (max-width: 800px) {
  .venue-signup-inner {
    grid-template-columns: 1fr;
  }
}

footer.site {
  padding: 24px var(--gutter) 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--mute);
  font-size: 13px;
}

/* ---------- login modal ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 20, 20, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--surface);
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-card);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 28px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal h2 {
  font-size: 22px;
}

.modal input {
  border: var(--outline) solid var(--ink);
  border-radius: var(--radius-card);
  padding: 11px 14px;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--surface);
  color: var(--ink);
}

.modal .close {
  align-self: flex-end;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--mute);
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

.modal .error {
  color: var(--tomato);
  font-size: 13px;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-chip .name {
  font-weight: 800;
  font-size: 14px;
}

.user-chip .signout {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--mute);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.lang-switch {
  display: flex;
  gap: 4px;
}

.lang-switch a {
  padding: 6px 10px;
  border-radius: var(--radius-chip);
  font-size: 12.5px;
  font-weight: 800;
  text-decoration: none;
  border: var(--outline) solid var(--ink);
}

.lang-switch a.active {
  background: var(--grape);
  color: var(--on-grape);
  border-color: var(--ink);
}

@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .venue-card {
    flex-basis: 220px;
  }
  .showcase {
    height: 420px;
  }
  .showcase-initial {
    font-size: 100px;
  }
  .hero-carousel {
    height: 72vh;
    min-height: 460px;
  }
  .steps-grid {
    grid-template-columns: 1fr;
  }
}
