/* ════════════════════════════════════════════════════════════
   MAINSTREET — a townbuilding company
   Palette: warm cream · deep green · brick · gold · muted blue
   Type:    Cormorant Garamond (display) · Inter (text)
   Shared design system across all pages.
   ════════════════════════════════════════════════════════════ */

:root {
  --cream: #F7F4EE;
  --paper: #FCFAF5;
  --char: #1C1B18;
  --green: #4A5B40;
  --green-deep: #36432E;
  --brick: #B65A45;
  --brick-deep: #9A4634;
  --gold: #C4A265;
  --gold-deep: #A8853F;
  --blue: #6E8794;
  --blue-deep: #516975;
  --stone: #D8D0C4;
  --stone-tint: #ECE5DA;

  --ink: #24221D;
  --ink-soft: #5A554B;
  --ink-faint: #8A8579;

  --font-serif: 'Cormorant Garamond', 'Hoefler Text', Georgia, serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --wrap: 1220px;
  --wrap-narrow: 820px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --section-y: clamp(4.5rem, 9vw, 8rem);
  --radius: 5px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow: 0 1px 2px rgba(28,27,24,0.05), 0 22px 48px -28px rgba(28,27,24,0.32);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  font-family: var(--font-sans); color: var(--ink); background: var(--cream);
  line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

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

/* ── Type ─────────────────────────────────────────────────── */
.display { font-family: var(--font-serif); font-weight: 500; line-height: 1.04; letter-spacing: -0.01em;
  font-size: clamp(2.1rem, 4.4vw, 3.5rem); color: var(--char); }
.display-xl { font-family: var(--font-serif); font-weight: 500; line-height: 1.0; letter-spacing: -0.015em;
  font-size: clamp(2.7rem, 6.6vw, 5.2rem); color: var(--char); }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.28rem); font-weight: 300; color: var(--ink-soft); }
.eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.72rem; font-weight: 600; color: var(--green); margin-bottom: 1.1rem; }
.eyebrow-light { color: rgba(255,255,255,0.88); }
.statement { font-family: var(--font-serif); font-style: italic; font-weight: 500; color: var(--char);
  font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.25; }

.section { padding-block: var(--section-y); position: relative; }
.section-head { max-width: 50ch; margin-bottom: clamp(2.4rem, 5vw, 3.8rem); }
.section-head .display { margin-top: 0.2rem; }
.section-head.center { margin-inline: auto; text-align: center; }
.bg-paper { background: var(--paper); }
.bg-cream { background: var(--cream); }
.bg-stone { background: var(--stone-tint); }
.bordered { border-block: 1px solid var(--stone); }

/* ── Buttons ──────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  font-family: var(--font-sans); font-size: 0.86rem; font-weight: 500; letter-spacing: 0.02em;
  padding: 0.95em 1.75em; border-radius: var(--radius); border: 1px solid transparent; cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease); }
.btn-brick { background: var(--brick); color: #fff; }
.btn-brick:hover { background: var(--brick-deep); transform: translateY(-2px); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-deep); transform: translateY(-2px); }
.btn-ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,0.55); }
.btn-ghost-light:hover { background: rgba(255,255,255,0.14); border-color: #fff; transform: translateY(-2px); }
.btn-ghost-dark { background: transparent; color: var(--char); border-color: var(--stone); }
.btn-ghost-dark:hover { background: #fff; border-color: var(--green); color: var(--green-deep); transform: translateY(-2px); }

/* ════════════════════════════════════════════ HEADER ═══════ */
.site-header { position: fixed; inset: 0 0 auto 0; z-index: 100; border-bottom: 1px solid transparent;
  transition: background .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease); }
