/* =========================================================
   Nearby — mobile landing page.
   Single column, 440px cap so a desktop browser shows it at
   phone width instead of stretching it.
   ========================================================= */

:root {
  --cream:  #f3eee3;
  --card:   #ffffff;
  --band:   #ece5d5;
  --tile:   #f6f2ea;
  --ink:    #151a21;
  --muted:  #8c8578;
  --faint:  #a9a294;
  --accent: #2f76e8;
  --g1:     #35c6a4;
  --g2:     #1b6fd8;
  --r:      22px;
  --pad:    16px;
}

* { box-sizing: border-box; }

html { background: #e7e1d4; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--cream);
  box-shadow: 0 0 60px -20px rgba(21, 26, 33, .35);
  overflow-x: clip;
}

/* ── hero ─────────────────────────────────────────────────── */

.hero {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: 68vh;
  min-height: 320px;
  border-radius: 0 0 22px 22px;
  overflow: hidden;
  background: #cfc7b6;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 32%;
  transition: opacity .28s ease;
}
.hero-img.swap { opacity: 0; }

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10, 14, 18, .34) 0%,
    rgba(10, 14, 18, .06) 22%,
    rgba(10, 14, 18, 0)   38%,
    rgba(10, 14, 18, .58) 66%,
    rgba(10, 14, 18, .90) 86%,
    rgba(10, 14, 18, .95) 100%);
}

.lang-pill {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  inset-inline-end: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 9px;
  border-radius: 999px;
  background: rgba(18, 22, 27, .46);
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
  color: #fff;
  z-index: 3;
}
.lang-pill select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 0 2px;
  max-width: 116px;
  cursor: pointer;
}
.lang-pill select:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }
.lang-pill option { color: #151a21; }

.hero-copy {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 0 20px 20px;
  z-index: 2;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 13px;
}

/* Kept for assistive tech only — the hero reads as a photo with a name. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(18, 22, 27, .55);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .01em;
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #35d39a;
  box-shadow: 0 0 0 3px rgba(53, 211, 154, .22);
}

/* ── hero headline (bottom-left, above the name) ──────────── */

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-width: 31ch;
}
.hero-lead {
  margin: 0;
  font-size: 19px;
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -.018em;
  text-shadow: 0 1px 14px rgba(10, 14, 18, .55);
}
.hero-sub {
  margin: 0;
  font-size: 12.8px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .86);
  text-shadow: 0 1px 12px rgba(10, 14, 18, .55);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .45);
  background: rgba(255, 255, 255, .13);
  -webkit-backdrop-filter: blur(7px);
  backdrop-filter: blur(7px);
  font-size: 12.5px;
  color: rgba(255, 255, 255, .95);
}
.chip b { font-weight: 700; }

/* ── body column ──────────────────────────────────────────── */

.body { padding: 0 var(--pad) 34px; }

/* ── thumbnail strip ──────────────────────────────────────── */

.thumbs {
  margin: 12px calc(var(--pad) * -1) 0;
  padding: 7px var(--pad) 8px;
  overflow: hidden;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--pad);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 22px, #000 calc(100% - 22px), transparent 100%);
}
.thumbs::-webkit-scrollbar { display: none; }

/* Two identical sets, so translating by half the track is a seamless loop.
   Each set carries a trailing gap equal to the column gap — without it the
   seam is half a gap short and the loop visibly jumps. */
.thumbs-track {
  display: flex;
  width: max-content;
  -webkit-animation: thumbs-marquee 46s linear infinite;
  animation: thumbs-marquee 46s linear infinite;
}
.thumbs-set { display: flex; flex: 0 0 auto; gap: 10px; padding-inline-end: 10px; }

@keyframes thumbs-marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes thumbs-marquee-rtl {
  from { transform: translateX(0); }
  to   { transform: translateX(50%); }
}
html[dir="rtl"] .thumbs-track {
  -webkit-animation-name: thumbs-marquee-rtl;
  animation-name: thumbs-marquee-rtl;
}

/* Stop it under the pointer so a thumbnail can actually be clicked. */
.thumbs:hover .thumbs-track,
.thumbs:focus-within .thumbs-track { animation-play-state: paused; }

.thumb {
  flex: 0 0 84px;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 15px;
  overflow: hidden;
  background: #d8d1c2;
  cursor: pointer;
  scroll-snap-align: start;
  box-shadow: 0 0 0 1px rgba(21, 26, 33, .1);
  transition: box-shadow .18s ease, transform .18s ease;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb:hover { transform: translateY(-1px); }
.thumb[aria-current="true"] {
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px var(--accent);
}
.thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* ── cards ────────────────────────────────────────────────── */

.card {
  margin-top: 14px;
  padding: 20px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(21, 26, 33, .05), 0 10px 26px -18px rgba(21, 26, 33, .5);
}

.eyebrow {
  margin: 0 0 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .115em;
  text-transform: uppercase;
  color: var(--muted);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -.017em;
}

.card .sub { margin: 0; color: var(--muted); font-size: 15px; }

/* ── stats band ───────────────────────────────────────────── */

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 14px;
  padding: 18px 10px;
  border-radius: var(--r);
  background: var(--band);
  text-align: center;
}
.stats b {
  display: block;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.025em;
}
.stats span {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--muted);
}

