/* ==========================================================================
   Victoria Unger - Real Estate
   Direction: warm, editorial, premium. Experience reads as an asset.
   Palette: ink + warm paper + Century 21 "Relentless Gold" (#BEAF87) accent.

   Motion principle: everything moves once, briefly, in the direction the eye is
   already travelling. Nothing loops, nothing bounces, nothing moves on hover
   that the user did not point at. All of it collapses under
   prefers-reduced-motion.
   ========================================================================== */

/* =====================================================================
   Century 21 brand faces
   =====================================================================
   Files live in assets/fonts/ and are deliberately NOT committed. Century 21
   licenses them to affiliated agents, but @font-face serves the file to every
   visitor, which is a separate web embedding licence. Confirm with the broker
   before deploying them. If the files are absent these rules simply fail and
   the stack falls through, so nothing breaks.                             */

@font-face { font-family: "Oakes"; src: url("../fonts/Oakes-Light.otf") format("opentype");     font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Oakes"; src: url("../fonts/Oakes-Regular.otf") format("opentype");   font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Oakes"; src: url("../fonts/Oakes-Medium.otf") format("opentype");    font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Oakes"; src: url("../fonts/Oakes-Semi-Bold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Oakes"; src: url("../fonts/Oakes-Bold.otf") format("opentype");      font-weight: 700; font-style: normal; font-display: swap; }

@font-face { font-family: "Typold"; src: url("../fonts/Typold-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Typold"; src: url("../fonts/Typold-Bold.ttf") format("truetype");    font-weight: 700; font-style: normal; font-display: swap; }

:root {
  /* ---------------------------------------------------------------- Colour

     Light theme values. The dark theme below redefines these same names, so
     every rule in this file flips themes without being touched. Values are
     the ones measured on the Brilliant canvas; see docs/DESIGN.md for the
     contrast table.

     Semantic meaning, since the names are historical:
       --ink            primary text, and the fill of solid buttons
       --ink-soft       strong secondary text
       --ink-mute       quiet secondary text
       --paper          page background
       --paper-2        the tinted band sections sit on
       --paper-3        a step deeper again
       --white          a raised surface above the page, not literally white
       --line           hairlines and borders
       --gold           Century 21 Relentless Gold, decoration only
       --gold-deep      the gold that is allowed to carry text
       --on-gold        text on a Relentless Gold fill, dark in both themes  */

  --ink:        #25221d;
  --ink-2:      #312c24;
  --ink-soft:   #3f382c;
  --ink-mute:   #5e5039;
  --paper:      #faf7f2;
  --paper-2:    #f2ece3;
  --paper-3:    #e7dfd2;
  --line:       #ddd4c5;
  --gold:       #beaf87;
  --gold-deep:  #6d5e36;
  --white:      #ffffff;
  --on-gold:    #25221d;

  /* Status colours need their own dark values: these are tuned for paper. */
  --ok:         #2f6b3f;
  --err:        #9a3327;

  /* Shadows are built from these so they can deepen in dark mode, where a
     shadow tinted with warm ink would read as a brown haze. Kept as raw
     channels because each use needs its own alpha. */
  --shadow-rgb: 23, 22, 19;
  --gold-rgb:   190, 175, 135;

  /* Century 21's official brand palette, from their brand portal.
     Relentless Gold is already --gold above, which turned out to be exact.
     Use these for anything that sits next to the C21 logo, so the brand
     elements match the real identity rather than an approximation. */
  --c21-legacy-gold:    #ffc72c;
  --c21-relentless:     #beaf87;
  --c21-dark-gold:      #a19276;
  --c21-light-grey:     #e6e7e8;
  --c21-medium-grey:    #808285;
  --c21-obsessed-grey:  #252526;
  --c21-digital-black:  #121212;

  /* Note on --gold-deep: Dark Gold (#a19276) is the official darker gold, but
     it only reaches about 2.6:1 on paper, so it cannot carry small text.
     --gold-deep stays darker than brand for body-sized gold text. Use
     --c21-dark-gold for fills and rules, never for type. */

  /* Type */
  /* Century 21's own faces first, then the previous pairing as the fallback.
     The fallback matters: the brand font files are gitignored pending a web
     embedding licence (see docs/DESIGN.md), so on a deploy without them the
     site lands on Fraunces and Inter, which is a coherent design rather than
     a broken one. Note Oakes is a geometric SANS despite living in the serif
     slot; the slot name is historical. */
  --serif: "Oakes", "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans:  "Typold", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Rhythm */
  --gut:      clamp(1.25rem, 4vw, 2rem);
  --section:  clamp(4.5rem, 10vw, 8rem);
  --maxw:     1180px;
  --radius:   4px;

  /* Motion */
  --ease:     cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur:      0.8s;
}

/* =====================================================================
   Dark theme
   =====================================================================
   Same token names, different values, so nothing else in this file needs
   to know a theme exists. Two selectors:

     1. The system is dark and the visitor has not chosen light.
     2. The visitor explicitly chose dark.

   The :not([data-theme="light"]) guard is what lets someone keep the site
   light on a dark machine. Without it their choice would be overruled every
   time their OS theme applied.                                             */

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --ink:        #faf7f2;
  --ink-2:      #f2ece3;
  --ink-soft:   #dcd5c9;
  --ink-mute:   #c9bea9;
  --paper:      #25221d;
  --paper-2:    #3d3a33;
  --paper-3:    #4a4338;
  --line:       #524c40;
  --gold:       #beaf87;
  --gold-deep:  #e4e1d8;
  --white:      #312c24;
  --on-gold:    #25221d;

  --ok:         #7cc08f;
  --err:        #e89a8e;

  /* Near black, and heavier. A warm shadow on a warm dark surface disappears. */
  --shadow-rgb: 0, 0, 0;
  }
}

