/* ==========================================================================
   MH Installation Guys — styles
   Design tokens pulled from the original site:
   green #3DBE5B · charcoal #1E2523 · light #E4E9E5 · off-white #F5F7F5
   Headings: Oswald (uppercase) · Body: Barlow
   ========================================================================== */

:root {
  --green: #3dbe5b;
  --green-dark: #2fa04b;
  --dark: #1e2523;
  --dark-soft: #2a322f;
  --light: #e4e9e5;
  --offwhite: #f5f7f5;
  --muted: #b7c0bb;
  --text: #1e2523;
  --white: #ffffff;
  --font-head: "Oswald", "Arial Narrow", sans-serif;
  --font-body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --container: 1140px;
  --radius: 10px;
  --shadow: 0 12px 40px rgba(30, 37, 35, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

h1 { font-size: clamp(2.6rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.9rem, 4vw, 3rem); margin-bottom: 1.2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.6rem; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 96px 0; }

.bg-offwhite { background: var(--offwhite); }
.bg-light { background: var(--light); }
.bg-dark { background: var(--dark); color: var(--white); }
.bg-dark h2, .bg-dark h3, .bg-dark h4 { color: var(--white); }

.eyebrow {
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.95rem;
  padding: 14px 32px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.btn-green {
  background: var(--green);
  color: var(--dark);
}

.btn-green:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(61, 190, 91, 0.35);
}

.btn-lg { padding: 17px 42px; font-size: 1.05rem; }
.btn-block { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.site-header.scrolled {
  background: rgba(30, 37, 35, 0.96);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

/* Pages with no hero video behind the header (e.g. apply.html) need it
   solid from the start, independent of the JS scroll-triggered .scrolled
   class. */
.solid-header .site-header {
  background: rgba(30, 37, 35, 0.96);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
}

.brand-logo { width: 68px; height: 68px; }

.main-nav { display: flex; gap: 28px; }

.main-nav a {
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  padding: 4px 0;
}

.main-nav a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--green);
  transition: width 0.25s ease;
}

.main-nav a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 26px; height: 3px;
  background: var(--white);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  overflow: hidden;
  color: var(--white);
}

.hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  will-change: transform;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 37, 35, 0.55) 0%, rgba(30, 37, 35, 0.75) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 200px;
  width: 100%;
  max-width: var(--container);
  text-align: left;
}

.hero-content h1 { color: var(--white); margin-bottom: 1.4rem; }

.hero-sub {
  font-size: 1.15rem;
  max-width: 640px;
  margin-bottom: 2.2rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero-scroll {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}

.chevron {
  display: block;
  width: 18px; height: 18px;
  border-right: 3px solid var(--green);
  border-bottom: 3px solid var(--green);
  transform: rotate(45deg);
  animation: bob 2s infinite;
}

@keyframes bob {
  0%, 100% { transform: rotate(45deg) translate(0, 0); }
  50% { transform: rotate(45deg) translate(6px, 6px); }
}

/* ---------- What We Do ---------- */
.what-we-do { background: var(--light); }

.section-intro {
  max-width: 820px;
  font-size: 1.25rem;
  margin-bottom: 3rem;
}

.service-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}

.service-cards-3 { grid-template-columns: repeat(3, 1fr); }

.service-card {
  background: var(--dark);
  color: var(--white);
  border-radius: var(--radius);
  padding: 34px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}

.card-number {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 2.4rem;
  color: var(--green);
  line-height: 1;
}

.service-card h3 { font-size: 1.25rem; }

.service-card p { font-size: 0.98rem; color: rgba(255, 255, 255, 0.85); }

/* ---------- Service detail sections ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.two-col.flip .col-text { order: 2; }
.two-col.flip .col-media { order: 1; }

/* Give landscape lot plans room to remain large and fully legible. */
#lot-planning .two-col {
  grid-template-columns: minmax(0, 0.75fr) minmax(0, 1.25fr);
  gap: 48px;
}

#lot-planning .slideshow {
  height: 435px;
}

.col-text p { margin-bottom: 1.4rem; }

.check-list { list-style: none; }

