/* flatping - mobile-first, light, one thumb. The card is the product.
 * Deck card layout ported from flat-radar's site/index.html (full card
 * parity, 2026-10-08): absolute cards in the stage, tap-through photo
 * set with the map as the last frame, back card behind the top one.
 *
 * Landing direction (2026-10-09, "the listing sheet"): the visual
 * language of a London letting notice - paper white, serif display,
 * mono for listing data, hairline rules instead of card grids, one
 * deep green. The purple SaaS kit, gradient washes and shadowed tile
 * grids are gone on purpose; the signed-in deck keeps its own language
 * (physical cards, soft shadows) because there the card metaphor is
 * literal. */

:root {
  --bg: #fdfdfb;
  --card: #ffffff;
  --text: #1b1e18;
  --muted: #5a5f52;
  --like: #07774f;   /* 5.7:1 on white - AA for text, not just big glyphs */
  --nope: #d13539;   /* 4.9:1 on white */
  --accent: #0a5c3c; /* deep green - parks, fresh listings, the ping */
  --accent-ink: #0a5c3c;
  --line: #e4e5df;
  --chip: #f0f1ea;
  --shadow: 0 12px 32px rgba(23, 19, 48, 0.10);
  --shadow-sm: 0 2px 8px rgba(23, 19, 48, 0.06);
  --serif: "Palatino Linotype", Palatino, "Iowan Old Style", "Book Antiqua", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font: 16px/1.45 -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
  touch-action: manipulation;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .btn, .mock-card, .blip, .card.back { transition: none; animation: none; }
}

.view { height: 100dvh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.muted { color: var(--muted); font-size: 0.85rem; }
.error { color: var(--nope); font-size: 0.9rem; margin-top: 0.6rem; }
.spacer { flex: 1; }

.bar {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.7rem 1rem; padding-top: calc(0.7rem + env(safe-area-inset-top));
}
.link {
  background: none; border: none; color: var(--muted);
  font-size: 0.95rem; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; min-width: 44px;
  padding: 0.2rem 0.55rem;
}
.link:active { color: var(--text); }

/* buttons shared by landing + app */
.btn {
  border: none; cursor: pointer; font-size: 1rem; font-weight: 600;
  border-radius: 10px; padding: 0.75rem 1.5rem; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform 160ms var(--ease-out);
  touch-action: manipulation;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line);
}

/* ---- landing ---- */
.lnav {
  display: flex; align-items: center;
  max-width: 66rem; width: 100%; margin: 0 auto;
  padding: 1.1rem 1.4rem; padding-top: calc(1.1rem + env(safe-area-inset-top));
}
.logo {
  font-family: var(--serif); font-size: 1.35rem; font-weight: 700;
  letter-spacing: -0.01em; display: inline-flex; align-items: baseline;
}
.logo-dot {
  width: 0.42em; height: 0.42em; border-radius: 50%;
  background: var(--accent); margin-left: 0.14em;
}
.lnav .btn { font-size: 0.9rem; padding: 0.7rem 1.3rem; }
.landing-scroll { flex: 1; overflow-y: auto; }

.hero {
  max-width: 66rem; margin: 0 auto; padding: 3rem 1.4rem 3.5rem;
  display: grid; gap: 2.5rem; align-items: center;
  grid-template-columns: 1.1fr 0.9fr;
}
.hero-copy h1 {
  font-family: var(--serif);
  font-size: clamp(2.5rem, 6vw, 3.9rem); font-weight: 700;
  letter-spacing: -0.01em; line-height: 1.06;
}
.hero-sub {
  max-width: 30rem; margin: 1.2rem 0 1.8rem;
  color: var(--muted); font-size: 1.12rem; line-height: 1.6;
}
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; }

/* a CSS-only card mock: no stock photos, just the product's shape,
 * with the radar it sits on. The one bold moment on the page. */