.site-header.scrolled, .site-header.solid { background: rgba(247,244,238,0.94);
  backdrop-filter: saturate(140%) blur(10px); border-bottom-color: var(--stone); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding-block: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.7rem; color: #fff; transition: color .4s var(--ease); }
.scrolled .brand, .solid .brand { color: var(--char); }
.brand-mark { width: 30px; height: 38px; color: var(--brick); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; letter-spacing: 0.005em; }
.brand-tag { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.54rem;
  font-weight: 600; margin-top: 0.34rem; opacity: 0.82; }
.nav { display: flex; align-items: center; gap: clamp(1rem, 2.2vw, 2rem); }
.nav > a { position: relative; font-size: 0.85rem; font-weight: 500; color: rgba(255,255,255,0.92); transition: color .3s var(--ease); }
.scrolled .nav > a, .solid .nav > a { color: var(--ink-soft); }
.nav > a.current { color: #fff; }
.scrolled .nav > a.current, .solid .nav > a.current { color: var(--green-deep); }
.nav > a:not(.nav-cta)::after { content: ''; position: absolute; left: 0; bottom: -5px; width: 100%; height: 1.5px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .32s var(--ease); }
.nav > a.current::after { transform: scaleX(1); }
.nav > a:not(.nav-cta):hover::after { transform: scaleX(1); }
.nav-cta { background: var(--brick); color: #fff !important; padding: 0.6em 1.2em; border-radius: var(--radius);
  font-weight: 500; transition: background .3s var(--ease), transform .3s var(--ease); }
.nav-cta:hover { background: var(--brick-deep); transform: translateY(-1px); }
.nav-cta::after { display: none; }
.nav-toggle { display: none; flex-direction: column; gap: 5px; width: 30px; height: 30px; background: none; border: 0; cursor: pointer; }
.nav-toggle span { height: 2px; width: 24px; background: #fff; border-radius: 2px; transition: transform .3s var(--ease), opacity .3s var(--ease), background .3s; }
.scrolled .nav-toggle span, .solid .nav-toggle span { background: var(--char); }
.nav-toggle.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-open span:nth-child(2) { opacity: 0; }
.nav-toggle.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav { display: none; }

/* ════════════════════════════════════════════ HERO (home) ═ */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; color: #fff; }
.hero-media { position: absolute; inset: 0; z-index: -1; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-scrim { position: absolute; inset: 0; background:
  linear-gradient(180deg, rgba(20,19,16,0.42) 0%, rgba(20,19,16,0.04) 30%, rgba(20,19,16,0.14) 58%, rgba(20,19,16,0.8) 100%),
  linear-gradient(95deg, rgba(20,19,16,0.5) 0%, rgba(20,19,16,0) 56%); }
.hero-content { padding-bottom: clamp(3.5rem, 9vh, 7rem); padding-top: 8rem; max-width: 62rem; }
.hero-title { font-family: var(--font-serif); font-weight: 500; letter-spacing: -0.015em; line-height: 1.0;
  font-size: clamp(2.9rem, 7.2vw, 5.6rem); text-shadow: 0 2px 30px rgba(0,0,0,0.28); }
.hero-lede { margin-top: 1.5rem; max-width: 46ch; font-size: clamp(1.02rem, 1.5vw, 1.24rem); font-weight: 300; color: rgba(255,255,255,0.93); }
.hero-actions { margin-top: 2.2rem; display: flex; flex-wrap: wrap; gap: 0.9rem; }

/* ── Page hero (inner pages) ──────────────────────────────── */
.page-hero { position: relative; min-height: clamp(420px, 64vh, 640px); display: flex; align-items: flex-end; color: #fff; }
.page-hero-media { position: absolute; inset: 0; z-index: -1; }
.page-hero-media img { width: 100%; height: 100%; object-fit: cover; }
.page-hero .hero-scrim { background:
  linear-gradient(180deg, rgba(20,19,16,0.46) 0%, rgba(20,19,16,0.12) 40%, rgba(20,19,16,0.72) 100%); }
.page-hero-content { padding-block: clamp(2.6rem, 6vh, 4.5rem) clamp(2.6rem, 6vh, 4rem); padding-top: 7rem; max-width: 54rem; }
.page-hero-title { font-family: var(--font-serif); font-weight: 500; line-height: 1.02; letter-spacing: -0.012em;
  font-size: clamp(2.4rem, 5.5vw, 4.3rem); text-shadow: 0 2px 26px rgba(0,0,0,0.28); }
.page-hero-lede { margin-top: 1.2rem; max-width: 48ch; font-size: clamp(1.02rem, 1.4vw, 1.2rem); font-weight: 300; color: rgba(255,255,255,0.93); }

/* ════════════════════════════════════════════ CARDS ═══════ */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.3rem, 2.5vw, 2rem); }
.cards2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(1.3rem, 2.5vw, 2rem); }
.card { background: var(--paper); border: 1px solid var(--stone); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.card-media { aspect-ratio: 3/2; overflow: hidden; background: var(--stone); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-body { padding: 1.5rem 1.5rem 1.8rem; display: flex; flex-direction: column; gap: 0.55rem; }
.tag { align-self: flex-start; font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.13em; font-weight: 600;
  color: var(--green-deep); background: var(--stone-tint); padding: 0.4em 0.7em; border-radius: 100px; }
.card-body h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.85rem; line-height: 1.06; color: var(--char); margin-top: 0.3rem; }
.card-kicker { font-family: var(--font-serif); font-style: italic; font-size: 1.12rem; color: var(--brick-deep); line-height: 1.25; }
.card-body p:last-child { font-size: 0.95rem; color: var(--ink-soft); margin-top: 0.15rem; }

/* ════════════════════════════════════════════ PROMISE ═════ */
.promise { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1rem; }
.promise-item { text-align: center; padding: 1.6rem 1rem; border-top: 2px solid var(--gold); background: var(--paper);
  border-radius: 0 0 var(--radius) var(--radius); }
.promise-item svg { width: 34px; height: 34px; color: var(--green); margin: 0 auto 0.8rem; display: block; }
.promise-item h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.35rem; color: var(--char); line-height: 1.1; }

/* ════════════════════════════════════════════ METHOD ══════ */
.method { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.4rem, 3vw, 2.4rem); }
.method-item { padding-top: 1.5rem; border-top: 2px solid var(--brick); }
.method-num { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.18em; color: var(--ink-faint); }
.method-item h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.6rem; color: var(--char); margin: 0.45rem 0 0.6rem; }
.method-item p { font-size: 0.96rem; color: var(--ink-soft); }

