/* ==========================================================================
   Bannister Custom Homes: Stylesheet
   Built from Brand Kit V1 tokens. Breakpoints: 1200 desktop / 900 tablet / 640 mobile.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,wght@0,400;0,500;1,400&family=Archivo:wght@400;500;600;700&display=swap');

:root {
  --ink: #1A1815;
  --graphite: #6E6862;
  --stone: #E5E0D8;
  --paper: #FAF8F4;
  --white: #FFFFFF;
  --pine: #33503C;
  --clay: #6A4433;

  --font-display: 'Newsreader', Georgia, serif;
  --font-body: 'Archivo', system-ui, -apple-system, sans-serif;

  --size-display: clamp(36px, 5.4vw + 10px, 64px);
  --lh-display: 1.05;
  --size-h2: clamp(26px, 2.6vw + 12px, 32px);
  --lh-h2: 1.2;
  --size-body-lg: 19px;
  --lh-body-lg: 1.6;
  --size-body: 17px;
  --lh-body: 1.65;
  --size-label: 12px;
  --track-label: 0.14em;

  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 88px;

  --container: 1200px;
  --gutter: 40px;
  --gutter-sm: 20px;
  --grid-gap: 24px;
  --section-gap: 88px;
  --section-gap-sm: 56px;
  --max-measure: 66ch;

  --rule: 1px solid var(--stone);
  --radius: 0;
  --control-h: 52px;
  --focus-border: 1px solid var(--ink);

  --ease: cubic-bezier(0.2, 0, 0.2, 1);
  --dur-hover: 150ms;
  --dur-enter: 200ms;
  --enter-travel: 12px;

  --gap: var(--gutter-sm);
  --section-space: var(--section-gap-sm);
}

@media (min-width: 900px) {
  :root {
    --gap: var(--gutter);
    --section-space: var(--section-gap);
  }
}

/* ---------------------------------- Reset ---------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
  word-break: break-word;
}
html { overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3, p, figure { margin: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------- Layout ---------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
}

.section {
  padding-top: var(--section-space);
  padding-bottom: var(--section-space);
}

.section-rule { border-top: var(--rule); }
.section-white { background: var(--white); }

.grid {
  display: grid;
  gap: var(--grid-gap);
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.grid > * { min-width: 0; }

@media (min-width: 900px) {
  .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.measure { max-width: var(--max-measure); }

/* ---------------------------------- Type ---------------------------------- */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--size-display);
  line-height: var(--lh-display);
  letter-spacing: -0.01em;
}
.heading {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--size-h2);
  line-height: var(--lh-h2);
}
.body-lg { font-size: var(--size-body-lg); line-height: var(--lh-body-lg); }
.body { font-size: var(--size-body); line-height: var(--lh-body); }
.label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--size-label);
  line-height: 1.1;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
}
.text-graphite { color: var(--graphite); font-size: 15px; }
.text-pine { color: var(--pine); }
.text-clay { color: var(--clay); }
.italic { font-style: italic; }

.section-kicker {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}
.section-kicker .label { color: var(--pine); }

/* ---------------------------------- Buttons ---------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  transition: background-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
}
.btn-primary:hover, .btn-primary:focus-visible { background: var(--pine); border-color: var(--pine); }

.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-secondary:hover, .btn-secondary:focus-visible { background: var(--ink); color: var(--paper); }

.btn-tertiary {
  color: var(--pine);
  border-bottom: 1px solid var(--stone);
  min-height: auto;
  padding: 0 0 2px 0;
  font-weight: 600;
}
.btn-tertiary:hover, .btn-tertiary:focus-visible { border-color: var(--pine); }

.btn-row { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }

:focus-visible { outline: var(--focus-border); outline-offset: 2px; }

/* ---------------------------------- Logo ---------------------------------- */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.logo-mark { width: 34px; height: 26px; flex: none; }
.logo-mark path { fill: none; stroke: var(--ink); stroke-width: 2.2; }
.logo-word { line-height: 1.1; }
.logo-word .b1 {
  display: block;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.03em;
}
.logo-word .b2 {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--graphite);
  text-transform: uppercase;
  margin-top: 2px;
}
.logo-invert .logo-mark path { stroke: var(--paper); }
.logo-invert .b1 { color: var(--paper); }
.logo-invert .b2 { color: var(--stone); }

