/* ==========================================================================
   Provision Homes — homepage. Loads after base.css.
   Breakpoints mirror the source design's viewport logic:
     701px+   "wide"      about / footer / gallery / associations layouts
     821px+   "navWide"   full nav bar (below: hamburger + sticky CTA)
     901px+                testimonials as a 3-up grid (below: carousel)
     1101px+               process as 4 columns
   ========================================================================== */

/* ---------- Sticky header: homepage reveals it on scroll ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}
.site-header.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}


/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 85vh;
  min-height: 560px;
  width: 100%;
  overflow: hidden;
  background: var(--ink-2);
  scroll-margin-top: 0;
}
.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 26, .42);
  pointer-events: none;
}
.hero__gradient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(20, 22, 26, .34) 0%,
    rgba(20, 22, 26, .04) 22%,
    rgba(20, 22, 26, .22) 46%,
    rgba(20, 22, 26, .26) 68%,
    rgba(20, 22, 26, .30) 100%);
}

.hero__frame {
  position: absolute;
  left: var(--frame-inset);
  right: var(--frame-inset);
  top: 58px;
  bottom: 46px;
  pointer-events: none;
}

/* Drawn frame rules */
.hero__rule {
  position: absolute;
  width: 1px;
  background: rgba(255, 255, 255, .8);
  transform-origin: top;
  animation: heroDrawY 900ms var(--ease) both;
}
.hero__rule--left  { left: 0; top: 60px; bottom: 0; }
.hero__rule--right { right: 0; top: 60px; bottom: 0; }
.hero__rule--top-mobile {
  left: 22px; right: 22px; top: 60px;
  width: auto; height: 1px;
  transform-origin: center;
  animation: heroDrawX 700ms 620ms var(--ease) both;
}
.hero__rule-h {
  flex: 1;
  min-width: 16px;
  height: 1px;
  background: rgba(255, 255, 255, .8);
  margin: 0 22px;
  transform-origin: left;
  animation: heroDrawX 700ms 500ms var(--ease) both;
}
.hero__rule-h--right { transform-origin: right; }

@keyframes heroDrawY { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes heroDrawX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero__topband {
  position: absolute;
  top: 0; left: 0; right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  letter-spacing: .24em;
}
.hero__nav {
  display: flex;
  gap: clamp(16px, 1.6vw, 24px);
  pointer-events: auto;
}
.hero__nav--left  { padding-left: 34px; }
.hero__nav--right { padding-right: 34px; }
.hero__nav a {
  padding-bottom: 5px;
  border-bottom: 1px solid transparent;
  transition: color 180ms ease, border-color 180ms ease;
}
.hero__nav a:hover { color: var(--gold); border-color: var(--gold); }

.hero__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: none;
  pointer-events: auto;
  color: #fff;
  text-align: center;
}
.hero__brand:hover { color: #fff; }
.hero__brand-line1 {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: .30em;
  line-height: 1.3;
}
.hero__brand-line2 {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .42em;
  line-height: 1;
  color: var(--on-dark);
}

.hamburger--hero {
  position: absolute;
  top: 0; right: 14px;
  transform: translateY(-50%);
  pointer-events: auto;
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, .6);
}

.hero__copy {
  position: absolute;
  left: 0; right: 0;
  top: 54%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 0 clamp(20px, 6vw, 90px);
  text-align: center;
}
.hero__copy h1 {
  max-width: 15em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(30px, 3.4vw, 48px);
  line-height: 1.15;
  letter-spacing: .005em;
  color: #fff;
  text-wrap: pretty;
}
.hero__eyebrow {
  font-size: 10px;
  letter-spacing: .24em;
  color: #fff;
  text-shadow: 0 1px 12px rgba(20, 22, 26, .65);
}

