/* Homepage. Layout: search bar and live listings up top, a guided three-step walkthrough with a sticky
   app preview, then the comparison, FAQ and closing card. Tokens, nav and buttons come from brand.css. */
html { scroll-behavior: smooth; scroll-padding-top: 100px; }
body.home { font-size: 17px; line-height: 1.6; }
body.home::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.home p { margin: 0; }
.kicker { font-family: var(--f-display); font-weight: 700; font-size: 14px; letter-spacing: 0.02em; color: var(--accent); }

/* ---------- House illustrations (used by <use>, so fills come from classes, not inline styles) ---------- */
.f-sky { fill: var(--sky); } .f-sun { fill: var(--sun); } .f-ground { fill: var(--ground); } .f-trim { fill: var(--trim); }
.f-wall { fill: var(--wall); } .f-win { fill: var(--win); } .f-tree { fill: var(--tree); }
.sky-a { --sky: var(--sky-a); } .sky-b { --sky: var(--sky-b); } .sky-c { --sky: var(--sky-c); }
.wall-brick { --wall: var(--wall-brick); } .wall-stone { --wall: var(--wall-stone); } .wall-slate { --wall: var(--wall-slate); }
.wall-blue { --wall: var(--wall-blue); } .wall-cream { --wall: var(--wall-cream); } .wall-sage { --wall: var(--wall-sage); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding-block: clamp(120px, 13vw, 156px) clamp(64px, 8vw, 104px); }
.hero > .wrap { position: relative; z-index: 1; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(70% 55% at 78% 0%, var(--accent-soft), transparent 70%), radial-gradient(60% 45% at 8% 10%, var(--surface-2), transparent 70%); }
.hero-bg { position: absolute; left: 0; right: 0; top: 0; height: clamp(460px, 58vw, 720px); color: var(--ink); pointer-events: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 62%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 30%, #000 62%, transparent 100%); }
.hero-bg svg { display: block; width: 100%; height: 100%; animation: drift 1.4s cubic-bezier(.2, .8, .2, 1) both; }
/* Solid tones mixed from the page colors (not opacity), so front shapes cover back ones cleanly. */
.hero-bg .far { fill: color-mix(in srgb, var(--ink) 5%, var(--bg)); }
.hero-bg .near { fill: color-mix(in srgb, var(--ink) 10%, var(--bg)); }
.hero-bg .win { fill: color-mix(in srgb, var(--ink) 4%, var(--bg)); }
@keyframes drift { from { transform: translateY(24px); } to { transform: none; } }
.hero-text { max-width: 800px; }
.hero h1 { font-weight: 800; font-size: clamp(2.6rem, 5.8vw, 4.7rem); line-height: 1.02; letter-spacing: -0.04em; }
.hero h1 .hl { color: var(--accent); }
.lede { margin-top: 20px !important; font-size: clamp(1.05rem, 1.5vw, 1.2rem); color: var(--muted); max-width: 38rem; }
.hero-in { animation: heroIn .7s cubic-bezier(.2, .8, .2, 1) both; }
.hero-in.d1 { animation-delay: .08s; } .hero-in.d2 { animation-delay: .16s; } .hero-in.d3 { animation-delay: .24s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Search bar */
.search { margin-top: 36px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; align-items: stretch; background: var(--surface);
  border: 1px solid var(--line); border-radius: 20px; padding: 8px; box-shadow: var(--shadow-lg); }
.field { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 8px 18px; border-radius: 14px; transition: background .2s; min-width: 0; }
.field + .field::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 1px; background: var(--line); }
.field:hover, .field:focus-within { background: var(--surface-2); }
.field:hover::before, .field:focus-within::before, .field:hover + .field::before, .field:focus-within + .field::before { opacity: 0; }
.field label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.field select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; padding: 4px 26px 4px 0; font-family: var(--f-display);
  font-weight: 600; font-size: 17px; cursor: pointer; width: 100%; min-height: 36px; outline: none; }