.check-list li {
  padding: 10px 0 10px 38px;
  position: relative;
  font-weight: 600;
  border-bottom: 1px solid rgba(30, 37, 35, 0.1);
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 14px;
  width: 20px; height: 20px;
  background: var(--green);
  border-radius: 50%;
  mask: none;
}

.check-list li::after {
  content: "";
  position: absolute;
  left: 7px; top: 18px;
  width: 5px; height: 9px;
  border-right: 2.5px solid var(--dark);
  border-bottom: 2.5px solid var(--dark);
  transform: rotate(45deg);
}

.bg-dark .check-list li { border-bottom-color: rgba(255, 255, 255, 0.15); }

/* Infrastructure: pulled out of the 3-phase flow, so it gets its own
   distinct treatment (dark band + accent line) to read as independent. */
.infra-band { border-top: 4px solid var(--green); }

/* cross-fading slideshow (lot planning) */
.slideshow {
  position: relative;
  height: 452px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1.2s ease;
}

.slideshow img.active { opacity: 1; }

/* Preserve complete technical drawings in the lot-planning rotation. */
.slideshow img.plan-image {
  object-fit: contain;
  background: #fff;
}

/* ---------- Scroll-scrubbed lot timeline ---------- */
/* Ships by default as a plain autoplaying video band (see .scroll-sequence-fallback).
   main.js upgrades it to a pinned scroll-scrub of the frame sequence when canvas
   is supported and the visitor hasn't asked for reduced motion; it adds
   .is-scrubbing and sets an inline height once frames are ready. */
.scroll-sequence { position: relative; }

.scroll-sequence-sticky {
  position: relative;
  height: 640px;
  overflow: hidden;
}

.scroll-sequence.is-scrubbing .scroll-sequence-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
}

.scroll-sequence-fallback,
.scroll-sequence-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scroll-sequence-canvas { display: none; }

.scroll-sequence.is-scrubbing .scroll-sequence-fallback { display: none; }
.scroll-sequence.is-scrubbing .scroll-sequence-canvas { display: block; }

/* ---------- Video band ---------- */
.video-band {
  position: relative;
  background: var(--dark);
  height: 480px;
  overflow: hidden;
}

/* Oversized and repositioned by the parallax scroll handler in main.js */
.video-band video {
  position: absolute;
  left: 0;
  top: -25%;
  width: 100%;
  height: 150%;
  object-fit: cover;
  object-position: center center;
  will-change: transform;
}

.video-band-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 37, 35, 0.55) 0%, rgba(30, 37, 35, 0.75) 100%);
}

/* ---------- Where we work ---------- */
.map-band {
  position: relative;
  height: 460px;
  max-width: 860px;
  margin: 3rem auto 0;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-band .map-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-band-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(30, 37, 35, 0) 55%, rgba(30, 37, 35, 0.8) 100%);
}

.map-caption {
  position: absolute;
  right: 28px; bottom: 22px;
  z-index: 2;
  color: var(--white);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.95rem;
}

/* ---------- Who we are ---------- */
.about-intro { max-width: 820px; }

.founders {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-top: 72px;
}

.founder-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px;
  box-shadow: var(--shadow);
  text-align: center;
}

.founder-card img {
  width: 140px;
  height: 140px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 20px;
  border: 4px solid var(--green);
}

.founder-role {
  color: var(--green);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.9rem;
  margin: 6px 0 14px;
}

/* ---------- Contact ---------- */
.contact { padding-bottom: 110px; }

.contact-grid { align-items: start; }

.contact-lines { margin-top: 2.4rem; display: flex; flex-direction: column; gap: 1.6rem; }

.contact-label {
  display: block;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 0.8rem;
  margin-bottom: 4px;
}

.contact-line h3 { font-size: clamp(1.5rem, 3vw, 2.1rem); }

.contact-line a:hover { color: var(--green); }

.contact-form {
  background: var(--offwhite);
  color: var(--text);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35);
}

.contact-form h4 { margin-bottom: 1.6rem; color: var(--text); }

.form-row { margin-bottom: 18px; }

.form-row label {
  display: block;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.form-row input,
.form-row select,
.form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #cfd6d1;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--white);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-row input:focus,
.form-row select:focus,
.form-row textarea:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(61, 190, 91, 0.2);
}

