/*
 * Tidewater Homes Realty demo: image-led, upmarket design.
 * Deep tidewater green, sand and brass; Cormorant display serif with Jost for text and labels.
 */

@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-latin-variable.woff2") format("woff2"); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant"; src: url("../fonts/cormorant-latin-variable-italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --deep: #11302e;
  --deep-2: #1b4542;
  --sand: #f2ede4;
  --sand-2: #e7dfd1;
  --white: #fffdf9;
  --ink: #1d2422;
  --muted: #5d6763;
  --brass: #b08d57;
  --brass-2: #94733f;
  --line: rgba(17, 48, 46, .14);
  --serif: "Cormorant", Georgia, "Times New Roman", serif;
  --sans: "Jost", "Segoe UI", Arial, sans-serif;
  --wrap: 1280px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--sand); color: var(--ink); font: 400 1.0625rem/1.65 var(--sans); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h1, h2 { font-family: var(--serif); letter-spacing: -0.01em; line-height: 1.02; }
h2 { font-size: clamp(2.3rem, 4.4vw, 3.8rem); }
h3 { font-family: var(--sans); font-size: 1.05rem; font-weight: 500; letter-spacing: .02em; }
em { font-style: italic; color: var(--brass-2); }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 56px); margin-inline: auto; }
.eyebrow { font-size: .76rem; letter-spacing: .24em; text-transform: uppercase; color: var(--brass-2); margin: 0 0 16px; font-weight: 500; }
.lead { font-size: 1.2rem; line-height: 1.6; color: var(--muted); }
main { overflow-x: clip; }

.skip-link { position: absolute; left: -9999px; top: 0; background: var(--deep); color: var(--white); padding: 10px 14px; z-index: 2000; }
.skip-link:focus { left: 12px; top: 12px; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 16px 30px; font: 500 .82rem/1 var(--sans); letter-spacing: .18em; text-transform: uppercase; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: background .25s ease, color .25s ease, border-color .25s ease; }
.btn-deep { background: var(--deep); color: var(--white); }
.btn-deep:hover { background: var(--brass-2); }
.btn-brass { background: var(--brass); color: var(--deep); }
.btn-brass:hover { background: var(--white); }
.text-link { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--brass); padding-bottom: 4px; white-space: nowrap; }
.text-link:hover { color: var(--brass-2); }

