@import url("/css/fonts.css");

/* ---------------------------------------------------------------- tokens */
:root {
  /* Brand palette, sampled from the Timberline Builders logo */
  --dark:        #25331f;
  --dark-soft:   #34432c;
  --green:       #5eab45;
  --green-deep:  #4a8c35;
  --sand:        #e1dfd9;
  --sand-soft:   #f2f1ed;
  --white:       #ffffff;
  --ink:         #1f2a1b;
  --ink-muted:   #5b6356;
  --rule:        rgba(37, 51, 31, 0.14);

  --font-head: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --font-body: Georgia, "Times New Roman", serif;

  --wide:    1200px;
  --narrow:  760px;
  --gutter:  clamp(1.25rem, 5vw, 4rem);

  --step:    clamp(3.5rem, 8vw, 7rem);
  --radius:  2px;
  --ease:    cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* ---------------------------------------------------------------- reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: clamp(1.02rem, 0.98rem + 0.2vw, 1.14rem);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img, picture, video { max-width: 100%; height: auto; display: block; }
a { color: var(--green-deep); text-underline-offset: 3px; }
a:hover { color: var(--dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--dark);
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 4rem); }
h2 { font-size: clamp(1.65rem, 1.1rem + 2.3vw, 2.7rem); }
h3 { font-size: clamp(1.15rem, 0.95rem + 0.9vw, 1.6rem); letter-spacing: .04em; text-transform: uppercase; }
h4 { font-size: 1.05rem; letter-spacing: .06em; text-transform: uppercase; }
p  { margin: 0 0 1.15em; text-wrap: pretty; }
p:last-child, ul:last-child, ol:last-child { margin-bottom: 0; }
ul, ol { margin: 0 0 1.15em; padding-left: 1.3em; }
li { margin-bottom: .45em; }
li::marker { color: var(--green); }
strong { color: var(--dark); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: var(--radius); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--dark); color: #fff; padding: .8rem 1.2rem;
  font-family: var(--font-head); font-size: .9rem;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------------------------------------------------------------- layout */
.wrap  { width: min(100% - var(--gutter) * 2, var(--wide));   margin-inline: auto; }
.wrap--narrow { width: min(100% - var(--gutter) * 2, var(--narrow)); margin-inline: auto; }

.section { padding-block: var(--step); }
.section--sand  { background: var(--sand); }
.section--soft  { background: var(--sand-soft); }
.section--dark  { background: var(--dark); color: var(--sand); }
.section--dark h1, .section--dark h2, .section--dark h3,
.section--dark h4, .section--dark strong { color: var(--white); }
.section--dark a:not(.btn) { color: var(--green); }
.section--dark li::marker { color: var(--green); }
.section--tight { padding-block: calc(var(--step) * .6); }

.section__head { max-width: 46rem; margin-bottom: 2.5rem; }
.section__head--center { margin-inline: auto; text-align: center; }

.eyebrow {
  font-family: var(--font-head); font-size: .78rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--green-deep);
  margin: 0 0 .9rem;
}
.section--dark .eyebrow { color: var(--green); }

.lede { font-size: 1.15em; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-block;
  font-family: var(--font-head); font-size: .82rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; text-decoration: none;
  padding: 1rem 2rem;
  border: 2px solid var(--dark); border-radius: var(--radius);
  background: var(--dark); color: var(--white);
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--green); border-color: var(--green); color: var(--white); }
.btn--solid { /* default treatment; named so content can ask for it */ }
.btn--ghost { background: transparent; color: var(--dark); }
.btn--ghost:hover { background: var(--dark); border-color: var(--dark); color: var(--white); }
.btn--light { background: var(--white); border-color: var(--white); color: var(--dark); }
.btn--light:hover { background: var(--green); border-color: var(--green); color: var(--white); }
.btn-row { display: flex; flex-wrap: wrap; gap: 1rem; margin-top: 2rem; }
.btn-row--center { justify-content: center; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .95);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 84px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 52px; width: auto; }

