/* ==========================================================================
   Design tokens — v2, full overhaul
   Subject: mother/son real estate team, Amity–Salem OR (Willamette Valley).
   Aesthetic: classic ranch brand / western heritage mark — leather, iron,
   rawhide, pasture green, wheat gold — with a handwritten signature touch
   layered onto clean structure. Signature motif: post-and-rail fence line.
   ========================================================================== */

:root {
  /* Color — heritage ranch-brand palette */
  --rawhide: #f2e6c8;    /* page background — sun-bleached rawhide */
  --parchment: #fffbf0;  /* card / surface background */
  --leather: #6b4226;    /* saddle-leather brown — headlines, brand ink */
  --iron: #2b2620;       /* near-black — footer, deep accents, brand mark */
  --pasture: #5b6b4c;    /* muted pasture green — accents, icons */
  --wheat: #c69a54;      /* sun-faded wheat gold — secondary accent */
  --sky: #8ea7b2;        /* dusty blue — accents, gradient washes */
  --rust: #9c4a34;       /* barn-red — primary accent, CTAs */
  --tan: #e8dcbd;        /* soft tan — card fills, dividers */
  --ink: #332c22;        /* body text */

  /* Golden-hour gradient wash — hero / feature sections */
  --golden-hour: linear-gradient(180deg, #9fb2ba 0%, #d3c191 55%, #cf9c68 100%);

  /* Type — three registers: bold heritage display, quiet serif for
     secondary headings, clean sans for body, script for signature
     accents, mono for structured/ledger-style labels */
  --font-display: "Rye", "Impact", sans-serif;
  --font-serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Work Sans", -apple-system, "Segoe UI", sans-serif;
  --font-script: "Caveat", cursive;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

  /* Scale */
  --step-0: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --step-1: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --step-2: clamp(1.9rem, 1.6rem + 1.2vw, 2.5rem);
  --step-3: clamp(2.5rem, 2rem + 1.8vw, 3.75rem);
  --step-4: clamp(3.25rem, 2.5rem + 3vw, 5.25rem);

  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.75rem;
  --space-4: 3rem;
  --space-5: 5rem;
  --space-6: 8rem;

  --radius: 3px;
  --max-w: 1180px;
}

/* ==========================================================================
   Reset / base
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--rawhide);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: 0.02em;
  margin: 0 0 var(--space-2);
  color: var(--leather);
}

h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 var(--space-2);
  color: var(--leather);
}

h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 var(--space-2); }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rust);
  display: inline-block;
  margin-bottom: var(--space-1);
}

/* Script accent — for the handwritten, personal touches: signatures,
   small kickers, attributions. Used sparingly, never for body copy. */
.script {
  font-family: var(--font-script);
  font-weight: 600;
  font-size: 1.35em;
  color: var(--rust);
  line-height: 1;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-3);
}

:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Header / nav
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--rawhide);
  border-bottom: 2px solid var(--leather);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 88px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7em;
  text-decoration: none;
  line-height: 1.1;
}

.brand-mark {
  width: 42px;
  height: 42px;
  color: var(--leather);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--leather);
}

.brand-text small {
  font-family: var(--font-script);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--rust);
  margin-top: -4px;
}

.main-nav { display: flex; align-items: center; gap: var(--space-4); }
.main-nav ul { list-style: none; display: flex; gap: var(--space-3); margin: 0; padding: 0; }

