/* Marlow & Finch Homes: reset, type scale and layout rhythm.
 * Brand values come from tokens.css (generated from design-guide/tokens.json).
 * Scale and spacing follow design-guide/current.md (Heading style, Spacing scale).
 * Skeleton stage: layout and type only; colour, texture and motion arrive in the styling pass.
 */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

:root {
  --font-display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --font-text: "Mulish", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;

  /* Type scale (design-guide/current.md, Heading style) */
  --t-welcome: clamp(1.75rem, 1.2rem + 2.4vw, 3.5rem);
  --t-h1: clamp(2.25rem, 1.4rem + 3.4vw, 4.25rem);
  --t-h2: clamp(1.875rem, 1.3rem + 2.2vw, 3.25rem);
  --t-h3: clamp(1.25rem, 1.1rem + 0.6vw, 1.625rem);
  --t-body: clamp(1.0625rem, 1rem + 0.2vw, 1.125rem);
  --t-lead: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  --t-small: 0.9375rem;
  --t-label: 0.75rem;
  --lh-heading: 1.08;
  --lh-body: 1.65;
  --measure: 64ch;

  /* Spacing scale: 4, 8, 12, 16, 24, 32, 48, 64, 96, 128, 160 */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;
  --space-10: 8rem;
  --space-11: 10rem;

  --gutter: 20px;
  --page-max: 1320px;
  --section-pad: 5rem;
  --heading-gap: 1.5rem;
  --card-gap: 1rem;

  --header-h: 72px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --topbar-h: 40px;
}

@media (min-width: 48em) {
  :root { --gutter: 48px; }
}

@media (min-width: 64em) {
  :root {
    --gutter: 64px;
    --section-pad: 9rem;
    --heading-gap: 2.5rem;
    --card-gap: 1.5rem;
  }
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--t-body);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: var(--lh-heading);
  text-wrap: balance;
}
h1 { font-size: var(--t-h1); }
h2 { font-size: var(--t-h2); }
h3 { font-size: var(--t-h3); line-height: 1.2; }
h4 { font-size: var(--t-h3); line-height: 1.2; }

p { margin: 0; }
p + p { margin-top: var(--space-4); }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
figure, blockquote { margin: 0; }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

/* ─── Layout primitives ─── */
.wrap {
  width: 100%;
  max-width: calc(var(--page-max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.band { padding-block: var(--section-pad); }
.measure { max-width: var(--measure); }

.on-dark { color: var(--color-linen); }
.on-dark :is(h1, h2, h3, .h-bracket) { color: var(--color-linen); }

.label {
  display: block;
  margin: 0 0 var(--space-3);
  font-family: var(--font-text);
  font-size: var(--t-label);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.lead { font-size: var(--t-lead); }

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

/* ─── Headings: the frame's top left corner, a small brass bracket beside the first line ─── */
.h-bracket { position: relative; padding-left: 1.75rem; color: var(--color-forest); }
.h-bracket::before {
  content: "";
  position: absolute; left: 0; top: 0.18em;
  width: 0.9rem; height: 0.9rem;
  border-top: 2px solid var(--color-brass);
  border-left: 2px solid var(--color-brass);
}
@media (min-width: 64em) { .h-bracket { padding-left: 2.25rem; } .h-bracket::before { width: 1.25rem; height: 1.25rem; } }

/* ─── Buttons: one main style (brass fill, forest words, the roof chevron), one outline; sharp corners, 52px ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: 0 var(--space-5);
  font-family: var(--font-text);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-decoration: none;
  border: 1.5px solid currentColor;
  border-radius: 0;
  background: transparent;
  color: var(--color-forest);
  cursor: pointer;
  transition: background-color 400ms var(--ease), color 400ms var(--ease), border-color 400ms var(--ease);
}
.btn--main { border-color: var(--color-brass); background: var(--color-brass); color: var(--color-forest); }
.btn--main:hover { background: var(--color-brass-pale); border-color: var(--color-brass-pale); }
.btn--line:hover { background: var(--color-forest); color: var(--color-linen); border-color: var(--color-forest); }
.on-dark .btn--line { color: var(--color-linen); }
.on-dark .btn--line:hover { background: var(--color-linen); color: var(--color-forest); border-color: var(--color-linen); }
.btn__ico { width: 18px; height: 18px; flex: none; transition: transform 400ms var(--ease); }
.btn:hover .btn__ico { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--color-forest); outline-offset: 3px; }
.on-dark .btn:focus-visible { outline-color: var(--color-linen); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-6);
}

.ico {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.ico--fill { fill: currentColor; stroke: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; animation-delay: 0ms !important; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

a[href^="tel:"], a[href^="mailto:"] { white-space: nowrap; }