.hero__ctaband {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  transform: translateY(50%);
  display: flex;
  align-items: center;
}
.hero__cta {
  flex: none;
  border: 1px solid rgba(255, 255, 255, .85);
  background: rgba(20, 22, 26, .28);
  color: #fff;
  padding: 15px 30px;
  font-size: 10px;
  letter-spacing: .20em;
  white-space: nowrap;
  pointer-events: auto;
  transition: background 200ms ease, color 200ms ease, letter-spacing 200ms ease;
}
.hero__cta:hover {
  background: #fff;
  color: var(--ink);
  letter-spacing: .24em;
}

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  gap: clamp(16px, 2vw, 26px);
}
.gallery--feature {
  margin-top: clamp(32px, 4vw, 48px);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.gallery--trio {
  margin-top: 26px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.gallery__item {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.gallery--feature .gallery__item--tall { grid-column: 1 / -1; }
.gallery--trio .gallery__item--lead    { grid-column: 1 / -1; }

.gallery__frame {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  overflow: hidden;
  cursor: zoom-in;
  outline: 1px solid var(--rule-soft);
  outline-offset: 6px;
  transition: outline-color 180ms ease;
  height: clamp(150px, 20vw, 280px);
}
.gallery__frame:hover { outline-color: var(--gold); }
.gallery__frame:focus-visible { outline: 2px solid var(--gold); outline-offset: 6px; }
.gallery__frame img { width: 100%; height: 100%; object-fit: cover; }

.gallery--feature .gallery__item--tall .gallery__frame { height: 230px; }
.gallery--trio .gallery__item--lead .gallery__frame    { height: clamp(230px, 34vw, 460px); }

.gallery__label {
  align-self: flex-start;
  text-align: left;
  font-size: 10px;
  letter-spacing: .24em;
  color: rgba(48, 50, 48, .7);
}

/* ---------- Built on Detail ---------- */
.detail {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
  padding: 88px clamp(20px, 4vw, 54px);
}
.detail__texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(135deg, transparent 47%, rgba(0,0,0,.13) 47%, rgba(0,0,0,.13) 53%, transparent 53%),
    linear-gradient(45deg,  transparent 47%, rgba(0,0,0,.13) 47%, rgba(0,0,0,.13) 53%, transparent 53%);
  background-size: 60px 60px;
}
.detail__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 22, 26, .42);
  pointer-events: none;
}
.detail__copy {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}
.detail__copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 32px;
  line-height: 1.18;
}
.detail__copy p {
  margin-top: 16px;
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
  text-wrap: pretty;
}
.detail__figure {
  position: relative;
  margin-top: 52px;
  height: clamp(320px, 38vw, 520px);
  overflow: hidden;
  outline: 1px solid rgba(255, 255, 255, .35);
  outline-offset: 6px;
}
.detail__figure img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Process ---------- */
.process {
  margin-top: clamp(34px, 4vw, 52px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.process__step {
  border-left: 1px solid var(--rule-dark);
  padding: 8px clamp(18px, 2vw, 30px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.process__step { border-left: 0; }          /* 1 column: no dividers */
.process__num {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: .10em;
  color: var(--gold);
}
.process__title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .20em;
  text-transform: uppercase;
}
.process__step p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--body-ink);
  text-wrap: pretty;
}

/* ---------- Where We Build ---------- */
.where { padding-top: clamp(30px, 4vw, 50px); }
.where__frame {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(46px, 5vw, 62px) clamp(14px, 4vw, 50px) clamp(40px, 4.4vw, 54px);
}
.where__border { position: absolute; inset: 0; pointer-events: none; }
.where__border span { position: absolute; background: var(--rule-mid); }
.where__border-t, .where__border-b { left: 0; right: 0; height: 1px; transform: scaleX(0); }
.where__border-l, .where__border-r { top: 0; bottom: 0; width: 1px; transform: scaleY(0); }
.where__border-t { top: 0;    transform-origin: left;   transition: transform 800ms var(--ease); }
.where__border-b { bottom: 0; transform-origin: right;  transition: transform 800ms 120ms var(--ease); }
.where__border-l { left: 0;   transform-origin: top;    transition: transform 800ms 240ms var(--ease); }
.where__border-r { right: 0;  transform-origin: bottom; transition: transform 800ms 240ms var(--ease); }
.where__frame.is-visible .where__border-t,
.where__frame.is-visible .where__border-b { transform: scaleX(1); }
.where__frame.is-visible .where__border-l,
.where__frame.is-visible .where__border-r { transform: scaleY(1); }

.where__legend {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -50%);
  background: var(--cream);
  padding: 0 16px;
  font-size: clamp(10px, 2.6vw, 12px);
  font-weight: 500;
  letter-spacing: .24em;
  text-indent: .24em;
  white-space: nowrap;
  color: var(--gold);
}
.where__title {
  margin-bottom: clamp(28px, 3vw, 40px);
  text-align: center;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(24px, 2.2vw, 32px);
  line-height: 1.18;
}
.where__places {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(13px, 3.4vw, 26px);
  letter-spacing: .06em;
}
.where__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2.2vw, 22px);
}

