/* The landing page (bites-design-kit screen 1, examples/landing.html).
   It shares tokens.css with the app but not style.css: the app is a fixed,
   full-viewport map, and this is an ordinary scrolling document. Every value
   below resolves to a kit token. */

:root {
  --font-display-stack: var(--font-display);
  --lead: 400 16px/1.55 var(--font-body);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--color-surface);
  color: var(--color-ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--color-user-location); outline-offset: 3px; border-radius: 6px; }

/* The kit caps content at 480 and centres it. On a PC that column alone would
   be a ribbon down the middle of an empty page, so the sections below widen
   and go two-up instead — same components, more of them per row. */
.page { max-width: 480px; margin: 0 auto; }

/* ---------- nav ---------- */

.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: max(16px, env(safe-area-inset-top)) var(--space-detail-padding) 8px;
}
.nav-right { display: flex; gap: 6px; align-items: center; }

.icon-btn-flat {
  width: 48px; height: 48px;
  border: 0; background: transparent;
  border-radius: 50%;
  color: var(--color-ink);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn-flat:hover { background: var(--color-surface-subtle); }

/* ---------- buttons ---------- */

.btn {
  height: 54px;
  border-radius: var(--radius-pill);
  border: 0;
  display: flex; gap: 10px; align-items: center; justify-content: center;
  font: 600 16px var(--font-body);
  text-decoration: none; cursor: pointer;
  width: 100%; padding: 0 22px;
}
.btn-primary { background: var(--color-fab); color: var(--color-on-fab); box-shadow: var(--shadow-fab); }
.btn-outline {
  height: 40px; width: auto; font-size: 14px;
  border: 1.5px solid var(--color-ink); background: transparent;
  color: var(--color-ink); padding: 0 16px;
}
.btn-text { height: 48px; background: none; color: var(--color-ink-secondary); font-size: 15px; }

/* ---------- hero ---------- */

.hero { padding: 28px var(--space-detail-padding) 0; display: flex; flex-direction: column; gap: 18px; }
.live {
  align-self: flex-start;
  display: flex; gap: 8px; align-items: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-subtle);
  font: 600 12px var(--font-body);
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--color-ink-secondary);
}
.hero h1 {
  margin: 0;
  font: 700 clamp(36px, 10vw, 52px)/1.04 var(--font-display);
  letter-spacing: -.03em;
}
.lead { margin: 0; font: var(--lead); color: var(--color-ink-secondary); }
.ctas { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }

/* The illustrated map. Painted from the map tokens, so it follows the theme. */
.hero-map {
  position: relative;
  margin: 12px var(--space-detail-padding) 0;
  height: 320px;
  border-radius: var(--radius-hero-map);
  overflow: hidden;
  background: var(--color-map-land);
  box-shadow: var(--shadow-photo);
}
.hero-map .base { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-map .radius {
  position: absolute; left: 50%; top: 50%;
  width: 240px; height: 240px; margin: -120px 0 0 -120px;
  border-radius: 50%;
  border: 2px dashed var(--color-user-location);
  background: color-mix(in srgb, var(--color-user-location) 12%, transparent);
}
.walk-chip {
  position: absolute; left: calc(50% + 30px); top: calc(50% + 98px);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-raised);
  font: 600 11px var(--font-body);
  box-shadow: var(--shadow-float-button);
  display: flex; gap: 4px; align-items: center;
}
.hero-map .me { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.me-halo, .me-ring {
  position: absolute; left: -30px; top: -30px;
  width: 60px; height: 60px; border-radius: 50%;
}
.me-halo {
  background: color-mix(in srgb, var(--color-user-location) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-user-location) 32%, transparent);
}
.me-ring { border: 2px solid var(--color-user-location); animation: bites-pulse 2s ease-out infinite; }
.me-dot {
  position: absolute; left: -9px; top: -9px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--color-user-location);
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 30%);
}

/* the kit's bite pin, placed by percentage on the illustration */
.hero-map .bite-pin { position: absolute; transform: translate(-50%, -100%); }

/* ---------- sections ---------- */