.nav { display: flex; align-items: center; gap: 2rem; }
.nav a {
  font-family: var(--font-head); font-size: .82rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; text-decoration: none;
  color: var(--dark); padding: .35rem 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--green); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: .6rem; color: var(--dark);
}
.nav-toggle svg { display: block; width: 26px; height: 26px; }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: 84px 0 auto; flex-direction: column; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--rule);
    padding: .5rem var(--gutter) 1.5rem;
    transform: translateY(-120%); transition: transform .3s var(--ease);
    max-height: calc(100dvh - 84px); overflow-y: auto;
  }
  .nav[data-open="true"] { transform: translateY(0); }
  .nav a { width: 100%; padding: 1rem 0; border-bottom: 1px solid var(--rule); font-size: .95rem; }
  .nav a::after { display: none; }
}

/* ---------------------------------------------------------------- hero */
.hero { position: relative; display: grid; place-items: center; isolation: isolate; text-align: center; }
.hero--tall  { min-height: min(88dvh, 780px); }
.hero--short { min-height: min(52dvh, 460px); }
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(37,51,31,.72) 0%, rgba(37,51,31,.56) 45%, rgba(37,51,31,.82) 100%);
}
.hero__inner { padding: clamp(4rem, 12vw, 8rem) var(--gutter); color: var(--white); max-width: 60rem; }
.hero h1 { color: var(--white); text-shadow: 0 2px 24px rgba(0,0,0,.3); }
.hero p { color: rgba(255,255,255,.92); font-size: 1.2em; max-width: 42rem; margin-inline: auto; }
.hero .eyebrow { color: var(--green); }

/* page banner (interior pages without a photo) */
.page-banner { background: var(--dark); color: var(--white); padding-block: clamp(3rem, 8vw, 5.5rem); text-align: center; }
.page-banner h1 { color: var(--white); margin-bottom: 0; }
/* `.page-banner p` outranks `.eyebrow`, so the kicker needs the banner scope
   to keep the logo green rather than inheriting the paragraph white. */
.page-banner .eyebrow { color: var(--green); }
.page-banner p { color: rgba(255,255,255,.84); margin: 1rem auto 0; max-width: 44rem; }

/* ---------------------------------------------------------------- split */
.split {
  display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; }
  .split--reverse > .split__media { order: 2; }
}
.split + .split { margin-top: var(--step); }
.split .prose > h2 { margin-top: 0; }
.split .prose > .eyebrow + h2 { margin-top: 0; }
.split__media img {
  width: 100%; border-radius: var(--radius);
  box-shadow: 0 18px 50px -24px rgba(37, 51, 31, .5);
}
/* Illustrations, floor plans and plats: no frame, and never upscaled. */
.split__media--plain img {
  box-shadow: none; border-radius: 0;
  width: auto; max-width: 100%; margin-inline: auto;
}

/* ---------------------------------------------------------------- grids */
.grid { display: grid; gap: clamp(1.25rem, 3vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid img { width: 100%; border-radius: var(--radius); }

.showcase img { aspect-ratio: 4 / 3; object-fit: cover; box-shadow: 0 18px 50px -26px rgba(37,51,31,.55); }
/* Cutout PNGs and diagrams should sit inside the box, not be cropped by it. */
.showcase--contain img { object-fit: contain; box-shadow: none; }
.showcase--natural img { aspect-ratio: auto; object-fit: initial; box-shadow: none; }

/* feature list with icons */
.features { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; list-style: none; padding: 0; margin: 0; }
.feature { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 2rem; }
.section--sand .feature { box-shadow: 0 14px 40px -28px rgba(37,51,31,.5); }
.feature__icon { width: 64px; height: 64px; object-fit: contain; margin-bottom: 1.2rem; }
.feature h3 { font-size: 1rem; }
.feature p:last-child { margin-bottom: 0; }

/* stat / spec lists */
.specs { display: grid; gap: 2rem 3rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.specs h4 { color: var(--green-deep); margin-bottom: .7rem; }
.section--dark .specs h4 { color: var(--green); }

/* team */
.team { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); list-style: none; padding: 0; margin: 0; }
.team figure { margin: 0; text-align: center; }
.team img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; box-shadow: 0 16px 40px -22px rgba(37,51,31,.6); }
.team figcaption { margin-top: 1.2rem; }
.team .name { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--dark); display: block; }
.team .role { font-family: var(--font-head); font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); display: block; margin-top: .35rem; }