/* ---------------------------------- Header ---------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  border-bottom: var(--rule);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
}
.nav-desktop {
  display: none;
  align-items: center;
  gap: var(--space-4);
}
.nav-desktop a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 15px;
  padding: 4px 0;
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav-desktop a:hover { border-color: var(--pine); color: var(--pine); }
.nav-desktop a[aria-current="page"] { color: var(--pine); border-color: var(--pine); }

.nav-right { display: flex; align-items: center; gap: var(--space-3); }
.nav-call {
  display: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
}

.nav-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: 1px solid var(--stone);
}
.nav-toggle svg { width: 20px; height: 20px; }

@media (min-width: 900px) {
  .nav-desktop { display: flex; }
  .nav-call { display: inline-flex; }
  .nav-toggle { display: none; }
}

.mobile-menu {
  position: fixed;
  inset: 76px 0 0 0;
  background: var(--paper);
  z-index: 39;
  padding: var(--space-4) var(--gutter-sm);
  display: none;
  overflow-y: auto;
}
.mobile-menu.is-open { display: block; }
.mobile-menu a {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  padding: var(--space-2) 0;
  border-bottom: var(--rule);
}
.mobile-menu .btn { margin-top: var(--space-4); width: 100%; }

@media (min-width: 900px) {
  .mobile-menu { display: none !important; }
}

/* ---------------------------------- Hero ---------------------------------- */
.hero { position: relative; }
.hero-media {
  position: relative;
  height: 640px;
  overflow: hidden;
}
@media (min-width: 480px) {
  .hero-media { height: 600px; }
}
@media (min-width: 640px) {
  .hero-media { height: auto; aspect-ratio: 16 / 9; }
}
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(26,24,21,0.78) 0%, rgba(26,24,21,0.38) 32%, rgba(26,24,21,0) 62%);
}
.hero-content {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--space-4) var(--gap) var(--space-5);
  color: var(--paper);
}
.hero-content .display { color: var(--white); }
.hero-content .body-lg { color: var(--stone); margin-top: var(--space-2); max-width: 52ch; }
.hero-eyebrow { color: var(--stone); margin-bottom: var(--space-1); }

.page-hero {
  padding-top: var(--space-5);
  padding-bottom: var(--space-4);
}
.page-hero .label { color: var(--pine); }
.page-hero .heading-xl {
  font-family: var(--font-display);
  font-size: var(--size-display);
  line-height: var(--lh-display);
  margin-top: var(--space-1);
}

/* ---------------------------------- Stats ---------------------------------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  padding: var(--space-4) 0;
}
@media (min-width: 640px) { .stat-row { grid-template-columns: repeat(3, 1fr); } }
.stat-num {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--pine);
}
.stat-label { margin-top: 4px; }

/* ---------------------------------- Cards / Process ---------------------------------- */
.card {
  border: var(--rule);
  padding: var(--space-3);
  background: var(--white);
}
.process-num {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--stone);
}
.process-title {
  font-family: var(--font-display);
  font-size: 21px;
  margin-top: var(--space-1);
  margin-bottom: var(--space-1);
}

.info-card { border: var(--rule); padding: var(--space-3); }

/* ---------------------------------- Portfolio ---------------------------------- */
.tile { display: block; }
.tile-media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--stone);
}
.tile-media img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 400ms var(--ease);
}
a.tile:hover .tile-media img { transform: scale(1.03); }
.tile-name {
  font-family: var(--font-display);
  font-size: 22px;
  margin-top: var(--space-2);
}
.tile-meta { color: var(--graphite); font-size: 14px; margin-top: 2px; }

.placeholder-tile {
  aspect-ratio: 4 / 3;
  background: repeating-linear-gradient(135deg, var(--stone) 0px, var(--stone) 10px, var(--white) 10px, var(--white) 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-3);
  border: var(--rule);
}
.placeholder-tile span {
  background: var(--paper);
  padding: var(--space-1) var(--space-2);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--graphite);
  border: var(--rule);
}

/* ---------------------------------- Forms ---------------------------------- */
.field { margin-bottom: var(--space-3); min-width: 0; }
.field label {
  display: block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--size-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--graphite);
  margin-bottom: var(--space-1);
}
.field input, .field textarea {
  width: 100%;
  max-width: 100%;
  min-height: var(--control-h);
  border: 1px solid var(--stone);
  background: var(--white);
  padding: 0 var(--space-2);
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  border-radius: var(--radius);
}
.field textarea { padding: var(--space-2); min-height: 120px; resize: vertical; }
.field input:focus-visible, .field textarea:focus-visible {
  outline: none;
  border: var(--focus-border);
}
.field input::placeholder, .field textarea::placeholder { color: #A8A19A; }

/* ---------------------------------- Sticky mobile call bar ---------------------------------- */
.mobile-call-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: var(--rule);
  background: var(--paper);
}
.mobile-call-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
}
.mobile-call-bar .call { background: var(--ink); color: var(--paper); }
.mobile-call-bar .text { background: var(--white); color: var(--ink); border-left: var(--rule); }

@media (min-width: 900px) {
  .mobile-call-bar { display: none; }
}
.has-mobile-bar { padding-bottom: 56px; }
@media (min-width: 900px) {
  .has-mobile-bar { padding-bottom: 0; }
}

/* ---------------------------------- Footer ---------------------------------- */
.site-footer {
  border-top: var(--rule);
  padding: var(--space-5) 0 var(--space-4);
}
.footer-grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) {
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}
.footer-col .label { color: var(--graphite); margin-bottom: var(--space-2); display: block; }
.footer-col a, .footer-col p { font-size: 15px; margin-bottom: 8px; }
.footer-col a:hover { color: var(--pine); }
.footer-bottom {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  color: var(--graphite);
  font-size: 13px;
}

/* ---------------------------------- Motion ---------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(var(--enter-travel));
  transition: opacity var(--dur-enter) var(--ease), transform var(--dur-enter) var(--ease);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------------------------------- Utility ---------------------------------- */
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.hide-mobile { display: none; }
@media (min-width: 640px) { .hide-mobile { display: block; } }
.aspect-portrait { aspect-ratio: 3/4; overflow: hidden; }
.aspect-portrait img { width: 100%; height: 100%; object-fit: cover; }