/* ── Stack list (land → stewardship) ──────────────────────── */
.stack { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.stack span { font-family: var(--font-serif); font-size: clamp(1.1rem, 1.8vw, 1.5rem); color: var(--char);
  background: var(--paper); border: 1px solid var(--stone); border-radius: 100px; padding: 0.35em 1em; }
.stack span .plus { color: var(--brick); margin-right: 0.3rem; }

/* ════════════════════════════════════════════ CONTRAST ════ */
.contrast { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.2rem, 3vw, 2rem); }
.contrast-col { padding: clamp(1.6rem, 3vw, 2.4rem); border-radius: var(--radius); }
.contrast-old { background: var(--stone-tint); border: 1px solid var(--stone); }
.contrast-new { background: var(--green); color: #fff; }
.contrast-col h3 { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.74rem;
  font-weight: 600; margin-bottom: 1.1rem; }
.contrast-old h3 { color: var(--ink-faint); }
.contrast-new h3 { color: rgba(255,255,255,0.7); }
.contrast-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.7rem; }
.contrast-col li { font-family: var(--font-serif); font-size: clamp(1.15rem, 1.9vw, 1.45rem); line-height: 1.25; }
.contrast-old li { color: var(--ink-soft); }
.contrast-new li { color: #fff; }

/* ════════════════════════════════════════════ TILES ═══════ */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.8rem, 1.6vw, 1.1rem); }
.tile { position: relative; aspect-ratio: 4/3; border-radius: var(--radius); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.tile:hover img { transform: scale(1.06); }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,19,16,0) 45%, rgba(20,19,16,0.72) 100%); }
.tile span { position: absolute; left: 1.1rem; bottom: 0.95rem; z-index: 1; color: #fff; font-family: var(--font-serif);
  font-size: 1.5rem; font-weight: 600; text-shadow: 0 1px 12px rgba(0,0,0,0.4); }