section { padding: 56px var(--space-detail-padding) 0; }
section h2 {
  margin: 0 0 18px;
  font: 700 28px/1.15 var(--font-display);
  letter-spacing: -.02em;
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head .note { font: 500 13px var(--font-body); color: var(--color-ink-muted); }

.steps { display: flex; flex-direction: column; gap: 22px; }
.step { display: flex; gap: 14px; }
.tile {
  width: 48px; height: 48px;
  border-radius: var(--radius-input);
  background: var(--color-surface-subtle);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--color-ink);
}
.step h3 { margin: 2px 0 4px; font: 600 18px var(--font-display); }
.step p { margin: 0; font: 400 14px/1.5 var(--font-body); color: var(--color-ink-secondary); }

/* Fresh nearby — real posts from /api/posts, not demo data. */
.strip {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding: 0 var(--space-detail-padding) 4px;
  margin: 0 calc(var(--space-detail-padding) * -1);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.strip::-webkit-scrollbar { display: none; }
.strip .bite { width: 168px; height: 216px; flex-shrink: 0; scroll-snap-align: start; }

.bite {
  position: relative; display: block;
  border-radius: var(--radius-card);
  overflow: hidden;
  text-decoration: none; color: var(--color-on-dark);
  background: var(--color-surface-subtle);
}
.bite img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bite-band {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, var(--color-scrim) 40%);
}
.bite-dish { font: 600 16px/1.2 var(--font-display); letter-spacing: -.01em; }
.bite-meta { margin-top: 2px; font: 500 12px var(--font-body); opacity: .92; }
.bite-age { font: 500 11px var(--font-body); opacity: .8; margin-top: 4px; }

.privacy {
  display: flex; gap: 14px;
  padding: 20px;
  border-radius: var(--radius-illustration);
  background: var(--color-surface-subtle);
}
.privacy h3 { margin: 0 0 4px; font: 600 16px var(--font-display); }
.privacy p { margin: 0; font: 400 14px/1.5 var(--font-body); color: var(--color-ink-secondary); }

/* The closing call to action inverts: ink block in light, subtle in dark. */
.cta {
  padding: 28px 24px;
  border-radius: var(--radius-hero-map);
  background: var(--color-ink);
  color: var(--color-surface);
  display: flex; flex-direction: column; gap: 16px;
}
.cta h2 { margin: 0; color: inherit; }
.cta p { margin: 0; opacity: .8; }
.cta .btn { background: var(--color-surface); color: var(--color-ink); }
:root[data-theme="dark"] .cta { background: var(--color-surface-subtle); color: var(--color-ink); }
:root[data-theme="dark"] .cta .btn { background: var(--color-fab); color: var(--color-on-fab); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .cta { background: var(--color-surface-subtle); color: var(--color-ink); }
  :root:not([data-theme="light"]) .cta .btn { background: var(--color-fab); color: var(--color-on-fab); }
}

footer.site {
  padding: 40px var(--space-detail-padding) max(28px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px; align-items: center;
}
footer.site nav { display: flex; gap: 20px; font-size: 14px; flex-wrap: wrap; justify-content: center; }
footer.site nav a { color: var(--color-ink-secondary); text-decoration: none; }
footer.site nav a:hover { color: var(--color-ink); }
footer.site .credit { width: 100%; }

/* ---------- credit ---------- */

.credit {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font: 500 12px var(--font-body);
  color: var(--color-ink-muted);
}
.credit-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.credit strong { font-weight: 600; color: var(--color-ink-secondary); }
.credit__logo {
  width: 16px; height: 16px; flex-shrink: 0;
  display: inline-block;
  border: 1.2px dashed var(--color-border-dashed);
  border-radius: 4px;
}
.credit__logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.credit__logo:has(img) { border: 0; }
.credit a { color: var(--color-link); text-decoration: none; border-bottom: 1px solid var(--color-border-strong); }
.credit--rule { padding-top: 14px; border-top: 1px solid var(--color-border); }

.new-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--color-accent);
  animation: bites-live 1.6s ease-in-out infinite;
  flex: 0 0 auto;
}