:root[data-theme="dark"] {
  --ink:        #faf7f2;
  --ink-2:      #f2ece3;
  --ink-soft:   #dcd5c9;
  --ink-mute:   #c9bea9;
  --paper:      #25221d;
  --paper-2:    #3d3a33;
  --paper-3:    #4a4338;
  --line:       #524c40;
  --gold:       #beaf87;
  --gold-deep:  #e4e1d8;
  --white:      #312c24;
  --on-gold:    #25221d;

  --ok:         #7cc08f;
  --err:        #e89a8e;

  /* Near black, and heavier. A warm shadow on a warm dark surface disappears. */
  --shadow-rgb: 0, 0, 0;
}


/* --------------------------------------------------------------- reset -- */

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 { font-size: clamp(2.6rem, 1.6rem + 4.4vw, 5rem); }
h2 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3.35rem); }
h3 { font-size: clamp(1.2rem, 1.08rem + 0.6vw, 1.5rem); }

p { margin: 0 0 1.15em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

::selection { background: var(--gold); color: var(--ink); }

:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ------------------------------------------------------------- helpers -- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section { padding-block: var(--section); }
.section--tint { background: var(--paper-2); border-block: 1px solid var(--line); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin: 0 0 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.eyebrow::before {
  content: "";
  width: 2rem;
  height: 1px;
  background: var(--gold);
  flex: none;
  transform-origin: left;
}

.lede {
  font-size: clamp(1.1rem, 1.02rem + 0.4vw, 1.3rem);
  line-height: 1.6;
  color: var(--ink-soft);
}

.measure { max-width: 62ch; }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 200;
}

.skip:focus { left: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   MOTION SYSTEM
   Add data-animate to any element. Optional --i on the element (or on a parent
   with data-stagger) offsets the delay so groups arrive in sequence.
   ========================================================================== */

/* Children of a stagger group are hidden only when JS is present to reveal them.
   The :not(.is-in) guard matters: without it this rule outranks [data-animate].is-in
   on specificity and the children stay invisible forever. */
html.js [data-stagger] > *:not(.is-in) { opacity: 0; }

[data-animate] {
  opacity: 0;
  transition:
    opacity var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-out),
    clip-path 1.05s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
  will-change: opacity, transform;
}

[data-animate="up"]    { transform: translateY(26px); }
[data-animate="fade"]  { transform: none; }
[data-animate="left"]  { transform: translateX(-26px); }
[data-animate="right"] { transform: translateX(26px); }
[data-animate="scale"] { transform: scale(0.97); }

/* Image wipe - the reveal edge travels upward with the scroll */
[data-animate="mask"] {
  /* Left, right and bottom are held open rather than at 0. A clip-path clips
     every descendant, so the shared inset(0) end state below was slicing the
     hero award badge in half where it overhangs the portrait. Only the bottom
     edge needs to move, and that is the wipe. */
  clip-path: inset(0 -40% 12% -40%);
  transform: translateY(20px);
}

[data-animate].is-in {
  opacity: 1;
  transform: none;
  clip-path: inset(0 0 0 0);
  will-change: auto;
}

/* Equal specificity to the rule above, (0,2,0) each, so this has to come
   after it to win. Worth stating because the same trap already cost this
   project its review cards once. */
[data-animate="mask"].is-in {
  clip-path: inset(0 -40% -40% -40%);
}

/* A hairline that draws itself in */
[data-animate="rule"] {
  opacity: 1;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.9s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}

[data-animate="rule"].is-in { transform: scaleX(1); }

/* ------------------------------------------------------------- buttons -- */

.btn {
  --btn-bg: var(--ink);
  --btn-fg: var(--paper);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.95rem 1.6rem;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 1px solid var(--btn-bg);
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out),
              color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

/* Gold wash sweeps up from the base on hover */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--gold);
  transform: translateY(101%);
  transition: transform 0.42s var(--ease-out);
  z-index: -1;
}

.btn:hover {
  transform: translateY(-2px);
  color: var(--ink);
  border-color: var(--gold);
  box-shadow: 0 12px 26px -14px rgba(var(--shadow-rgb), 0.55);
}

.btn:hover::before { transform: translateY(0); }
.btn:active { transform: translateY(0); transition-duration: 0.08s; }

.btn--gold  { --btn-bg: var(--gold); --btn-fg: var(--on-gold); }
.btn--gold::before { background: var(--ink); }
.btn--gold:hover { color: var(--paper); border-color: var(--ink); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink); border-color: var(--line); }
.btn--ghost::before { background: var(--ink); }
.btn--ghost:hover { color: var(--paper); border-color: var(--ink); }

.btn--light { --btn-bg: var(--paper); --btn-fg: var(--ink); }

.btn svg { width: 1.05em; height: 1.05em; flex: none; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* Text link with an underline that wipes in */
.tlink {
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding-bottom: 2px;
  background-image: linear-gradient(var(--gold), var(--gold));
  background-size: 0% 1.5px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.4s var(--ease-out);
}

.tlink:hover { background-size: 100% 1.5px; }
.tlink svg { width: 0.95em; height: 0.95em; transition: transform 0.35s var(--ease-out); }
.tlink:hover svg { transform: translateX(4px); }

/* -------------------------------------------------------------- header -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color 0.35s var(--ease), background 0.35s var(--ease),
              box-shadow 0.35s var(--ease);
}

.site-header.is-stuck {
  border-bottom-color: var(--line);
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  box-shadow: 0 10px 30px -26px rgba(var(--shadow-rgb), 0.6);
}

/* Reading-progress hairline */
.progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 100%;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.site-header.is-stuck .progress { opacity: 1; }

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 4.75rem;
}

