/* ============================================================
   The Home Building Company - Homepage Concept
   Design language: Nordic Minimal (type/spacing/composition/motion)
   Palette: THBC's real brand (logo sky blue #37b6ff, logo black,
   white) - sky deepened within family for contrast on light.
   ============================================================ */

:root {
  /* Brand colors, extracted from thbcidaho.com logo files */
  --snow:       #fafbfc;
  --cloud:      #eef2f6;
  --white:      #ffffff;
  --graphite:   #101418;   /* their logo black, cooled to graphite */
  --slate:      #1a2129;
  --sky:        #37b6ff;   /* exact logo blue (55,182,255) */
  --sky-deep:   #1287cf;   /* their blue deepened for text on light */
  --sky-muted:  rgba(55, 182, 255, 0.22);
  --line:       rgba(16, 20, 24, 0.12);
  --line-light: rgba(255, 255, 255, 0.14);

  --text-dark:        #101418;
  --text-body:        #3d4650;
  --text-muted:       #6b7683;
  --text-light:       rgba(255, 255, 255, 0.88);
  --text-light-muted: rgba(255, 255, 255, 0.6);

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;

  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --nav-height: 76px;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-body);
  background: var(--snow);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  width: min(90%, 1100px);
  margin-inline: auto;
}

/* ---------- Typography ---------- */

.h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.9rem, 4.2vw, 3rem);
  line-height: 1.12;
  color: var(--text-dark);
}

.h2--light { color: var(--text-light); }

.h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.45rem, 2.6vw, 2rem);
  line-height: 1.15;
  color: var(--text-dark);
}

.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sky-deep);
  margin-bottom: 1rem;
}

.eyebrow--light { color: var(--sky); }
.eyebrow--accent { color: var(--sky); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.9rem;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}

.btn--solid {
  background: var(--graphite);
  color: var(--white);
}
.btn--solid:hover { background: var(--sky-deep); }

.btn--accent {
  background: var(--sky);
  color: var(--graphite);
}
.btn--accent:hover { background: var(--white); }

.btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: var(--white);
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.14); border-color: var(--white); }

.btn--outline {
  border: 1px solid var(--line);
  color: var(--text-dark);
}
.btn--outline:hover { border-color: var(--sky-deep); color: var(--sky-deep); }

.link-arrow {
  display: inline-block;
  margin-top: 1.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--sky-deep);
  border-bottom: 1px solid var(--sky-muted);
  padding-bottom: 0.25rem;
  transition: border-color 0.25s var(--ease);
}
.link-arrow::after { content: " \2192"; }
.link-arrow:hover { border-color: var(--sky-deep); }

/* ---------- Navigation ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: transparent;
  transition: background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.nav--solid {
  background: var(--white);
  box-shadow: 0 1px 0 var(--line);
}

.nav__inner {
  width: min(94%, 1240px);
  margin-inline: auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav__logo img {
  width: auto;
  height: 44px;
  max-width: 220px;
  object-fit: contain;
  transition: opacity 0.3s var(--ease);
}

/* Over the hero the dark logo sits on a white plate for legibility */
.nav__logo {
  display: inline-flex;
  align-items: center;
  background: var(--white);
  border-radius: 8px;
  padding: 0.35rem 0.7rem;
}
.nav--solid .nav__logo { background: transparent; padding-inline: 0; }

.nav__links {
  display: flex;
  gap: 1.9rem;
}

.nav__links a {
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--white);
  transition: color 0.25s var(--ease);
}
.nav__links a:hover { color: var(--sky); }
.nav--solid .nav__links a { color: var(--text-dark); }
.nav--solid .nav__links a:hover { color: var(--sky-deep); }

.nav__cta { padding: 0.65rem 1.5rem; background: var(--sky); color: var(--graphite); }
.nav__cta:hover { background: var(--graphite); color: var(--white); }
.nav--solid .nav__cta { background: var(--graphite); color: var(--white); }
.nav--solid .nav__cta:hover { background: var(--sky-deep); }

.nav__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 102;
}
.nav__burger span {
  display: block;
  width: 26px;
  height: 2px;
  margin-inline: auto;
  background: var(--white);
  transition: transform 0.3s var(--ease), background 0.3s var(--ease);
}
.nav--solid .nav__burger span,
.nav__burger.is-open span { background: var(--text-dark); }
.nav__burger.is-open span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- Mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 101;
  background: var(--snow);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0.3s var(--ease);
}
.mobile-menu.is-open { opacity: 1; visibility: visible; }

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
  text-align: center;
}
.mobile-menu__links > a:not(.btn) {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--text-dark);
  text-decoration: none;
  padding-block: 0.2rem;
}
.mobile-menu__links > a:not(.btn):hover { color: var(--sky-deep); }
.mobile-menu__divider {
  width: 48px;
  height: 1px;
  background: var(--line);
  margin-block: 0.4rem;
}
.mobile-menu__phone {
  font-size: 0.95rem;
  color: var(--text-muted);
  text-decoration: none;
  padding-block: 0.4rem;
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero__media { position: absolute; inset: 0; }

.hero__img {
  width: 100%;
  height: 112%;
  object-fit: cover;
  will-change: transform;
}

.hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 18, 0.82) 0%, rgba(10, 14, 18, 0.35) 45%, rgba(10, 14, 18, 0.25) 100%);
}