.hero-art {
  position: relative; display: flex; justify-content: center;
  overflow: hidden; padding: 1.4rem 0.6rem;
}
.radar {
  position: absolute; inset: 0;
  background:
    repeating-radial-gradient(circle at 50% 50%,
      rgba(10, 92, 60, 0.16) 0 1px, transparent 1px 52px);
  pointer-events: none;
}
.mock-card {
  position: relative; width: min(300px, 78vw);
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden; text-align: left;
  box-shadow: var(--shadow); transform: rotate(-1.5deg);
}
.mock-photo {
  height: 150px; position: relative;
  background: #e9f0ea;
}
.mock-fresh {
  position: absolute; top: 10px; left: 10px;
  background: var(--accent); color: #fff;
  font: 700 11px/1 var(--mono); letter-spacing: 0.08em;
  padding: 4px 8px; border-radius: 4px;
}
.blip {
  position: absolute; top: 38%; left: 58%;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
}
.blip::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: ping 1.4s var(--ease-out) 0.4s 1 forwards; opacity: 0;
}
@keyframes ping {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(4.2); opacity: 0; }
}
.blip.still { top: 64%; left: 26%; width: 6px; height: 6px; opacity: 0.55; }
.blip.still::after { animation: none; }
.mock-info { padding: 0.9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.mock-price {
  font: 700 1rem/1.2 var(--mono); color: var(--accent);
}
.mock-title { font-weight: 650; }
.mock-meta { font: 400 11.5px/1.5 var(--mono); color: var(--muted); }

/* sections: a reading column divided by hairline rules, not cards */
.landing-scroll section {
  max-width: 46rem; margin: 0 auto; padding: 2.6rem 1.4rem;
  border-top: 1px solid var(--line);
}
.landing-scroll h2 {
  font-family: var(--serif); font-size: 1.7rem; font-weight: 700;
  letter-spacing: -0.01em; margin-bottom: 1.6rem;
}
.steps { list-style: none; }
.steps li {
  position: relative; padding: 0 0 1.6rem 2.6rem;
  border-left: 1px solid var(--line); margin-left: 0.8rem;
}
.steps li:last-child { padding-bottom: 0.2rem; }
.steps li::before {
  content: attr(data-n); position: absolute; left: -0.85rem; top: 0;
  width: 1.7rem; height: 1.7rem; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font: 700 0.85rem/1 var(--mono); color: var(--accent);
}
.steps h3, .feature h3, .faq-item h3 {
  font-size: 1.05rem; font-weight: 700; margin-bottom: 0.35rem;
}
.steps p, .feature p, .faq-item p {
  color: var(--muted); font-size: 0.94rem; line-height: 1.6; max-width: 38rem;
}
.feature-list {
  display: grid; gap: 0 2.5rem; grid-template-columns: 1fr 1fr;
}
.feature { padding: 1rem 0; border-top: 1px solid var(--line); }
.feature:first-child, .feature:nth-child(2) { border-top: none; }
.faq-item { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.faq-item:first-child { border-top: none; padding-top: 0; }

.cta-band { text-align: left; }
.cta-band h2 { margin-bottom: 0.4rem; }
.cta-band p { color: var(--muted); margin: 0 0 1.5rem; }

.lfooter {
  display: flex; gap: 0.5rem; justify-content: center; align-items: center;
  color: var(--muted); font-size: 0.85rem;
  padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}
.lfooter span:first-child { font-family: var(--serif); font-weight: 700; color: var(--text); }
.dot { opacity: 0.5; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 2.2rem; }
  .hero-art { margin-top: 0.5rem; }
  .feature-list { grid-template-columns: 1fr; }
  .feature:first-child, .feature:nth-child(2) { border-top: 1px solid var(--line); }
  .feature:first-child { border-top: none; }
}

/* ---- login ---- */
#login { justify-content: center; align-items: center; }
.login-box {
  width: min(24rem, 88vw); background: var(--card);
  border-radius: 1.4rem; padding: 2rem 1.8rem 1.8rem;
  box-shadow: var(--shadow-sm);
}
.login-box .link { margin-bottom: 0.8rem; padding: 0; }
.login-box h1 { font-size: 1.8rem; letter-spacing: -0.02em; font-weight: 800; }
.tag { margin: 0.4rem 0 1.6rem; color: var(--muted); }
#loginForm { display: flex; flex-direction: column; gap: 0.7rem; }
#loginForm input, .form-box input:not([type="checkbox"]) {
  background: #fff; border: 1px solid #d9d8e4; color: var(--text);
  border-radius: 0.9rem; padding: 0.8rem 0.9rem; font-size: 1rem; width: 100%;
}
#loginForm input:focus, .form-box input:not([type="checkbox"]):focus {
  outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent;
}
#loginForm button {
  background: var(--accent); border: none; color: #fff; font-size: 1rem; font-weight: 650;
  border-radius: 10px; padding: 0.8rem; cursor: pointer; margin-top: 0.4rem;
}
button:active { filter: brightness(0.95); }