.brand {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.1;
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  transition: color 0.3s var(--ease);
}

.brand:hover .brand__name { color: var(--gold-deep); }

.brand__sub {
  /* The office name is one name. Broken over two lines it read as two
     separate things stacked under hers. */
  white-space: nowrap;
  font-size: 0.61rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-top: 0.25rem;
}

.nav__links {
  display: flex;
  align-items: center;
  /* Tightens as the viewport narrows instead of forcing the row to wrap.
     Seven items, two of them two words long, is a lot to fit. */
  gap: clamp(0.95rem, 1.7vw, 1.85rem);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__links a {
  /* "Working Together" breaking across two lines is worse than a tighter row.
     A label is one thing and should look like one thing. */
  white-space: nowrap;
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--ink-mute);
  padding-block: 0.35rem;
  position: relative;
  transition: color 0.3s var(--ease);
}

.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1.5px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.nav__links a:hover,
.nav__links a.is-active { color: var(--ink); }

.nav__links a:hover::after,
.nav__links a.is-active::after { transform: scaleX(1); transform-origin: left; }

.nav__cta { display: flex; gap: 0.6rem; align-items: center; }
.nav__cta .btn {
  padding: 0.72rem 1.2rem;
  font-size: 0.82rem;
  /* A phone number split over two lines is close to unreadable, and this is
     the single most important control on the page. */
  white-space: nowrap;
}

.nav__toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}

.nav__toggle:hover { border-color: var(--gold); }

.nav__toggle span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--ink);
  transition: transform 0.35s var(--ease-out), opacity 0.2s var(--ease);
}

.nav__toggle span + span { margin-top: 5px; }
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* 1000px was too low. Between there and about 1250 the row was technically
   fitting while looking squashed, with labels and the phone number wrapping.
   The menu now takes over before that happens. */
@media (max-width: 1180px) {
  .nav__toggle { display: block; }
  /* Only the call button goes. The theme toggle lives in here too and used to
     disappear entirely on phones, which is where a dark theme matters most. */
  .nav__cta .btn { display: none; }

  .nav__links {
    position: fixed;
    inset: 4.75rem 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: var(--gut);
    box-shadow: 0 24px 44px -26px rgba(var(--shadow-rgb), 0.4);
    clip-path: inset(0 0 100% 0);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s var(--ease), clip-path 0.42s var(--ease-out), visibility 0.42s;
  }

  .nav__links.is-open { opacity: 1; visibility: visible; clip-path: inset(0 0 0 0); }

  .nav__links a {
    font-size: 1.05rem;
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--paper-3);
  }

  .nav__links li:last-child a { border-bottom: 0; }
}

/* ---------------------------------------------------------------- hero -- */

.hero {
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  position: relative;
  overflow: hidden;
}

/* Barely-there warm bloom behind the portrait */
.hero::before {
  content: "";
  position: absolute;
  top: -18%; right: -12%;
  width: 46rem; height: 46rem;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.20) 0%, rgba(var(--gold-rgb), 0) 68%);
  pointer-events: none;
}

.hero__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.hero h1 { margin-bottom: 0.35em; }
.hero h1 em { font-style: italic; color: var(--gold-deep); }

.hero__stars {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2rem;
  font-size: 0.875rem;
  color: var(--ink-mute);
}

.hero__stars .stars { color: var(--gold-deep); letter-spacing: 0.1em; }

.hero__figure { position: relative; margin: 0; }

.hero__figure img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  /* Source is taller than 4:5, so cover crops vertically. Bias the crop upward
     or it takes the top off her hair. */
  object-position: 50% 20%;
  border-radius: var(--radius);
  background: var(--paper-2);
  position: relative;
  z-index: 1;
}

.hero__figure::after {
  content: "";
  position: absolute;
  inset: auto -0.9rem -0.9rem auto;
  width: 55%; height: 55%;
  border: 1px solid var(--gold);
  border-radius: var(--radius);
}

/* Floating credential chip over the portrait */
.hero__badge {
  position: absolute;
  z-index: 2;
  /* Overhangs the portrait rather than sitting on it. At -1.25rem only 20px of
     a 216px card cleared the edge, which read as "inside the photo" instead of
     as a card pinned to it. The clamp keeps the overhang from eating into the
     text column as the viewport narrows and the gap between them closes. */
  left: clamp(-4.5rem, -3.5vw, -1.5rem);
  bottom: 2.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 0.9rem 1.15rem;
  box-shadow: 0 18px 40px -24px rgba(var(--shadow-rgb), 0.45);
  line-height: 1.25;
}

.hero__badge strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 500;
}

.hero__badge span {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__figure { order: -1; max-width: 17rem; }
  .hero__figure img { aspect-ratio: 1 / 1; }
  .hero__badge { left: auto; right: -0.75rem; bottom: 1rem; padding: 0.7rem 0.9rem; }
}

@media (max-width: 560px) {
  .hero { padding-block: 1.75rem clamp(2.5rem, 6vw, 4rem); }
  .hero__figure { max-width: 11.5rem; }
  .hero__figure::after { inset: auto -0.6rem -0.6rem auto; }
  .hero__badge { display: none; }
}

/* ------------------------------------------------------------ proofbar -- */

.proofbar { border-block: 1px solid var(--line); background: var(--paper-2); }

