/* ==========================================================================
   Arbor & Vale — demo site
   One stylesheet for every page. Tokens first, then base, layout, components,
   page sections, motion states, view transitions.
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  /* Palette taken from Halden House's materials */
  --limestone: #f3efe8;      /* terrace stone, page background (60%) */
  --limestone-2: #ebe5da;    /* alternate section tint */
  --ink: #151513;            /* window frames, text (30%) */
  --ink-muted: #57524a;      /* secondary text, 6.2:1 on limestone */
  --bronze: #8a5a36;         /* cedar cladding, accent (10%), 5.1:1 on limestone */
  --bronze-deep: #6f4629;    /* hover */
  --bronze-light: #c89a6e;   /* accent on dark grounds, 5.4:1 on forest */
  --forest: #22302a;         /* the pines behind the house */
  --on-dark: #f3efe8;
  --on-dark-muted: #c9c2b6;  /* 7.8:1 on forest */
  --rule: rgba(21, 21, 19, 0.18);
  --rule-dark: rgba(243, 239, 232, 0.2);
  --focus: var(--bronze);

  /* Type: two families, five sizes */
  --serif: "Instrument Serif", "Times New Roman", Georgia, serif;
  --sans: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --fs-sm: 0.9375rem;                                          /* 15 */
  --fs-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);         /* 17 → 18 */
  --fs-h3: clamp(1.5rem, 1.35rem + 0.5vw, 1.75rem);            /* 24 → 28 */
  --fs-h2: clamp(2.25rem, 1.55rem + 2.4vw, 3.5rem);            /* 36 → 56 */
  --fs-display: clamp(2.75rem, 1.1rem + 6.4vw, 6rem);          /* 44 → 96 */

  /* 8px spacing grid — only these values */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px; --s6: 64px; --s7: 96px;

  --max: 1120px;
  --wide: 1440px;
  --gutter: 20px;
  --header-h: 64px;
  --bar-h: 64px;           /* mobile action bar */
  --section: var(--s6);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}
@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 80px; --bar-h: 0px; --section: var(--s7); }
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--limestone);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-weight: 400;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}
img, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-display); line-height: 0.95; }
h2 { font-size: var(--fs-h2); line-height: 1.04; }
h3 { font-size: var(--fs-h3); line-height: 1.2; }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: var(--s2); }
ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; }
a:hover { color: var(--bronze); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
::selection { background: var(--bronze); color: var(--limestone); }
[hidden] { display: none !important; }
[id] { scroll-margin-top: calc(var(--header-h) + var(--s3)); }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s2); top: -100px; z-index: 100;
  background: var(--ink); color: var(--limestone); padding: var(--s2) var(--s3);
  text-decoration: none; font-weight: 600;
}
.skip:focus { top: var(--s2); color: var(--limestone); }

/* Lenis (inlined from lenis@1.1.13/dist/lenis.css) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

/* ---------- Layout ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: calc(var(--wide) + 2 * var(--gutter)); }
.section { padding-block: var(--section); }
.section--tint { background: var(--limestone-2); }
.section--dark { background: var(--forest); color: var(--on-dark); --focus: var(--bronze-light); --rule: var(--rule-dark); }
.section--dark a:hover { color: var(--bronze-light); }
.section--ink { background: var(--ink); color: var(--on-dark); --focus: var(--bronze-light); --rule: var(--rule-dark); }
.grid { display: grid; gap: var(--s4); }
@media (min-width: 768px) {
  .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s4); }
}
.measure { max-width: 62ch; }
.muted { color: var(--ink-muted); }
.section--dark .muted, .section--ink .muted { color: var(--on-dark-muted); }
.lede { font-size: var(--fs-h3); font-family: var(--serif); line-height: 1.3; max-width: 30ch; }
.stack > * + * { margin-top: var(--s3); }

/* Kicker label with the "cantilever rule": a bronze hairline that projects
   in from the page edge, like the cedar volume over the glass. */