/* ── why tiles ────────────────────────────────────────────── */

.tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.tile {
  padding: 13px 9px;
  border-radius: 15px;
  background: var(--tile);
  border: 1px solid rgba(21, 26, 33, .05);
  text-align: center;
}
.tile b { display: block; font-size: 13.5px; font-weight: 700; }
.tile span {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--muted);
}

/* ── CTA ──────────────────────────────────────────────────── */

.cta {
  position: relative;
  display: block;
  width: 100%;
  margin-top: 20px;
  padding: 17px 26px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(98deg, var(--g1) 0%, #26a0c4 48%, var(--g2) 100%);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.012em;
  cursor: pointer;
  box-shadow: 0 12px 26px -12px rgba(27, 111, 216, .7);
  transition: transform .14s ease, box-shadow .14s ease;
}
.cta:hover { box-shadow: 0 16px 30px -12px rgba(27, 111, 216, .8); }
.cta:active { transform: translateY(1px); }
.cta:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.cta .hand {
  position: absolute;
  inset-inline-end: -4px;
  bottom: -17px;
  width: 50px;
  height: 66px;
  transform: rotate(-20deg);
  filter: drop-shadow(0 4px 7px rgba(21, 26, 33, .28));
  pointer-events: none;
}

/* ── legal line ───────────────────────────────────────────── */

.legal {
  margin: 6px 0 0;
  padding: 0 6px;
  text-align: center;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--faint);
}
.legal a { color: var(--muted); text-underline-offset: 2px; }
.legal a:hover { color: var(--ink); }

/* ── heart charge ─────────────────────────────────────────── */

/* A near-full-screen heart fills, then the deck card grows out of its
   centre. One second, so it reads as an opening flourish rather than a
   loading screen. */
.heart-charge {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: rgba(243, 238, 227, .84);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity .22s ease;
}
.heart-charge.show { opacity: 1; }
.heart-charge.done { opacity: 0; transition-duration: .3s; }

.heart-charge svg {
  display: block;
  width: min(88vw, 70vh);
  height: auto;
  aspect-ratio: 1;
  transform: scale(.92);
  transition: transform .44s cubic-bezier(.2, .9, .3, 1.08);
  filter: drop-shadow(0 18px 44px rgba(255, 45, 85, .26));
}
.heart-charge.show svg { transform: scale(1); }

.hc-outline { fill: rgba(255, 45, 85, .16); }
.hc-fill { fill: url(#heartGrad); }

/* ── overlays (deck + sheet) ──────────────────────────────── */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  max-width: 440px;
  margin: 0 auto;
  padding: 14px var(--pad) max(22px, env(safe-area-inset-bottom));
  background: var(--cream);
  -webkit-animation: rise .22s ease both;
  animation: rise .22s ease both;
}
.overlay[hidden] { display: none; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* The deck's card animates itself out of the CTA button, so the panel behind
   it only fades — a slide would fight the scale. */
.deck { animation: fade .24s ease both; }
@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.overlay-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 2px 12px;
}
.overlay-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.015em;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 50%;
  background: rgba(21, 26, 33, .07);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s ease;
}
.icon-btn:hover { background: rgba(21, 26, 33, .13); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── deck ─────────────────────────────────────────────────── */

.deck-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Capped to a photo-card shape instead of stretched to the viewport. A
   full-height box cropped these near-square sources to ~40% of their width
   and forced a 2-3x upscale on high-DPI screens; 4:5 shows the whole frame
   and stays inside the source resolution. */
.pcard {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: 100%;
  border-radius: var(--r);
  overflow: hidden;
  background: #d8d1c2;
  box-shadow: 0 14px 34px -18px rgba(21, 26, 33, .6);
}
.pcard img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.pcard::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 18, 0) 42%, rgba(10, 14, 18, .72) 74%, rgba(10, 14, 18, .93) 100%);
}

.pcard-body {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  z-index: 2;
  padding: 20px;
  color: #fff;
}
/* The caption arrives in layers once the card has settled: name, then city,
   then bio, then the tags. */
.pcard-body.revealing > * {
  -webkit-animation: pcard-in .34s cubic-bezier(.2, .9, .3, 1.12) both;
  animation: pcard-in .34s cubic-bezier(.2, .9, .3, 1.12) both;
}
.pcard-body.revealing > *:nth-child(2) { animation-delay: .07s; }
.pcard-body.revealing > *:nth-child(3) { animation-delay: .14s; }
.pcard-body.revealing > *:nth-child(4) { animation-delay: .21s; }