.hero__content {
  position: relative;
  z-index: 2;
  width: min(90%, 1100px);
  margin-inline: auto;
  padding-bottom: clamp(3.5rem, 8vh, 6rem);
}

.hero__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.7rem, 7.5vw, 5.4rem);
  line-height: 1.05;
  color: var(--white);
  max-width: 14ch;
}

.hero__sub {
  margin-top: 1.3rem;
  max-width: 54ch;
  font-size: clamp(0.98rem, 1.4vw, 1.12rem);
  font-weight: 300;
  color: var(--text-light);
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2rem;
}

/* ---------- Sections ---------- */

.section-light { background: var(--snow); }
.section-white { background: var(--white); }
.section-cloud { background: var(--cloud); }
.section-dark  { background: var(--graphite); }

/* ---------- Why Choose Us ---------- */

.why { padding-block: clamp(3rem, 6vw, 5rem); }

.why__head { max-width: 34ch; }

.why__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4.5rem);
  margin-top: clamp(1.8rem, 3.5vw, 2.8rem);
  align-items: start;
}

.why__lede {
  font-size: clamp(1.02rem, 1.5vw, 1.15rem);
  font-weight: 300;
  color: var(--text-body);
}

.why__pillars {
  display: flex;
  flex-direction: column;
  gap: 1.7rem;
}

.pillar__rule {
  display: block;
  width: 34px;
  height: 2px;
  background: var(--sky);
  margin-bottom: 0.8rem;
}

.pillar__title {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dark);
  margin-bottom: 0.35rem;
}

.pillar p { font-size: 0.95rem; }

/* ---------- Services ---------- */

.services { padding-block: clamp(3rem, 6vw, 5rem) 0; }

.services__head { margin-bottom: clamp(2.2rem, 4vw, 3.5rem); }
.services__sub { margin-top: 0.8rem; color: var(--text-muted); max-width: 50ch; }

.service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  width: min(94%, 1240px);
  margin-inline: auto;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}

.service__media {
  overflow: hidden;
  border-radius: 4px;
}

.service__media img {
  width: 100%;
  height: 100%;
  min-height: 380px;
  max-height: 560px;
  object-fit: cover;
  transition: transform 0.7s var(--ease);
}
.service:hover .service__media img { transform: scale(1.035); }

.service__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.8rem, 4vw, 4rem);
}

.service--flip .service__media { order: 2; }
.service--flip .service__body { order: 1; }

.service__index {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--sky-deep);
  margin-bottom: 0.9rem;
}

.service__body p { margin-top: 0.9rem; max-width: 44ch; }

/* ---------- Full bleed ---------- */

.bleed {
  height: clamp(300px, 55vh, 560px);
  overflow: hidden;
}
.bleed img {
  width: 100%;
  height: 118%;
  object-fit: cover;
  will-change: transform;
}

/* ---------- Before & After gallery ---------- */

.gallery { padding-block: clamp(3rem, 6vw, 5rem); }

.gallery__head { margin-bottom: clamp(1.8rem, 3vw, 2.6rem); }

.gallery__hint {
  margin-top: 0.7rem;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-light-muted);
}