/* Header: sits over the photo on the home page, solid elsewhere */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--deep); color: var(--white); transition: background .35s ease, box-shadow .35s ease; }
.home .site-header { background: transparent; }
.home .site-header.is-solid { background: var(--deep); box-shadow: 0 10px 30px rgba(0, 0, 0, .18); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 84px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-name { font-family: var(--serif); font-size: 1.7rem; font-weight: 500; line-height: .9; display: flex; flex-direction: column; }
.brand-name small { font-family: var(--sans); font-size: .62rem; letter-spacing: .3em; text-transform: uppercase; margin-top: 6px; color: var(--brass); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 34px; }
.main-nav a { text-decoration: none; font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; padding: 6px 0; border-bottom: 1px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-bottom-color: var(--brass); }
.main-nav .nav-cta a { border: 1px solid var(--brass); padding: 12px 18px; }
.main-nav .nav-cta a:hover { background: var(--brass); color: var(--deep); }
.nav-toggle { display: none; align-items: center; gap: 10px; background: none; border: 1px solid rgba(255, 255, 255, .5); color: var(--white); padding: 10px 14px; font: 500 .78rem var(--sans); letter-spacing: .16em; text-transform: uppercase; cursor: pointer; }
.nav-toggle .bars { width: 18px; height: 10px; border-top: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }

/* Home hero: full-bleed photograph */
.hero { position: relative; min-height: min(92vh, 860px); margin-top: -84px; display: flex; align-items: flex-end; color: var(--white); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 30, 29, .62) 0%, rgba(10, 30, 29, .35) 45%, transparent 75%), linear-gradient(180deg, rgba(10, 30, 29, .55) 0%, rgba(10, 30, 29, .05) 30%, rgba(10, 30, 29, .25) 55%, rgba(10, 30, 29, .85) 100%); }
.hero-content { position: relative; z-index: 1; padding: 160px 0 72px; }
.hero .eyebrow { color: var(--sand-2); }
.hero h1 { font-size: clamp(2.9rem, 6.6vw, 6.4rem); font-weight: 400; max-width: 13em; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.hero h1 em { color: #e5c99a; }
.quick-search { margin-top: 40px; display: inline-flex; flex-wrap: wrap; align-items: center; background: rgba(255, 253, 249, .96); color: var(--deep); }
.quick-search span { padding: 18px 22px; font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); }
.quick-search a { padding: 18px 22px; text-decoration: none; font-size: .95rem; border-right: 1px solid var(--line); transition: background .2s ease; }
.quick-search a:hover { background: var(--sand-2); }
.quick-search a.all { background: var(--deep); color: var(--white); border: 0; }
.quick-search a.all:hover { background: var(--brass-2); }
@media (prefers-reduced-motion: no-preference) {
  .hero-img { animation: drift 18s ease-out both; }
  .hero-content > * { animation: up 1s cubic-bezier(.2, .7, .2, 1) both; }
  .hero-content > *:nth-child(2) { animation-delay: .12s; }
  .hero-content > *:nth-child(3) { animation-delay: .24s; }
  @keyframes drift { from { transform: scale(1.08); } to { transform: scale(1); } }
  @keyframes up { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
}

/* Sections */
.section { padding: 110px 0; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 48px; }

/* Listing cards */
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px 32px; }
.listing-card { background: var(--white); display: flex; flex-direction: column; transition: transform .35s ease, box-shadow .35s ease; }
.listing-card:hover { transform: translateY(-4px); box-shadow: 0 24px 50px rgba(17, 48, 46, .12); }
.listing-card[hidden] { display: none; }
.card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s ease; }
.listing-card:hover .card-media img { transform: scale(1.05); }
.tag { position: absolute; left: 16px; top: 16px; background: var(--white); color: var(--deep); font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; padding: 7px 10px; }
.card-body { padding: 24px 26px 28px; display: flex; flex-direction: column; flex: 1; }
.card-area { font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.card-body h3 { font-family: var(--serif); font-size: 1.9rem; font-weight: 500; letter-spacing: 0; line-height: 1.05; }
.card-body h3 a { text-decoration: none; }
.card-price { font-size: 1.15rem; color: var(--deep); margin: 10px 0 12px; font-weight: 500; }
.facts { list-style: none; margin: 0 0 14px; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; color: var(--muted); }
.card-summary { font-size: .95rem; color: var(--muted); }
.card-link { margin-top: auto; align-self: flex-start; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; text-decoration: none; border-bottom: 1px solid var(--brass); padding-bottom: 3px; }
.card-link:hover { color: var(--brass-2); }

/* Buying and selling band */
.intro-band { background: var(--white); padding: 110px 0; }
.intro-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 80px; align-items: center; }
.intro-figure { margin: 0; position: relative; }
.intro-figure::before { content: ""; position: absolute; inset: 28px -28px -28px 28px; border: 1px solid var(--brass); z-index: 0; }
.intro-figure img { position: relative; z-index: 1; aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.intro-copy h2 { margin-bottom: 22px; }
.intro-copy > p { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 32px 0 36px; }
.two-col h3 { margin-bottom: 10px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { padding: 8px 0 8px 22px; position: relative; border-bottom: 1px solid var(--line); font-size: .97rem; color: var(--muted); }
.dash-list li::before { content: ""; position: absolute; left: 0; top: 19px; width: 12px; height: 1px; background: var(--brass); }

/* Neighbourhood mosaic */
.hood-grid { display: grid; grid-template-columns: 1.4fr 1fr; grid-template-rows: 280px 280px; gap: 20px; }
.hood { position: relative; overflow: hidden; display: block; text-decoration: none; color: var(--white); }
.hood.big { grid-row: 1 / 3; }
.hood img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.hood:hover img { transform: scale(1.06); }
.hood::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 30, 29, .78)); }
.hood span { position: absolute; left: 26px; right: 26px; bottom: 22px; z-index: 1; font-size: .92rem; }
.hood strong { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 500; line-height: 1.1; }

.cta { background: var(--deep); color: var(--white); padding: 110px 0; text-align: center; }
.cta-inner h2 { margin-bottom: 14px; }
.cta-inner p { color: rgba(255, 253, 249, .78); margin-bottom: 32px; }

