/* What's My LI Home Worth? — lead page.
   Look: approved Higgsfield mockup A (.impeccable/mocks/bay-a-modern-farmhouse.png) in the Ferrari world
   (.impeccable/mocks/ferrari/DESIGN.proposed.md). Black ground, white type, one red for the main action,
   Geist throughout, 56px controls, 16px+ text. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/geist-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("assets/fonts/geist-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --black: #0a0a0a;          /* page ground (mockup #090909) */
  --raised: #161616;          /* cards */
  --raised-2: #202020;        /* pressed fills, photo slots */
  --ink: #f7f7f7;             /* text and control edges: 18.9:1 */
  --ink-2: #c9c9c9;           /* secondary text: 11.9:1 */
  --ink-3: #9a9a9a;           /* fine print: 6.9:1 */
  --rule: rgba(247, 247, 247, 0.3);
  --red: #d60808;             /* the one main action (mockup #d60808); white on it 5.4:1 */
  --red-press: #a80606;
  --focus: #f6e500;           /* keyboard focus ring, 15:1 on black */
  --error: #ff7a6e;           /* 7.6:1 on black, always with an icon and words */
  --font: "Geist", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pad: 16px;
  --dock-h: calc(84px + env(safe-area-inset-bottom));
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--black); }
body {
  min-height: 100dvh;
  background: var(--black);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: var(--dock-h);
}
img, svg { display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--ink); color: var(--black); padding: 12px 16px; font-weight: 700; border-radius: 4px; }
.skip:focus { top: 8px; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- top bar ---------- */
.topbar {
  position: relative; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: max(12px, env(safe-area-inset-top)) var(--pad) 8px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.wordmark { font-weight: 800; font-size: clamp(15px, 4.7vw, 20px); letter-spacing: -0.01em; text-transform: uppercase; white-space: nowrap; }
.brand-rule { width: 1.5px; height: 1.35em; background: rgba(247, 247, 247, 0.7); }
.free { color: var(--red); font-weight: 800; font-style: italic; font-size: clamp(17px, 5.2vw, 22px); letter-spacing: -0.01em; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding-right: 8px; font-weight: 700; font-size: 1rem; }
.progress { margin-left: auto; color: var(--ink-2); font-size: 0.9375rem; white-space: nowrap; }
body:not([data-step="town"]) .brand { display: none; }

/* ---------- type ---------- */
.display { font-weight: 700; font-size: clamp(32px, 9.8vw, 42px); line-height: 1.04; letter-spacing: -0.025em; text-wrap: balance; }
.display-sm { font-weight: 700; font-size: clamp(28px, 8.2vw, 36px); line-height: 1.08; letter-spacing: -0.02em; text-wrap: balance; }
.h2 { font-weight: 700; font-size: 1.375rem; line-height: 1.25; letter-spacing: -0.01em; margin-top: 40px; }
.num { font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1; }
.lede { color: var(--ink-2); font-size: 1.0625rem; margin-top: 12px; }
.lede a, .town-line a { text-underline-offset: 4px; text-decoration-color: rgba(247, 247, 247, 0.5); }
h1:focus { outline: none; }

/* ---------- 1. town snapshot ---------- */
/* Phone: headline, then the house, then the town picker (mockup A's stack). */
.screen-town { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); }
.town-col { display: contents; }
.town-col .display { order: 1; position: relative; z-index: 2; padding: 6px 24px 0; }
.hero { order: 2; position: relative; height: clamp(240px, 72vw, 330px); margin-top: -20px; overflow: hidden; }
.hero picture, .hero img { width: 100%; height: 100%; }
.hero img { object-fit: cover; object-position: 50% 62%; animation: hero-in 1600ms var(--ease-out) both; }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, var(--black) 0%, rgba(10, 10, 10, 0.4) 16%, rgba(10, 10, 10, 0) 34%),
    linear-gradient(0deg, var(--black) 0%, rgba(10, 10, 10, 0.8) 14%, rgba(10, 10, 10, 0) 40%);
}
.town-body { order: 3; position: relative; z-index: 2; padding: 0 var(--pad); margin-top: -34px; }