.kicker {
  display: flex; align-items: center; gap: var(--s2);
  font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600;
  font-variant-caps: all-small-caps; letter-spacing: 0.14em; line-height: 1.2;
  color: var(--bronze); margin: 0 0 var(--s3);
}
.section--dark .kicker, .section--ink .kicker { color: var(--bronze-light); }
.kicker::before { content: ""; flex: 0 0 var(--s5); height: 1px; background: currentColor; }
.kicker--bleed::before {
  --edge: calc(var(--gutter) + max(0px, (100vw - var(--max) - 2 * var(--gutter)) / 2));
  flex-basis: calc(var(--edge) + var(--s5));
  margin-left: calc(-1 * var(--edge));
}
.label {
  font-size: var(--fs-sm); font-weight: 600; font-variant-caps: all-small-caps;
  letter-spacing: 0.14em; line-height: 1.3; color: var(--ink-muted);
}
.section--dark .label, .section--ink .label { color: var(--on-dark-muted); }

/* ---------- Demo note + header ---------- */
.demo-note {
  background: var(--ink); color: var(--on-dark-muted);
  font-size: var(--fs-sm); line-height: 1.4; padding-block: var(--s1);
}
.demo-note p { display: flex; gap: var(--s1); flex-wrap: wrap; }
.demo-note strong { color: var(--limestone); font-weight: 600; }
.demo-note .wrap { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.motion-switch {
  flex: none; min-height: 32px; padding: 0 var(--s1); margin-right: calc(-1 * var(--s1));
  background: none; border: 0; color: var(--limestone); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em;
  --focus: var(--bronze-light);
}
.motion-switch:focus-visible { outline: 2px solid var(--bronze-light); outline-offset: 0; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--limestone);
  border-bottom: 1px solid var(--rule);
  view-transition-name: site-header;
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: var(--s3); }
.brand { display: flex; flex-direction: column; text-decoration: none; line-height: 1; margin-right: auto; min-height: 48px; justify-content: center; }
.brand:hover { color: var(--ink); }
.brand-name, .brand-sub { white-space: nowrap; }
.brand-name { font-family: var(--serif); font-size: var(--fs-h3); letter-spacing: -0.01em; }
.brand-name .amp { color: var(--bronze); }
.brand-sub { font-size: var(--fs-sm); font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: 0.16em; color: var(--ink-muted); margin-top: 4px; }

.nav { display: none; }
.nav ul { display: flex; gap: var(--s4); }
.nav a {
  position: relative; display: inline-flex; align-items: center; min-height: 48px;
  text-decoration: none; font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.01em;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px;
  background: var(--bronze); transform: scaleX(0); transform-origin: right; transition: transform 0.35s var(--ease-out);
}
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.nav a[aria-current="page"] { color: var(--bronze); }
.nav a[aria-current="page"]::after { transform: scaleX(1); }
.btn.header-cta { display: none; }
.menu-toggle {
  min-height: 48px; min-width: 48px; padding: 0 var(--s2); margin-right: calc(-1 * var(--s2));
  background: none; border: 0; cursor: pointer; display: inline-flex; align-items: center; gap: var(--s1);
  font-size: var(--fs-sm); font-weight: 600;
}
.menu-toggle .bars { width: 22px; height: 8px; position: relative; }
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 1.5px; background: currentColor; transition: transform 0.3s var(--ease-out); }
.menu-toggle .bars::before { top: 0; }
.menu-toggle .bars::after { bottom: 0; }
.menu-toggle[aria-expanded="true"] .bars::before { transform: translateY(3.25px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { transform: translateY(-3.25px) rotate(-45deg); }

@media (min-width: 960px) {
  .nav { display: block; }
  .btn.header-cta { display: inline-flex; }
  .menu-toggle { display: none; }
}

/* Mobile menu panel */
.menu-panel {
  position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
  background: var(--limestone); overflow-y: auto;
  padding: var(--s5) var(--gutter) calc(var(--s5) + var(--bar-h));
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s5);
}
.menu-panel ol { counter-reset: m; }
.menu-panel li { border-bottom: 1px solid var(--rule); counter-increment: m; }
.menu-panel li a {
  display: flex; align-items: baseline; gap: var(--s2); padding-block: var(--s2);
  font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.1; text-decoration: none;
}
.menu-panel li a::before { content: "0" counter(m); font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600; color: var(--bronze); min-width: 2.5ch; }
.menu-panel a[aria-current="page"] { color: var(--bronze); }
.menu-panel .menu-contact { display: grid; gap: var(--s1); }
.menu-panel .menu-contact a { min-height: 48px; display: inline-flex; align-items: center; }
html.menu-open { overflow: hidden; }

/* ---------- Buttons & links ---------- */
.btn {
  --btn-bg: var(--bronze); --btn-fg: var(--limestone); --btn-bd: var(--bronze);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s3);
  background: var(--btn-bg); color: var(--btn-fg); border: 1px solid var(--btn-bd); border-radius: 2px;
  font-family: var(--sans); font-size: var(--fs-sm); font-weight: 600; letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn:hover { --btn-bg: var(--bronze-deep); --btn-bd: var(--bronze-deep); color: var(--limestone); }
.btn .arrow { width: 18px; height: 10px; transition: transform 0.35s var(--ease-out); }
.btn:hover .arrow, .link-arrow:hover .arrow { transform: translateX(4px); }
.btn--line { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--ink); }
.btn--line:hover { --btn-bg: var(--ink); --btn-bd: var(--ink); color: var(--limestone); }
.section--dark .btn--line, .section--ink .btn--line, .on-image .btn--line { --btn-fg: var(--limestone); --btn-bd: var(--limestone); }
.section--dark .btn--line:hover, .section--ink .btn--line:hover, .on-image .btn--line:hover { --btn-bg: var(--limestone); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); }
.link-arrow {
  display: inline-flex; align-items: center; gap: var(--s1); min-height: 48px;
  font-weight: 600; font-size: var(--fs-sm); text-decoration: none; border-bottom: 1px solid currentColor;
  min-height: auto; padding-block: var(--s1);
}
.link-arrow .arrow { width: 18px; height: 10px; transition: transform 0.35s var(--ease-out); }