.main-nav a {
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.4em 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

.nav-toggle { display: none; }

@media (max-width: 760px) {
  .main-nav ul { display: none; }
  .nav-toggle {
    display: inline-flex;
    background: none;
    border: 1px solid var(--leather);
    border-radius: var(--radius);
    padding: 0.5em 0.8em;
    font-family: var(--font-mono);
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Buttons — stamped-ticket feel: sharp corners, tracked uppercase type
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.9em 1.7em;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-primary { background: var(--rust); color: var(--parchment); border-color: var(--rust); }
.btn-primary:hover { background: #833a28; transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--leather); border-color: var(--leather); }
.btn-ghost:hover { background: var(--leather); color: var(--parchment); }

/* ==========================================================================
   Fence-line divider — signature element
   Post-and-rail fence silhouette, standing in for the working farms and
   pastures along the back roads between Amity and Salem. Used between
   major sections in place of the old hill-contour motif.
   ========================================================================== */

.fence-divider {
  width: 100%;
  height: 46px;
  display: block;
  color: var(--leather);
  opacity: 0.55;
}

.fence-divider.flip { transform: scaleY(-1); }

.hero-fence-base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  color: var(--iron);
  opacity: 0.55;
  z-index: 1;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  padding: var(--space-6) 0 var(--space-5);
  position: relative;
  overflow: hidden;
  background: var(--golden-hour);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--rawhide);
  opacity: 0.68;
  pointer-events: none;
}

.hero .wrap {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: var(--space-5);
  align-items: center;
}

.hero h1 { margin-bottom: var(--space-2); }
.hero .lede { font-size: var(--step-1); max-width: 46ch; color: #4a4030; }
.hero .cta-row { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; }

.hero-portrait {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--leather);
  box-shadow: 6px 6px 0 rgba(107,66,38,0.15);
}

.hero-fence-base {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40px;
  color: var(--iron);
  opacity: 0.5;
  z-index: 1;
}

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-portrait { order: -1; max-width: 340px; }
}

/* ==========================================================================
   Sections
   ========================================================================== */

section { padding: var(--space-5) 0; }
section.tight { padding: var(--space-4) 0; }
.section-head { max-width: 62ch; margin-bottom: var(--space-4); }

.bg-mist { background: var(--tan); }
.bg-vine { background: var(--iron); color: var(--rawhide); }
.bg-vine h2, .bg-vine h3 { color: var(--rawhide); }

/* Golden-hour section background — alternative to bg-vine for CTA/feature
   sections that want the sun-faded wash instead of solid iron-dark */
.bg-golden {
  background: var(--golden-hour);
  color: var(--ink);
}
.bg-golden h2, .bg-golden h3 { color: var(--leather); }

/* Faint wheat-row texture — thin repeating diagonal strokes, evoking a
   field without literally depicting one. Layer onto any solid section. */
.bg-wheat-texture {
  background-image: repeating-linear-gradient(
    115deg,
    rgba(198,154,84,0.12) 0px,
    rgba(198,154,84,0.12) 2px,
    transparent 2px,
    transparent 14px
  );
}

/* Drop-in slot for real photography once it's shot/licensed — apply
   alongside an element with a fixed height (like .hero-portrait or
   .duo-photo) and set --photo-src via an inline style:
   style="--photo-src: url('/images/whatever.jpg')"
   Falls back to nothing (shows the .ph placeholder beneath) if unset. */
.photo-bg {
  background-image: var(--photo-src, none);
  background-size: cover;
  background-position: center;
}

/* ==========================================================================
   Grids / cards
   ========================================================================== */

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }

@media (max-width: 860px) {
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}

/* Cards read like a stamped ticket or seal: sharp corners, a hard
   leather-toned border, and a small offset shadow instead of a soft blur. */
.card {
  background: var(--parchment);
  border: 1.5px solid rgba(107,66,38,0.25);
  box-shadow: 4px 4px 0 rgba(107,66,38,0.08);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
  box-shadow: 6px 6px 0 rgba(107,66,38,0.14);
  transform: translate(-2px, -2px);
}

.card-body { padding: var(--space-3); }
.card h3 { margin-bottom: 0.35em; }

/* Listings */

.listing-photo { aspect-ratio: 4/3; background: var(--tan); position: relative; }

.listing-tag {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  background: var(--iron);
  color: var(--rawhide);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3em 0.7em;
  border-radius: 2px;
}

.listing-price {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 400;
  color: var(--rust);
  margin-bottom: 0.1em;
}

.listing-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #6b5d47;
  display: flex;
  gap: 1em;
  margin-top: var(--space-1);
}

.listing-mls {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #8a7c5e;
  margin-top: var(--space-2);
}

/* Testimonials — quotes styled like a warm, handwritten note rather than
   a formal pull-quote; attribution signed in script */

.testimonial { border-left: 3px solid var(--rust); padding-left: var(--space-3); }
.testimonial p.quote { font-family: var(--font-serif); font-size: var(--step-1); font-style: italic; color: var(--leather); }
.testimonial .attribution { font-family: var(--font-script); font-size: 1.3rem; font-weight: 600; color: var(--rust); }
.stars { color: var(--wheat); letter-spacing: 0.15em; margin-bottom: var(--space-1); }

/* Team / about */

.duo-photo {
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--leather);
  box-shadow: 6px 6px 0 rgba(107,66,38,0.15);
}

/* "Since [Year]" ranch-seal badge — double ring, stamped look */
.badge-since {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--rust);
  outline: 1px solid var(--rust);
  outline-offset: 3px;
  color: var(--rust);
  border-radius: 999px;
  padding: 0.5em 1.1em;
}

/* Forms */

.form-field { margin-bottom: var(--space-3); }
.form-field label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5em;
  color: var(--leather);
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.75em 0.9em;
  border: 1.5px solid rgba(107,66,38,0.35);
  border-radius: var(--radius);
  background: var(--parchment);
  color: var(--ink);
}

.form-field textarea { resize: vertical; min-height: 120px; }

/* Placeholder image blocks (swap for real photos) */

.ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: repeating-linear-gradient(135deg, var(--tan), var(--tan) 10px, #ded0a8 10px, #ded0a8 20px);
  color: var(--leather);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-2);
}

/* ==========================================================================
   Footer — dark iron/leather, like a branding sign at the property line
   ========================================================================== */

.site-footer {
  background: var(--iron);
  color: var(--rawhide);
  padding: var(--space-4) 0 var(--space-3);
  border-top: 4px solid var(--rust);
}

.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.site-footer a { text-decoration: none; opacity: 0.85; }
.site-footer a:hover { opacity: 1; text-decoration: underline; }
.site-footer .legal { font-family: var(--font-mono); font-size: 0.72rem; opacity: 0.65; margin-top: var(--space-3); }

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--wheat);
  margin-bottom: var(--space-1);
}

.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4em; }