.field select option { color: #0E151C; background: #FFFFFF; }
.field .chev { position: absolute; right: 16px; bottom: 18px; width: 12px; height: 12px; color: var(--muted); pointer-events: none; }
.search .btn { margin: 4px; min-height: 56px; padding: 0 26px; border-radius: 14px; }
@media (max-width: 820px) {
  .search { grid-template-columns: minmax(0, 1fr); }
  .field + .field::before { left: 18px; right: 18px; top: 0; bottom: auto; width: auto; height: 1px; }
  .search .btn { margin: 6px; }
}

/* Live results */
.pv { margin-top: clamp(40px, 5vw, 56px); }
.pv-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 20px; margin-bottom: 16px; }
.pv-note { font-size: 15px; color: var(--muted); }
.pv-note b { color: var(--ink); font-weight: 600; }
.pv-tag { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.pv-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.pv-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: box-shadow .25s, transform .25s; text-decoration: none; color: inherit; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ph { position: relative; aspect-ratio: 16 / 10; max-width: 100%; background: var(--surface-2); }
.ph svg { display: block; width: 100%; height: 100%; }
.pill { position: absolute; left: 12px; top: 12px; display: inline-flex; align-items: center; gap: 7px; background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 6px 12px 6px 9px; font-size: 13.5px; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.4); }
.pill svg { width: 15px; height: 15px; color: var(--accent); flex: none; }
.pill b { font-weight: 800; font-variant-numeric: tabular-nums; }
.cb { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.ct { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ct h3 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.ct .area { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.price { font-size: 14px; color: var(--muted); }
.price b { font-family: var(--f-display); font-size: 1.5rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; margin-right: 4px; }
.meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: auto;
  font-size: 13.5px; color: var(--muted); }
.meta .src { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ok { display: inline-flex; align-items: center; gap: 6px; color: var(--good); font-weight: 600; white-space: nowrap; }
.ok svg { width: 15px; height: 15px; }
.ok.check { color: var(--warn); }
.card.empty { border-style: dashed; box-shadow: none; align-items: center; justify-content: center; text-align: center; padding: 28px; color: var(--muted);
  font-size: 15px; min-height: 200px; }
.card.empty:hover { transform: none; }
.card.skeleton { min-height: 280px; background: linear-gradient(90deg, var(--surface), var(--surface-2), var(--surface)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pv-cap { margin-top: 14px !important; font-size: 13px; color: var(--muted); }
@media (max-width: 980px) {
  .pv-grid { grid-template-columns: minmax(0, 1fr); }
  .card { flex-direction: row; }
  .card.skeleton { min-height: 120px; }
  .ph { flex: none; width: clamp(120px, 32%, 220px); aspect-ratio: auto; }
  .pill .to { display: none; }
  .pill { left: 8px; top: 8px; padding: 5px 9px 5px 7px; font-size: 12.5px; }
  .ct { flex-direction: column; gap: 0; }
  .cb { padding: 12px 14px; gap: 6px; }
  .meta { flex-wrap: wrap; gap: 4px 10px; padding-top: 8px; }
  .price b { font-size: 1.25rem; }
}

/* ---------- Section frame ---------- */
section { scroll-margin-top: 96px; }
.sec { padding-block: clamp(80px, 10vw, 128px); }
.sec-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); display: flex; flex-direction: column; gap: 14px; }
.sec-head h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.sec-head p { color: var(--muted); font-size: 1.08rem; max-width: 36rem; }
.band { background: var(--surface); border-block: 1px solid var(--line); }

/* ---------- How it works ---------- */
.how { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); gap: clamp(32px, 6vw, 88px); }
.steps { display: flex; flex-direction: column; }
.step { min-height: 64vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-block: 24px; transition: opacity .45s ease; }
.step:first-child { min-height: 48vh; justify-content: flex-start; padding-top: 8px; }
.how.js .step:not(.is-active) { opacity: 0.32; }
.step-n { display: inline-flex; align-items: center; gap: 10px; font-family: var(--f-display); font-weight: 700; font-size: 14px; color: var(--muted); }
.step-n span { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-2);
  color: var(--ink); font-size: 14px; transition: background .3s, color .3s; }
.step.is-active .step-n span { background: var(--crimson); color: var(--on-crimson); }
.step h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.1; font-weight: 800; letter-spacing: -0.03em; }
.step p { color: var(--muted); max-width: 30rem; font-size: 1.05rem; }
.slot { display: none; }
.stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 112px); align-self: start; }
.device { background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); padding: 20px; overflow: hidden; }
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 18px; }
.progress i { height: 4px; border-radius: 4px; background: var(--surface-2); overflow: hidden; position: relative; }
.progress i::after { content: ""; position: absolute; inset: 0; background: var(--crimson); transform: scaleX(0); transform-origin: left; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.progress i.on::after { transform: none; }
.screens { position: relative; height: 440px; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; opacity: 0; visibility: hidden; transform: translateY(18px) scale(0.985);
  transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .5s; }
.screen.active { opacity: 1; visibility: visible; transform: none; transition: opacity .5s ease, transform .5s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
.screen.active .stg { animation: stgIn .55s cubic-bezier(.2, .8, .2, 1) both; }
.screen.active .i0 { animation-delay: 140ms; } .screen.active .i1 { animation-delay: 220ms; } .screen.active .i2 { animation-delay: 300ms; }
.screen.active .i3 { animation-delay: 380ms; } .screen.active .i4 { animation-delay: 460ms; } .screen.active .i5 { animation-delay: 540ms; }
@keyframes stgIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.demo-results { display: flex; flex-direction: column; gap: 14px; }
.scr-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.scr-head b { font-family: var(--f-display); font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; }
.scr-head span { font-size: 13px; color: var(--muted); }
.place { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.place.picked { border-color: var(--accent); background: var(--accent-soft); }
.place .ic { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.place.picked .ic { background: var(--surface); }
.place .ic svg { width: 18px; height: 18px; }
.place .tx { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.place .tx b { font-weight: 700; font-size: 15.5px; }
.place .tx span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.place .tick { color: var(--accent); display: flex; }
.budget-big { font-family: var(--f-display); font-weight: 800; font-size: 3rem; letter-spacing: -0.04em; line-height: 1; }
.budget-big small { font-family: var(--f-body); font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 8px; }
.slider { position: relative; height: 6px; border-radius: 6px; background: var(--surface-2); margin: 10px 0 4px; }
.slider .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: 6px; background: var(--crimson); }
.slider .thumb { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: var(--surface);
  border: 3px solid var(--crimson); box-shadow: var(--shadow-sm); }
.screen.active .slider .fill { animation: fillIn 1s cubic-bezier(.2, .8, .2, 1) .25s both; }
.screen.active .slider .thumb { animation: thumbIn 1s cubic-bezier(.2, .8, .2, 1) .25s both; }
@keyframes fillIn { from { width: 8%; } to { width: 50%; } }
@keyframes thumbIn { from { left: 8%; } to { left: 50%; } }
.scale { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.breakdown { border: 1px solid var(--line); border-radius: 16px; padding: 6px 16px; }
.breakdown div { display: flex; justify-content: space-between; gap: 12px; padding-block: 10px; font-size: 15px; border-top: 1px solid var(--line); }
.breakdown div:first-child { border-top: 0; }
.breakdown span:first-child { color: var(--muted); }
.breakdown .total span { color: var(--ink); font-weight: 700; }
.under { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; background: var(--good-soft); color: var(--good); font-weight: 600; font-size: 14px;
  padding: 7px 12px; border-radius: 999px; }
.res { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 16px; }
.res svg.thumb { width: 76px; height: 56px; border-radius: 10px; display: block; }
.res .tx { display: flex; flex-direction: column; min-width: 0; }
.res .tx b { font-weight: 700; font-size: 15px; }
.res .tx span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.res .wk { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.res .wk b { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; line-height: 1; font-variant-numeric: tabular-nums; }
.res .wk span { font-size: 12px; color: var(--muted); }
.res.first { border-color: var(--accent); background: var(--accent-soft); }
.fake-btn { margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; border-radius: 14px; background: var(--crimson);
  color: var(--on-crimson); font-family: var(--f-display); font-weight: 700; }
@media (max-width: 900px) {
  .how { grid-template-columns: minmax(0, 1fr); }
  .stage { display: none; }
  .step, .step:first-child { min-height: 0; padding-block: 0 48px; justify-content: flex-start; }
  .how.js .step:not(.is-active) { opacity: 1; }
  .step .step-n span { background: var(--crimson); color: var(--on-crimson); }
  .slot { display: block; margin-top: 10px; }
  .slot .device { padding: 16px; }
  .slot .screen { position: relative; inset: auto; opacity: 1; visibility: visible; transform: none; }
  .slot .screens { height: auto; }
}

/* ---------- Compare ---------- */
.cmp-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; }
table.cmp { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cmp col.q { width: 28%; }
.cmp th, .cmp td { padding: 20px 24px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); font-size: 16px; line-height: 1.35; }
.cmp thead th { border-top: 0; font-family: var(--f-display); font-weight: 700; font-size: 14px; color: var(--muted); padding-block: 18px; }
.cmp thead th.ours { background: var(--crimson); color: var(--on-crimson); }
.cmp tbody th { font-weight: 700; color: var(--ink); }
.cmp td { color: var(--muted); }
.cmp td.ours { background: var(--accent-soft); color: var(--ink); font-weight: 700; }
.cmp tbody tr td, .cmp tbody tr th { transition: background .2s; }
.cmp tbody tr:hover td:not(.ours), .cmp tbody tr:hover th { background: var(--surface-2); }
.val { display: flex; align-items: center; gap: 12px; min-width: 0; }
.val svg { flex: none; width: 18px; height: 18px; }
.mk-part, .mk-none { color: var(--muted); }
.mk-yes { color: var(--crimson); }
.legend { display: flex; flex-wrap: wrap; gap: 10px 28px; padding: 16px 24px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend svg { width: 16px; height: 16px; }
@media (max-width: 760px) {
  .cmp thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cmp, .cmp tbody, .cmp tr, .cmp th, .cmp td { display: block; width: 100%; }
  .cmp tbody tr { padding: 18px 16px 10px; border-top: 1px solid var(--line); }
  .cmp tbody tr:first-child { border-top: 0; }
  .cmp tbody th { border: 0; padding: 0 0 10px; font-size: 17px; }
  .cmp td { border: 0; padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-radius: 10px; }
  .cmp td::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); flex: none; }
  .cmp td .val { justify-content: flex-end; text-align: right; }
  .cmp tbody tr:hover td:not(.ours), .cmp tbody tr:hover th { background: transparent; }
}

/* ---------- FAQ ---------- */
.faq-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.7fr); gap: 24px 64px; }
@media (max-width: 860px) { .faq-grid { grid-template-columns: minmax(0, 1fr); } }
.faq-grid h2 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.05; font-weight: 800; letter-spacing: -0.035em; }
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-block: 22px;
  font-family: var(--f-display); font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq .plus { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); position: relative; transition: transform .3s, background .3s; }