.proofbar__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}

.proofbar__item {
  background: var(--paper-2);
  padding: clamp(1.75rem, 4vw, 2.5rem) clamp(0.75rem, 2vw, 1.75rem);
  text-align: center;
}

.proofbar__num {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 1.4rem + 1.8vw, 2.9rem);
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.proofbar__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

@media (max-width: 760px) { .proofbar__grid { grid-template-columns: repeat(2, 1fr); } }

/* --------------------------------------------------------- split block -- */

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}

.split--reverse .split__media { order: -1; }
.split__media { margin: 0; overflow: hidden; border-radius: var(--radius); }

.split__media img {
  width: 100%;
  aspect-ratio: 5 / 6;
  object-fit: cover;
  background: var(--paper-2);
}

@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split--reverse .split__media { order: 0; }
}

.pullquote {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 1.1rem + 1.1vw, 1.9rem);
  line-height: 1.32;
  font-style: italic;
  color: var(--ink);
  border-left: 2px solid var(--gold);
  padding-left: clamp(1.25rem, 3vw, 2rem);
  margin: 2.25rem 0;
}

/* ------------------------------------------------------------ dark band -- */

.band-dark { background: var(--ink); color: var(--paper); }
.band-dark h2, .band-dark h3 { color: var(--paper); }
.band-dark .lede { color: color-mix(in srgb, var(--paper) 76%, transparent); }
.band-dark .eyebrow { color: var(--gold); }
.band-dark .eyebrow::before { background: var(--gold-deep); }

.channels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1px;
  background: color-mix(in srgb, var(--paper) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 3rem;
}

.channel {
  position: relative;
  background: var(--ink);
  padding: clamp(1.5rem, 3vw, 2.15rem);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow: hidden;
  transition: background 0.35s var(--ease);
}

/* Gold rule grows along the top edge on hover */
.channel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-out);
}

.channel:hover { background: var(--ink-2); }
.channel:hover::before { transform: scaleX(1); }

.channel__icon {
  color: var(--gold);
  width: 1.4rem; height: 1.4rem;
  margin-bottom: 0.6rem;
  transition: transform 0.4s var(--ease-out);
}

.channel:hover .channel__icon { transform: translateY(-3px); }

.channel__label {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold);
}

.channel__value { font-family: var(--serif); font-size: 1.3rem; }
.channel__note { font-size: 0.85rem; color: color-mix(in srgb, var(--paper) 62%, transparent); }

/* ------------------------------------------------------------ services -- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: 3.5rem;
}

.card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out),
              border-color 0.4s var(--ease-out);
}

.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.5s var(--ease-out);
}

.card:hover {
  transform: translateY(-5px);
  border-color: var(--paper-3);
  box-shadow: 0 24px 48px -30px rgba(var(--shadow-rgb), 0.5);
}

.card:hover::before { transform: scaleX(1); }

.card__num {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--paper-3);
}

.card ul { margin: 1rem 0 0; padding: 0; list-style: none; }

.card li {
  position: relative;
  padding-left: 1.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.925rem;
  color: var(--ink-soft);
}

.card li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.62em;
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: var(--gold);
}

/* ------------------------------------------------------------- process -- */

.steps {
  position: relative;
  margin-top: 3.5rem;
  display: grid;
  gap: 0;
}

/* The spine the steps hang from */
.steps::before {
  content: "";
  position: absolute;
  left: 1.05rem;
  top: 0.9rem;
  bottom: 0.9rem;
  width: 1px;
  background: var(--line);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.4s var(--ease-out);
}

.steps.is-in::before { transform: scaleY(1); }

.step {
  position: relative;
  display: grid;
  grid-template-columns: 2.1rem 1fr;
  gap: clamp(1.25rem, 3vw, 2.25rem);
  padding-block: clamp(1.25rem, 2.5vw, 1.75rem);
}

.step__dot {
  position: relative;
  z-index: 1;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--gold-deep);
  transition: background 0.45s var(--ease-out), border-color 0.45s var(--ease-out),
              color 0.45s var(--ease-out);
}

.section--tint .step__dot { background: var(--paper-2); }

.step.is-in .step__dot {
  background: var(--gold);
  border-color: var(--gold);
  /* Gold is a pale fill in both themes, so its label cannot follow --ink. */
  color: var(--on-gold);
}

.step h3 { margin-bottom: 0.3rem; }
.step p { color: var(--ink-soft); margin: 0; max-width: 56ch; }

/* ----------------------------------------------------------- valuation -- */

.valuation {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
}

.valuation::before {
  content: "";
  position: absolute;
  top: -30%; left: -10%;
  width: 40rem; height: 40rem;
  background: radial-gradient(circle, rgba(var(--gold-rgb), 0.16) 0%, rgba(var(--gold-rgb), 0) 70%);
  pointer-events: none;
}

.valuation__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

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

.valuation h2 { color: var(--paper); }
.valuation .eyebrow { color: var(--gold); }
.valuation .eyebrow::before { background: var(--gold-deep); }
.valuation .lede { color: color-mix(in srgb, var(--paper) 78%, transparent); }
.valuation__fine { color: color-mix(in srgb, var(--paper) 66%, transparent); font-size: 0.92rem; }