/* sources / citations */
.sources { font-size: .86rem; color: var(--ink-muted); }
.sources h4 { font-size: .72rem; letter-spacing: .14em; color: var(--ink-muted); margin-bottom: .5rem; }
.sources ul { padding-left: 1.1em; margin: 0; }
.sources a { color: inherit; word-break: break-word; }
.section--dark .sources, .section--dark .sources h4 { color: rgba(225,223,217,.72); }

/* ---------------------------------------------------------------- gallery */
.gallery { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.gallery button {
  padding: 0; border: 0; background: none; cursor: zoom-in; display: block;
  border-radius: var(--radius); overflow: hidden; line-height: 0;
}
.gallery img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  transition: transform .5s var(--ease), filter .3s var(--ease);
}
.gallery button:hover img { transform: scale(1.04); filter: brightness(1.05); }

.lightbox {
  position: fixed; inset: 0; z-index: 300; border: 0; padding: 0;
  width: 100%; max-width: 100%; height: 100%; max-height: 100%;
  background: rgba(20, 27, 17, .96);
}
.lightbox::backdrop { background: rgba(20, 27, 17, .96); }
.lightbox__img { width: 100%; height: 100%; object-fit: contain; padding: clamp(1rem, 4vw, 3.5rem); }
.lightbox__btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.35);
  width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
  font-size: 1.4rem; line-height: 1; display: grid; place-items: center;
}
.lightbox__btn:hover { background: var(--green); border-color: var(--green); }
.lightbox__prev { left: clamp(.5rem, 2vw, 1.5rem); }
.lightbox__next { right: clamp(.5rem, 2vw, 1.5rem); }
.lightbox__close { top: clamp(.5rem, 2vw, 1.5rem); right: clamp(.5rem, 2vw, 1.5rem); transform: none; }
.lightbox__count {
  position: absolute; bottom: clamp(.75rem, 2vw, 1.5rem); left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.8); font-family: var(--font-head); font-size: .8rem; letter-spacing: .1em;
}

/* ---------------------------------------------------------------- form */
.form { display: grid; gap: 1.4rem; }
.form__row { display: grid; gap: 1.4rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.field { display: grid; gap: .5rem; }
.field label { font-family: var(--font-head); font-size: .76rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--dark); }
.field input, .field textarea {
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: .9rem 1rem; width: 100%;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus {
  outline: 0; border-color: var(--green); box-shadow: 0 0 0 3px rgba(94, 171, 69, .22);
}
.field textarea { min-height: 170px; resize: vertical; }
.form__note { font-size: .88rem; color: var(--ink-muted); }
.hp { position: absolute; left: -9999px; }

.contact-card { display: grid; gap: 1.5rem; align-content: start; }
.contact-card dt { font-family: var(--font-head); font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-muted); }
.contact-card dd { margin: .3rem 0 0; font-size: 1.05rem; }
.contact-card dd a { text-decoration: none; }
.contact-card dd a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- footer */
.site-footer { background: var(--dark); color: rgba(225, 223, 217, .82); padding-block: clamp(3rem, 7vw, 4.5rem); font-size: .96rem; }
.site-footer a { color: rgba(225, 223, 217, .82); text-decoration: none; }
.site-footer a:hover { color: var(--green); }
.site-footer__grid { display: grid; gap: 2.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.site-footer img { height: 62px; width: auto; margin-bottom: 1.2rem; }
.site-footer__tag { font-style: italic; max-width: 22rem; }
.site-footer h2 { font-size: .76rem; letter-spacing: .16em; text-transform: uppercase; color: var(--green); margin-bottom: 1rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .6rem; }
.site-footer__bottom { margin-top: 3rem; padding-top: 1.75rem; border-top: 1px solid rgba(225,223,217,.16); font-size: .84rem; color: rgba(225,223,217,.6); }

/* ---------------------------------------------------------------- prose */
/* Keep running text at a comfortable measure even in full-width bands. */
.prose { max-width: 72ch; }
.split .prose, .feature .prose { max-width: none; }
.section__head--center + .prose, .prose[style*="center"] { margin-inline: auto; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin-top: 2.2em; }
.prose h3 { margin-top: 2em; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