/* ---------- About ---------- */
.about {
  max-width: 1080px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 3vw, 40px);
  align-items: stretch;
}
.about__media { display: flex; flex-direction: column; gap: 24px; }
.about__portrait {
  position: relative;
  flex: 1;
  min-height: 300px;
  overflow: hidden;
  outline: 1px solid var(--rule-soft);
  outline-offset: 6px;
}
.about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.about__extras { display: none; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 24px; }
.about__extra {
  position: relative;
  height: 150px;
  overflow: hidden;
  outline: 1px solid var(--rule-soft);
  outline-offset: 6px;
}
.about__extra img { width: 100%; height: 100%; object-fit: cover; }

.about__copy {
  display: flex;
  flex-direction: column;
  gap: 20px;
  text-align: center;
}
.about__copy h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.4vw, 34px);
  line-height: 1.18;
}
.about__btn { align-self: center; }


/* ---------- Associations ---------- */
.associations {
  padding: 0 clamp(20px, 6vw, 96px) clamp(40px, 5vw, 64px);
}
.associations__inner {
  border-top: 1px solid var(--rule-dark);
  border-bottom: 1px solid var(--rule-dark);
  padding: 26px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 36px);
}
.associations__rule { display: none; width: 1px; height: 26px; background: var(--rule-mid); }
.associations__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(18px, 3vw, 36px);
  flex-wrap: wrap;
}
.associations__logo { width: auto; filter: grayscale(1); opacity: .82; }
.associations__logo--nahb { height: 52px; }
.associations__logo--tab  { height: 40px; }

/* ---------- Closing CTA ---------- */
.cta {
  position: relative;
  background: var(--ink);
  padding: clamp(50px, 5vw, 72px) 0;
}
.cta__border {
  position: absolute;
  left: var(--frame-inset);
  right: var(--frame-inset);
  top: 22px;
  bottom: 22px;
  pointer-events: none;
}
.cta__border span { position: absolute; background: rgba(255, 255, 255, .8); }
.cta__border-t, .cta__border-b { left: 0; right: 0; height: 1px; transform: scaleX(0); }
.cta__border-l, .cta__border-r { top: 0; bottom: 0; width: 1px; transform: scaleY(0); }
.cta__border-t { top: 0;    transform-origin: left;   transition: transform 800ms var(--ease); }
.cta__border-b { bottom: 0; transform-origin: right;  transition: transform 800ms 120ms var(--ease); }
.cta__border-l { left: 0;   transform-origin: top;    transition: transform 800ms 240ms var(--ease); }
.cta__border-r { right: 0;  transform-origin: bottom; transition: transform 800ms 240ms var(--ease); }
.cta__border.is-visible .cta__border-t,
.cta__border.is-visible .cta__border-b { transform: scaleX(1); }
.cta__border.is-visible .cta__border-l,
.cta__border.is-visible .cta__border-r { transform: scaleY(1); }