.valuation__card {
  /* A light card sitting on an inverted panel. The panel declares the dark
     palette for everything inside it, which is right for the panel's own copy
     and wrong here: the field labels came out pale gold on a pale card and the
     inputs came out as dark boxes. The card restores the light palette for its
     own subtree. It stays light in both themes, which is the design. */
  --ink:        #25221d;
  --ink-2:      #312c24;
  --ink-soft:   #3f382c;
  --ink-mute:   #5e5039;
  --paper:      #faf7f2;
  --paper-2:    #f2ece3;
  --paper-3:    #e7dfd2;
  --white:      #ffffff;
  --line:       #ddd4c5;
  --gold-deep:  #6d5e36;
  --shadow-rgb: 23, 22, 19;

  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.5rem);
  box-shadow: 0 40px 80px -50px rgba(0,0,0,0.9);
}

.valuation__card h3 { margin-bottom: 0.4rem; }

.valuation__card > p {
  font-size: 0.92rem;
  color: var(--ink-mute);
  margin-bottom: 1.5rem;
}

/* --------------------------------------------------------- listings ---- */

.listings {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17.5rem, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: 3.5rem;
}

.listing {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.listing:hover { transform: translateY(-5px); box-shadow: 0 24px 48px -30px rgba(var(--shadow-rgb), 0.5); }
.listing__media { position: relative; background: var(--paper-2); overflow: hidden; }

.listing__media img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  transition: transform 0.85s var(--ease-out);
}

.listing:hover .listing__media img { transform: scale(1.05); }

.listing__status {
  position: absolute; top: 0.85rem; left: 0.85rem;
  background: var(--ink); color: var(--paper);
  font-size: 0.66rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.4rem 0.7rem; border-radius: 2px;
}

.listing__status[data-status="Sold"] { background: var(--gold-deep); color: var(--white); }
.listing__status[data-status="Pending"] { background: var(--ink-soft); }
.listing__body { padding: 1.4rem 1.5rem 1.6rem; flex: 1; display: flex; flex-direction: column; }
.listing__price { font-family: var(--serif); font-size: 1.45rem; margin-bottom: 0.3rem; }
.listing__addr { font-size: 0.95rem; color: var(--ink-soft); margin-bottom: 0.2rem; }
.listing__city { font-size: 0.85rem; color: var(--ink-mute); }

.listing__facts {
  display: flex; gap: 1.1rem; flex-wrap: wrap;
  margin-top: auto; padding-top: 1.1rem;
  border-top: 1px solid var(--paper-3);
  font-size: 0.82rem; color: var(--ink-mute);
}

.listings__empty {
  margin-top: 3rem;
  padding: clamp(2rem, 5vw, 3rem);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-mute);
}

/* Skeleton shown while listings load */
.skeleton { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--white); }
.skeleton__img { aspect-ratio: 3 / 2; background: var(--paper-2); }
.skeleton__body { padding: 1.4rem 1.5rem 1.6rem; display: grid; gap: 0.7rem; }
.skeleton__line { height: 0.85rem; border-radius: 2px; background: var(--paper-2); }
.skeleton__line:nth-child(1) { width: 45%; height: 1.3rem; }
.skeleton__line:nth-child(2) { width: 80%; }
.skeleton__line:nth-child(3) { width: 55%; }

.skeleton__img, .skeleton__line {
  background-image: linear-gradient(90deg, var(--paper-2) 0%, var(--paper-3) 50%, var(--paper-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer { to { background-position: -200% 0; } }

/* -------------------------------------------------------- testimonials -- */

.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin-top: 3.5rem;
}

.quote {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 3vw, 2.35rem);
  display: flex;
  flex-direction: column;
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.quote:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -32px rgba(var(--shadow-rgb), 0.45); }

/* Oversized quote mark, very low contrast */
.quote::after {
  content: "\201D";
  position: absolute;
  top: 0.35rem; right: 1.1rem;
  font-family: var(--serif);
  font-size: 6rem;
  line-height: 1;
  color: var(--gold);
  opacity: 0.16;
  pointer-events: none;
}

.quote__stars { color: var(--gold-deep); letter-spacing: 0.14em; margin-bottom: 1.1rem; font-size: 0.9rem; }

.quote blockquote {
  margin: 0 0 1.5rem;
  font-family: var(--serif);
  font-size: 1.075rem;
  line-height: 1.5;
  color: var(--ink);
  flex: 1;
}

.quote__by {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-mute);
  padding-top: 1.25rem;
  border-top: 1px solid var(--paper-3);
}

/* --------------------------------------------------------------- areas -- */

.areas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 2.75rem;
  padding: 0;
  list-style: none;
}

.areas li {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font-size: 0.875rem;
  color: var(--ink-soft);
  transition: border-color 0.3s var(--ease), color 0.3s var(--ease),
              transform 0.3s var(--ease-out);
}

.areas li:hover { border-color: var(--gold); color: var(--ink); transform: translateY(-2px); }

.niche {
  margin-top: 3.5rem;
  padding: clamp(1.75rem, 4vw, 2.75rem);
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
}

/* ---------------------------------------------------------- calculator -- */

.calc {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
  margin-top: 3.5rem;
}

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

.calc__controls { display: grid; gap: 1.6rem; }

.calc__row { display: grid; gap: 0.6rem; }

.calc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.calc__head label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.calc__value {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

/* The input itself is the hit area, not the visible line. It used to be 2px
   tall with an 18px thumb, and the browser clips a thumb to the control's own
   box, so the top of it was sliced off. The line is drawn by the track
   pseudo-element now and the control is tall enough to hold the thumb, which
   also gives it a finger-sized target. */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 1.75rem;
  background: transparent;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 1.15rem; height: 1.15rem;
  /* Centres the thumb on a 2px track: half the thumb less half the track. */
  margin-top: -0.515rem;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--paper);
  box-shadow: 0 2px 8px -2px rgba(var(--shadow-rgb), 0.5);
  transition: transform 0.2s var(--ease-out);
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