@keyframes pcard-in {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.pcard-body h3 {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 3px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.02em;
}
.pcard-body .age { font-size: 18px; font-weight: 600; opacity: .82; }
.pcard-city { margin: 0 0 8px; font-size: 14px; color: rgba(255, 255, 255, .82); }
.pcard-bio { margin: 0 0 12px; font-size: 14px; line-height: 1.5; color: rgba(255, 255, 255, .9); }

.tags { display: flex; flex-wrap: wrap; gap: 7px; margin: 0; padding: 0; list-style: none; }
.tags li {
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .32);
  background: rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  font-size: 12px;
}

/* ── like button ──────────────────────────────────────────── */

/* Opens the WhatsApp-number window; the heart fills once a number is sent. */
.like-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  margin-top: 12px;
  padding: 13px 20px;
  border: 1.5px solid rgba(255, 45, 85, .34);
  border-radius: 999px;
  background: var(--card);
  color: #ff2d55;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.like-btn:hover { border-color: rgba(255, 45, 85, .62); }
.like-btn:focus-visible { outline: 2px solid #ff2d55; outline-offset: 3px; }
.like-btn.on { background: #ff2d55; border-color: #ff2d55; color: #fff; }

.like-heart { width: 20px; height: 20px; flex: 0 0 auto; }
.like-heart path { fill: none; stroke: currentColor; stroke-width: 2; transition: fill .2s ease; }
.like-btn.on .like-heart path { fill: currentColor; }

.like-btn.pop { animation: like-pop .44s cubic-bezier(.3, .8, .3, 1); }
.like-btn.pop .like-heart { animation: like-beat .44s ease; }
@keyframes like-pop {
  0%   { transform: scale(1); }
  38%  { transform: scale(1.07); }
  68%  { transform: scale(.975); }
  100% { transform: scale(1); }
}
@keyframes like-beat {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.5); }
  100% { transform: scale(1); }
}

.deck-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 18px 0 6px;
}
.nav-btn {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  box-shadow: 0 2px 8px -2px rgba(21, 26, 33, .22);
  transition: transform .15s ease, background .15s ease;
}
.nav-btn:hover { background: #fff; transform: translateY(-1px); }
.nav-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-btn[disabled] { opacity: .4; cursor: default; transform: none; }

.deck-count { min-width: 62px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--muted); }

/* ── sheet ────────────────────────────────────────────────── */

.sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 20px;
  border-radius: var(--r);
  background: var(--card);
  font-size: 14.5px;
  line-height: 1.65;
  color: #3d434c;
}
.sheet-body h3 {
  margin: 20px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.sheet-body h3:first-child { margin-top: 0; }
.sheet-body p { margin: 0 0 12px; }
.sheet-body strong { color: var(--ink); }

.sheet-ok { margin-top: 16px; }

/* ── WhatsApp number window ───────────────────────────────── */

.ws-card {
  padding: 18px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(21, 26, 33, .05), 0 10px 26px -18px rgba(21, 26, 33, .5);
}
.ws-lead {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 600;
}
.ws-input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(21, 26, 33, .14);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  letter-spacing: .01em;
}
.ws-input::placeholder { color: #b3aca0; }
.ws-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(47, 118, 232, .18); }
.ws-hint { margin: 9px 0 0; font-size: 12px; color: var(--muted); }
.ws-error { margin: 10px 0 0; font-size: 12.5px; font-weight: 600; color: #d7263d; }

.ws-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 13px;
  padding: 28px 18px;
  border-radius: var(--r);
  background: var(--card);
  text-align: center;
}
.ws-done p { margin: 0; font-size: 15px; line-height: 1.5; font-weight: 600; }
.ws-count {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(37, 211, 102, .14);
  color: #128c4a;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.ws-done[hidden], .ws-card[hidden] { display: none; }

.ws .cta { margin-top: auto; }

/* ── right-to-left ────────────────────────────────────────── */

html[dir="rtl"] .cta .hand { transform: rotate(20deg) scaleX(-1); }
html[dir="rtl"] .card h2 { letter-spacing: 0; }

/* ── coarse pointers get a touch more room ────────────────── */

@media (max-width: 360px) {
  .tile span { font-size: 11px; }
  .stats b { font-size: 21px; }
  .thumb { flex-basis: 74px; }
  .hero-lead { font-size: 17px; }
  .hero-sub { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    /* the marquee is infinite; without this it becomes a strobe, not a stop */
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }

  /* Fall back to the plain scrollable strip and drop the duplicate set. */
  .thumbs { overflow-x: auto; }
  .thumbs-track { animation: none !important; }
  .thumbs-set[data-dup] { display: none; }
}