/* ---- deck ---- */
.stage {
  flex: 1; min-height: 0; position: relative;
  width: 100%; max-width: 520px; margin: 0 auto; padding: 0 10px;
}
.card {
  position: absolute; inset: 10px 0 12px;
  background: var(--card); border-radius: 1.3rem;
  box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  touch-action: none; user-select: none; -webkit-user-select: none;
  z-index: 1; will-change: transform;
}
.card, .card * { touch-action: none; }
.card.back {
  transform: scale(0.94) translateY(10px); opacity: 0.45;
  pointer-events: none; transition: transform .2s, opacity .2s; z-index: 0;
}
.photo {
  position: relative; flex: 0 0 58%; flex-shrink: 0;
  background: #e9eaf0; overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  gap: 6px; align-items: center; justify-content: center;
  color: #4d4963; font-size: 13px;
}
.tapzone {
  position: absolute; top: 0; bottom: 0; width: 38%; z-index: 3;
  display: flex; align-items: center; padding: 10px;
  color: rgba(255,255,255,0.9); font-size: 26px;
  opacity: 0; transition: opacity .15s;
}
.tapzone.left { left: 0; justify-content: flex-start; }
.tapzone.right { right: 0; justify-content: flex-end; }
.photo .tapzone:active { opacity: 1; }
.counter {
  position: absolute; top: 10px; right: 10px; z-index: 4;
  background: rgba(15,13,25,0.6); padding: 3px 9px;
  border-radius: 999px; font-size: 12px; color: #fff;
}
.loading {
  position: absolute; inset: 0; z-index: 2; display: none;
  align-items: center; justify-content: center; background: rgba(247,247,250,0.55);
}
.loading.on { display: flex; }
.loading .ring {
  width: 26px; height: 26px; border: 3px solid #d9d8e4;
  border-top-color: var(--accent); border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.pagebadge {
  position: absolute; bottom: 10px; left: 10px; z-index: 5;
  background: rgba(15,13,25,0.6); color: #fff; border-radius: 8px;
  padding: 5px 10px; font-size: 11px; letter-spacing: 0.04em; display: none;
}
.hint {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  z-index: 5; background: rgba(15,13,25,0.6); color: #fff; border-radius: 999px;
  padding: 5px 12px; font-size: 11px; letter-spacing: 0.03em; display: none;
}
.stamp {
  position: absolute; top: 24px; z-index: 4; padding: 5px 12px;
  border: 3px solid; border-radius: 10px; font-weight: 800;
  font-size: 20px; letter-spacing: 0.06em;
  opacity: 0; transform: scale(0.7); pointer-events: none;
}
.stamp.love { left: 22px; color: var(--like); border-color: var(--like); transform: rotate(-12deg); }
.stamp.no { right: 22px; color: var(--nope); border-color: var(--nope); transform: rotate(12deg); }

.info { flex: 1; padding: 14px 16px 12px; overflow: hidden; }
.info h2 { font-size: 18px; font-weight: 650; line-height: 1.25; }
.meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 6px;
  color: var(--muted); font-size: 13px;
}
.price { color: var(--like); font-weight: 700; font-size: 17px; }
.score { font-weight: 700; color: var(--accent); }
.score.strong { color: var(--like); }
.fresh { color: var(--like); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chips span {
  background: var(--chip); color: #3d3a52; font-size: 11.5px;
  padding: 3px 9px; border-radius: 999px; letter-spacing: 0.02em;
}
.chips span.outdoor {
  background: #e5f6ee; color: #07774f; font-weight: 650;
}
.chips span.feat {
  background: #e7f2ec; color: #0a5c3c;
}

/* ---- setup wizard + chip pickers ---- */
.setup-box {
  flex: 1; overflow-y: auto; width: min(24rem, 92vw); margin: 0 auto;
  padding: 1rem 0 2rem;
}
.setup-step h2 { font-size: 1.35rem; margin-top: 0.6rem; letter-spacing: -0.02em; }
.setup-step h2.q2 { margin-top: 2rem; }
.setup-step .muted { margin: 0.4rem 0 1rem; }
.setup-step input[type="number"] {
  background: #fff; border: 1px solid #d9d8e4; color: var(--text);
  border-radius: 0.9rem; padding: 0.8rem 0.9rem; font-size: 1.2rem;
  width: 100%; max-width: 12rem;
}
.tier-label { margin: 1.1rem 0 0.4rem; text-transform: uppercase; letter-spacing: 0.05em; }
.chips-pick {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.6rem 0 0.4rem;
}
.chips-pick button {
  background: #fff; border: 1px solid #d9d8e4; color: #3d3a52;
  border-radius: 999px; padding: 0.45rem 0.95rem; font-size: 0.9rem;
  cursor: pointer; touch-action: manipulation;
  display: inline-flex; align-items: center; min-height: 40px;
}
.chips-pick button.on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.btns { display: flex; gap: 8px; margin-top: 10px; }
.open {
  display: inline-block; color: var(--accent); text-decoration: none;
  font-size: 13.5px; border: 1px solid var(--line);
  padding: 12px 16px; border-radius: 8px; touch-action: manipulation;
}
.more {
  background: #fff; border: 1px solid var(--line); color: var(--accent);
  font: inherit; font-size: 13.5px; padding: 12px 16px;
  border-radius: 8px; cursor: pointer; touch-action: manipulation;
}
.more:active { background: var(--chip); }

.done {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  gap: 8px; align-items: center; justify-content: center;
  color: var(--muted); text-align: center; padding: 0 20px;
}

.actions {
  display: flex; justify-content: center; gap: 1.2rem;
  padding: 1rem 0 calc(1.2rem + env(safe-area-inset-bottom));
}
.act {
  width: 4.2rem; height: 4.2rem; border-radius: 50%;
  border: none; font-size: 1.5rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #fff; box-shadow: var(--shadow-sm);
  touch-action: manipulation;
}
.act.no { color: var(--nope); }
.act.love { color: var(--like); font-size: 1.8rem; }
.act.skip { color: var(--muted); font-size: 1.3rem; }
.queued { text-align: center; color: #b07c1e; font-size: 0.8rem; padding-bottom: 0.4rem; }

/* ---- card detail overlay (deck parity) ---- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(21,19,31,0.45);
  display: none; align-items: center; justify-content: center;
}
.overlay.on { display: flex; }
.panel {
  position: relative; width: 88%; max-width: 360px;
  background: #fff; border: 1px solid var(--line);
  border-radius: 1.2rem; padding: 16px;
  box-shadow: var(--shadow);
}
.panel h3 { font-size: 16px; font-weight: 650; margin-bottom: 8px; padding-right: 44px; }
.panel .pmeta {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  color: var(--muted); font-size: 13px; margin-bottom: 8px;
}
.panel .ptext {
  font-size: 13.5px; color: var(--muted); line-height: 1.5;
  max-height: 44vh; overflow: auto;
}
.panel .popen { margin-top: 12px; display: inline-block; }
.panel .pclose {
  position: absolute; top: 10px; right: 10px; border: none;
  background: var(--chip); color: var(--text); border-radius: 50%;
  width: 40px; height: 40px; font-size: 15px;
  cursor: pointer; touch-action: manipulation;
}

/* ---- criteria ---- */
.form-box { width: min(24rem, 88vw); margin: 0 auto; overflow-y: auto; padding-bottom: 2rem; }
.form-box h2 { margin-bottom: 0.3rem; letter-spacing: -0.02em; }
.form-box label { display: block; margin-top: 1rem; color: #3d3a52; font-size: 0.9rem; }
.form-box .row { display: flex; gap: 0.6rem; align-items: center; margin-top: 0.3rem; }
.form-box .row input { width: 5rem; }
.form-box .check { display: flex; gap: 0.5rem; align-items: center; }
.form-box .check input { width: auto; }
.form-box button {
  background: var(--accent); border: none; color: #fff; font-weight: 650;
  border-radius: 10px; padding: 0.8rem 1.6rem; cursor: pointer; margin-top: 1.2rem;
}

/* ---- loved ---- */
.loved-list { overflow-y: auto; padding: 0 1rem 2rem; display: flex; flex-direction: column; gap: 0.8rem; }
.loved-card {
  background: var(--card); border-radius: 0.9rem; padding: 0.8rem 1rem;
  display: flex; gap: 0.9rem; align-items: center;
  box-shadow: var(--shadow-sm);
}
.loved-card img { width: 4.5rem; height: 3.4rem; object-fit: cover; border-radius: 0.5rem; background: var(--chip); }
.loved-card a {
  color: var(--text); text-decoration: none; font-weight: 600;
  display: flex; align-items: center; min-height: 44px;
  padding: 0.35rem 0;
}
.loved-card .price { font-size: 1rem; }

@media (max-height: 700px) {
  .photo { flex: 0 0 50%; }
  .info h2 { font-size: 16px; }
  .meta { font-size: 12px; }
}
@media (hover: hover) {
  .tapzone:hover { opacity: 1; }
  .more:hover { background: var(--chip); }
  .btn.primary:hover { background: #0d7049; }
  .btn.ghost:hover { border-color: #c9c7d8; }
}