input[type="range"]::-moz-range-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
}

input[type="range"]::-moz-range-thumb {
  width: 1.15rem; height: 1.15rem;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--paper);
  box-shadow: 0 2px 8px -2px rgba(var(--shadow-rgb), 0.5);
  cursor: pointer;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}
input[type="range"]:focus-visible::-moz-range-thumb {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  input[type="range"]::-webkit-slider-thumb { transition: none; }
}


.calc__out {
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.35rem);
  position: sticky;
  top: 6.5rem;
}

.calc__out h3 { color: var(--paper); font-size: 1.05rem; margin-bottom: 1.5rem; }

.calc__total {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem);
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  margin-bottom: 0.35rem;
}

.calc__sub { font-size: 0.82rem; color: color-mix(in srgb, var(--paper) 62%, transparent); }

.calc__break {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, var(--paper) 18%, transparent);
  display: grid;
  gap: 0.7rem;
  font-size: 0.88rem;
}

.calc__break div { display: flex; justify-content: space-between; gap: 1rem; }
.calc__break span:first-child { color: color-mix(in srgb, var(--paper) 66%, transparent); }
.calc__break span:last-child { font-variant-numeric: tabular-nums; }

.calc__note {
  margin-top: 1.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
  color: color-mix(in srgb, var(--paper) 50%, transparent);
}

/* ------------------------------------------------------------- contact -- */

.contact__grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

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

.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: 0.45rem; }

.field label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  width: 100%;
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.field textarea { resize: vertical; min-height: 7.5rem; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold-deep);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gold) 30%, transparent);
}

.field--row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.15rem; }
@media (max-width: 560px) { .field--row { grid-template-columns: 1fr; } }

.form__note { font-size: 0.82rem; color: var(--ink-mute); }
.form__status { font-size: 0.9rem; font-weight: 500; min-height: 1.4rem; }
.form__status[data-state="ok"]  { color: var(--ok); }
.form__status[data-state="err"] { color: var(--err); }

.hp { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.contact__direct { display: grid; gap: 1.5rem; margin: 0; }
.contact__line { display: grid; gap: 0.2rem; }

.contact__line dt {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--gold-deep);
}

.contact__line dd { margin: 0; font-family: var(--serif); font-size: 1.2rem; }
.contact__line dd a { text-decoration: none; border-bottom: 1px solid var(--line); transition: border-color 0.3s var(--ease); }
.contact__line dd a:hover { border-bottom-color: var(--gold); }

/* =====================================================================
   Inverted panels
   =====================================================================
   Five blocks are deliberately the opposite polarity of the page: the
   Working Together band, the valuation panel, the calculator output, the
   footer and the mobile action bar. Each sets `background: var(--ink)` and
   `color: var(--paper)`, and everything inside was authored against a dark
   surface: light text, gold at the pale end, and faded text built with
   color-mix on --paper.

   Letting those tokens follow the page theme broke all of it in dark mode.
   The panel flipped to light while its contents kept pointing at the dark
   theme's values, which put gold text at 2:1 and the faded copy at 3.1:1.

   So these panels keep the dark polarity in both themes and take their own
   local palette. In dark mode they go a step deeper than the page instead of
   inverting, so a panel still reads as a panel.                          */

.band-dark,
.valuation,
.calc__out,
.site-footer {
  --ink:        #25221d;   /* becomes the panel's background */
  --ink-2:      #312c24;
  --ink-soft:   #dcd5c9;
  --ink-mute:   #c9bea9;
  --paper:      #faf7f2;   /* becomes the panel's text */
  --paper-2:    #f2ece3;
  --paper-3:    #e7dfd2;
  --white:      #312c24;
  --line:       #4a443a;
  --gold-deep:  #e4e1d8;
  --shadow-rgb: 0, 0, 0;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) :is(.band-dark, .valuation, .calc__out, .site-footer) {
    --ink:  #17150f;
    --line: #3b362d;
  }
}

:root[data-theme="dark"] :is(.band-dark, .valuation, .calc__out, .site-footer) {
  --ink:  #17150f;
  --line: #3b362d;
}

/* -------------------------------------------------------------- footer -- */

.site-footer {
  background: var(--ink);
  color: color-mix(in srgb, var(--paper) 72%, transparent);
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  font-size: 0.875rem;
}

.site-footer a { color: var(--paper); text-decoration: none; transition: color 0.3s var(--ease); }
.site-footer a:hover { color: var(--gold); }

.footer__grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 16%, transparent);
}

@media (max-width: 760px) { .footer__grid { grid-template-columns: 1fr; } }

.footer__name { font-family: var(--serif); font-size: 1.5rem; color: var(--paper); margin-bottom: 0.35rem; }

.footer__col h4 {
  font-family: var(--sans);
  font-size: 0.7rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold); margin-bottom: 1rem;
}

.footer__col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }

.socials { display: flex; gap: 0.9rem; margin-top: 1.35rem; }

.socials a {
  width: 2.4rem; height: 2.4rem;
  display: grid; place-items: center;
  border: 1px solid color-mix(in srgb, var(--paper) 22%, transparent);
  border-radius: 50%;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
              color 0.3s var(--ease), transform 0.3s var(--ease-out);
}

.socials a:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); transform: translateY(-3px); }
.socials svg { width: 1.05rem; height: 1.05rem; }

.legal {
  padding-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.78rem;
  line-height: 1.6;
  color: color-mix(in srgb, var(--paper) 56%, transparent);
}