/* the kit's bite pin, shared with the app */
.bite-pin { position: relative; width: 52px; height: 62px; filter: drop-shadow(0 4px 8px rgb(0 0 0 / 30%)); }
.bite-pin__tail {
  position: absolute; left: 19px; top: 46px;
  width: 14px; height: 14px; background: #fff;
  transform: rotate(45deg); border-radius: 2px;
}
.bite-pin__photo {
  position: absolute; inset: 0 0 10px 0;
  width: 52px; height: 52px;
  border-radius: 50%; border: 3px solid #fff;
  object-fit: cover; background: var(--color-surface-subtle);
}
.bite-pin__cat {
  position: absolute; left: -4px; bottom: 14px;
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid #fff; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.bite-pin__age {
  position: absolute; right: -8px; top: -6px;
  padding: 2px 6px; border-radius: var(--radius-pill);
  background: var(--color-fab); color: var(--color-on-fab);
  font: 600 10px/1.4 var(--font-body);
}

@media (prefers-reduced-motion: reduce) {
  .me-ring, .new-dot { animation: none; }
}

/* ---------- PC ---------- */
/* The kit has no desktop landing page. Rather than invent one, the page
   widens to the screen and the sections that are lists go across — the same
   components, more of them per row. */

@media (min-width: 900px) {
  /* The page uses the laptop's width instead of a narrow centred column: the
     gutter grows with the screen and the cap only stops lines getting silly
     long on very wide monitors. */
  :root { --gutter: clamp(40px, 5vw, 96px); }
  .page { max-width: 1600px; }

  .nav { padding-inline: var(--gutter); }

  /* Hero and its map sit side by side and fill the first screen. */
  .hero-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    gap: clamp(40px, 5vw, 88px);
    align-items: center;
    min-height: min(calc(100svh - 72px), 880px);
    padding: 24px var(--gutter) 48px;
  }
  .hero { padding: 0; gap: 22px; }
  .hero h1 { font-size: clamp(44px, 3.9vw, 72px); }
  .lead { font-size: clamp(16px, 1.25vw, 20px); max-width: 38ch; }
  .ctas { flex-direction: row; align-items: center; gap: 12px; }
  .ctas .btn { width: auto; }
  .hero-map { margin: 0; height: clamp(420px, 68svh, 680px); }
  /* The walk radius grows with the map instead of staying a phone-sized ring. */
  .hero-map .radius {
    width: auto; height: 58%; aspect-ratio: 1;
    margin: 0; transform: translate(-50%, -50%);
  }
  .walk-chip { left: calc(50% + 12%); top: calc(50% + 23%); }

  section { padding: 72px var(--gutter) 0; }
  section h2 { font-size: clamp(32px, 2.6vw, 44px); }

  /* Three steps across, not down. */
  .steps { flex-direction: row; gap: clamp(28px, 3vw, 56px); }
  .step { flex: 1; flex-direction: column; }
  .step h3 { font-size: 20px; }
  .step p { font-size: 15px; }

  /* The strip stops being a swipe and becomes a grid — a mouse cannot swipe. */
  .strip {
    display: grid;
    /* Up to six posts: three or six across, so no card sits alone on a row. */
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    overflow: visible;
    margin: 0; padding: 0;
  }
  .strip .bite { width: auto; height: auto; aspect-ratio: 4 / 5; }
  .strip .bite:hover { transform: translateY(-2px); }
  .bite { transition: transform 140ms ease; }

  .privacy { padding: 26px 28px; align-items: center; }
  .cta { flex-direction: row; align-items: center; justify-content: space-between; padding: 40px 48px; }
  .cta .btn { width: auto; flex: 0 0 auto; }

  footer.site { padding: 56px var(--gutter) 40px; }
}

@media (min-width: 1280px) {
  .strip { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Dark mode: the Emergent mark is a near-black tile and would vanish into the
   surface, so it gets a hairline ring (outside the mark, not a recolour). */
:root[data-theme="dark"] .credit__logo--emergent img { border-radius: 4px; box-shadow: 0 0 0 1px var(--color-border-strong); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .credit__logo--emergent img { border-radius: 4px; box-shadow: 0 0 0 1px var(--color-border-strong); }
}

/* The Bites lockup swaps to the kit's white version in dark mode. */
.mark-dark { display: none; }
:root[data-theme="dark"] .mark-light { display: none; }
:root[data-theme="dark"] .mark-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .mark-light { display: none; }
  :root:not([data-theme="light"]) .mark-dark { display: block; }
}