/* ---------- Figures / images ---------- */
.figure { position: relative; overflow: hidden; background: var(--limestone-2); }
.figure img { width: 100%; height: 100%; object-fit: cover; }
.figure--16x9 { aspect-ratio: 16 / 9; }
.figure--3x2 { aspect-ratio: 3 / 2; }
.figure--4x3 { aspect-ratio: 4 / 3; }
.figure--4x5 { aspect-ratio: 4 / 5; }
.figure--21x9 { aspect-ratio: 21 / 9; }
.caption { display: flex; gap: var(--s2); margin-top: var(--s2); font-size: var(--fs-sm); color: var(--ink-muted); line-height: 1.45; }
.caption b { color: var(--bronze); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Status labels: shape + word, never colour alone */
.status {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-size: var(--fs-sm); font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: 0.14em; line-height: 1;
}
.status::before { content: ""; width: 8px; height: 8px; border: 1px solid currentColor; }
.status--sale { color: var(--bronze); }
.status--sale::before { background: currentColor; }
.status--offer { color: var(--ink); }
.status--offer::before { background: linear-gradient(90deg, currentColor 50%, transparent 50%); }
.status--sold { color: var(--ink-muted); }

/* "Title block" — key facts set like the corner block of an architectural drawing */
.titleblock { border: 1px solid var(--ink); }
.titleblock-head {
  display: flex; justify-content: space-between; gap: var(--s2);
  padding: var(--s1) var(--s2); border-bottom: 1px solid var(--ink);
  font-size: var(--fs-sm); font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: 0.14em; line-height: 1.6;
}
.titleblock dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.titleblock dl > div { padding: var(--s2); border-bottom: 1px solid var(--rule); border-right: 1px solid var(--rule); }
.titleblock dl > div:nth-child(2n) { border-right: 0; }
.titleblock dt { font-size: var(--fs-sm); font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--ink-muted); line-height: 1.4; }
.titleblock dd { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.2; margin-top: 4px; }
.titleblock dd small { font-family: var(--sans); font-size: var(--fs-sm); color: var(--ink-muted); display: block; margin-top: 4px; line-height: 1.4; }
@media (min-width: 768px) {
  .titleblock--4 dl { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .titleblock--4 dl > div:nth-child(2n) { border-right: 1px solid var(--rule); }
  .titleblock--4 dl > div:nth-child(4n) { border-right: 0; }
}
.titleblock dl > div:nth-last-child(-n + 2) { border-bottom: 0; }
@media (min-width: 768px) {
  .titleblock--4 dl > div:nth-last-child(-n + 4) { border-bottom: 0; }
}

/* ---------- Home: scroll sequence ---------- */
.seq { position: relative; }
.seq-stage { position: relative; }
.seq-plate { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ink); }
@media (min-width: 768px) { .seq-plate { aspect-ratio: 16 / 9; } }
.seq-poster, .seq-canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seq-canvas, .seq-scrim, .seq-hud, .seq-hint { display: none; }

