/* ==========================================================================
   SPUR HOMES — Base: reset, typography, layout primitives, utilities
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Lenis owns scrolling when active; native smooth would fight it. */
html.lenis, html.lenis body { height: auto; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }

body {
  margin: 0;
  min-height: 100dvh;
  background-color: var(--color-bg);
  color: var(--color-fg);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* Warm architectural wash behind everything */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(1100px 700px at 8% -6%, rgba(233, 234, 226, 0.85), transparent 62%),
    radial-gradient(900px 620px at 96% 12%, rgba(234, 223, 199, 0.5), transparent 60%),
    radial-gradient(800px 800px at 50% 108%, rgba(210, 212, 198, 0.45), transparent 65%);
}

img, svg, video, canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

a {
  color: inherit;
  text-decoration-color: color-mix(in srgb, currentColor 35%, transparent);
  text-underline-offset: 0.22em;
}

/* --- Headings ------------------------------------------------------------ */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-4);
  font-family: var(--font-display);
  font-weight: 500;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--ink-900);
  text-wrap: balance;
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p { margin: 0 0 var(--space-4); text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

strong, b { font-weight: 700; color: var(--ink-900); }

ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25em; }
li { margin-bottom: var(--space-2); }

hr {
  border: 0;
  height: 1px;
  background: var(--color-border);
  margin: var(--space-7) 0;
}

::selection {
  background: var(--olive-200);
  color: var(--ink-900);
}

/* --- Focus --------------------------------------------------------------- */
:focus { outline: none; }
:focus-visible {
  outline: 3px solid var(--color-ring);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: var(--space-4);
  z-index: var(--z-toast);
  padding: var(--space-3) var(--space-5);
  background: var(--olive-700);
  color: #fff;
  border-radius: var(--radius-pill);
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform var(--dur-base) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

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

/* --- Layout primitives --------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--wide { max-width: var(--container-wide); }
.container--narrow { max-width: 820px; }

.section {
  position: relative;
  padding-block: var(--section-y);
}
.section--tight { padding-block: clamp(3rem, 6vw, 6rem); }
.section--flush-top { padding-top: 0; }

/* --- Section headers ----------------------------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--gold-700);
}
.eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section-head { max-width: 62ch; margin-bottom: var(--space-8); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow::before { display: none; }

.lede {
  font-size: var(--text-lg);
  line-height: 1.6;
  color: var(--color-fg-muted);
  max-width: 60ch;
}
.section-head--center .lede { margin-inline: auto; }

/* Serif italic used for brand-voice emphasis (mirrors the guide's script) */
.accent-script {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  color: var(--olive-600);
}

/* --- Grid ---------------------------------------------------------------- */
.grid { display: grid; gap: var(--space-5); }
@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 992px) {
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
  .grid--3-lg { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 991px) {
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 575px) {
  .grid--4 { grid-template-columns: 1fr; }
}

/* --- Utilities ----------------------------------------------------------- */
.text-center { text-align: center; }
.text-muted { color: var(--color-fg-muted); }
.text-balance { text-wrap: balance; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-6); }
.flow-tight { max-width: 58ch; }

.tabular { font-variant-numeric: tabular-nums; }

/* Media wrapper that reserves space (prevents CLS) */
.media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--sand-300);
}
.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--4x3 { aspect-ratio: 4 / 3; }
.media--3x2 { aspect-ratio: 3 / 2; }
.media--16x9 { aspect-ratio: 16 / 9; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 3 / 4; }

/* --- Scroll-reveal base state (GSAP takes over when JS runs) -------------- */
[data-reveal] { will-change: transform, opacity; }
.js [data-reveal] { opacity: 0; }
.js [data-reveal="up"]    { transform: translate3d(0, 28px, 0); }
.js [data-reveal="fade"]  { transform: none; }
.js [data-reveal="left"]  { transform: translate3d(-28px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(28px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(0.965); }
.reveal-done { will-change: auto; }

/* No-JS and reduced-motion users must still see everything */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
