/* Jamie Fosgate Homes — styles modeled on the Nestedge Realty look:
   black header and hero, big editorial serif headlines, clean sans body,
   slate-blue and coral accents from the Nestedge logo. */

:root {
  --ink: #0c0c0c;
  --ink-2: #171717;
  --ink-3: #242424;
  --paper: #ffffff;
  --cream: #f5f1e8;          /* matches the Town Guides app */
  --line: #e4ded2;
  --text: #1d1d1d;
  --muted: #6b6b6b;
  --muted-on-dark: #b9b9b9;
  --slate: #4d6a85;          /* "Edge" blue from the Nestedge logo */
  --slate-dark: #3b546c;
  --coral: #e0735a;          /* Nestedge tagline coral */
  --coral-dark: #c95e46;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", "Helvetica Neue", Arial, sans-serif;
  --max: 1200px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--slate); }
a:hover { color: var(--slate-dark); }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.6rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); }
h3 { font-size: 1.45rem; }
p { margin: 0 0 1.1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.center { text-align: center; }
.eyebrow {
  font-family: var(--sans); font-size: .78rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase; color: var(--coral); margin-bottom: 14px; display: block;
}
.lead { font-size: 1.2rem; color: var(--muted); max-width: 680px; }
.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans); font-size: .82rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  text-decoration: none; padding: 16px 30px; border-radius: var(--radius); border: 1.5px solid transparent;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:hover { background: var(--coral-dark); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--ink-3); color: #fff; }
.btn-outline-light { border-color: rgba(255,255,255,.7); color: #fff; background: transparent; }
.btn-outline-light:hover { background: #fff; color: var(--ink); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-lg { padding: 20px 38px; font-size: .9rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
.center .btn-row { justify-content: center; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--ink); color: #fff; border-bottom: 1px solid #222; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 84px; }
.brand { text-decoration: none; color: #fff; display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; white-space: nowrap; }
.brand-name { font-family: var(--serif); font-size: 1.65rem; letter-spacing: .01em; }
.brand-sub { font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; color: var(--muted-on-dark); margin-top: 7px; }
.brand-sub b { color: var(--coral); font-weight: 700; }
.main-nav { display: flex; align-items: center; gap: 22px; }
.main-nav a { color: #e9e9e9; text-decoration: none; font-size: .76rem; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid transparent; white-space: nowrap; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--coral); }
.main-nav .btn { padding: 12px 18px; font-size: .72rem; border-bottom: 0; }
.main-nav .btn:hover { border-bottom: 0; }
.nav-toggle { display: none; background: none; border: 0; color: #fff; cursor: pointer; padding: 8px; }
.header-quiz { display: none; padding: 10px 14px; font-size: .68rem; letter-spacing: .1em; margin-left: auto; white-space: nowrap; }
@media (max-width: 1260px) { .header-quiz { display: inline-flex; } }
@media (max-width: 480px) {
  .header-inner { gap: 10px; }
  .brand-name { font-size: 1.3rem; }
  .brand-sub { font-size: .52rem; letter-spacing: .14em; white-space: nowrap; }
  .header-quiz { padding: 9px 10px; font-size: .62rem; }
  .embed-hint { font-size: .85rem; }
  .embed-bar .container { padding-top: 10px; padding-bottom: 10px; gap: 6px; }
}
.nav-toggle span { display: block; width: 26px; height: 2px; background: #fff; margin: 6px 0; transition: transform .25s, opacity .25s; }

@media (max-width: 1260px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed; inset: 84px 0 0 0; background: var(--ink); flex-direction: column; align-items: flex-start;
    padding: 30px 24px; gap: 4px; transform: translateX(100%); transition: transform .3s ease; overflow-y: auto;
  }
  .main-nav.open { transform: translateX(0); }
  .main-nav a { font-size: 1rem; padding: 14px 0; width: 100%; border-bottom: 1px solid #222; }
  .main-nav .btn { margin-top: 18px; width: 100%; padding: 18px; font-size: .85rem; }
  .nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

/* ---------- Hero ---------- */
.hero { position: relative; background: var(--ink); color: #fff; overflow: hidden; }
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .5; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(12,12,12,.92) 0%, rgba(12,12,12,.6) 55%, rgba(12,12,12,.25) 100%); }
.hero-inner { position: relative; z-index: 1; padding: 110px 0 120px; max-width: 760px; }
.hero h1 { color: #fff; }
.hero h1 em { font-style: italic; color: #d9d9d9; }
.hero p { font-size: 1.2rem; color: #dcdcdc; max-width: 600px; margin-bottom: 34px; }
.hero-caption {
  position: absolute; right: 24px; bottom: 20px; z-index: 2; color: #fff; text-decoration: none;
  font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  background: rgba(12,12,12,.55); padding: 9px 14px; border-radius: var(--radius); backdrop-filter: blur(4px);
}
.hero-caption:hover { background: var(--coral); color: #fff; }
@media (max-width: 640px) { .hero-caption { left: 16px; right: auto; bottom: 14px; font-size: .62rem; letter-spacing: .08em; } }
.hero-quiz-note { margin-top: 18px; font-size: .9rem; color: var(--muted-on-dark); }

.page-hero { background: var(--ink); color: #fff; padding: 90px 0 80px; }
.page-hero h1 { color: #fff; font-size: clamp(2.3rem, 5vw, 3.8rem); }
.page-hero p { color: #d0d0d0; font-size: 1.15rem; max-width: 680px; }

/* ---------- Quiz strip (high on the page) ---------- */
.quiz-strip { background: var(--coral); color: #fff; }
.quiz-strip .container { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 22px; padding-bottom: 22px; flex-wrap: wrap; }
.quiz-strip p { margin: 0; font-family: var(--serif); font-size: 1.35rem; }
.quiz-strip .btn { background: var(--ink); color: #fff; }
.quiz-strip .btn:hover { background: #000; }

/* ---------- Stats ---------- */
.stats { background: var(--ink-2); color: #fff; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; }
.stat { padding: 46px 16px; border-left: 1px solid #2a2a2a; }
.stat:first-child { border-left: 0; }
.stat-num { font-family: var(--serif); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1; display: block; }
.stat-label { display: block; margin-top: 12px; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-on-dark); }
@media (max-width: 760px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-left: 0; }
  .stat { border-top: 1px solid #2a2a2a; }
}

/* ---------- Sections ---------- */
.section { padding: 100px 0; }
.section-sm { padding: 70px 0; }
.section-cream { background: var(--cream); }
.section-dark { background: var(--ink); color: #fff; }
.section-dark h2, .section-dark h3 { color: #fff; }
.section-dark .lead, .section-dark p { color: #cfcfcf; }
.section-head { margin-bottom: 50px; }
.section-head.split { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.section-head h2 { margin-bottom: 10px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 70px; align-items: center; }
.two-col.top { align-items: start; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; gap: 40px; } }

.photo-frame { position: relative; }
.photo-frame img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); }
.photo-frame.wide img { aspect-ratio: 4/3; }
.photo-frame::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 1.5px solid var(--slate); border-radius: var(--radius); z-index: -1; }
.photo-wrap { position: relative; z-index: 0; }
.photo-frame.headshot { max-width: 430px; margin: 0 auto; }
.photo-frame.headshot img { aspect-ratio: 429 / 456; height: auto; }
.team-photo { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: center 25%; border-radius: var(--radius); margin-bottom: 20px; }

/* Placeholder for photos Jamie still needs to send */
.placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  background: repeating-linear-gradient(135deg, #ece6da 0 14px, #f3eee5 14px 28px);
  border: 2px dashed #c9bfae; color: #7a6f5d; border-radius: var(--radius); padding: 24px; aspect-ratio: 4/5;
}
.placeholder .initials { font-family: var(--serif); font-size: 4rem; line-height: 1; color: var(--slate); }
.placeholder small { margin-top: 12px; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.placeholder.monogram { background: linear-gradient(135deg, var(--slate) 0%, var(--slate-dark) 100%); border: 0; color: #e6edf3; }
.placeholder.monogram .initials { color: #fff; }
.placeholder.monogram small { color: #dbe4ec; }
.todo { background: #fff4d6; border: 1px dashed #d6b25c; color: #6b5313; padding: 2px 8px; border-radius: 3px; font-size: .85em; }

.checklist { list-style: none; padding: 0; margin: 0 0 1.5em; }
.checklist li { position: relative; padding-left: 30px; margin-bottom: 12px; }
.checklist li::before { content: ""; position: absolute; left: 0; top: .55em; width: 14px; height: 8px; border-left: 2px solid var(--coral); border-bottom: 2px solid var(--coral); transform: rotate(-45deg); }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.cards.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .cards, .cards.four { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards, .cards.four { grid-template-columns: 1fr; } }

.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .25s, transform .25s; }
.card:hover { box-shadow: 0 18px 40px rgba(0,0,0,.08); transform: translateY(-3px); }
.card-body { padding: 28px; flex: 1; display: flex; flex-direction: column; }
.card-body h3 { margin-bottom: 10px; }
.card-body p { color: var(--muted); font-size: .97rem; }
.card-link { margin-top: auto; font-size: .76rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; text-decoration: none; color: var(--ink); }
.card-link:hover { color: var(--coral); }
.card-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }

/* Town cards */
.town-card { position: relative; min-height: 300px; color: #fff; text-decoration: none; border-radius: var(--radius); overflow: hidden; display: flex; align-items: flex-end; padding: 26px; background: var(--ink-3); }
.town-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 30%, rgba(0,0,0,.75) 100%), var(--bg, none) center/cover; transition: transform .5s; }
.town-card:hover::before { transform: scale(1.04); }
.town-card > * { position: relative; }
.town-card h3 { color: #fff; margin: 0 0 4px; }
.town-card span { font-size: .85rem; color: #e2e2e2; }
.town-card.t1 { background: #2f4a5f; } .town-card.t2 { background: #4d6a85; } .town-card.t3 { background: #3c4a3e; } .town-card.t4 { background: #5a4636; }
.town-card.t5 { background: #24343f; } .town-card.t6 { background: #6b4f45; } .town-card.t7 { background: #36505a; } .town-card.t8 { background: #4a4a3a; }

/* ---------- Reviews ---------- */
.stars { color: var(--coral); letter-spacing: 3px; font-size: 1rem; }
.review { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 34px; display: flex; flex-direction: column; }
.review blockquote { margin: 14px 0 20px; font-family: var(--serif); font-size: 1.3rem; line-height: 1.4; }
.review p { color: var(--muted); font-size: .96rem; }
.review cite { margin-top: auto; font-style: normal; font-weight: 700; font-size: .9rem; }
.review cite small { display: block; font-weight: 400; color: var(--muted); margin-top: 2px; }
.section-dark .review { background: var(--ink-2); border-color: #2a2a2a; }
.section-dark .review blockquote { color: #fff; }
.section-dark .review cite { color: #fff; }
.rating-badges { display: flex; gap: 18px; flex-wrap: wrap; }
.rating-badge { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 24px; text-decoration: none; color: var(--text); background: #fff; min-width: 190px; }
.rating-badge strong { font-family: var(--serif); font-size: 2rem; font-weight: 400; display: block; line-height: 1; }
.rating-badge span { font-size: .85rem; color: var(--muted); }

.big-quote { font-family: var(--serif); font-size: clamp(1.6rem, 3.2vw, 2.4rem); line-height: 1.3; margin: 0 0 24px; }

/* ---------- Sales table / grid ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 26px; align-items: center; }
.filters select, .filters input { font: inherit; font-size: .95rem; padding: 12px 14px; border: 1px solid #cfc8bb; border-radius: var(--radius); background: #fff; min-width: 180px; }
.filters .count { margin-left: auto; color: var(--muted); font-size: .92rem; }
.sold-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 1000px) { .sold-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .sold-grid { grid-template-columns: 1fr; } .filters .count { margin-left: 0; width: 100%; } }
.sold-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; position: relative; }
.sold-card .tag { position: absolute; top: 20px; right: 20px; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 5px 9px; border-radius: 2px; background: var(--ink); color: #fff; }
.sold-card .tag.buyer { background: var(--slate); }
.sold-card .price { font-family: var(--serif); font-size: 1.75rem; line-height: 1.1; margin-bottom: 8px; }
.sold-card .addr { font-weight: 700; margin: 0; }
.sold-card .town { color: var(--muted); margin: 0 0 14px; font-size: .95rem; }
.sold-card .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .86rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.load-more { margin-top: 34px; text-align: center; }

.listing-empty { border: 1px solid var(--line); background: #fff; padding: 44px; border-radius: var(--radius); text-align: center; }

/* ---------- Team ---------- */
.team-card { text-align: center; }
.team-card .placeholder { aspect-ratio: 1/1; margin-bottom: 20px; }
.team-card h3 { margin-bottom: 4px; }
.team-card .role { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--coral); font-weight: 700; margin-bottom: 12px; }
.team-card p { color: var(--muted); font-size: .95rem; }

/* ---------- Blog ---------- */
.post-meta { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.article { padding: 80px 0 100px; }
.article h2 { font-size: 1.9rem; margin-top: 1.6em; }
.article h3 { margin-top: 1.4em; }
.article ul, .article ol { padding-left: 1.3em; margin-bottom: 1.2em; }
.article li { margin-bottom: .5em; }
.article table { width: 100%; border-collapse: collapse; margin: 1em 0 1.6em; font-size: .95rem; }
.article th, .article td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.article th { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.callout { background: var(--cream); border-left: 3px solid var(--coral); padding: 24px 28px; margin: 2em 0; border-radius: 0 var(--radius) var(--radius) 0; }
.callout p:last-child { margin-bottom: 0; }

/* ---------- Embedded town guides app ---------- */
.embed-bar { background: var(--ink-2); color: #fff; }
.embed-bar .container { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
.embed-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.embed-tabs button { font: inherit; font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; padding: 11px 16px; background: transparent; color: #ddd; border: 1px solid #3a3a3a; border-radius: var(--radius); cursor: pointer; }
.embed-tabs button[aria-pressed="true"] { background: var(--coral); border-color: var(--coral); color: #fff; }
.embed-bar a { color: var(--muted-on-dark); font-size: .85rem; }
.embed-hint { margin: 0; font-size: .95rem; color: #e6e6e6; }
.embed-hint strong { color: var(--coral); font-weight: 700; }
.app-frame { display: block; width: 100%; height: calc(100vh - 84px - 62px); min-height: 640px; border: 0; background: var(--cream); }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
label { display: block; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=tel], select, textarea {
  width: 100%; font: inherit; font-size: 1rem; padding: 14px 16px; border: 1px solid #cfc8bb; border-radius: var(--radius); background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--slate); outline-offset: 1px; border-color: var(--slate); }
textarea { min-height: 140px; resize: vertical; }
.consent { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.contact-list { list-style: none; padding: 0; margin: 0 0 30px; }
.contact-list li { padding: 16px 0; border-bottom: 1px solid #2a2a2a; }
.contact-list small { display: block; font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted-on-dark); margin-bottom: 4px; }
.contact-list a { color: #fff; text-decoration: none; font-size: 1.15rem; }
.contact-list a:hover { color: var(--coral); }

/* ---------- CTA band ---------- */
.cta-band { background: var(--slate); color: #fff; padding: 80px 0; text-align: center; }
.cta-band h2 { color: #fff; }
.cta-band p { color: #e6edf3; font-size: 1.15rem; max-width: 620px; margin: 0 auto 30px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #bdbdbd; padding: 80px 0 30px; font-size: .93rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { font-family: var(--sans); font-size: .74rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: #fff; margin-bottom: 18px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #d6d6d6; text-decoration: none; }
.site-footer a:hover { color: var(--coral); }
.footer-brand .brand-name { color: #fff; }
.footer-legal { border-top: 1px solid #262626; margin-top: 60px; padding-top: 26px; font-size: .78rem; color: #8d8d8d; line-height: 1.7; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.footer-legal a { color: #b0b0b0; text-decoration: underline; }
.eho { display: inline-flex; align-items: center; gap: 8px; }

/* Utility */
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; } .mt-2 { margin-top: 2rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