/* Static (reduced motion / no JS): image, then the beats as an editorial list */
.seq-beats { padding: var(--s5) var(--gutter) var(--s6); max-width: calc(var(--max) + 2 * var(--gutter)); margin-inline: auto; display: grid; gap: var(--s5); }
.beat-lg { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1.05; max-width: 20ch; letter-spacing: -0.01em; }
.beat .beat-sub { margin-top: var(--s2); max-width: 44ch; }
.beat-1 .price { font-family: var(--serif); font-size: var(--fs-h3); margin-top: var(--s2); }
.beat-1 h1 { margin-top: var(--s1); }
.beat .btn-row { margin-top: var(--s4); }
@media (min-width: 768px) {
  .seq-beats { grid-template-columns: 1fr 1fr; column-gap: var(--s6); }
  .seq-beats .beat-1, .seq-beats .beat-5 { grid-column: 1 / -1; }
}

/* Motion: sticky full-viewport plate that scrubs frames */
.motion .seq { height: 600vh; }
.motion .seq-stage {
  --plate-x: var(--s2); --plate-y: var(--s2);
  position: sticky; top: var(--header-h);
  height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h));
  overflow: hidden;
}
@media (min-width: 768px) { .motion .seq-stage { --plate-x: var(--s4); --plate-y: var(--s3); } }
.motion .seq-plate {
  position: absolute; inset: 0; aspect-ratio: auto;
  clip-path: inset(calc((1 - var(--open, 0)) * var(--plate-y)) calc((1 - var(--open, 0)) * var(--plate-x)));
}
.motion .seq-canvas { display: block; opacity: 0; transition: opacity 0.4s; }
.motion .seq-canvas.is-live { opacity: 1; }
.motion .seq-scrim {
  display: block; position: absolute; inset: 0; pointer-events: none;
  /* legibility overlay for the text beats, not decoration */
  background:
    linear-gradient(to top, rgba(21, 21, 19, 0.82) 0%, rgba(21, 21, 19, 0.55) 34%, rgba(21, 21, 19, 0) 66%),
    linear-gradient(to right, rgba(21, 21, 19, 0.35), rgba(21, 21, 19, 0) 60%);
}
.motion .seq-beats { position: absolute; inset: 0; padding: 0; max-width: none; display: block; pointer-events: none; }
.motion .beat {
  position: absolute;
  left: max(calc(var(--plate-x) + var(--gutter)), calc((100% - var(--max)) / 2));
  right: calc(var(--plate-x) + var(--gutter));
  bottom: calc(var(--plate-y) + var(--s5) + var(--bar-h));
  color: var(--limestone); opacity: 0; will-change: opacity, transform;
  --focus: var(--limestone);
}
.motion .beat.is-active { pointer-events: auto; }
.motion .beat-1 { opacity: 1; bottom: calc(var(--plate-y) + var(--s5) + var(--bar-h) + var(--note-h, 0px)); }
.motion .beat .label { color: var(--on-dark-muted); }
.motion .beat .kicker { color: var(--bronze-light); }
.motion .beat-1 h1 { max-width: 10ch; }
.motion .seq-hud {
  display: grid; grid-template-columns: auto auto; column-gap: var(--s2); row-gap: 4px; align-items: baseline;
  position: absolute; top: calc(var(--plate-y) + var(--s2)); left: calc(var(--plate-x) + var(--s2));
  background: rgba(21, 21, 19, 0.86); color: var(--limestone);
  padding: var(--s1) var(--s2); font-size: var(--fs-sm); line-height: 1.3; font-variant-numeric: tabular-nums;
}
.seq-hud .hud-time { font-weight: 600; }
.seq-hud .label { color: var(--on-dark-muted); }
.seq-hud .hud-phase, .seq-hud .hud-deg { color: var(--on-dark-muted); font-variant-caps: all-small-caps; letter-spacing: 0.12em; }
.seq-hud .hud-bar { grid-column: 1 / -1; height: 1px; background: var(--rule-dark); margin-top: 4px; position: relative; }
.seq-hud .hud-bar i { position: absolute; inset: 0; background: var(--bronze-light); transform-origin: left; transform: scaleX(0); }
@media (min-width: 768px) {
  .motion .seq-hud { left: auto; right: calc(var(--plate-x) + var(--s3)); top: calc(var(--plate-y) + var(--s3)); }
  .motion .seq-hint {
    display: flex; align-items: center; gap: var(--s2);
    position: absolute; right: calc(var(--plate-x) + var(--s4)); bottom: calc(var(--plate-y) + var(--s5));
    color: var(--limestone); font-size: var(--fs-sm); font-weight: 600; transition: opacity 0.4s;
  }
  .seq-hint .hint-line { width: 1px; height: var(--s5); background: var(--rule-dark); position: relative; overflow: hidden; }
  .seq-hint .hint-line::after { content: ""; position: absolute; inset: 0; background: var(--limestone); animation: hint 2.2s var(--ease-out) infinite; }
  .seq-hint.is-gone { opacity: 0; }
}
@keyframes hint { from { transform: translateY(-100%); } to { transform: translateY(100%); } }