/* ════════════════════════════════════════════ WORK CARDS ══ */
.work-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 2vw, 1.4rem); }
.work-card { padding: 1.7rem; border: 1px solid var(--stone); border-radius: var(--radius); background: var(--paper);
  transition: transform .35s var(--ease), border-color .35s var(--ease); }
.work-card:hover { transform: translateY(-3px); border-color: var(--green); }
.work-card h3 { font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; color: var(--char); margin-bottom: 0.4rem; }
.work-card p { font-size: 0.95rem; color: var(--ink-soft); }

/* ════════════════════════════════════════════ SPLIT ═══════ */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split-media { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.split-media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.split.reverse .split-text { order: 2; }
.split-text p { color: var(--ink-soft); margin-top: 1rem; font-size: 1.04rem; }

/* ════════════════════════════════════════════ GALLERY ═════ */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.8rem, 1.6vw, 1.2rem); }
.gallery figure { border-radius: var(--radius); overflow: hidden; background: var(--stone); }
.gallery img { width: 100%; aspect-ratio: 3/2; object-fit: cover; transition: transform .7s var(--ease); }
.gallery figure:hover img { transform: scale(1.05); }
.gallery figcaption { font-size: 0.82rem; color: var(--ink-soft); padding: 0.6rem 0.2rem 0; }
.gallery .wide { grid-column: span 2; }
.gallery .wide img { aspect-ratio: 21/9; }