.hidden-field { display: none; }

.form-error-msg {
  display: none;
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 4px;
  background: rgba(220, 53, 53, 0.08);
  border: 1.5px solid #dc3535;
  color: #b42323;
  font-size: 0.9rem;
}

.form-error-msg.visible { display: block; }
.form-error-msg a { text-decoration: underline; }

.form-success { text-align: center; }
.form-success h4 { color: var(--green); }

.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn:disabled:hover { transform: none; box-shadow: none; }

/* ---------- Apply page ---------- */
.page-hero { padding: 220px 0 80px; }

.page-hero-video {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.page-hero-bg,
.page-hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.page-hero-bg {
  object-fit: cover;
  object-position: center;
}

.page-hero-overlay {
  background:
    linear-gradient(90deg, rgba(20, 27, 24, 0.86) 0%, rgba(20, 27, 24, 0.62) 55%, rgba(20, 27, 24, 0.38) 100%),
    linear-gradient(0deg, rgba(20, 27, 24, 0.35), rgba(20, 27, 24, 0.1));
}

.page-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

.page-hero-sub {
  max-width: 640px;
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 1rem;
}

.apply-section .container { max-width: 720px; }

.apply-intro { margin-bottom: 2.4rem; }

.apply-intro p { margin-top: 0.6rem; }

.apply-form { padding: 44px; }

.apply-note {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #161c1a;
  color: var(--muted);
  padding-top: 64px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}

.footer-brand img { width: 72px; margin-bottom: 16px; background: var(--white); border-radius: 8px; padding: 4px; }

.footer-nav { display: flex; flex-direction: column; gap: 10px; }

.footer-nav a, .footer-contact a { transition: color 0.2s ease; }

.footer-nav a:hover, .footer-contact a:hover { color: var(--green); }

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 20px 24px;
  text-align: center;
  font-size: 0.85rem;
}

/* ---------- Reveal animations ---------- */
.reveal {
  transition: opacity 0.7s ease, transform 0.7s ease;
}

/* Hidden pre-animation state: only when JS is running and not yet revealed.
   Keep this selector's specificity ABOVE the base .reveal rule but scoped so
   that adding .visible always wins — do not simplify to `html:not(.no-js)
   .reveal` (it out-specifies `.reveal.visible` and leaves the page blank). */
html:not(.no-js) .reveal:not(.visible) {
  opacity: 0;
  transform: translateY(28px);
}

.delay-1 { transition-delay: 0.12s; }
.delay-2 { transition-delay: 0.24s; }
.delay-3 { transition-delay: 0.36s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  html:not(.no-js) .reveal:not(.visible) { opacity: 1; transform: none; }
  .chevron { animation: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .service-cards { grid-template-columns: 1fr 1fr; }
  .two-col { gap: 40px; }
}

@media (max-width: 820px) {
  .section { padding: 72px 0; }

  .main-nav {
    position: fixed;
    top: 74px; left: 0; right: 0;
    background: rgba(30, 37, 35, 0.98);
    flex-direction: column;
    align-items: center;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .main-nav.open { max-height: 340px; }

  .main-nav a { padding: 16px 0; }

  .header-cta { display: none; }

  .nav-toggle { display: flex; }

  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  .two-col { grid-template-columns: 1fr; }

  #lot-planning .two-col { grid-template-columns: 1fr; }
  #lot-planning .slideshow { height: 340px; }

  .two-col.flip .col-text { order: 1; }
  .two-col.flip .col-media { order: 2; }

  .slideshow { height: 340px; }

  .founders { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }

  .video-band { height: 340px; }

  .hero-content { padding-top: 150px; }

  .scroll-sequence-sticky { height: 420px; }

  .scroll-sequence.is-scrubbing .scroll-sequence-sticky { height: 100vh; }

  .map-band { height: 360px; }

  .page-hero { padding: 150px 0 56px; }

  .brand-logo { width: 54px; height: 54px; }
}

@media (max-width: 480px) {
  body { font-size: 16px; }
  .slideshow { height: 260px; }
  #lot-planning .slideshow { height: 260px; }
  .contact-form { padding: 28px 20px; }
}