/* ---------- Home: sections after the sequence ---------- */
@media (min-width: 768px) { .intro-grid .intro-label { grid-column: 1 / 4; } }
@media (min-width: 768px) { .intro-grid .intro-body { grid-column: 4 / -1; } }
.intro-body h2 { max-width: 18ch; }
.intro-body .intro-text { margin-top: var(--s5); display: grid; gap: var(--s4); }
@media (min-width: 768px) {
  .intro-body .intro-text { grid-template-columns: 1fr 1fr; }
}

.feature { align-items: end; }
@media (min-width: 768px) { .feature .feature-media { grid-column: 1 / 8; } }
@media (min-width: 768px) { .feature .feature-info { grid-column: 8 / -1; padding-bottom: var(--s1); } }
.feature-info h2, .listing-main h2 { width: fit-content; }
.feature-info .price, .listing-main .price { font-family: var(--serif); font-size: var(--fs-h3); margin-top: var(--s2); }
.feature-info .titleblock, .listing-main .titleblock { margin-block: var(--s4); }
.vt-halden-image { view-transition-name: halden-image; }
.vt-halden-title { view-transition-name: halden-title; }

.steps { counter-reset: step; border-top: 1px solid var(--rule); margin-top: var(--s5); }
.step { display: grid; gap: var(--s2); padding-block: var(--s4); border-bottom: 1px solid var(--rule); }
.step-num { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1; color: var(--bronze-light); font-variant-numeric: lining-nums; }
.step h3 { margin-bottom: var(--s1); }
@media (min-width: 768px) {
  .step { grid-template-columns: 2fr 4fr 6fr; gap: var(--s4); align-items: baseline; padding-block: var(--s5); }
}
.sell-head { display: grid; gap: var(--s3); }
@media (min-width: 768px) { .sell-head { grid-template-columns: 7fr 5fr; align-items: end; gap: var(--s6); } }

.cta-block h2 { max-width: 20ch; }
.cta-block .btn-row { margin-top: var(--s5); }
.cta-block p { margin-top: var(--s3); max-width: 52ch; }

/* ---------- Page heads (inner pages) ---------- */
.page-head { padding-top: var(--s6); padding-bottom: var(--s5); }
@media (min-width: 768px) { .page-head { padding-top: var(--s7); padding-bottom: var(--s6); } }
.page-head h1 { max-width: 16ch; }
.page-head .lede, .page-head .page-intro { margin-top: var(--s4); }
.page-intro { max-width: 52ch; }
.crumbs { font-size: var(--fs-sm); color: var(--ink-muted); margin-bottom: var(--s3); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: var(--s1); }
.crumbs li + li::before { content: "/"; margin-right: var(--s1); color: var(--rule); }
.crumbs a { display: inline-flex; min-height: 24px; align-items: center; }

