/* Rift Realty — the brokerage's public site and buyer portal. Photo-led and quiet: the listings do the
   talking. Source Serif for headings, Inter for everything else, the brokerage's colour in --accent. */
:root {
  --bg: #ffffff; --paper: #f7f8fa; --tint: #eef2f7; --ink: #0f172a; --ink-2: #334155; --muted: #64748b; --muted-2: #94a3b8;
  --line: #e2e8f0; --line-2: #cbd5e1; --dark: #0f172a;
  --accent: #1d4ed8; --good: #047857; --good-bg: #ecfdf5; --warn: #b45309; --warn-bg: #fffbeb; --bad: #b91c1c; --bad-bg: #fef2f2;
  --serif: "Source Serif 4", Georgia, serif; --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 14px; --r-sm: 9px; --shadow: 0 1px 2px rgba(15,23,42,.06), 0 10px 30px rgba(15,23,42,.07);
  --wrap: 1200px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; letter-spacing: -.02em; line-height: 1.12; margin: 0 0 .5em; }
h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); } .small { font-size: .9rem; } .tiny { font-size: .8rem; }
.num { font-variant-numeric: tabular-nums; }
.eyebrow { font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 10px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }

/* ---- header */
.head { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.head .wrap { display: flex; align-items: center; gap: 20px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--serif); font-size: 1.28rem; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand img { height: 38px; width: auto; }
.brand .mark { width: 38px; height: 38px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 1rem; font-weight: 700; font-family: var(--sans); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink-2); font-weight: 550; font-size: .95rem; }
.nav a:hover, .nav a.on { color: var(--accent); text-decoration: none; }
.nav form { margin: 0; }
.nav-toggle { display: none; }