.gallery__track {
  display: flex;
  gap: clamp(1rem, 2vw, 1.6rem);
  overflow-x: auto;
  padding-inline: max(5%, (100vw - 1240px) / 2);
  padding-bottom: 1.2rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__track.is-dragging { cursor: grabbing; scroll-behavior: auto; }

.gallery__card {
  flex: 0 0 clamp(300px, 44vw, 520px);
}

.gallery__card img {
  border-radius: 4px;
  width: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery__card figcaption { padding-top: 1rem; }

.gallery__card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.25rem;
  color: var(--text-light);
}

.gallery__card figcaption p {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: var(--text-light-muted);
  max-width: 46ch;
}

/* ---------- Process ---------- */

.process { padding-block: clamp(3rem, 6vw, 5rem); }

.process__layout {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr;
  gap: clamp(2rem, 5vw, 5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.process__sticky {
  position: sticky;
  top: calc(var(--nav-height) + 3rem);
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.process__numeral {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 9vw, 7.5rem);
  line-height: 1;
  color: var(--sky);
}

.process__bar {
  width: 2px;
  height: clamp(90px, 14vw, 150px);
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}
.process__bar span {
  display: block;
  width: 100%;
  height: 0%;
  background: var(--sky-deep);
  transition: height 0.3s var(--ease);
}

.process__steps { list-style: none; }

.process-step {
  padding-block: clamp(1.6rem, 3vw, 2.4rem);
  border-bottom: 1px solid var(--line);
}
.process-step:first-child { padding-top: 0.4rem; }
.process-step:last-child { border-bottom: none; }

.process-step h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.process-step p { font-size: 0.97rem; max-width: 58ch; }

/* ---------- Team ---------- */

.team { padding-block: clamp(3rem, 6vw, 5rem); }

.team__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.6rem, 4vw, 3.5rem);
  margin-top: clamp(2rem, 4vw, 3rem);
}

.team-card__photo {
  overflow: hidden;
  border-radius: 4px;
  aspect-ratio: 4 / 3;
}
.team-card__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.team-card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1.5rem;
  color: var(--text-light);
  margin-top: 1.3rem;
}

.team-card__role {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sky);
  margin-top: 0.25rem;
}

.team-card__bio {
  margin-top: 0.8rem;
  font-size: 0.95rem;
  color: var(--text-light-muted);
  max-width: 52ch;
}

/* ---------- CTA ---------- */

.cta { padding-block: clamp(3.5rem, 7vw, 6rem); }

.cta__inner { text-align: center; }

.cta__sub {
  margin-top: 0.9rem;
  margin-inline: auto;
  max-width: 52ch;
  color: var(--text-muted);
}

.cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

.cta__address {
  margin-top: 1.8rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* ---------- Footer ---------- */

.footer {
  background: var(--slate);
  padding-top: clamp(2.5rem, 5vw, 4rem);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(2rem, 4vw, 3rem);
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.footer__logo {
  width: auto;
  height: 64px;
  max-width: 240px;
  object-fit: contain;
}

.footer__brand p {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sky);
}

.footer__nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer__nav a,
.footer__contact a {
  color: var(--text-light-muted);
  text-decoration: none;
  font-size: 0.92rem;
  padding-block: 0.65rem;
  transition: color 0.25s var(--ease);
}
.footer__nav a:hover,
.footer__contact a:hover { color: var(--sky); }

.footer__contact {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.footer__contact p {
  margin-top: 0.6rem;
  font-size: 0.9rem;
  color: var(--text-light-muted);
}

.footer__base {
  border-top: 1px solid var(--line-light);
  padding-block: 1.4rem;
}

.footer__base p {
  font-size: 0.82rem;
  color: var(--text-light-muted);
}

/* ---------- Reveal (GSAP hooks; visible without JS) ---------- */

.reveal { opacity: 1; }

/* ---------- 404 ---------- */

.error-section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--graphite);
  padding: calc(var(--nav-height) + 2rem) var(--gutter) 3rem;
}

.error__code {
  font-family: var(--font-display);
  font-size: clamp(6rem, 18vw, 12rem);
  line-height: 1;
  color: var(--sky-muted);
}

.error__title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  color: var(--text-light);
  margin-top: 0.6rem;
}

.error__body {
  margin: 1rem auto 2rem;
  max-width: 46ch;
  color: var(--text-light-muted);
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
  .nav__links { gap: 1.3rem; }
}

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__burger { display: flex; }

  .why__grid { grid-template-columns: 1fr; }

  .service,
  .service--flip { grid-template-columns: 1fr; }
  .service--flip .service__media { order: 0; }
  .service--flip .service__body { order: 1; }
  .service__media img { min-height: 260px; max-height: 420px; }
  .service__body { padding: 1.5rem 0.4rem 0.5rem; }

  .process__layout { grid-template-columns: 1fr; }
  .process__rail { display: none; }

  .team__grid { grid-template-columns: 1fr; }

  .footer__grid { grid-template-columns: 1fr; gap: 1.6rem; }
}

@media (max-width: 768px) {
  .hero:not([style]) {
    height: auto;
    min-height: 100svh;
    padding-top: 6rem;
  }
}

@media (max-width: 860px) {
  .link-arrow { padding-block: 0.65rem; }
}

@media (max-width: 480px) {
  .hero:not([style]) { padding-top: 5rem; }
  .hero__ctas .btn { width: 100%; }
  .cta__actions { flex-direction: column; align-items: stretch; }
  .gallery__card { flex-basis: min(84vw, 340px); }
  .nav__logo img { height: 36px; max-width: 175px; }
}