/* ---------- Listings ---------- */
.listing-main { align-items: end; border-top: 1px solid var(--ink); padding-top: var(--s4); }
@media (min-width: 768px) { .listing-main .listing-media { grid-column: 1 / 8; } }
@media (min-width: 768px) { .listing-main .listing-info { grid-column: 8 / -1; } }
.listing-meta { display: flex; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s3); }
.listing-row {
  display: grid; gap: var(--s3); padding-block: var(--s5); border-top: 1px solid var(--ink);
}
.listing-row:last-child { border-bottom: 1px solid var(--ink); }
.listing-row h2 { font-size: var(--fs-h2); }
.listing-row .listing-place { margin-top: var(--s1); }
.listing-row .listing-specs { font-size: var(--fs-sm); color: var(--ink-muted); margin-top: var(--s2); }
.listing-plate {
  border: 1px solid var(--rule); padding: var(--s4); display: grid; align-content: space-between; gap: var(--s4);
  background:
    repeating-linear-gradient(90deg, transparent 0 23px, var(--rule) 23px 24px); /* cedar batten rhythm */
  background-color: var(--limestone-2);
  min-height: 200px;
}
.listing-plate p { background: var(--limestone-2); padding: var(--s1) 0; max-width: 34ch; }
.listing-plate .plate-mark { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.2; }
@media (min-width: 768px) {
  .listing-row { grid-template-columns: 2fr 5fr 5fr; gap: var(--s4); align-items: start; }
}
.listing-num { font-family: var(--serif); font-size: var(--fs-h3); color: var(--bronze); line-height: 1.2; }
.off-market { margin-top: var(--s6); }

/* ---------- Property ---------- */
.prop-head { display: grid; gap: var(--s4); align-items: end; }
.prop-head h1 { width: fit-content; }
.prop-head .prop-sum { display: grid; gap: var(--s2); }
.prop-head .price { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1; }
@media (min-width: 768px) { .prop-head { grid-template-columns: 7fr 5fr; gap: var(--s6); } }
.prop-hero { margin-top: var(--s5); }
.prop-hero .figure { aspect-ratio: 4 / 3; }
@media (min-width: 768px) { .prop-hero .figure { aspect-ratio: 21 / 9; } }

@media (min-width: 768px) { .desc-grid .desc-label { grid-column: 1 / 4; } }
@media (min-width: 768px) { .desc-grid .desc-body { grid-column: 4 / -1; } }
.desc-body h2 { max-width: 20ch; }
.desc-body .desc-text { margin-top: var(--s5); columns: 1; }
@media (min-width: 960px) { .desc-body .desc-text { columns: 2; column-gap: var(--s5); } .desc-text p { break-inside: avoid; } }

.gallery { display: grid; gap: var(--s4); margin-top: var(--s5); }
.gallery figure { min-width: 0; }
.gallery .g-btn { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.gallery .g-btn:focus-visible { outline-offset: 4px; }
.gallery .figure { display: block; aspect-ratio: 4 / 3; }
.gallery .figure img { transition: transform 1.2s var(--ease-out); }
@media (hover: hover) { .gallery .g-btn:hover .figure > img { transform: scale(1.03); } }
@media (min-width: 768px) {
  .gallery { grid-template-columns: repeat(12, minmax(0, 1fr)); row-gap: var(--s6); }
  .gallery .g1 { grid-column: 1 / -1; } .gallery .g1 .figure { aspect-ratio: 21 / 9; }
  .gallery .g2 { grid-column: 1 / 8; align-self: end; } .gallery .g2 .figure { aspect-ratio: 4 / 3; }
  .gallery .g3 { grid-column: 9 / -1; } .gallery .g3 .figure { aspect-ratio: 4 / 5; }
  .gallery .g4 { grid-column: 3 / -1; } .gallery .g4 .figure { aspect-ratio: 16 / 7; }
  .gallery .g5 { grid-column: 1 / 10; } .gallery .g5 .figure { aspect-ratio: 16 / 9; }
}

.features { border-top: 1px solid var(--rule); margin-top: var(--s5); }
.features li { display: grid; gap: var(--s1); padding-block: var(--s3); border-bottom: 1px solid var(--rule); }
.features h3 { font-size: var(--fs-h3); }
@media (min-width: 768px) {
  .features { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s6); }
  .features li { grid-template-columns: 1fr; }
}

@media (min-width: 768px) { .loc-grid .loc-text { grid-column: 1 / 7; } }
@media (min-width: 768px) { .loc-grid .loc-list { grid-column: 8 / -1; } }
.distances li { display: flex; justify-content: space-between; gap: var(--s2); padding-block: var(--s2); border-bottom: 1px solid var(--rule); }
.distances li:first-child { border-top: 1px solid var(--rule); }
.distances span:last-child { font-variant-numeric: tabular-nums; color: var(--on-dark-muted); white-space: nowrap; }
.section:not(.section--dark) .distances span:last-child { color: var(--ink-muted); }