/* ---- hero */
.hero { position: relative; color: #fff; background: #0f172a; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .55; }
.hero-bg.art { opacity: 1; background:
  radial-gradient(900px 420px at 15% 110%, color-mix(in srgb, var(--accent) 70%, #38bdf8), transparent 70%),
  radial-gradient(700px 400px at 85% -10%, #1e293b, transparent 70%), linear-gradient(160deg, #0f172a, #172033); }
.hero-bg.art::after { content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 48px 48px; }
.hero .wrap { position: relative; padding: 86px 24px 34px; }
.hero h1 { color: #fff; max-width: 16ch; }
.hero p.lede { font-size: 1.12rem; color: rgba(255,255,255,.85); max-width: 52ch; }

/* ---- search bar */
.searchbar { position: relative; z-index: 3; background: #fff; border-radius: var(--r); box-shadow: 0 24px 60px rgba(15,23,42,.28); padding: 16px; margin: 26px 0 -48px; }
.searchbar form { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: end; }
.field { display: block; min-width: 0; }
.field > span { display: block; font-size: .76rem; font-weight: 650; color: var(--ink-2); margin-bottom: 5px; }
.input { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
textarea.input { min-height: 110px; resize: vertical; }
.searchbar .btn { min-height: 46px; }

/* ---- sections */
.section { padding: 64px 0; }
.section.tint { background: var(--paper); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }

/* ---- listing cards */
.cards .card { scroll-margin-top: 150px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 22px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; min-width: 0; }
.card:hover { border-color: var(--line-2); }
.card .shot { position: relative; aspect-ratio: 3 / 2; background: var(--tint); overflow: hidden; display: block; }
.card .shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease, ease); }
.card:hover .shot img { transform: scale(1.03); }
.card .shot .none { display: grid; place-items: center; height: 100%; color: var(--muted-2); font-size: .85rem; }
.card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card .price { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; }
.card .addr { font-weight: 600; color: var(--ink); }
.card .addr a { color: inherit; }
.card .city { color: var(--muted); font-size: .92rem; }
.card .facts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .92rem; }
.card .facts b { font-weight: 700; }
.card .office { color: var(--muted-2); font-size: .74rem; margin-top: 8px; }
.pill { position: absolute; top: 12px; left: 12px; background: rgba(15,23,42,.82); color: #fff; font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.pill.active { background: rgba(4,120,87,.92); }
.pill.pending { background: rgba(180,83,9,.92); }
.pill.sold { background: rgba(15,23,42,.88); }
.pill.coming_soon { background: rgba(29,78,216,.92); }
.heart { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(15,23,42,.18); }
.heart svg { width: 19px; height: 19px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; }
.heart.on svg { fill: #e11d48; stroke: #e11d48; }
.heart:hover svg { stroke: #e11d48; }
.card-photos { position: absolute; bottom: 10px; right: 10px; background: rgba(15,23,42,.72); color: #fff; font-size: .74rem; padding: 3px 8px; border-radius: 999px; }

/* ---- results page */
.results { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 0; align-items: start; }
.results.list-only { grid-template-columns: minmax(0, 1fr); }
.results-list { padding: 24px 24px 60px; }
.results .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.results-map { position: sticky; top: 68px; height: calc(100vh - 68px); background: var(--tint); }
.results-map .map { width: 100%; height: 100%; }
.filters { position: sticky; top: 68px; z-index: 20; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); padding: 12px 24px; }
.filters form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters .input { min-height: 40px; width: auto; min-width: 128px; }
.filters .input.q { min-width: 220px; }
.filters details { position: relative; }
.filters summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); font-weight: 600; background: #fff; }
.filters summary::-webkit-details-marker { display: none; }
.filters details[open] summary { border-color: var(--ink); }
.more-filters { position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; background: #fff; border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px; width: min(560px, 90vw); display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.more-filters .full { grid-column: 1 / -1; }
.checks { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .94rem; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.result-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.result-head h1 { font-size: 1.5rem; margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--tint); color: var(--ink-2); border-radius: 999px; padding: 5px 12px; font-size: .86rem; }
.chip a { color: var(--muted); font-weight: 700; }

/* ---- listing page */
.gallery { display: grid; grid-template-columns: 2fr 1fr 1fr; grid-auto-rows: 200px; gap: 8px; margin-top: 18px; }
.gallery a { display: block; overflow: hidden; border-radius: 6px; background: var(--tint); }
.gallery a:first-child { grid-row: span 2; grid-column: span 1; }
.gallery img { width: 100%; height: 100%; object-fit: cover; }
.gallery .more { position: relative; }
.gallery .more span { position: absolute; inset: 0; background: rgba(15,23,42,.55); color: #fff; display: grid; place-items: center; font-weight: 650; }
.listing-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; flex-wrap: wrap; margin-top: 26px; }
.listing-head h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.listing-price { font-size: clamp(1.8rem, 3.4vw, 2.4rem); font-weight: 700; letter-spacing: -.03em; }
.listing-price small { display: block; font-size: .86rem; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.key-facts { display: flex; flex-wrap: wrap; gap: 26px; padding: 18px 0; margin: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.key-facts div { min-width: 0; }
.key-facts b { display: block; font-size: 1.28rem; font-weight: 700; }
.key-facts span { color: var(--muted); font-size: .86rem; }
.listing-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 350px); gap: 40px; align-items: start; padding-bottom: 60px; }
.detail-table { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 0 28px; }
.detail-table div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.detail-table span:first-child { color: var(--muted); }
.detail-table span:last-child { font-weight: 600; text-align: right; }
.features { display: flex; flex-wrap: wrap; gap: 8px; }
.feature { background: var(--tint); border-radius: var(--r-sm); padding: 6px 12px; font-size: .9rem; }
.sticky-card { position: sticky; top: 90px; display: grid; gap: 16px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.panel h3 { margin-top: 0; }
.agent-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--tint); display: grid; place-items: center; font-weight: 700; color: var(--ink-2); flex: none; }
.avatar.lg { width: 84px; height: 84px; font-size: 1.4rem; }
.mini-map { height: 240px; border-radius: var(--r-sm); overflow: hidden; background: var(--tint); }
.calc-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; }
.calc-total { border-top: 2px solid var(--ink); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }
.note { border-radius: var(--r-sm); padding: 12px 14px; margin-bottom: 16px; font-weight: 550; }
.note.ok { background: var(--good-bg); color: #065f46; }
.note.bad { background: var(--bad-bg); color: #991b1b; }
.note.info { background: var(--tint); color: var(--ink-2); }
.disclaimer { color: var(--muted-2); font-size: .78rem; line-height: 1.5; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 30px; }

/* ---- agents */
.agent-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 22px; }
.agent-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; text-align: center; box-shadow: var(--shadow); }
.agent-card .avatar { margin: 0 auto 12px; }
.agent-card h3 { margin-bottom: 2px; }

/* ---- portal */
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 32px; align-items: start; }
.saved-search { border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; background: #fff; }
.saved-search .top { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.badge { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; padding: 2px 9px; font-size: .78rem; font-weight: 650; }
.badge.grey { background: var(--tint); color: var(--muted); }
.auth-card { max-width: 440px; margin: 60px auto; }
.tabs { display: flex; gap: 0; border: 1px solid var(--line-2); border-radius: var(--r-sm); overflow: hidden; margin-bottom: 18px; }
.tabs a { flex: 1; text-align: center; padding: 10px; font-weight: 600; color: var(--ink-2); }
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a:hover { text-decoration: none; }

/* ---- footer */
.foot { background: var(--dark); color: rgba(255,255,255,.7); padding: 46px 0 30px; margin-top: 40px; font-size: .92rem; }
.foot a { color: #fff; }
.foot .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 28px; }
.foot h4 { color: #fff; font-family: var(--sans); font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin: 0 0 12px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot .legal { border-top: 1px solid rgba(255,255,255,.14); margin-top: 30px; padding-top: 18px; font-size: .78rem; color: rgba(255,255,255,.55); }
.hp { position: absolute; left: -9999px; }
.pager { margin-top: 26px; }
.pager nav > div:first-child { display: none; }
.pager svg { width: 16px; height: 16px; }
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* ---- photo viewer */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(8,12,20,.93); display: grid; place-items: center; padding: 40px 60px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox button:hover { background: rgba(255,255,255,.22); }
.lb-close { top: 18px; right: 18px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: rgba(255,255,255,.8); font-size: .9rem; }

/* ---- map */
.leaflet-popup-content { margin: 0; width: 230px !important; }
.map-pop { width: 230px; }
.map-pop img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.map-pop .t { padding: 10px 12px 12px; }
.map-pop b { display: block; font-size: 1.05rem; }
.map-pop span { color: var(--muted); font-size: .86rem; }
.marker-price { background: #fff; border: 1px solid var(--line-2); border-radius: 999px; padding: 3px 9px; font-weight: 700; font-size: .8rem; box-shadow: 0 2px 6px rgba(15,23,42,.2); white-space: nowrap; }
.marker-price.on { background: var(--accent); color: #fff; border-color: var(--accent); }

@media (max-width: 1000px) {
  .results { grid-template-columns: minmax(0, 1fr); }
  .results-map { display: none; }
  .listing-grid, .portal-grid { grid-template-columns: minmax(0, 1fr); }
  .sticky-card { position: static; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .searchbar form { grid-template-columns: 1fr 1fr; }
  .searchbar .btn { grid-column: 1 / -1; }
  .nav { position: fixed; inset: 68px 0 auto; background: #fff; border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch;
    gap: 0; padding: 8px 16px 16px; display: none; box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .nav a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: 10px; }
  .nav-toggle { display: inline-grid; place-items: center; margin-left: auto; width: 42px; height: 42px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #fff; cursor: pointer; }
  .gallery { grid-template-columns: 1fr 1fr; grid-auto-rows: 150px; }
  .gallery a:first-child { grid-column: span 2; }
  .hero .wrap { padding-top: 54px; }
  .key-facts { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .card .shot img { transition: none; } }
@media print { .head, .foot, .sticky-card, .filters { display: none; } }