.field-label { display: block; font-weight: 600; font-size: 1.125rem; margin-bottom: 8px; }
.select { position: relative; }
.select select {
  appearance: none; -webkit-appearance: none; width: 100%;
  height: 56px; padding: 0 52px 0 18px;
  background: var(--black); border: 2px solid var(--ink); border-radius: 4px;
  font-size: 1.1875rem; font-weight: 500; letter-spacing: -0.005em;
}
.select .i { position: absolute; right: 16px; top: 50%; translate: 0 -50%; pointer-events: none; width: 24px; height: 24px; stroke-width: 2.4; }
.select option, .select optgroup { background: #141414; color: var(--ink); }

.snapshot { margin-top: 18px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; }
.stat + .stat { border-left: 1.5px solid var(--rule); padding-left: 24px; }
.stat .num { font-size: clamp(38px, 11.5vw, 48px); }
.stat-label { color: var(--ink-2); font-size: 1rem; line-height: 1.3; margin-top: 6px; }
.latest { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 1rem; }
.screen-town .cta { margin-top: 18px; }
.screen-town .agent { margin-top: 16px; }
.snapshot-loading { margin-top: 18px; }
.num.skel { color: transparent; background: #1f1f1f; border-radius: 4px; width: max-content; animation: pulse 1.4s ease-in-out infinite; }
.loading-line { color: var(--ink-2); }
.teaser.is-pending { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.cta[aria-busy="true"] { opacity: 0.8; pointer-events: none; }
.no-range { margin-top: 12px; }
.no-range-title { font-weight: 700; font-size: 1.625rem; line-height: 1.2; letter-spacing: -0.01em; }
.snapshot-empty { margin-top: 22px; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.empty-title { color: var(--ink); font-weight: 700; font-size: 1.125rem; margin-bottom: 4px; }

.cta {
  display: flex; align-items: center; justify-content: center; text-align: center; text-decoration: none;
  width: 100%; min-height: 56px; padding: 10px 20px; margin-top: 22px;
  background: var(--red); color: #fff; border-radius: 4px;
  font-weight: 800; font-size: clamp(18px, 5.4vw, 22px); letter-spacing: 0.005em; text-transform: uppercase; line-height: 1.1;
  transition: background-color 150ms ease, transform 120ms var(--ease-out);
  touch-action: manipulation;
}
.cta:active { background: var(--red-press); transform: scale(0.985); }
@media (hover: hover) { .cta:hover { background: var(--red-press); } }

.agent { display: flex; align-items: center; gap: 14px; margin-top: 22px; font-size: 1rem; white-space: nowrap; }
.agent::before, .agent::after { content: ""; flex: 1; min-width: 12px; height: 1px; background: var(--rule); }
.agent-id { display: flex; align-items: center; gap: 10px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 1.5px solid rgba(247, 247, 247, 0.55); flex: none; }
/* Short phones (iPhone SE and similar): keep the red button above the Call/Text bar on first load. */
@media (max-width: 1023px) and (max-height: 760px) {
  .town-col .display { font-size: clamp(28px, 8.4vw, 34px); }
  .hero { height: clamp(170px, 27vh, 210px); }
  .stat .num { font-size: clamp(34px, 10vw, 40px); }
  .snapshot { margin-top: 14px; }
  .latest { margin-top: 10px; padding-top: 10px; }
  .screen-town .cta { margin-top: 14px; }
}
@media (max-width: 440px) {
  .agent { justify-content: center; white-space: normal; }
  .agent::before, .agent::after { display: none; }
  .agent-id { text-align: left; line-height: 1.3; }
}

.agent-card { display: flex; align-items: center; gap: 16px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--rule); }
.avatar-lg { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; border: 2px solid rgba(247, 247, 247, 0.6); }
.agent-name { font-weight: 700; font-size: 1.1875rem; line-height: 1.25; }
.agent-org { color: var(--ink-2); margin-top: 2px; }
.step .agent-card + .cta { margin-top: 18px; }

/* ---------- dock (Call / Text Robin) ---------- */
.dock {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  padding: 14px var(--pad) calc(14px + env(safe-area-inset-bottom));
  background: linear-gradient(0deg, var(--black) 72%, rgba(10, 10, 10, 0));
}
.dock-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px;
  border: 2px solid var(--ink); border-radius: 4px; text-decoration: none; background: var(--black);
  font-weight: 800; font-size: 1.0625rem; text-transform: uppercase; letter-spacing: 0.01em;
  transition: background-color 150ms ease, transform 120ms var(--ease-out); touch-action: manipulation;
}
.dock-btn:active { background: var(--raised-2); transform: scale(0.985); }
@media (hover: hover) { .dock-btn:hover { background: var(--raised-2); } }

/* ---------- steps 2–5 ---------- */
.step { width: 100%; max-width: 560px; margin-inline: auto; padding: 8px var(--pad) 32px; }
.form { margin-top: 28px; display: grid; gap: 22px; }
.form .cta { margin-top: 6px; }
/* Cloudflare's spam check. Invisible for most visitors; when Cloudflare needs a tap it appears above the button. */
.human-check { display: flex; justify-content: center; }
.human-check:not(.asking) { position: absolute; width: 0; height: 0; overflow: hidden; } /* out of the layout: takes no space */
.input {
  width: 100%; height: 56px; padding: 0 16px;
  background: var(--black); border: 2px solid var(--ink); border-radius: 4px;
  font-size: 1.1875rem; caret-color: var(--red);
}
.input[aria-invalid="true"] { border-color: var(--error); }
.err { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; color: var(--error); font-size: 1rem; }
.err .i { width: 20px; height: 20px; margin-top: 2px; }
.town-line { color: var(--ink-2); }

fieldset.choices { border: 0; padding: 0; min-width: 0; }
legend { font-weight: 700; font-size: 1.125rem; margin-bottom: 10px; padding: 0; }
.legend-note { font-weight: 400; color: var(--ink-3); font-size: 0.9375rem; margin-left: 4px; }
.cells { display: grid; gap: 8px; }
.cells.six { grid-template-columns: repeat(6, 1fr); }
.cells.three { grid-template-columns: repeat(3, 1fr); }
.cells.two { grid-template-columns: repeat(2, 1fr); }
.cell { position: relative; }
.cell input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cell span {
  display: flex; align-items: center; justify-content: center; text-align: center;
  min-height: 56px; padding: 6px 4px; border: 2px solid rgba(247, 247, 247, 0.55); border-radius: 4px;
  font-weight: 700; font-size: 1.0625rem; line-height: 1.15; font-variant-numeric: tabular-nums;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.cell input:checked + span { background: var(--ink); color: var(--black); border-color: var(--ink); }
.cell input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
@media (hover: hover) { .cell:hover span { border-color: var(--ink); } }

.teaser { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 24px; filter: blur(5px); opacity: 0.85; }
.tcard { background: var(--raised); border-radius: 4px; overflow: hidden; padding-bottom: 12px; }
.tcard i { display: block; aspect-ratio: 4 / 3; background: linear-gradient(160deg, #3a3a3a, #1d1d1d); }
.tcard b, .tcard s { display: block; height: 12px; margin: 10px 10px 0; border-radius: 2px; background: #4a4a4a; }
.tcard s { width: 60%; background: #333; }
.unlock { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-weight: 600; }
.unlock .i { width: 20px; height: 20px; }

.consent { display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; color: var(--ink-2); font-size: 0.9375rem; line-height: 1.45; cursor: pointer; }
.consent input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.consent .box { width: 28px; height: 28px; border: 2px solid var(--ink); border-radius: 4px; display: grid; place-items: center; }
.consent .box .i { width: 18px; height: 18px; stroke-width: 3; opacity: 0; color: var(--black); }
.consent input:checked + .box { background: var(--ink); }
.consent input:checked + .box .i { opacity: 1; }
.consent input:focus-visible + .box { outline: 3px solid var(--focus); outline-offset: 2px; }
.consent.intent { color: var(--ink-2); font-size: 1rem; align-items: center; }
.consent.intent b { color: var(--ink); font-weight: 700; }
.fine { color: var(--ink-3); font-size: 0.9375rem; text-align: center; }

.preview-pill { display: inline-block; margin-bottom: 18px; padding: 4px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--ink-3); font-size: 0.875rem; }
.result-for { color: var(--ink-2); font-size: 1.0625rem; }
.range { font-size: clamp(40px, 12.4vw, 56px); margin-top: 10px; white-space: nowrap; }
.likely { font-size: 1.125rem; margin-top: 12px; color: var(--ink-2); }
.likely b { color: var(--ink); font-size: 1.625rem; letter-spacing: -0.02em; margin-left: 4px; }
.disclaimer { color: var(--ink-3); font-size: 0.9375rem; margin-top: 12px; }
.step .cta[data-walkthrough] { margin-top: 24px; font-size: clamp(16px, 4.6vw, 21px); text-wrap: balance; }

.comps { list-style: none; padding: 0; margin-top: 16px; display: grid; gap: 16px; }
.comp { background: var(--raised); border-radius: 4px; overflow: hidden; }
.comp-photo { aspect-ratio: 16 / 9; display: grid; place-items: center; gap: 6px; align-content: center; background: linear-gradient(160deg, #262626, #151515); color: var(--ink-3); font-size: 0.9375rem; }
.comp-photo .i { width: 28px; height: 28px; stroke-width: 1.6; }
.comp-body { padding: 16px; }
.comp-price { font-size: 1.75rem; }
.comp-addr { font-size: 1.125rem; margin-top: 8px; }
.comp-meta { color: var(--ink-2); margin-top: 4px; }

/* ---------- footer ---------- */
.footer { max-width: 560px; margin: 24px auto 0; padding: 28px var(--pad) 32px; border-top: 1px solid var(--rule); color: var(--ink-3); font-size: 0.875rem; line-height: 1.55; display: grid; gap: 10px; }
.footer b { color: var(--ink-2); font-weight: 600; }
.footer .links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.footer a { color: var(--ink-2); text-underline-offset: 3px; }
.eho { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 600; }
.license { display: grid; gap: 2px; padding: 12px 0 12px 14px; border-left: 2px solid var(--rule); }
.license p:first-child { color: var(--ink-2); }
.eho svg { width: 30px; height: 30px; }

/* ---------- motion ---------- */
@keyframes hero-in { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rise { animation: rise 760ms var(--ease-out) both; animation-delay: calc(180ms + var(--i, 0) * 70ms); }
.screen.entering { animation: rise 360ms var(--ease-out) both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.swap { animation: fade 200ms ease-out both; }
.still *, .still *::before, .still *::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- wide screens ---------- */
@media (min-width: 1024px) {
  :root { --pad: 32px; --dock-h: 0px; }
  .topbar { min-height: 84px; padding-inline: max(48px, 5vw); }
  .wordmark { font-size: 20px; }
  .free { font-size: 22px; }
  .dock { position: fixed; inset: 18px max(48px, 5vw) auto auto; display: flex; padding: 0; background: none; gap: 12px; }
  .dock-btn { min-height: 48px; padding: 0 18px; font-size: 0.9375rem; }
  body:not([data-step="town"]) .dock { position: absolute; }

  body[data-step="town"] .topbar { position: absolute; inset: 0 0 auto 0; }
  .screen-town { min-height: 100vh; display: flex; align-items: center; }
  .town-col { display: block; }
  .town-col .display { order: initial; }
  .hero { position: absolute; inset: 0; height: auto; margin: 0; }
  .hero img { object-position: 70% 55%; }
  .hero::after {
    background:
      linear-gradient(90deg, var(--black) 0%, rgba(10, 10, 10, 0.9) 30%, rgba(10, 10, 10, 0.35) 52%, rgba(10, 10, 10, 0) 70%),
      linear-gradient(0deg, var(--black) 0%, rgba(10, 10, 10, 0) 22%),
      linear-gradient(180deg, rgba(10, 10, 10, 0.7) 0%, rgba(10, 10, 10, 0) 18%);
  }
  .town-col { margin: 0; padding: 120px 0 64px max(48px, 5vw); width: min(560px, 46vw); box-sizing: content-box; }
  .town-col .display { padding: 0; margin: 0; max-width: 12ch; font-size: clamp(48px, 4.6vw, 68px); }
  .town-body { padding: 0; margin-top: 36px; order: initial; }
  .step { padding-top: 24px; }
  .footer { max-width: none; padding-inline: max(48px, 5vw); }
}
