/* PrimeNest Realty — deep green, sand and brass. No external requests. */
@font-face {
  font-family: "Fraunces";
  src: url("../fonts/fraunces-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #1f3a33;
  --green-2: #2c5247;
  --green-ink: #13251f;
  --sand: #f3ede3;
  --sand-2: #e9e0d1;
  --paper: #fbf9f5;
  --white: #ffffff;
  --ink: #1b2421;
  --muted: #5f6b66;
  --line: #e2dccf;
  --brass: #b8894a;
  --brass-dark: #8f6630;
  --brass-soft: #ecdcc2;
  --err: #b3261e;
  --ok: #2d6a4f;
  --radius: 16px;
  --shadow: 0 24px 60px -24px rgba(19, 37, 31, .35);
  --shadow-sm: 0 6px 20px -8px rgba(19, 37, 31, .2);
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
html:has(dialog[open]) { overflow: hidden; }
body { margin: 0; font: 16px/1.6 var(--sans); color: var(--ink); background: var(--paper); overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { width: 22px; height: 22px; flex: none; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--green); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 999; }
.skip-link:focus { top: 12px; }
.wrap { width: min(100% - 2 * var(--gutter), 1280px); margin-inline: auto; }
.muted { color: var(--muted); }
.center { text-align: center; }

.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brass-dark); margin-bottom: .8rem; }
.eyebrow--light { color: var(--brass-soft); }
.h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -.015em; font-variation-settings: "opsz" 72; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: 0 1.4rem; border-radius: 12px; border: 1px solid transparent; font-weight: 600; font-size: .95rem; text-decoration: none; transition: background .2s, color .2s, border-color .2s, transform .15s; white-space: nowrap; }
.btn:active { transform: scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn--brass { background: var(--brass); color: #1d1408; }
.btn--brass:hover { background: #caa068; }
.btn--green { background: var(--green); color: #fff; }
.btn--green:hover { background: var(--green-2); }
.btn--ghost { border-color: var(--line); background: var(--white); }
.btn--ghost:hover { border-color: var(--green); }
.btn--ghost-light { border-color: rgba(255,255,255,.35); color: #fff; background: transparent; }
.btn--ghost-light:hover { background: rgba(255,255,255,.1); }
.btn--sm { min-height: 44px; padding: 0 1rem; font-size: .9rem; }
.btn--block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; transition: background .2s; }
.icon-btn:hover { background: rgba(31, 58, 51, .08); }
.icon-btn--light { color: #fff; }
.icon-btn--light:hover { background: rgba(255, 255, 255, .15); }

/* Header */
.header { position: sticky; top: 0; z-index: 60; background: rgba(251, 249, 245, .94); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header__inner { height: var(--header-h); display: flex; align-items: center; gap: 1.5rem; }
.logo { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-family: var(--serif); font-size: 1.45rem; font-weight: 500; color: var(--green); letter-spacing: -.01em; }
.logo svg { width: 30px; height: 30px; color: var(--brass); }
.logo b { font-weight: 700; }
.logo--light { color: #fff; }
.nav { margin-left: auto; }
.nav ul { display: flex; gap: .4rem; }
.nav a { display: block; padding: .6rem .85rem; border-radius: 10px; text-decoration: none; font-weight: 500; font-size: .95rem; transition: background .2s; }
.nav a:hover { background: var(--sand); }
.header__actions { display: flex; align-items: center; gap: .6rem; }
.btn-saved { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: 0 .9rem; border-radius: 12px; border: 1px solid var(--line); background: var(--white); font-weight: 600; font-size: .9rem; }
.btn-saved svg { width: 20px; height: 20px; color: var(--brass-dark); }
.btn-saved[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.btn-saved[aria-pressed="true"] svg { color: var(--brass-soft); }
.count { min-width: 22px; height: 22px; border-radius: 11px; background: var(--sand-2); color: var(--green); font-size: .75rem; display: grid; place-items: center; padding: 0 6px; }
.btn-saved[aria-pressed="true"] .count { background: rgba(255,255,255,.18); color: #fff; }
.count.bump { animation: bump .45s; }
@keyframes bump { 50% { transform: scale(1.35); } }
.burger { display: none; }

/* Hero */
.hero { position: relative; color: #fff; overflow: hidden; background: var(--green-ink); }
.hero__bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 50%; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, rgba(13, 28, 23, .88) 0%, rgba(13, 28, 23, .6) 45%, rgba(13, 28, 23, .15) 100%), linear-gradient(to top, rgba(13, 28, 23, .6), transparent 45%); }
.hero__inner { position: relative; z-index: 2; padding-block: clamp(56px, 9vw, 120px) clamp(40px, 5vw, 64px); }
.hero__title { font-family: var(--serif); font-weight: 400; font-size: clamp(2.5rem, 6vw, 4.8rem); line-height: 1.02; letter-spacing: -.025em; max-width: 14ch; font-variation-settings: "opsz" 144; }
.hero__title em { font-style: normal; color: var(--brass-soft); font-weight: 300; }
.hero__lead { max-width: 36rem; font-size: clamp(1rem, 1.4vw, 1.15rem); color: rgba(255, 255, 255, .86); margin: 1.4rem 0 2.2rem; }
.search { background: var(--white); color: var(--ink); border-radius: 20px; padding: 10px; box-shadow: var(--shadow); max-width: 1080px; }
.seg { display: inline-flex; background: var(--sand); border-radius: 12px; padding: 4px; margin: 4px 4px 10px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; padding: .5rem 1.3rem; border-radius: 9px; font-weight: 600; font-size: .9rem; min-height: 38px; }
.seg input:checked + span { background: var(--green); color: #fff; }
.seg input:focus-visible + span { outline: 2px solid var(--brass); outline-offset: 2px; }
.search__fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 6px; }
.sf { display: flex; flex-direction: column; padding: .55rem .9rem .45rem; border-radius: 12px; background: var(--paper); border: 1px solid var(--line); transition: border-color .2s; cursor: pointer; min-width: 0; }
.sf:focus-within { border-color: var(--green); }
.sf span { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.sf select { border: 0; background: transparent; padding: .15rem 0; font-weight: 600; font-size: 1rem; appearance: none; cursor: pointer; width: 100%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231f3a33' stroke-width='2'/%3E%3C/svg%3E") no-repeat right center / 16px; padding-right: 20px; }
.sf select:focus { outline: none; }
.search__go { min-height: 64px; padding: 0 1.8rem; border-radius: 12px; }
.hero__stats { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; margin: 2.4rem 0 0; }
.hero__stats dt { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; }
.hero__stats dd { margin: 0; font-size: .85rem; color: rgba(255,255,255,.75); }

/* Sections */
.section { padding-block: clamp(56px, 8vw, 110px); }
.section--sand { background: var(--sand); }
.section__head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 1rem 2rem; margin-bottom: 1.6rem; }
.section__head p.muted { margin: .4rem 0 0; }
.toolbar { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.select select { appearance: none; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; padding: 0 2.4rem 0 1rem; background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231f3a33' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; font-weight: 500; }
.switch { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; min-height: 44px; font-weight: 500; font-size: .95rem; }
.switch input { position: absolute; opacity: 0; }
.switch__ui { width: 44px; height: 26px; border-radius: 13px; background: var(--sand-2); position: relative; transition: background .2s; }
.switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + .switch__ui { background: var(--green); }
.switch input:checked + .switch__ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__ui { outline: 2px solid var(--brass); outline-offset: 2px; }
.chips-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.4rem; }
.chips-row:empty { display: none; }
.chip-x { display: inline-flex; align-items: center; gap: .3rem; min-height: 36px; padding: 0 .55rem 0 .9rem; border-radius: 999px; background: var(--sand); border: 1px solid var(--line); font-size: .85rem; font-weight: 500; }
.chip-x svg { width: 16px; height: 16px; }
.chip-x:hover { border-color: var(--green); }

/* Property cards */
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 28px); }
.pcard { position: relative; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--line), var(--shadow-sm); transition: transform .3s, box-shadow .3s; display: flex; flex-direction: column; animation: rise .5s both; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
.pcard:hover { transform: translateY(-4px); box-shadow: 0 1px 0 var(--line), var(--shadow); }
.pcard__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--sand-2); }
.pcard__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s cubic-bezier(.2,.7,.2,1); }
.pcard:hover .pcard__media img { transform: scale(1.05); }
.pcard__tags { position: absolute; left: 12px; top: 12px; display: flex; gap: .35rem; z-index: 2; pointer-events: none; }
.tag { font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .94); color: var(--green); letter-spacing: .02em; }
.tag--rent { background: var(--brass); color: #1d1408; }
.tag--new { background: var(--green); color: #fff; }
.pcard__fav { position: absolute; right: 10px; top: 10px; z-index: 2; background: rgba(255,255,255,.94); width: 42px; height: 42px; color: var(--green); }
.pcard__fav:hover { background: #fff; }
.pcard__fav[aria-pressed="true"] { color: #c2410c; }
.pcard__photos { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: .3rem; background: rgba(19, 37, 31, .75); color: #fff; font-size: .75rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; pointer-events: none; }
.pcard__photos svg { width: 15px; height: 15px; }
.pcard__body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.pcard__price { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; color: var(--green); letter-spacing: -.01em; }
.pcard__price small { font-family: var(--sans); font-size: .85rem; color: var(--muted); font-weight: 500; }
.pcard__title { font-size: 1.05rem; font-weight: 600; margin: .15rem 0 .2rem; }
.pcard__title a { text-decoration: none; }
.pcard__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.pcard__loc { display: flex; align-items: center; gap: .3rem; font-size: .88rem; color: var(--muted); margin-bottom: .9rem; }
.pcard__loc svg { width: 16px; height: 16px; }
.facts { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .88rem; padding-top: .85rem; border-top: 1px solid var(--line); margin-top: auto; }
.facts span { display: inline-flex; align-items: center; gap: .35rem; }
.facts svg { width: 18px; height: 18px; color: var(--brass-dark); }
.pcard__compare { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: .5rem; margin-top: .8rem; font-size: .85rem; font-weight: 600; cursor: pointer; min-height: 36px; align-self: flex-start; }
.pcard__compare input { width: 18px; height: 18px; accent-color: var(--green); margin: 0; }

.empty { text-align: center; padding: 3.5rem 1.5rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--white); }
.empty svg { width: 40px; height: 40px; color: var(--brass); }
.empty h3 { font-family: var(--serif); font-weight: 500; font-size: 1.5rem; margin: .6rem 0 .4rem; }
.empty p { color: var(--muted); max-width: 42ch; margin-inline: auto; }

/* Why */
.why { background: var(--green); color: #fff; padding-block: clamp(56px, 8vw, 100px); }
.why__head { max-width: 40rem; margin-bottom: 2.5rem; }
.why__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(16px, 2.5vw, 32px); counter-reset: w; }
.why__grid li { padding: 1.8rem; border-radius: var(--radius); background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); }
.why__grid svg { width: 34px; height: 34px; color: var(--brass-soft); margin-bottom: 1rem; }
.why__grid h3 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin-bottom: .5rem; }
.why__grid p { color: rgba(255, 255, 255, .78); margin: 0; font-size: .95rem; }

/* Mortgage */
.mortgage { display: grid; grid-template-columns: 1fr 1.6fr; gap: clamp(24px, 4vw, 64px); align-items: center; }
.mortgage__intro p.muted { max-width: 30rem; margin-top: 1rem; }
.calc { display: grid; grid-template-columns: 1.2fr 1fr; background: var(--white); border-radius: 22px; box-shadow: 0 1px 0 var(--line), var(--shadow); overflow: hidden; }
.calc__inputs { padding: clamp(20px, 3vw, 36px); display: flex; flex-direction: column; gap: 1.3rem; }
.rf__top { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .4rem; }
.rf label { font-weight: 600; font-size: .92rem; }
.rf output { font-family: var(--serif); font-weight: 600; font-size: 1.15rem; color: var(--green); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; height: 28px; margin: 0; background: transparent; appearance: none; -webkit-appearance: none; cursor: pointer; --p: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--green) var(--p), var(--sand-2) var(--p)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--green) var(--p), var(--sand-2) var(--p)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; border-radius: 50%; background: #fff; border: 3px solid var(--green); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--green); }
input[type="range"]:focus { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var(--brass-soft); }
.calc__result { background: var(--sand); padding: clamp(20px, 3vw, 36px); display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; }
.donut { width: 132px; height: 132px; }
.donut circle { transition: stroke-dasharray .5s; }
.calc__monthly span { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.calc__monthly strong { font-family: var(--serif); font-size: clamp(1.9rem, 3vw, 2.4rem); font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
.calc__dl { width: 100%; margin: 0; font-size: .9rem; }
.calc__dl div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.calc__dl dt { display: flex; align-items: center; gap: .45rem; color: var(--muted); }
.calc__dl dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.dot--green { background: var(--green); }
.dot--brass { background: var(--brass-soft); box-shadow: inset 0 0 0 1px var(--brass); }

/* Agents */
.agents { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.agent { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 0 var(--line); display: flex; flex-direction: column; }
.agent img { width: 100%; aspect-ratio: 1; object-fit: cover; object-position: 50% 25%; }
.agent__body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.agent h3 { font-family: var(--serif); font-weight: 500; font-size: 1.3rem; }
.agent__role { color: var(--brass-dark); font-size: .85rem; font-weight: 600; margin: .15rem 0 .5rem; }
.agent__areas { font-size: .88rem; color: var(--muted); margin-bottom: 1rem; }
.agent__actions { display: flex; gap: .5rem; margin-top: auto; }
.agent__actions .btn { flex: 1; min-height: 44px; font-size: .88rem; padding: 0 .8rem; }
.agent__actions .icon-btn { border: 1px solid var(--line); border-radius: 12px; flex: none; }

/* Quotes */
.quotes { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2vw, 24px); margin-top: 2.4rem; }
.quote { margin: 0; padding: 2rem; border-radius: var(--radius); background: var(--white); border: 1px solid var(--line); display: flex; flex-direction: column; }
.quote blockquote { margin: 0 0 1.2rem; font-family: var(--serif); font-size: 1.15rem; line-height: 1.5; flex: 1; }
.quote figcaption { font-size: .88rem; color: var(--muted); }
.quote strong { color: var(--ink); }

/* Contact */
.contact { background: var(--green-ink); color: #fff; padding-block: clamp(56px, 8vw, 110px); }
.contact__grid { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(28px, 5vw, 80px); align-items: start; }
.contact__intro > p { color: rgba(255,255,255,.78); margin-top: 1rem; }
.contact__list { margin-top: 2rem; display: grid; gap: 1rem; }
.contact__list li { display: flex; gap: .8rem; align-items: flex-start; color: rgba(255,255,255,.88); }
.contact__list svg { color: var(--brass-soft); margin-top: 2px; }
.contact__list a { text-decoration: none; }
.contact__list a:hover { text-decoration: underline; }
.card-form { position: relative; background: var(--white); color: var(--ink); border-radius: 22px; padding: clamp(20px, 3vw, 36px); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .1rem 1rem; }
.span-2 { grid-column: 1 / -1; }
.field label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .35rem; }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 12px; padding: .65rem .9rem; background: var(--paper); font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
.field select { appearance: none; background: var(--paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231f3a33' stroke-width='2'/%3E%3C/svg%3E") no-repeat right 12px center / 16px; padding-right: 2.4rem; }
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(31, 58, 51, .12); }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--err); }
.err { color: var(--err); font-size: .8rem; min-height: 1.25em; margin: .25rem 0 .35rem; }
.check { display: flex; align-items: flex-start; gap: .6rem; font-size: .9rem; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--green); flex: none; }
.success { position: absolute; inset: 0; background: var(--white); border-radius: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; animation: rise .4s both; }
.success:focus { outline: none; }
.success__icon { width: 72px; height: 72px; border-radius: 50%; background: var(--ok); color: #fff; display: grid; place-items: center; margin-bottom: 1rem; }
.success__icon svg { width: 36px; height: 36px; }
.success h3 { font-family: var(--serif); font-weight: 500; font-size: 1.7rem; margin-bottom: .5rem; }
.success p { color: var(--muted); max-width: 34ch; }

/* Footer */
.footer { background: #0d1a16; color: rgba(255,255,255,.72); padding-top: clamp(44px, 6vw, 72px); font-size: .92rem; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-bottom: 2.5rem; }
.footer .logo { margin-bottom: .8rem; }
.footer h3 { color: #fff; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .9rem; }
.footer a { text-decoration: none; display: inline-block; padding: .3rem 0; }
.footer a:hover { color: #fff; }
.footer__base { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; border-top: 1px solid rgba(255,255,255,.1); padding: 1.3rem 0 5rem; font-size: .82rem; }
.footer__base p { margin: 0; }

.back-link { position: fixed; left: 14px; bottom: 14px; z-index: 50; background: rgba(19, 37, 31, .9); color: #fff; text-decoration: none; font-size: .8rem; font-weight: 600; padding: .6rem .95rem; border-radius: 999px; backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0,0,0,.2); transition: transform .2s; }
.back-link:hover { transform: translateY(-2px); background: var(--green-2); }
body.has-compare .back-link { bottom: 96px; }

/* Compare bar */
.compare-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 70; width: min(720px, calc(100% - 24px)); background: var(--green-ink); color: #fff; border-radius: 18px; box-shadow: var(--shadow); animation: barIn .35s both; }
@keyframes barIn { from { transform: translate(-50%, 30px); opacity: 0; } }
.compare-bar__inner { display: flex; align-items: center; gap: .8rem; padding: 10px 10px 10px 14px; }
.compare-bar__thumbs { display: flex; }
.compare-bar__thumbs img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; border: 2px solid var(--green-ink); margin-left: -8px; }
.compare-bar__thumbs li:first-child img { margin-left: 0; }
.compare-bar__text { margin: 0 auto 0 0; font-size: .9rem; }

/* Dialogs */
dialog { padding: 0; border: 0; color: var(--ink); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 20, 17, .6); backdrop-filter: blur(3px); }
.modal { width: min(1100px, calc(100% - 32px)); max-height: calc(100dvh - 32px); border-radius: 22px; background: var(--paper); overflow: auto; box-shadow: var(--shadow); }
.modal[open] { animation: pop .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.98); } }
.modal__close { position: sticky; top: 12px; float: right; margin: 12px 12px -56px 0; z-index: 5; background: rgba(255, 255, 255, .95); box-shadow: var(--shadow-sm); }

/* Detail */
.gallery { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; gap: 8px; height: clamp(300px, 52vh, 520px); padding: 8px; }
.gallery button { position: relative; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: var(--sand-2); }
.gallery button:first-child { grid-row: 1 / 3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.gallery button:hover img { transform: scale(1.04); }
.gallery__all { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: .4rem; background: rgba(255,255,255,.95); color: var(--ink); padding: .5rem .8rem; border-radius: 10px; font-size: .85rem; font-weight: 600; }
.gallery__all svg { width: 18px; height: 18px; }
.detail__grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: clamp(20px, 3vw, 44px); padding: clamp(20px, 3vw, 40px); }
.detail__head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.detail__title { font-family: var(--serif); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.015em; }
.detail__price { font-family: var(--serif); font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; color: var(--green); white-space: nowrap; }
.detail__price small { font-family: var(--sans); font-size: .9rem; font-weight: 500; color: var(--muted); }
.detail__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 1.4rem; }
.keyfacts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 1.6rem; }
.keyfacts div { background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: .8rem; }
.keyfacts dt { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.keyfacts dd { margin: 0; font-weight: 700; font-size: 1.05rem; }
.detail h3 { font-family: var(--serif); font-weight: 500; font-size: 1.35rem; margin: 1.6rem 0 .7rem; }
.features { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem 1rem; }
.features li { display: flex; align-items: center; gap: .5rem; font-size: .94rem; }
.features svg { width: 18px; height: 18px; color: var(--ok); }
.hood { background: var(--white); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.hood svg { width: 100%; height: auto; display: block; }
.hood__foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .5rem; padding: .7rem 1rem; border-top: 1px solid var(--line); font-size: .88rem; }
.hood__foot a { display: inline-flex; align-items: center; gap: .35rem; font-weight: 600; color: var(--green); }
.hood__foot svg { width: 16px; height: 16px; }
.side-card { background: var(--white); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; margin-bottom: 1rem; }
.side-card h3 { margin-top: 0; font-size: 1.2rem; }
.agent-mini { display: flex; gap: .8rem; align-items: center; margin-bottom: 1rem; }
.agent-mini img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; }
.agent-mini strong { display: block; }
.agent-mini span { font-size: .85rem; color: var(--muted); }
.side-card .field input, .side-card .field textarea { background: var(--paper); }
.side-card .form-grid { grid-template-columns: 1fr; }
.mini-calc { font-size: .9rem; }
.mini-calc .rf { margin-bottom: .8rem; }
.mini-calc .rf output { font-size: 1rem; }
.mini-calc__out { display: flex; justify-content: space-between; align-items: baseline; padding-top: .8rem; border-top: 1px solid var(--line); }
.mini-calc__out strong { font-family: var(--serif); font-size: 1.5rem; color: var(--green); }
.detail__side { align-self: start; position: sticky; top: 16px; }

/* Lightbox */
.lightbox { width: 100%; height: 100%; max-width: 100%; max-height: 100%; margin: 0; background: rgba(8, 14, 12, .96); color: #fff; display: none; flex-direction: column; }
.lightbox[open] { display: flex; animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.lightbox__top { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 0 20px; }
.lightbox__top p { margin: 0; font-size: .9rem; color: rgba(255,255,255,.8); }
.lightbox__stage { flex: 1; margin: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; padding: 10px 64px; touch-action: pan-y; }
.lightbox__stage img { max-width: 100%; max-height: calc(100% - 36px); object-fit: contain; border-radius: 8px; animation: fade .3s; }
.lightbox__stage figcaption { margin-top: .6rem; font-size: .9rem; color: rgba(255,255,255,.75); }
.lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; background: rgba(255,255,255,.1); }
.lightbox__nav--prev { left: 10px; }
.lightbox__nav--next { right: 10px; }
.lightbox__thumbs { display: flex; gap: 8px; justify-content: center; padding: 10px 12px 18px; overflow-x: auto; }
.lightbox__thumbs button { flex: none; width: 72px; height: 50px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; opacity: .55; }
.lightbox__thumbs button[aria-current="true"] { border-color: var(--brass); opacity: 1; }
.lightbox__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* Compare */
.compare__body { padding: clamp(20px, 3vw, 40px); }
.compare__scroll { overflow-x: auto; margin-top: 1.4rem; -webkit-overflow-scrolling: touch; }
.cmp { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .93rem; }
.cmp th, .cmp td { padding: .75rem .8rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp thead th { vertical-align: bottom; }
.cmp thead img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; margin-bottom: .6rem; }
.cmp thead strong { font-family: var(--serif); font-weight: 500; font-size: 1.1rem; display: block; }
.cmp tbody th { color: var(--muted); font-weight: 600; width: 150px; font-size: .85rem; }
.cmp .best { color: var(--ok); font-weight: 700; }
.cmp .best::after { content: " ★"; }
.cmp .remove { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: .3rem 0; font-size: .82rem; }

/* Toasts */
.toasts { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 2000; display: flex; flex-direction: column; gap: .5rem; pointer-events: none; }
.toast { background: var(--green-ink); color: #fff; padding: .75rem 1rem; border-radius: 12px; font-size: .9rem; box-shadow: var(--shadow); animation: rise .3s both; max-width: 340px; }
.toast.out { opacity: 0; transition: opacity .3s; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .search__fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search__go { grid-column: 1 / -1; min-height: 52px; }
  .mortgage { grid-template-columns: 1fr; }
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .agent { flex-direction: row; }
  .agent img { width: 42%; aspect-ratio: auto; }
}

@media (max-width: 960px) {
  :root { --header-h: 64px; }
  .burger { display: inline-grid; }
  .header__cta { display: none; }
  .header__actions { margin-left: auto; }
  .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); padding: .5rem var(--gutter) 1rem; display: none; }
  .nav.is-open { display: block; animation: rise .25s both; }
  .nav ul { flex-direction: column; gap: 0; }
  .nav a { padding: .9rem .4rem; font-size: 1.1rem; font-family: var(--serif); border-bottom: 1px solid var(--line); border-radius: 0; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why__grid, .quotes { grid-template-columns: 1fr; }
  .contact__grid { grid-template-columns: 1fr; }
  .detail__grid { grid-template-columns: 1fr; }
  .detail__side { position: static; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid > div:first-child { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  body { font-size: 15.5px; }
  .hero::before { background: linear-gradient(180deg, rgba(13, 28, 23, .55) 0%, rgba(13, 28, 23, .85) 60%, rgba(13, 28, 23, .95) 100%); }
  .hero__inner { padding-top: 44px; }
  .search { padding: 8px; border-radius: 18px; }
  .seg { display: flex; margin: 2px 2px 8px; }
  .seg label { flex: 1; text-align: center; }
  .search__fields { grid-template-columns: 1fr 1fr; }
  .sf { padding: .5rem .7rem .4rem; }
  .sf select { font-size: .95rem; }
  .hero__stats { gap: 1rem 1.8rem; }
  .hero__stats dt { font-size: 1.35rem; }
  .cards { grid-template-columns: 1fr; }
  .toolbar { width: 100%; justify-content: space-between; }
  .calc { grid-template-columns: 1fr; }
  .agents { grid-template-columns: 1fr; }
  .agent img { width: 38%; }
  .agent__body { padding: 1rem; }
  .agent h3 { font-size: 1.15rem; }
  .agent__areas { font-size: .82rem; margin-bottom: .7rem; }
  .form-grid { grid-template-columns: 1fr; }
  .btn-saved__label { display: none; }
  .btn-saved { padding: 0 .7rem; }
  .modal { width: 100%; max-height: 100dvh; height: 100dvh; border-radius: 0; }
  .gallery { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; height: auto; }
  .gallery button:first-child { grid-column: 1 / -1; grid-row: auto; aspect-ratio: 3 / 2; }
  .gallery button:not(:first-child) { aspect-ratio: 3 / 2; }
  .gallery button:nth-child(4) { display: none; }
  .keyfacts { grid-template-columns: repeat(2, 1fr); }
  .features { grid-template-columns: 1fr; }
  .lightbox__stage { padding: 10px 8px; }
  .lightbox__nav { top: auto; bottom: 86px; transform: none; }
  .compare-bar__text { font-size: .82rem; }
  .compare-bar__thumbs img { width: 36px; height: 36px; }
  .compare-bar #compareClear { display: none; }
  .back-link { bottom: 10px; left: 10px; font-size: .75rem; padding: .5rem .8rem; }
  body.has-compare .back-link { bottom: 88px; }
  .toasts { left: 16px; right: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media (max-width: 680px) {
  .hero__stats { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 1rem 1.4rem; }
  .hero__stats dd { font-size: .78rem; }
}
.gallery button:nth-child(4) { display: none; }
.success-inline:focus { outline: none; }
.cmp thead th { min-width: 170px; }
.cmp thead .muted { font-weight: 400; font-size: .85rem; }
/* Phones: each row label sits on its own line above the values, so 2–3 homes fit side by side without sideways scrolling */
@media (max-width: 640px) {
  .compare__scroll { overflow-x: visible; }
  .cmp, .cmp thead, .cmp tbody { display: block; min-width: 0; width: 100%; font-size: .85rem; }
  .cmp tr { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); column-gap: 10px; border-bottom: 1px solid var(--line); }
  .cmp th, .cmp td { border-bottom: 0; padding: .15rem 0 .55rem; overflow-wrap: anywhere; }
  .cmp thead td:first-child { display: none; }
  .cmp thead th { min-width: 0; padding: .4rem 0 .6rem; }
  .cmp thead strong { font-size: .95rem; }
  .cmp tbody th { grid-column: 1 / -1; width: auto; padding: .6rem 0 .1rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
  .cmp tbody th:empty { display: none; }
  .cmp .btn--sm { width: 100%; padding-inline: 6px; white-space: normal; line-height: 1.2; }
}

/* "All projects" link: on phones it moves into the page footer (see app.js) so it never covers content;
   without JS it falls back to a small round button */
@media (max-width: 640px) {
  .back-link { width: 40px; height: 40px; min-height: 0; padding: 0 !important; display: inline-grid; place-items: center; overflow: hidden; font-size: 0 !important; letter-spacing: 0; }
  .back-link::before { content: "\2190"; font-size: 1.1rem; line-height: 1; }
}
.back-foot { display: flex; justify-content: center; width: 100%; flex-basis: 100%; grid-column: 1 / -1; padding: 16px 16px 24px; }
.back-link.in-footer { position: static; inset: auto; width: auto; height: auto; min-height: 42px; padding: 0 18px !important; display: inline-flex; align-items: center; font-size: .82rem !important; letter-spacing: .02em; opacity: 1; transform: none; box-shadow: none; }
.back-link.in-footer::before { content: none; }
