/* ============================================================
   Perry Anderson Real Estate
   Brand: champagne gold on charcoal. Display serif + Switzer.
   ============================================================ */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);

  /* Spacing */
  --space-1: 0.25rem;  --space-2: 0.5rem;   --space-3: 0.75rem;
  --space-4: 1rem;     --space-5: 1.25rem;  --space-6: 1.5rem;
  --space-8: 2rem;     --space-10: 2.5rem;  --space-12: 3rem;
  --space-16: 4rem;    --space-20: 5rem;    --space-24: 6rem;
  --space-32: 8rem;

  /* Fonts */
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Switzer', 'Inter', system-ui, sans-serif;

  --radius: 3px;
  --radius-lg: 6px;
  --shell: 1200px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Brand constant */
  --gold-brand: #c29c4f;
}

/* ---------- Dark (default, brand-native) ---------- */
:root, [data-theme='dark'] {
  --bg: #232221;
  --bg-alt: #1d1c1b;
  --surface: #2c2b29;
  --surface-2: #343230;
  --line: #413e3a;
  --line-soft: #373532;
  --ink: #ece7de;
  --ink-soft: #b8b1a6;
  --ink-mute: #8e877d;
  --gold: #cfa960;
  --gold-soft: #e0c48d;
  --on-gold: #211f1d;
  --scrim-a: rgba(24, 23, 22, 0.32);
  --scrim-b: rgba(24, 23, 22, 0.88);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

/* ---------- Light ---------- */
[data-theme='light'] {
  --bg: #f8f5f0;
  --bg-alt: #f1ece4;
  --surface: #ffffff;
  --surface-2: #faf7f2;
  --line: #ddd5c8;
  --line-soft: #e7e0d5;
  --ink: #26241f;
  --ink-soft: #55504a;
  --ink-mute: #726b62;
  --gold: #8a6a24;
  --gold-soft: #6f5419;
  --on-gold: #ffffff;
  --scrim-a: rgba(22, 21, 20, 0.30);
  --scrim-b: rgba(22, 21, 20, 0.86);
  --shadow: 0 16px 40px rgba(60, 50, 32, 0.12);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

:where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: var(--space-4); top: -100px; z-index: 200;
  background: var(--gold); color: var(--on-gold);
  padding: var(--space-3) var(--space-5); border-radius: var(--radius);
  font-size: var(--text-sm); font-weight: 500;
  transition: top 0.2s var(--ease);
}
.skip:focus { top: var(--space-4); }

.shell {
  width: 100%; max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 5vw, var(--space-12));
}

/* ---------- Type ---------- */
h1, h2, h3 { font-weight: 400; line-height: 1.12; letter-spacing: -0.01em; }

h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  max-width: 19ch;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  max-width: 26ch;
  margin-bottom: var(--space-5);
}
.eyebrow {
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
}
.lede {
  font-size: var(--text-base);
  color: var(--ink-soft);
  max-width: 62ch;
}
.prose p { color: var(--ink-soft); max-width: 62ch; }
.prose p + p { margin-top: var(--space-4); }
.reg { font-size: 0.45em; vertical-align: super; letter-spacing: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease);
}
.site-header.is-scrolled { border-bottom-color: var(--line-soft); }

.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  padding-block: var(--space-3);
}
.brand img { width: clamp(108px, 11vw, 138px); height: auto; }
[data-theme='light'] .brand img,
[data-theme='light'] .footer-brand img { filter: brightness(0.8) saturate(1.2); }

.nav { display: flex; align-items: center; gap: var(--space-6); }
.nav a {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  position: relative;
  padding-block: var(--space-1);
  transition: color 0.2s var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--gold);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.3s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); }

.nav-phone {
  display: inline-flex; align-items: center; gap: var(--space-2);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.nav-phone svg { width: 15px; height: 15px; color: var(--gold); }
.nav-cta {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-2) var(--space-4) !important;
  color: var(--gold) !important;
}
.nav-cta::after { display: none; }
.nav-cta:hover { background: var(--surface); border-color: var(--gold); }

.header-tools { display: flex; align-items: center; gap: var(--space-2); }
.icon-btn {
  display: grid; place-items: center;
  width: 38px; height: 38px;
  background: none; border: 1px solid var(--line-soft);
  border-radius: var(--radius); color: var(--ink-soft);
  cursor: pointer;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.icon-btn:hover { color: var(--gold); border-color: var(--gold); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }

[data-theme='dark'] .i-sun { display: none; }
[data-theme='light'] .i-moon { display: none; }

.mobile-nav[hidden] { display: none !important; }
.mobile-nav {
  display: grid;
  border-top: 1px solid var(--line-soft);
  padding: var(--space-2) clamp(var(--space-5), 5vw, var(--space-12)) var(--space-5);
}
.mobile-nav a {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}
.mobile-nav a:last-child { border-bottom: 0; color: var(--gold); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--text-sm); font-weight: 500;
  letter-spacing: 0.02em;
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
              border-color 0.25s var(--ease), color 0.25s var(--ease);
}
.btn-primary { background: var(--gold); color: var(--on-gold); }
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-2px); }
.btn-ghost { border-color: rgba(255, 255, 255, 0.34); color: #f3efe7; }
.btn-ghost:hover { border-color: #fff; background: rgba(255, 255, 255, 0.1); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: min(76vh, 760px);
  display: flex; align-items: flex-end;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 62% center;
}
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--scrim-b) 0%, var(--scrim-a) 58%, rgba(24,23,22,0.14) 100%),
    linear-gradient(to left, rgba(20,19,18,0.74) 0%, rgba(20,19,18,0.34) 42%, rgba(20,19,18,0) 66%);
}
.hero-inner {
  position: relative;
  display: flex;
  justify-content: flex-end;
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
  color: #f4f0e8;
}
.hero-copy { max-width: min(52ch, 54%); }
/* The hero always sits on a dark photograph, so its colours are fixed
   rather than theme-derived. */