/* ════════════════════════════════════════════ CTA BAND ════ */
.cta-band { position: relative; color: #fff; text-align: center; }
.cta-band-media { position: absolute; inset: 0; z-index: -1; }
.cta-band-media img { width: 100%; height: 100%; object-fit: cover; }
.cta-band::before { content: ''; position: absolute; inset: 0; background: rgba(20,19,16,0.56); }
.cta-band .wrap { position: relative; padding-block: clamp(4.5rem, 9vw, 7.5rem); }
.cta-band .display { color: #fff; max-width: 18ch; margin-inline: auto; }
.cta-band .hero-actions { justify-content: center; }

/* ════════════════════════════════════════════ CONTACT ═════ */
.contact-grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: start; }
.contact-intro .display { margin: 0.2rem 0 1.1rem; }
.contact-intro > p { color: var(--ink-soft); font-size: 1.08rem; max-width: 40ch; }
.contact-meta { margin-top: 1.6rem; font-size: 0.98rem; color: var(--ink-soft); line-height: 1.9; }
.contact-meta a { color: var(--brick-deep); border-bottom: 1px solid transparent; transition: border-color .3s; }
.contact-meta a:hover { border-bottom-color: var(--brick-deep); }
.contact-form { display: flex; flex-direction: column; gap: 1.05rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.05rem; }
.field label { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600; color: var(--ink-soft); }
.field label .opt { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-faint); }
.field input, .field select, .field textarea { font-family: var(--font-sans); font-size: 0.98rem; color: var(--ink);
  background: #fff; border: 1px solid var(--stone); border-radius: var(--radius); padding: 0.8em 0.9em; width: 100%;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease); }
.field textarea { resize: vertical; min-height: 120px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(74,91,64,0.16); }
.contact-form .btn { align-self: flex-start; margin-top: 0.3rem; }
.form-status { font-family: var(--font-serif); font-style: italic; font-size: 1.2rem; color: var(--green-deep);
  background: var(--stone-tint); border-left: 3px solid var(--green); padding: 0.9rem 1.1rem; border-radius: var(--radius); }
.hp { position: absolute; left: -9999px; }

/* ════════════════════════════════════════════ FOOTER ══════ */
.site-footer { background: var(--char); color: rgba(247,244,238,0.78); padding-block: clamp(3rem, 6vw, 4.5rem); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(247,244,238,0.14); }
.footer-brand { display: flex; align-items: center; gap: 0.85rem; color: #fff; margin-bottom: 1rem; }
.footer-brand .brand-mark { width: 34px; height: 42px; color: var(--brick); }
.footer-brand .brand-name { font-family: var(--font-serif); font-weight: 600; font-size: 1.5rem; color: #fff; }
.footer-brand .brand-tag { text-transform: uppercase; letter-spacing: 0.2em; font-size: 0.54rem; font-weight: 600; color: rgba(247,244,238,0.6); margin-top: 0.3rem; }
.footer-line { font-family: var(--font-serif); font-style: italic; font-size: clamp(1.4rem, 2.6vw, 1.9rem); color: #fff; max-width: 24ch; line-height: 1.2; }
.footer-col h4 { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: rgba(247,244,238,0.5); margin-bottom: 1rem; }
.footer-col a { display: block; font-size: 0.9rem; color: rgba(247,244,238,0.78); padding: 0.3rem 0; transition: color .3s; }
.footer-col a:hover { color: #fff; }
.footer-base { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; justify-content: space-between; font-size: 0.82rem;
  color: rgba(247,244,238,0.55); padding-top: 1.6rem; }
.footer-base a { color: rgba(247,244,238,0.72); }
.footer-base a:hover { color: #fff; }

/* ════════════════════════════════════════════ REVEAL ══════ */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
.stagger > *.reveal:nth-child(2){transition-delay:.07s}
.stagger > *.reveal:nth-child(3){transition-delay:.14s}
.stagger > *.reveal:nth-child(4){transition-delay:.21s}
.stagger > *.reveal:nth-child(5){transition-delay:.28s}
.stagger > *.reveal:nth-child(6){transition-delay:.35s}
@media (prefers-reduced-motion: reduce){ .reveal{opacity:1;transform:none;transition:none} }

/* ════════════════════════════════════════════ RESPONSIVE ══ */
@media (max-width: 1000px){
  .cards3, .method, .tiles, .gallery, .work-cards { grid-template-columns: repeat(2,1fr); }
  .promise { grid-template-columns: repeat(2,1fr); }
  .contrast, .split, .contact-grid, .footer-top { grid-template-columns: 1fr; }
  .split.reverse .split-text { order: 0; }
  .gallery .wide { grid-column: span 2; }
}
@media (max-width: 720px){
  .nav { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav { display: flex; flex-direction: column; gap: 0.3rem; background: var(--cream);
    border-bottom: 1px solid var(--stone); padding: 0.8rem var(--gutter) 1.3rem; }
  .mobile-nav a { padding: 0.6rem 0; font-size: 1rem; color: var(--ink); border-bottom: 1px solid var(--stone-tint); }
  .mobile-nav a:last-child { border-bottom: 0; }
  .mobile-nav .nav-cta { background: var(--brick); color: #fff; text-align: center; border-radius: var(--radius); margin-top: 0.5rem; }
  .hero { min-height: 92svh; }
  .hero-actions .btn, .cta-band .btn { flex: 1 1 auto; }
  .cards3, .method, .tiles, .gallery, .work-cards, .promise { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .gallery .wide { grid-column: span 1; }
  .gallery .wide img { aspect-ratio: 3/2; }
}
@media (max-width: 440px){
  .tiles { grid-template-columns: 1fr; }
  .brand-name { font-size: 1.25rem; }
  .stack span { font-size: 1rem; }
}