/* Inner page hero */
.page-hero { background: var(--deep); color: var(--white); padding: 90px 0 80px; }
.page-hero h1 { font-size: clamp(2.8rem, 6vw, 5.4rem); font-weight: 400; margin-bottom: 18px; }
.page-hero h1 em { color: #e5c99a; }
.page-hero .lead { color: rgba(255, 253, 249, .78); max-width: 36em; margin: 0; }
.page-hero .eyebrow { color: var(--brass); }
.image-hero { position: relative; min-height: 520px; display: flex; align-items: flex-end; overflow: hidden; }
.image-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.image-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 30, 29, .15), rgba(10, 30, 29, .8)); }
.image-hero .wrap { position: relative; z-index: 1; }

/* Listings page */
.listings-section { padding-top: 56px; }
.filters { display: grid; grid-template-columns: repeat(4, 1fr) auto; gap: 18px; align-items: end; background: var(--white); padding: 24px; margin-bottom: 22px; box-shadow: 0 12px 40px rgba(17, 48, 46, .06); }
.filter { display: flex; flex-direction: column; gap: 8px; }
.filter label, .field label { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.filter select { font: 400 1rem var(--sans); color: var(--ink); background: var(--sand); border: 1px solid var(--line); padding: 12px; border-radius: 0; }
.reset { background: none; border: 0; border-bottom: 1px solid var(--brass); font: 500 .74rem var(--sans); letter-spacing: .18em; text-transform: uppercase; color: var(--deep); padding: 4px 0; margin-bottom: 12px; cursor: pointer; }
.result-count { font-size: .9rem; color: var(--muted); margin-bottom: 26px; }
.no-results { padding: 40px; text-align: center; background: var(--white); color: var(--muted); }

/* Listing detail */
.detail-head { padding: 48px 0 28px; }
.crumbs { font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.crumbs a { color: var(--deep); }
.detail-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.detail-title h1 { font-size: clamp(2.8rem, 6vw, 5rem); font-weight: 400; }
.detail-price { font-family: var(--serif); font-size: clamp(1.8rem, 3vw, 2.6rem); color: var(--deep); margin: 0; white-space: nowrap; }
.gallery { display: grid; grid-template-columns: 1fr 140px; gap: 16px; }
.gallery-main { margin: 0; position: relative; background: var(--deep); aspect-ratio: 16 / 10; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main figcaption { position: absolute; right: 16px; bottom: 16px; background: rgba(17, 48, 46, .82); color: var(--white); font-size: .78rem; letter-spacing: .12em; padding: 6px 10px; }
.gallery-thumbs { display: flex; flex-direction: column; gap: 12px; }
.thumb { padding: 0; border: 2px solid transparent; background: none; cursor: pointer; flex: 1; min-height: 0; overflow: hidden; opacity: .7; transition: opacity .2s ease, border-color .2s ease; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb:hover, .thumb[aria-current="true"] { opacity: 1; border-color: var(--brass); }
.detail-body { padding-top: 64px; }
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 72px; align-items: start; }
.key-facts { list-style: none; margin: 0 0 48px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.key-facts li { padding: 20px 0; font-size: .74rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.key-facts li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.key-facts span { display: block; font-family: var(--serif); font-size: 2.4rem; letter-spacing: 0; text-transform: none; color: var(--deep); line-height: 1.1; }
.detail-grid h2 { margin-bottom: 18px; }
.detail-grid h3 { margin: 36px 0 14px; }
.feature-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; }
.feature-list li { padding: 10px 0 10px 22px; border-bottom: 1px solid var(--line); position: relative; }
.feature-list li::before { content: ""; position: absolute; left: 0; top: 21px; width: 12px; height: 1px; background: var(--brass); }
.viewing-card { background: var(--white); padding: 34px; position: sticky; top: 110px; border-top: 3px solid var(--brass); scroll-margin-top: 110px; }
.viewing-card h2 { font-size: 2.2rem; margin-bottom: 8px; }
.viewing-card > p { color: var(--muted); }
.viewing-card .field { margin-bottom: 16px; }
.viewing-card .btn { width: 100%; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 8px; }
.field.full { grid-column: 1 / -1; }
.field label span { text-transform: none; letter-spacing: 0; }
.field input, .field select, .field textarea { font: 400 1rem var(--sans); color: var(--ink); background: var(--sand); border: 1px solid var(--line); padding: 13px 14px; border-radius: 0; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brass); background: var(--white); }
.was-checked :invalid { border-color: #b3261e; }
.form-note { font-size: .86rem; color: var(--muted); margin: 14px 0 0; }

/* About */
.about-grid { display: grid; grid-template-columns: 5fr 7fr; gap: 72px; align-items: center; }
.about-grid figure { margin: 0; }
.about-grid figure img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }
.about-buyers h2 { margin-bottom: 20px; }
.about-buyers p { color: var(--muted); margin-bottom: 30px; }
.steps-band { background: var(--deep); color: var(--white); padding: 100px 0; }
.steps-band .eyebrow { color: var(--brass); }
.steps { list-style: none; margin: 30px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.steps li { border-top: 1px solid rgba(255, 253, 249, .25); padding-top: 24px; }
.steps span { font-family: var(--serif); font-size: 2.6rem; color: var(--brass); line-height: 1; }
.steps h3 { margin: 14px 0 8px; font-size: 1.1rem; }
.steps p { color: rgba(255, 253, 249, .75); font-size: .97rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 64px; align-items: start; }
.contact-card { background: var(--white); padding: 44px; scroll-margin-top: 110px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 26px; }
.contact-side dl { margin: 0 0 28px; }
.contact-side dl > div { padding: 16px 0; border-bottom: 1px solid var(--line); }
.contact-side dt { font-size: .7rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.contact-side dd { margin: 0; overflow-wrap: anywhere; font-size: 1.05rem; }
.contact-figure { margin: 0; }
.contact-figure img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* Footer */
.site-footer { background: #0b2220; color: rgba(255, 253, 249, .78); padding: 90px 0 36px; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 32px; padding-bottom: 56px; border-bottom: 1px solid rgba(255, 253, 249, .14); }
.footer-line { font-family: var(--serif); font-size: clamp(1.9rem, 3.4vw, 3rem); color: var(--white); line-height: 1.1; margin: 0; max-width: 18em; }
.footer-line em { color: #e5c99a; }
.footer-grid { display: grid; grid-template-columns: 2fr 1.4fr 1.4fr 1fr; gap: 36px; padding: 48px 0; }
.footer-brand { font-family: var(--serif); font-size: 1.6rem; color: var(--white); margin-bottom: 8px; }
.site-footer h3 { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--brass); margin-bottom: 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { text-decoration: none; overflow-wrap: anywhere; }
.site-footer a:hover { color: var(--white); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .84rem; border-top: 1px solid rgba(255, 253, 249, .14); padding-top: 24px; }

/* Fade-in on scroll (only when JavaScript runs and motion is welcome) */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(30px); transition: opacity .9s ease, transform .9s cubic-bezier(.2, .7, .2, 1); }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}

/* Tablet */
@media (max-width: 1040px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--deep); display: none; padding: 8px 28px 28px; }
  .main-nav.is-open { display: block; }
  .home .site-header:has(.main-nav.is-open) { background: var(--deep); }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .main-nav li a { display: block; padding: 14px 0; border-bottom: 1px solid rgba(255, 253, 249, .12); }
  .main-nav .nav-cta a { margin-top: 18px; text-align: center; }
  .card-grid { grid-template-columns: 1fr 1fr; }
  .intro-grid, .about-grid, .contact-grid, .detail-grid { grid-template-columns: 1fr; gap: 56px; }
  .intro-figure { max-width: 520px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .reset { justify-self: start; }
  .steps { grid-template-columns: 1fr 1fr; }
  .viewing-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { flex-direction: column; align-items: flex-start; }
}

/* Phone */
@media (max-width: 640px) {
  body { font-size: 1rem; }
  .wrap { width: min(var(--wrap), 100% - 32px); }
  .header-inner { min-height: 72px; }
  .hero { margin-top: -72px; min-height: 640px; }
  .hero-content { padding: 130px 0 40px; }
  .quick-search { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .quick-search span { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .quick-search a { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .section, .intro-band, .cta { padding: 72px 0; }
  .section-head { flex-direction: column; align-items: flex-start; }
  .card-grid, .two-col, .form-grid, .feature-list, .filters, .steps { grid-template-columns: 1fr; }
  .intro-figure::before { inset: 16px -12px -16px 12px; }
  .hood-grid { grid-template-columns: 1fr; grid-template-rows: 300px 220px 220px; }
  .hood.big { grid-row: auto; }
  .gallery { grid-template-columns: 1fr; }
  .gallery-thumbs { flex-direction: row; height: 64px; }
  .key-facts { grid-template-columns: 1fr 1fr; }
  .key-facts li:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .key-facts li:nth-child(4) { border-top: 1px solid var(--line); }
  .detail-title { flex-direction: column; align-items: flex-start; }
  .contact-card, .viewing-card { padding: 26px 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
}