.hero-inner .eyebrow { color: #e3c893; }
.hero .btn-primary { background: #cfa960; color: #211f1d; }
.hero .btn-primary:hover { background: #e3c893; }
.hero-inner h1 { color: #fbf8f2; text-shadow: 0 2px 22px rgba(0, 0, 0, 0.42); }
.hero-sub {
  margin-top: var(--space-5);
  max-width: 50ch;
  color: #ded8cd;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  margin-top: var(--space-8);
}

/* ---------- Sections ---------- */
.section { padding-block: clamp(var(--space-16), 9vw, var(--space-32)); }
.section-alt { background: var(--bg-alt); }

/* Approach cards */
.cards {
  list-style: none; padding: 0;
  margin-top: var(--space-12);
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 268px), 1fr));
  counter-reset: none;
}
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}
.card:hover { transform: translateY(-4px); border-color: var(--gold); }
.card-num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold);
  margin-bottom: var(--space-4);
}
.card h3 {
  font-size: var(--text-lg);
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-3);
}
.card p { color: var(--ink-soft); font-size: var(--text-sm); }
@media (min-width: 760px) { .cards-4 { grid-template-columns: repeat(2, 1fr); } }
.section-alt .card { background: var(--bg); }
.buyers-foot {
  margin-top: var(--space-10);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--space-6);
  padding-top: var(--space-8);
  border-top: 1px solid var(--line-soft);
}
.buyers-foot p { color: var(--ink-soft); max-width: 60ch; }
.buyers-foot strong { color: var(--ink); font-weight: 600; }

/* Full-bleed quote */
.bleed { position: relative; display: grid; place-items: center; overflow: hidden; }
.bleed img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.bleed-scrim { position: absolute; inset: 0; background: rgba(22, 21, 19, 0.62); }
.bleed-quote {
  position: relative;
  max-width: 44ch;
  text-align: center;
  padding: clamp(var(--space-20), 13vw, var(--space-32)) var(--space-6);
}
.bleed-quote p {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: 1.3;
  color: #f6f2ea;
}
.bleed-quote cite {
  display: block;
  margin-top: var(--space-5);
  font-family: var(--font-body);
  font-style: normal;
  font-size: var(--text-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #e0c48d;
}

/* About split */
.split {
  display: grid; gap: clamp(var(--space-8), 5vw, var(--space-16));
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  align-items: start;
}
.portrait { margin: 0; }
.portrait img {
  width: 100%;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-soft);
}
.facts {
  margin-top: var(--space-10);
  display: grid; gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid var(--line-soft);
  padding-top: var(--space-8);
}
.facts dt {
  font-size: var(--text-xs);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--space-2);
}
.facts dd { margin: 0; font-size: var(--text-sm); color: var(--ink); }

/* Team */
.team-grid {
  margin-top: var(--space-10);
  display: grid; gap: clamp(var(--space-8), 5vw, var(--space-16));
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}
.team-list { list-style: none; padding: 0; display: grid; gap: var(--space-5); }
.team-list li {
  font-size: var(--text-sm);
  color: var(--ink-soft);
  border-left: 1px solid var(--gold);
  padding-left: var(--space-5);
}
.team-list span {
  display: block;
  color: var(--ink);
  font-weight: 500;
  margin-bottom: var(--space-1);
}

/* ---------- Form ---------- */
.form-wrap {
  display: grid; gap: clamp(var(--space-10), 5vw, var(--space-16));
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.disclosure {
  margin-top: var(--space-6);
  padding-left: var(--space-5);
  border-left: 1px solid var(--gold);
  font-size: var(--text-sm);
  color: var(--ink-mute);
}
/* Direct contact block beside the form */
.direct {
  margin-top: var(--space-10);
  padding-top: var(--space-8);
  border-top: 1px solid var(--line-soft);
  display: grid; gap: var(--space-3);
  justify-items: start;
}
.direct-label {
  font-size: var(--text-xs);
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-mute);
}
.direct-link {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-lg);
  font-family: var(--font-display);
  color: var(--ink);
  transition: color 0.2s var(--ease);
  word-break: break-word;
}
.direct-link svg {
  width: 18px; height: 18px; flex: 0 0 auto;
  color: var(--gold);
}
.direct-link:hover { color: var(--gold); }