.legal p { margin: 0; flex: 1 1 22rem; }
.legal__marks { display: flex; align-items: center; gap: 1rem; flex: none; }
.legal__marks svg { width: 2.2rem; height: 2.2rem; opacity: 0.8; }

/* --------------------------------------------------- mobile action bar -- */

.actionbar {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 90;
  display: none;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -18px rgba(var(--shadow-rgb), 0.5);
  transform: translateY(100%);
  transition: transform 0.45s var(--ease-out);
}

.actionbar.is-in { transform: translateY(0); }

.actionbar a {
  flex: 1;
  background: var(--paper);
  /* Stated, not inherited. body resolves `color: var(--ink)` with its own
     token value and children inherit that finished colour, so redefining
     --ink in an ancestor of this link would not reach it. */
  color: var(--ink);
  padding: 0.95rem 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.actionbar a.is-primary { background: var(--gold); color: var(--on-gold); }
.actionbar a:active { background: var(--paper-3); }
.actionbar a.is-primary:active { background: var(--gold-deep); }
.actionbar svg { width: 1.05rem; height: 1.05rem; }

@media (max-width: 700px) {
  .actionbar { display: flex; }
  body { padding-bottom: 3.5rem; }
}

/* --------------------------------------------------- reduced motion --- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  [data-animate] { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  [data-animate="rule"] { transform: scaleX(1) !important; }
  .steps::before { transform: scaleY(1) !important; }
  .actionbar { transform: none !important; }
}

/* =====================================================================
   Live reviews, from the RealSatisfied feed
   ===================================================================== */

.rsbar {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.rsbar__item {
  background: var(--paper);
  padding: 1.35rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.rsbar__num {
  font-family: var(--serif);
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
  font-weight: 600;
  line-height: 1;
  color: var(--ink);
  /* The number is swapped by JS once the feed answers. Reserving the line box
     stops the row jumping when 97% becomes 98%. */
  min-height: 1em;
}

.rsbar__label {
  font-size: 0.875rem;
  color: var(--ink-mute);
}

.rsfilter {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.rsfilter[hidden] { display: none; }

.rsfilter__btn {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  /* 44px minimum target. A lot of her clients are tapping this on an iPad. */
  min-height: 44px;
  padding: 0.5rem 1.15rem;
  cursor: pointer;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.rsfilter__btn:hover { border-color: var(--gold-deep); }

.rsfilter__btn.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.rsfilter__btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.rsfilter__status {
  margin: 0 0 0 auto;
  font-size: 0.875rem;
  color: var(--ink-mute);
}

@media (max-width: 760px) {
  .rsbar { grid-template-columns: repeat(2, 1fr); }
  .rsfilter__status { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .rsfilter__btn { transition: none; }
}

/* "her cell" beside the number. One line, two facts, no second row. */
.contact__hint {
  font-size: 0.8125rem;
  color: var(--ink-mute);
  margin-left: 0.4rem;
}

/* =====================================================================
   Finishing motion. Paired with assets/js/polish.js.
   Every rule here is scoped to html.js so that a visitor without
   JavaScript never meets an element parked at opacity 0.
   ===================================================================== */

/* ------------------------------------------------- word-by-word reveal */

/* .wr is the clipping box, .wr__i is the word that rises out of it.
   inline-block on the outer box is what gives the clip something to clip. */
html.js .has-words .wr {
  display: inline-block;
  overflow: hidden;
  /* The clip box has to clear the deepest descender in whatever face actually
     renders. 0.14em was tuned against Oakes and clipped the tail of a y in
     Fraunces, which is what the site falls back to wherever the brand fonts
     are not deployed. The equal negative margin keeps line spacing honest, so
     a generous value costs nothing. */
  padding-bottom: 0.3em;
  margin-bottom: -0.3em;
  vertical-align: bottom;
}

/* Once the words have arrived the box has no reason to clip anything, so it
   stops. Belt and braces: even if a face has a descender deeper than the
   padding above, it is only ever clipped while the word is moving. */
html.js .has-words.words-done .wr {
  overflow: visible;
}

/* An animation, not a transition. A transition only runs if the browser sees a
   style change between two painted frames, and with the words parked at
   opacity 0 inside a parent that is itself mid-reveal, that change was being
   collapsed and the words simply stayed at 0. An animation with fill `both`
   has no such dependency: it ends at its final frame and stays there. */
html.js .has-words .wr__i {
  display: inline-block;
  opacity: 0;
  will-change: transform, opacity;
}

html.js .has-words.is-words-in .wr__i {
  animation: wordRise 0.74s cubic-bezier(0.16, 1, 0.3, 1) both;
  /* Capped so a long heading does not keep the reader waiting on the tail. */
  animation-delay: calc(min(var(--w, 0) * 42ms, 520ms));
  will-change: auto;
}

@keyframes wordRise {
  from { transform: translateY(105%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ------------------------------------------------------ image fade-in */

/* Opt-in, and this is not a style choice. A blanket `html.js img { opacity: 0 }`
   hides every image JS has not personally seen, so the listing photos that
   main.js injects later were invisible forever. Only an image that polish.js
   has taken responsibility for gets hidden. */
html.js img.will-fade {
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
}

html.js img.will-fade.is-loaded { opacity: 1; }

/* The hero portrait also eases its scale, so it settles rather than appears. */
html.js .hero__figure img {
  transform-origin: 50% 20%;
  transition: opacity 0.9s var(--ease-out);
}

/* ------------------------------------------------------- back to top */

.totop {
  position: fixed;
  right: clamp(1rem, 3vw, 2rem);
  bottom: clamp(1rem, 3vw, 2rem);
  z-index: 60;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 10px 30px -14px rgba(var(--shadow-rgb), 0.45);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px) scale(0.92);
  pointer-events: none;
  transition:
    opacity 0.4s var(--ease-out),
    transform 0.4s var(--ease-out),
    background 0.3s var(--ease),
    border-color 0.3s var(--ease);
}

.totop.is-in {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.totop:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.totop:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

.totop svg { width: 20px; height: 20px; }

/* The mobile action bar owns the bottom of the screen on phones, so the
   back-to-top control gets out of its way rather than sitting on top of it. */
@media (max-width: 760px) {
  .totop { bottom: calc(env(safe-area-inset-bottom, 0px) + 5.25rem); }
}

/* ----------------------------------------------------- reduced motion */

@media (prefers-reduced-motion: reduce) {
  html.js .has-words .wr__i {
    transform: none;
    opacity: 1;
    transition: none;
    transition-delay: 0s;
  }
  html.js img.will-fade { opacity: 1; transition: none; }
  .totop { transition: opacity 0.01ms; transform: none; }
  .hero__figure img { transform: none !important; }
}


/* =====================================================================
   Theme toggle
   ===================================================================== */

.themebtn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease),
              color 0.3s var(--ease);
}

.themebtn:hover { border-color: var(--gold-deep); }

.themebtn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.themebtn svg { width: 19px; height: 19px; }

/* Only one icon is ever shown. Which one depends on the theme actually in
   force, which is why the system-preference case needs its own rule: with no
   data-theme attribute at all, CSS is the only thing that knows. */
.themebtn__moon { display: block; }
.themebtn__sun  { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .themebtn__moon { display: none; }
  :root:not([data-theme="light"]) .themebtn__sun  { display: block; }
}

:root[data-theme="dark"] .themebtn__moon { display: none; }
:root[data-theme="dark"] .themebtn__sun  { display: block; }
:root[data-theme="light"] .themebtn__moon { display: block; }
:root[data-theme="light"] .themebtn__sun  { display: none; }

/* The toggle sits beside the call button and must never crowd it out. */
.nav__cta { display: flex; align-items: center; gap: 0.6rem; }

@media (prefers-reduced-motion: reduce) {
  .themebtn { transition: none; }
}

/* A hidden breakdown row must not keep its flex box. */
.calc__break [hidden] { display: none; }

/* ------------------------------------------------- review pagination -- */

.rspager {
  margin-top: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.75rem, 2vw, 1.5rem);
  flex-wrap: wrap;
}

.rspager[hidden] { display: none; }

.rspager__btn {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  /* 44px, because this is a control older clients will be tapping on a tablet. */
  min-height: 44px;
  padding: 0.5rem 1.15rem;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.3s var(--ease), border-color 0.3s var(--ease);
}

.rspager__btn svg { width: 17px; height: 17px; }
.rspager__btn:hover:not(:disabled) { border-color: var(--gold-deep); }

.rspager__btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.rspager__btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

.rspager__count {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--ink-mute);
  min-width: 13ch;
  text-align: center;
}

/* Pins the attribution to the bottom of its card. Grid rows are equal height,
   so without this a short review leaves its name floating mid-card. */
.quote__by { margin-top: auto; }

@media (prefers-reduced-motion: reduce) {
  .rspager__btn { transition: none; }
}

/* --------------------------------------------- compact review cards -- */

/* Reviews run from two words to six hundred characters. Left alone the grid
   grew to whatever the longest one needed, which made the section taller than
   a screen and meant paging shifted the page under the reader. Clamping gives
   every card the same height and keeps the whole section in view. */
.quote blockquote {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
}

.quote.is-open blockquote {
  -webkit-line-clamp: unset;
  line-clamp: unset;
  overflow: visible;
}

.quote__more {
  align-self: flex-start;
  margin-top: 0.6rem;
  padding: 0.25rem 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-deep);
  background: none;
  border: 0;
  border-bottom: 1px solid currentColor;
  cursor: pointer;
}

.quote__more:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
}

/* Tighter than the old card now that the text is bounded. */
.quotes { margin-top: 1.75rem; }
.quote { padding: clamp(1.4rem, 2.2vw, 1.8rem); }
.quote blockquote { font-size: 0.975rem; }

/* The live-rate footnote under the interest rate slider. Only ever present
   when /api/rate actually answered. */
.calc__live {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--ink-mute);
}

/* ------------------------------------- buying / selling calculator switch -- */

.calcswitch {
  display: inline-flex;
  gap: 2px;
  margin: 2rem 0 0;
  padding: 3px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.calcswitch__btn {
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ink-mute);
  background: transparent;
  border: 0;
  border-radius: 999px;
  /* 44px, because a seller in their seventies is tapping this on an iPad. */
  min-height: 44px;
  padding: 0.5rem 1.35rem;
  cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

.calcswitch__btn.is-on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(var(--shadow-rgb), 0.18);
}

.calcswitch__btn:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}

/* The hidden panel must lose its grid, not just its paint. */
.calc[hidden] { display: none; }

/* A sale that nets below zero is a real outcome and the number says so
   plainly. Hiding it would be the one genuinely dishonest thing this
   calculator could do: someone underwater needs to know before they list. */
.calc__total[data-negative="true"] { color: var(--err); }

@media (max-width: 560px) {
  .calcswitch { display: flex; width: 100%; }
  .calcswitch__btn { flex: 1; padding: 0.5rem 0.75rem; }
}

@media (prefers-reduced-motion: reduce) {
  .calcswitch__btn { transition: none; }
}