/* ---------- Forms ---------- */
@media (min-width: 768px) { .form-grid .form-intro { grid-column: 1 / 6; } }
@media (min-width: 768px) { .form-grid .form-wrap { grid-column: 7 / -1; } }
.form { display: grid; gap: var(--s3); }
.form .row { display: grid; gap: var(--s3); }
@media (min-width: 600px) { .form .row { grid-template-columns: 1fr 1fr; } }
.field { display: grid; gap: var(--s1); }
.field label { font-size: var(--fs-sm); font-weight: 600; }
.field label .opt { font-weight: 400; color: var(--ink-muted); }
.section--dark .field label .opt { color: var(--on-dark-muted); }
.field input, .field textarea, .field select {
  width: 100%; min-height: 48px; padding: 12px var(--s2);
  font: inherit; font-size: var(--fs-body); color: var(--ink);
  background: #fbf9f5; border: 1px solid #8c857a; border-radius: 2px;
  transition: border-color 0.2s;
}
.field textarea { min-height: 136px; resize: vertical; }
.field input:hover, .field textarea:hover { border-color: var(--ink); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: #a3271d; border-width: 2px; }
.field .error { font-size: var(--fs-sm); color: #a3271d; font-weight: 600; min-height: 0; }
.section--dark .field .error { color: #f2b8a8; }
.field .error:empty { display: none; }
.form-note { font-size: var(--fs-sm); color: var(--ink-muted); }
.section--dark .form-note { color: var(--on-dark-muted); }
.form-done { border: 1px solid currentColor; padding: var(--s4); }
.form-done h3 { margin-bottom: var(--s2); }
.form-done:focus { outline: none; }
.form-done:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }

/* ---------- About ---------- */
@media (min-width: 768px) { .story-grid .story-label { grid-column: 1 / 4; } }
@media (min-width: 768px) { .story-grid .story-body { grid-column: 4 / 11; } }
.principles { border-top: 1px solid var(--rule); margin-top: var(--s5); counter-reset: pr; }
.principles li { display: grid; gap: var(--s1); padding-block: var(--s3); border-bottom: 1px solid var(--rule); counter-increment: pr; }
.principles li::before { content: counter(pr, upper-roman) "."; font-family: var(--serif); font-size: var(--fs-h3); color: var(--bronze); line-height: 1.2; }
@media (min-width: 768px) { .principles li { grid-template-columns: 1fr 5fr 6fr; gap: var(--s4); align-items: baseline; } }

.team { border-top: 1px solid var(--ink); margin-top: var(--s5); }
.agent { display: grid; gap: var(--s3); padding-block: var(--s5); border-bottom: 1px solid var(--rule); }
.monogram {
  width: 96px; height: 96px; display: grid; place-items: center;
  border: 1px solid var(--ink); font-family: var(--serif); font-size: var(--fs-h2); line-height: 1; letter-spacing: 0.02em;
  position: relative;
}
.monogram::after { content: ""; position: absolute; left: -1px; right: -1px; bottom: 16px; height: 1px; background: var(--bronze); }
.agent h3 { font-size: var(--fs-h2); line-height: 1.05; }
.agent .role { margin-top: var(--s1); }
.agent .agent-contact { display: grid; gap: 4px; font-size: var(--fs-sm); }
.agent .agent-contact a { display: inline-flex; min-height: 32px; align-items: center; }
@media (min-width: 768px) {
  .agent { grid-template-columns: 2fr 4fr 6fr; gap: var(--s4); align-items: start; }
  .agent .agent-bio { display: grid; gap: var(--s3); }
}

/* ---------- Contact ---------- */
@media (min-width: 768px) { .contact-grid .contact-info { grid-column: 1 / 6; } }
@media (min-width: 768px) { .contact-grid .form-wrap { grid-column: 7 / -1; } }
.office dl { border-top: 1px solid var(--rule); }
.office dl > div { display: grid; gap: 4px; padding-block: var(--s3); border-bottom: 1px solid var(--rule); }
.office dt { font-size: var(--fs-sm); font-weight: 600; font-variant-caps: all-small-caps; letter-spacing: 0.14em; color: var(--ink-muted); }
.office dd a { display: inline-flex; min-height: 32px; align-items: center; }
.office .big { font-family: var(--serif); font-size: var(--fs-h3); line-height: 1.25; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: var(--on-dark); --focus: var(--bronze-light); padding-top: var(--s6); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--bronze-light); text-decoration: underline; }
.footer-top { display: grid; gap: var(--s5); padding-bottom: var(--s6); border-bottom: 1px solid var(--rule-dark); }
.footer-mark { font-family: var(--serif); font-size: var(--fs-h2); line-height: 1; }
.footer-mark .amp { color: var(--bronze-light); }
.footer-top h2.label { margin-bottom: var(--s2); color: var(--on-dark-muted); font-family: var(--sans); }
.footer-top li a, .footer-top address a { display: inline-flex; min-height: 40px; align-items: center; }
.footer-top address { font-style: normal; }
.footer-col p { color: var(--on-dark-muted); }
@media (min-width: 768px) { .footer-top { grid-template-columns: 4fr 3fr 3fr 2fr; gap: var(--s4); } }
.footer-base { display: grid; gap: var(--s2); padding-block: var(--s4); font-size: var(--fs-sm); color: var(--on-dark-muted); }
@media (min-width: 768px) { .footer-base { grid-template-columns: 1fr auto; } }

/* ---------- Mobile action bar ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--ink); padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--rule-dark); --focus: var(--bronze-light);
}
.action-bar a {
  display: flex; align-items: center; justify-content: center; gap: var(--s1);
  height: var(--bar-h); text-decoration: none; font-weight: 600; font-size: var(--fs-sm);
  color: var(--limestone);
}
.action-bar a:focus-visible { outline-offset: -4px; }
.action-bar a + a { background: var(--bronze); }
.action-bar svg { width: 18px; height: 18px; }
@media (min-width: 768px) { .action-bar { display: none; } }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: var(--ink); color: var(--limestone); --focus: var(--bronze-light);
}
.lightbox::backdrop { background: var(--ink); }
.lightbox[open] { display: grid; grid-template-rows: auto 1fr auto; }
.lb-top, .lb-bottom { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); padding: var(--s2) var(--gutter); }
.lb-stage { min-height: 0; display: grid; place-items: center; padding-inline: var(--gutter); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-caption { font-size: var(--fs-sm); color: var(--on-dark-muted); max-width: 60ch; }
.lb-count { font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.lb-btn {
  min-width: 48px; min-height: 48px; padding: 0 var(--s2); background: none; border: 1px solid var(--rule-dark); border-radius: 2px;
  color: var(--limestone); cursor: pointer; font-size: var(--fs-sm); font-weight: 600;
}
.lb-btn:hover { border-color: var(--limestone); }
.lb-nav { display: flex; gap: var(--s1); }

/* ---------- Motion initial states (only when JS + motion are on) ---------- */
.motion [data-split] { visibility: hidden; }
.motion [data-reveal] { clip-path: inset(100% 0% 0% 0%); }
.motion [data-parallax] > img { position: absolute; left: 0; top: -6%; height: 112%; }
.split-line { display: block; overflow: hidden; padding-bottom: 0.1em; margin-bottom: -0.1em; }
.split-line > span { display: inline-block; will-change: transform; }

/* ---------- Cross-page transitions (View Transitions API) ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out 0.5s cubic-bezier(0.7, 0, 0.84, 0) both; }
::view-transition-new(root) { animation: vt-in 0.95s var(--ease-out) both; }
::view-transition-group(halden-image),
::view-transition-group(halden-title) { animation-duration: 0.95s; animation-timing-function: var(--ease-out); }
::view-transition-old(halden-image),
::view-transition-new(halden-image) { width: 100%; height: 100%; object-fit: cover; overflow: clip; }
::view-transition-group(site-header) { animation: none; z-index: 10; }
::view-transition-old(site-header) { display: none; }
::view-transition-new(site-header) { animation: none; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-24px); } }
@keyframes vt-in {
  from { clip-path: inset(100% 0 0 0); transform: translateY(48px); }
  to { clip-path: inset(0 0 0 0); transform: none; }
}

/* Reduced motion: honoured unless the visitor switches animations on (see .motion-switch).
   Cross-page transitions are skipped from the head script when .motion is absent. */
@media (prefers-reduced-motion: reduce) {
  html:not(.motion) *, html:not(.motion) *::before, html:not(.motion) *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* Listings: off-market note */
@media (min-width: 768px) {
  .off-market .om-text { grid-column: 1 / 8; }
  .off-market .om-cta { grid-column: 9 / -1; align-self: end; }
}