.form-note {
  margin-top: var(--space-6);
  font-size: var(--text-xs);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
}
.card-surface {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-6), 3.5vw, var(--space-10));
  box-shadow: var(--shadow);
}
.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: var(--space-2); min-width: 0; align-content: start; }
.field-row {
  display: grid; gap: var(--space-5); align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
}
.field label {
  font-size: var(--text-xs);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
}
.req { color: var(--gold); }

/* Buy / sell / both selector */
.intent { border: 0; padding: 0; margin: 0; }
.intent legend {
  padding: 0;
  font-size: var(--text-xs);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: var(--space-3);
}
.radio-row {
  display: grid; gap: var(--space-2);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.intent label.radio {
  display: flex; align-items: center; gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: var(--space-3) var(--space-3);
  font-size: var(--text-sm);
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.intent label.radio:hover { border-color: var(--gold); }
.radio > input[type='radio'] {
  appearance: none;
  width: 15px; height: 15px; flex: 0 0 auto;
  min-width: 0; padding: 0; margin: 0;
  background: none;
  border: 1px solid var(--ink-mute);
  border-radius: 50%;
  display: grid; place-content: center;
  cursor: pointer;
}
.radio > input[type='radio']::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  transform: scale(0);
  transition: transform 0.18s var(--ease);
}
.radio > input[type='radio']:checked { border-color: var(--gold); }
.radio > input[type='radio']:checked::after { transform: scale(1); }
.radio:has(input:checked) { border-color: var(--gold); color: var(--ink); }

.field input, .field select, .field textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.field textarea { resize: vertical; min-height: 84px; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-mute); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--gold); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--gold);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--gold) 22%, transparent);
}
.select-wrap { position: relative; display: grid; }
.select-wrap select { appearance: none; padding-right: var(--space-10); cursor: pointer; }
.select-wrap svg {
  position: absolute; right: var(--space-4); top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--ink-mute); pointer-events: none;
}

.err { font-size: var(--text-xs); color: #e2795f; min-height: 0; }
[data-theme='light'] .err { color: #b4432a; }
.field.has-error input, .field.has-error select { border-color: #e2795f; }

.fine { font-size: var(--text-xs); color: var(--ink-mute); text-align: center; }

.form-status {
  border-radius: var(--radius);
  padding: var(--space-4) var(--space-5);
  font-size: var(--text-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.form-status.is-ok { border-color: var(--gold); color: var(--ink); }
.form-status.is-warn { border-color: #c98a3e; color: var(--ink-soft); }
.form-status strong { color: var(--gold); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--line-soft);
  padding-top: clamp(var(--space-12), 7vw, var(--space-20));
}
.footer-inner {
  display: grid; gap: var(--space-10);
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.25fr);
  padding-bottom: var(--space-12);
}
.footer-brand img { width: clamp(150px, 19vw, 210px); }
.footer-brand p {
  margin-top: var(--space-5);
  font-size: var(--text-sm); color: var(--ink-mute);
  max-width: 34ch;
}
.footer-cols {
  display: grid; gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(138px, 1fr));
  align-items: start;
}
.footer-cols h3 {
  font-size: var(--text-xs);
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: var(--space-4);
  font-family: var(--font-body); font-weight: 500;
}
.footer-cols a, .footer-cols p {
  display: block;
  font-size: var(--text-sm); color: var(--ink-soft);
  padding-block: var(--space-1);
}
.footer-cols a { transition: color 0.2s var(--ease); }
.footer-cols a:hover { color: var(--gold); }

.footer-base {
  border-top: 1px solid var(--line-soft);
  padding-block: var(--space-6);
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  align-items: center; justify-content: space-between;
}
.footer-base p { font-size: var(--text-xs); color: var(--ink-mute); }
.eho { display: inline-flex; align-items: center; gap: var(--space-2); }
.eho svg { width: 15px; height: 15px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(16px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .card:hover, .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .split, .form-wrap, .footer-inner { grid-template-columns: 1fr; }
  .portrait { max-width: 340px; }
  .hero-bg { object-position: 68% center; }
  .hero-copy { max-width: 62ch; }
  .hero-inner { justify-content: flex-start; }
  .hero-scrim {
    background: linear-gradient(to top, var(--scrim-b) 0%, rgba(20,19,18,0.62) 58%, rgba(20,19,18,0.34) 100%);
  }
}
@media (max-width: 1080px) {
  .nav-phone { display: none; }
}
@media (max-width: 720px) {
  .nav { display: none; }
  .menu-btn { display: grid; }
  h1 { max-width: 24ch; }
  .hero { min-height: auto; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-scrim {
    background: linear-gradient(to top, var(--scrim-b) 0%, rgba(24,23,22,0.66) 60%, rgba(24,23,22,0.42) 100%);
  }
}
@media (min-width: 721px) {
  .mobile-nav { display: none !important; }
}