.cta__inner {
  position: relative;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 54px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(34px, 5vw, 64px);
  align-items: start;
  color: #fff;
}
.cta__copy { display: flex; flex-direction: column; gap: 16px; }
.cta__copy h2 {
  max-width: 14em;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 36px);
  line-height: 1.18;
}
.cta__copy p {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--on-dark);
}
.cta__figure {
  position: relative;
  margin-top: 8px;
  height: clamp(220px, 22vw, 300px);
  overflow: hidden;
  outline: 1px solid rgba(255, 255, 255, .35);
  outline-offset: 6px;
}
.cta__figure img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Contact form ---------- */
.contact-form { display: flex; flex-direction: column; gap: 26px; }
.contact-form[hidden] { display: none; }
.contact-form__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
  gap: 24px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label {
  font-size: 10px;
  letter-spacing: .20em;
  color: rgba(255, 255, 255, .75);
}
.field input,
.field textarea {
  background: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 300;
}
.field input {
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .45);
  padding: 6px 0;
}
.field textarea {
  border: 1px solid rgba(255, 255, 255, .45);
  padding: 12px;
  resize: vertical;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.field ::placeholder { color: rgba(255, 255, 255, .35); }
.field__error {
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .85);
}
.field__error[hidden] { display: none; }

.contact-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.contact-form__note {
  font-size: 10px;
  letter-spacing: .16em;
  color: rgba(255, 255, 255, .7);
}
.contact-form__failure {
  font-size: 11px;
  letter-spacing: .1em;
  color: #F0B7A4;
}
.contact-form__failure[hidden] { display: none; }
.btn-solid[aria-busy="true"] { opacity: .5; }

.contact-sent {
  border: 1px solid rgba(255, 255, 255, .5);
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: #fff;
}
.contact-sent[hidden] { display: none; }
.contact-sent h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 26px;
  line-height: 1.2;
}
.contact-sent p {
  font-size: 15px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--on-dark);
}

/* ==========================================================================
   Breakpoints
   ========================================================================== */

/* ---- Below 821px: hamburger nav + sticky CTA ---- */
@media (max-width: 820px) {
  .hero__nav,
  .hero__rule-h { display: none; }
}

/* ---- 821px and up: full nav bar ---- */
@media (min-width: 821px) {
  .hero__rule--left,
  .hero__rule--right { top: 0; }
  .hero__rule--top-mobile { display: none; }
}

/* ---- 701px and up: "wide" layouts ---- */
@media (min-width: 701px) {
  .gallery--feature {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: 1fr 1fr;
  }
  .gallery--feature .gallery__item--tall { grid-area: 1 / 1 / 3 / 2; }
  .gallery--feature .gallery__item--tall .gallery__frame { flex: 1; height: auto; min-height: 420px; }
  .gallery--feature .gallery__frame { height: auto; }

  .gallery--trio { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gallery--trio .gallery__item--lead { grid-column: auto; }
  .gallery--trio .gallery__frame,
  .gallery--trio .gallery__item--lead .gallery__frame { height: 210px; }

  .process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process__step { border-left: 1px solid var(--rule-dark); }
  .process__step:nth-child(2n + 1) { border-left: 0; }

  .about { grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr); }
  .about__portrait { min-height: 260px; }
  .about__extras { display: grid; }
  .about__copy { text-align: left; }
  .about__btn { align-self: flex-start; }

  .associations__inner { flex-direction: row; }
  .associations__rule { display: block; }

}

/* ---- 1101px and up: process in 4 columns ---- */
@media (min-width: 1101px) {
  .process { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .process__step { border-left: 1px solid var(--rule-dark); }
  .process__step:nth-child(2n + 1) { border-left: 1px solid var(--rule-dark); }
  .process__step:nth-child(4n + 1) { border-left: 0; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .where__border-t, .where__border-b,
  .cta__border-t, .cta__border-b { transform: scaleX(1); }
  .where__border-l, .where__border-r,
  .cta__border-l, .cta__border-r { transform: scaleY(1); }
}