.faq .plus::before, .faq .plus::after { content: ""; position: absolute; left: 50%; top: 50%; width: 11px; height: 2px; background: var(--ink); transform: translate(-50%, -50%); }
.faq .plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.faq details[open] .plus { transform: rotate(45deg); background: var(--surface-2); }
.faq details p { color: var(--muted); padding-bottom: 24px; max-width: 44rem; }

/* ---------- Closing ---------- */
.closing { padding-block: 0 clamp(80px, 10vw, 120px); }
.closing-card { position: relative; overflow: hidden; background: var(--crimson); color: var(--on-crimson); border-radius: 30px; padding: clamp(36px, 6vw, 72px);
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px 40px; align-items: end; }
@media (max-width: 760px) { .closing-card { grid-template-columns: minmax(0, 1fr); } }
.closing-card h2 { position: relative; font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.04em; max-width: 16ch; }
.closing-card p { position: relative; margin-top: 14px !important; max-width: 30rem; opacity: 0.88; }
.closing-card .btn { position: relative; background: var(--on-crimson); color: var(--crimson); }
.closing-mark { position: absolute; right: -50px; top: -60px; width: min(420px, 70vw); height: auto; opacity: 0.12; pointer-events: none; }
.closing-mark path { fill: none; stroke: var(--on-crimson); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

footer { border-top: 1px solid var(--line); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; padding-block: 28px 40px; font-size: 14px; color: var(--muted); }
.wm-foot { font-size: 18px; color: var(--ink); }

/* Scroll reveal: tied to scroll position, visible wherever unsupported */
@keyframes rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .reveal { animation: rise linear; animation-timeline: view(); animation-range: entry 0% entry 75%; }
  }
}
