/* ==========================================================================
   Mass Green Insulation — Layout & components
   Colors, fonts and radii live in css/theme.css.
   ========================================================================== */

/* ---------- Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a { color: var(--brand-green); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, p { margin: 0; }

h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.07;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 200;
  padding: 10px 18px; border-radius: var(--radius-pill);
  background: var(--color-bg); color: var(--color-text);
}
.skip-link:focus { top: 12px; }

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

.section { padding-block: var(--section-pad); }
.section--alt { background: var(--color-bg-alt); }
.section--dark {
  background: var(--color-bg-dark);
  color: var(--color-text-inverse);
}
.section--dark a:not(.btn) { color: var(--brand-green-bright); }

.section-head {
  max-width: 820px;
  margin: 0 auto clamp(48px, 7vw, 80px);
  text-align: center;
}
.section-title { font-size: var(--fs-display); }
.section-lead {
  margin-top: 20px;
  font-size: var(--fs-lead);
  line-height: 1.4;
  color: var(--color-text-muted);
}
.section--dark .section-lead { color: var(--color-text-inverse-muted); }

.eyebrow {
  display: block;
  margin-bottom: 14px;
  font-size: var(--fs-small);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-green);
}
.section--dark .eyebrow { color: var(--brand-green-bright); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease,
    border-color 200ms ease, transform 200ms var(--ease-out);
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--brand-green); color: #fff; }
.btn--primary:hover { background: var(--brand-green-hover); }

.btn--ghost {
  border-color: currentColor;
  color: inherit;
  background: transparent;
}
.btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }
.section--alt .btn--ghost:hover,
.section:not(.section--dark) .btn--ghost:hover { background: rgba(0, 0, 0, 0.05); }

.btn--light { background: #fff; color: var(--color-text); }
.btn--light:hover { background: #e8e8ed; }

.btn--sm { min-height: 32px; padding: 6px 14px; font-size: 0.8125rem; }

.btn[disabled] { opacity: 0.6; cursor: progress; }

.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}
.link-arrow::after {
  content: "›";
  font-size: 1.25em;
  line-height: 1;
  transition: transform 200ms var(--ease-out);
}
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- Navbar ---------- */
.nav {
  --nav-current: var(--nav-height-lg);
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--nav-current);
  background: rgba(22, 22, 23, 0.72);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  color: var(--color-text-inverse);
  transition: background-color 300ms ease, height 400ms var(--ease-out);
}
.nav.is-scrolled {
  --nav-current: var(--nav-height);
  background: rgba(22, 22, 23, 0.86);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand svg { width: 22px; height: 22px; color: var(--brand-green-bright); }

/* Navbar logo: large at the top, shrinks smoothly once the page scrolls. */
.brand__logo {
  display: block;
  width: auto;
  height: var(--nav-logo-lg);
  transition: height 400ms var(--ease-out);
}
.nav.is-scrolled .brand__logo { height: var(--nav-logo); }

.nav__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav__links {
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav__links a {
  color: rgba(245, 245, 247, 0.8);
  font-size: 0.8125rem;
  transition: color 200ms ease;
}
.nav__links a:hover { color: #fff; text-decoration: none; }

.nav__toggle {
  display: none;
  width: 44px; height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  width: 18px; height: 1.5px;
  margin: 5px auto;
  background: currentColor;
  transition: transform 300ms var(--ease-out), opacity 200ms ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3.25px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 1023px) {
  .nav__toggle { display: block; }
  .nav__menu {
    position: fixed;
    inset: var(--nav-current) 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px var(--gutter) 28px;
    background: rgba(22, 22, 23, 0.96);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 250ms ease, transform 300ms var(--ease-out), visibility 0s 300ms;
  }
  .nav.is-open .nav__menu {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity 250ms ease, transform 300ms var(--ease-out);
  }
  .nav__links { flex-direction: column; gap: 0; }
  .nav__links a {
    display: block;
    padding: 14px 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-inverse);
    border-bottom: 1px solid var(--color-border-dark);
  }
  .nav__menu .btn { margin-top: 16px; min-height: 48px; font-size: 1rem; }
}

/* Wrappers injected by js/layout.js take no space of their own. */
site-header,
site-footer { display: contents; }

/* ---------- Services menu (navbar) ---------- */
.nav__has-sub { position: relative; }
.nav__sub-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(245, 245, 247, 0.8);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: color 200ms ease;
}
.nav__sub-toggle:hover,
.nav__sub-toggle[aria-expanded="true"] { color: #fff; }
.nav__sub-toggle svg {
  width: 10px;
  height: 7px;
  transition: transform 300ms var(--ease-out);
}
.nav__sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav__sub {
  position: absolute;
  top: calc(100% + 18px);
  left: 50%;
  width: min(560px, 90vw);
  padding: 24px 28px 22px;
  border-radius: 20px;
  background: rgba(29, 29, 31, 0.96);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -6px);
  transition: opacity 220ms ease, transform 300ms var(--ease-out), visibility 0s 300ms;
}
/* Invisible bridge so the menu stays open while the pointer moves down. */
.nav__sub::before {
  content: "";
  position: absolute;
  inset: -20px 0 auto;
  height: 20px;
}
.nav__has-sub.is-open .nav__sub {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition: opacity 220ms ease, transform 300ms var(--ease-out);
}
.nav__sub-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav .nav__sub-list a,
.nav .nav__sub-all {
  display: block;
  padding: 7px 0;
  color: var(--color-text-inverse);
  font-size: 0.9375rem;
  font-weight: 500;
}
.nav .nav__sub-list a:hover { color: var(--brand-green-bright); text-decoration: none; }
.nav__sub-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0 28px;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--color-border-dark);
}
.nav .nav__sub-all { color: var(--brand-green-bright); }

@media (max-width: 1023px) {
  .nav__menu { max-height: calc(100vh - var(--nav-current)); overflow-y: auto; }
  .nav__sub-toggle {
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border-dark);
    color: var(--color-text-inverse);
    font-size: 1.5rem;
    font-weight: 600;
  }
  .nav__sub-toggle svg { width: 16px; height: 11px; }
  .nav__sub {
    position: static;
    display: none;
    width: auto;
    padding: 8px 0 12px 4px;
    border-radius: 0;
    background: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }
  .nav__sub::before { display: none; }
  .nav__has-sub.is-open .nav__sub { display: block; transform: none; }
  .nav__sub-list { grid-template-columns: 1fr; }
  .nav .nav__sub-list a { padding: 9px 0; font-size: 1.0625rem; border: 0; }
  .nav .nav__sub-all { font-size: 1.0625rem; }
}

/* ---------- Hero (scroll sequence) ----------
   White page with the logo and headline on top and the video frames in a
   large rounded card below. */
.hero {
  position: relative;
  background: var(--hero-bg);
  color: var(--color-text);
}

.hero__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding-top: var(--nav-height-lg);
  overflow: hidden;
  background: var(--hero-bg);
}
@supports (height: 100svh) {
  .hero__stage { height: 100svh; }
}

.hero__copy {
  position: relative;
  z-index: 1;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(6px, 1.4vh, 14px);
  padding: clamp(12px, 2.6vh, 28px) var(--gutter) clamp(14px, 2.6vh, 26px);
  text-align: center;
}

.hero__logo {
  display: block;
  width: auto;
  height: clamp(64px, 12vh, 124px);
}

/* All steps share one grid cell, so the area is as tall as the tallest
   step (the one with buttons) and the video card never jumps. */
.hero__steps {
  display: grid;
  place-items: start center;
}
.hero__step {
  grid-area: 1 / 1;
  opacity: 0;
  visibility: hidden;
}
.hero__step:first-child { opacity: 1; visibility: visible; }

.hero__eyebrow {
  margin-bottom: 10px;
  font-size: clamp(0.8125rem, 1.4vw, 0.9375rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-green);
}
.hero__sub {
  margin-top: -4px;
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--brand-green);
}

.hero__title {
  max-width: 22ch;
  margin-inline: auto;
  font-size: var(--fs-hero);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.04;
}

.hero__cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 20px);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.hero__actions .btn { min-width: 200px; }
.hero .btn--ghost:hover { background: rgba(0, 0, 0, 0.05); }
@media (max-width: 559px) {
  .hero__actions .btn { min-width: 0; padding-inline: 18px; font-size: 0.9375rem; }
}

.hero__media {
  position: relative;
  flex: 1;
  min-height: 0;
  width: calc(100% - 2 * var(--gutter));
  max-width: 1400px;
  margin: 0 auto var(--gutter);
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-bg-alt);
}
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Slim loading bar, shown only while frames are still downloading. */
.hero__progress {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(160px, 40vw);
  height: 3px;
  overflow: hidden;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.4);
  transform: translateX(-50%);
  transition: opacity 400ms ease;
}
.hero__progress.is-done { opacity: 0; }
.hero__progress-bar {
  height: 100%;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms linear;
}

.hero__hint {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}
.hero__hint::after {
  content: "";
  width: 1px;
  height: 28px;
  background: linear-gradient(to bottom, #fff, transparent);
  animation: hint 1.8s var(--ease-out) infinite;
}
.hero__progress:not([hidden]):not(.is-done) ~ .hero__hint { display: none; }
@keyframes hint {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* Static hero: reduced motion or GSAP unavailable. Shows the logo, the
   first headline and the buttons over the final frame. */
.hero--static .hero__steps {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.hero--static .hero__step { display: none; }
.hero--static .hero__step:first-child { display: block; opacity: 1; visibility: visible; }
.hero--static .hero__cta { display: flex; opacity: 1; visibility: visible; }
.hero--static .hero__cta .hero__title,
.hero--static .hero__cta .hero__sub,
.hero--static .hero__hint { display: none; }

/* ---------- Why us ---------- */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1023px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 559px) { .feature-grid { grid-template-columns: 1fr; } }

.feature-card {
  padding: 36px 30px;
  border-radius: var(--radius-card);
  background: var(--color-bg-alt);
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}
.feature-card__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 28px;
  border-radius: 16px;
  background: var(--brand-green-tint);
  color: var(--brand-green);
}
.feature-card__icon svg { width: 26px; height: 26px; }
.feature-card h3 {
  margin-bottom: 8px;
  font-size: 1.3125rem;
  letter-spacing: -0.015em;
}
.feature-card p {
  font-size: 1.0625rem;
  line-height: 1.45;
  color: var(--color-text-muted);
}

/* ---------- Foam story (scroll sequence) ----------
   Pure white so the frames blend into the page; the canvas also fades its
   image edges into white (see js/scroll-sequence.js, `feather`). */
.story {
  position: relative;
  background: #fff;
  color: var(--color-text);
}

.story__stage {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 64px);
  width: 100%;
  max-width: 1320px;
  height: 100vh;
  margin-inline: auto;
  padding: calc(var(--nav-height) + 16px) var(--gutter) 24px;
}
@supports (height: 100svh) {
  .story__stage { height: 100svh; }
}

.story__media {
  position: relative;
  height: min(72vh, 680px);
}
.story__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.story__title {
  font-size: clamp(2rem, 3.6vw, 3.25rem);
}
.story__text {
  margin-top: 20px;
  font-size: clamp(1.0625rem, 1.5vw, 1.3125rem);
  line-height: 1.5;
  color: var(--color-text-muted);
}
.story__text--strong { color: var(--color-text); font-weight: 500; }
.story__cta { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.story__cta a:not(.btn) { color: var(--brand-green); font-weight: 600; }

/* Mobile: canvas on top, text below. */
@media (max-width: 833px) {
  .story__stage {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    gap: 12px;
    padding-top: calc(var(--nav-height) + 8px);
    text-align: center;
  }
  .story__media { height: 36vh; }
  .story__title { font-size: clamp(1.625rem, 6.4vw, 2.25rem); }
  .story__text { margin-top: 12px; font-size: 1rem; }
  .story__cta { align-items: center; gap: 12px; }
  .story .eyebrow { margin-bottom: 6px; }
}
@media (max-width: 833px) and (max-height: 760px) {
  .story__media { height: 26vh; }
  .story__cta .btn { min-height: 40px; padding-block: 8px; }
  .story__title { font-size: 1.5rem; }
  .story__text { margin-top: 8px; font-size: 0.9375rem; line-height: 1.45; }
}

/* ---------- Services ---------- */
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (min-width: 1024px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 599px) { .service-grid { grid-template-columns: 1fr; } }

.service-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-surface);
  transition: transform 400ms var(--ease-out), box-shadow 400ms var(--ease-out);
}
.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.1);
}
.service-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--media-bg, linear-gradient(135deg, #2f7a4d, #133322));
}
.service-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 800ms var(--ease-out);
}
.service-card:hover .service-card__media img,
.service-card:hover .service-card__placeholder { transform: scale(1.04); }

/* Placeholder art until real photos are added */
.service-card__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background:
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 14px, transparent 14px 28px);
  transition: transform 800ms var(--ease-out);
}
.service-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding: 28px 30px 32px;
}
.service-card__body h3 { font-size: 1.625rem; }
.service-card__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 20px;
  margin-top: auto;
}
.sheets-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, color 200ms ease;
}
.sheets-btn svg { width: 16px; height: 16px; }
.sheets-btn:hover { text-decoration: none; border-color: var(--brand-green); color: var(--brand-green); background: var(--brand-green-tint); }

/* ---------- Location band ---------- */
.band {
  position: relative;
  overflow: hidden;
  text-align: center;
}
.band::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background: radial-gradient(ellipse at center, rgba(108, 195, 143, 0.22), transparent 60%);
  pointer-events: none;
}
.band__inner { position: relative; max-width: 900px; margin-inline: auto; }
.band__text {
  font-size: var(--fs-title);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.band__text span { color: var(--color-text-inverse-muted); }
.band .btn { margin-top: 44px; }

/* ---------- Reviews ---------- */
.review-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 899px) { .review-grid { grid-template-columns: 1fr; } }

.review-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0;
  padding: 36px 32px;
  border-radius: var(--radius-card);
  background: var(--color-bg-alt);
}
.review-card__stars {
  display: flex;
  gap: 3px;
  color: var(--brand-green);
}
.review-card__stars svg { width: 18px; height: 18px; }
.review-card blockquote {
  flex: 1;
  margin: 0;
  font-size: 1.1875rem;
  line-height: 1.45;
  letter-spacing: -0.01em;
}
.review-card figcaption { font-size: var(--fs-small); color: var(--color-text-muted); }
.review-card__quote { width: 32px; height: 32px; color: var(--brand-green); opacity: 0.85; }
.reviews__more { margin-top: 40px; text-align: center; font-size: 1.0625rem; }
.review-card figcaption strong { display: block; color: var(--color-text); font-weight: 600; }
.review-card--placeholder blockquote { color: var(--color-text-muted); font-style: italic; }

/* ---------- Social icons ---------- */
.socials { display: flex; gap: 12px; margin-top: 4px; }
.socials a {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #2c2c2e;
  color: var(--color-text-inverse) !important;
  transition: background-color 200ms ease, transform 200ms var(--ease-out);
}
.socials a:hover { background: var(--brand-green); transform: translateY(-2px); }
.socials svg { width: 22px; height: 22px; }

/* ---------- Quote form ---------- */
.quote {
  max-width: 720px;
  margin-inline: auto;
}
.form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding: clamp(28px, 5vw, 48px);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: 0 2px 30px rgba(0, 0, 0, 0.05);
}
@media (max-width: 599px) { .form { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 8px; }
.field--full { grid-column: 1 / -1; }

.field label { font-size: 0.9375rem; font-weight: 600; }

.field input,
.field select {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 1.0625rem; /* ≥16px avoids iOS zoom on focus */
  transition: border-color 200ms ease, box-shadow 200ms ease;
  -webkit-appearance: none;
  appearance: none;
}
.field select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%236e6e73' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
}
.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-green);
  box-shadow: 0 0 0 4px var(--brand-green-ring);
}
.field.is-invalid input,
.field.is-invalid select { border-color: var(--color-error); }
.field.is-invalid input:focus,
.field.is-invalid select:focus { box-shadow: 0 0 0 4px rgba(215, 0, 21, 0.14); }

.field__error {
  min-height: 1.2em;
  font-size: 0.8125rem;
  color: var(--color-error);
}

.form__footer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
  margin-top: 6px;
}
.form__footer .btn { min-width: 220px; }
.form__note { font-size: var(--fs-small); color: var(--color-text-muted); }

.form__status {
  grid-column: 1 / -1;
  display: none;
  padding: 16px 20px;
  border-radius: var(--radius-input);
  font-weight: 500;
}
.form__status.is-success,
.form__status.is-error { display: block; }
.form__status.is-success { background: var(--brand-green-tint); color: var(--brand-green-hover); }
.form__status.is-error { background: #fdecee; color: var(--color-error); }

/* ---------- Final call to action ---------- */
.cta-final {
  background: var(--brand-green);
  color: #fff;
  text-align: center;
}
.cta-final__inner { max-width: 820px; margin-inline: auto; }
.cta-final .section-lead { color: rgba(255, 255, 255, 0.82); }
/* Links on the green background (phone numbers included) stay white. */
.cta-final a:not(.btn) {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.cta-final__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 40px;
}
.cta-final .btn--ghost:hover { background: rgba(255, 255, 255, 0.12); }

/* ---------- Footer ---------- */
.footer {
  padding-block: clamp(56px, 8vw, 96px) 32px;
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border);
  font-size: 0.9375rem;
  color: var(--color-text-muted);
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: 40px clamp(24px, 4vw, 56px);
}
@media (max-width: 899px) { .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer__brand { grid-column: 1 / -1; } }
@media (max-width: 499px) { .footer__grid { grid-template-columns: 1fr; } }

.footer__brand { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }
.footer__logo { display: block; width: min(260px, 64vw); height: auto; }
.footer__about { max-width: 36ch; line-height: 1.55; }
.footer .socials a { background: #e8e8ed; color: var(--color-text) !important; }
.footer .socials a:hover { background: var(--brand-green); color: #fff !important; }

.footer__heading {
  margin-bottom: 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text);
}
.footer__col ul { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.footer__col a { color: var(--color-text-muted); }
.footer__col a:hover { color: var(--brand-green); }

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  font-size: 0.8125rem;
}

/* ---------- Scroll reveal ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity var(--dur-reveal) var(--ease-out),
    transform var(--dur-reveal) var(--ease-out);
  transition-delay: var(--delay, 0ms);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .js .reveal { opacity: 1; transform: none; }
  .feature-card:hover,
  .service-card:hover,
  .socials a:hover { transform: none; }
}

/* ==========================================================================
   Product Data Sheets page (data-sheets.html)
   ========================================================================== */
.ds-hero {
  padding: calc(var(--nav-height-lg) + clamp(48px, 8vw, 96px)) 0 clamp(32px, 5vw, 48px);
  text-align: center;
}
.ds-hero__title { font-size: var(--fs-display); }
.ds-hero__subtitle {
  margin-top: 16px;
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
}

.ds-search {
  position: relative;
  max-width: 560px;
  margin: 36px auto 0;
}
.ds-search__icon {
  position: absolute;
  left: 20px;
  top: 50%;
  width: 20px;
  height: 20px;
  color: var(--color-text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}
.ds-search__input {
  width: 100%;
  min-height: 56px;
  padding: 14px 20px 14px 52px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-bg-alt);
  color: var(--color-text);
  font: inherit;
  font-size: 1.0625rem;
  transition: border-color 200ms ease, box-shadow 200ms ease, background-color 200ms ease;
}
.ds-search__input:focus {
  outline: none;
  border-color: var(--brand-green);
  background: var(--color-surface);
  box-shadow: 0 0 0 4px var(--brand-green-ring);
}
.ds-status {
  min-height: 1.4em;
  margin-top: 14px;
  font-size: var(--fs-small);
  color: var(--color-text-muted);
}

/* Chips stick under the navbar. */
.ds-chips {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  padding: 12px 0;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid #e8e8ed;
}
.ds-chips__list {
  position: relative;
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}
.ds-chips__list::-webkit-scrollbar { display: none; }
.ds-chips__list li { flex: none; }
.ds-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease;
}
.ds-chip:hover { text-decoration: none; border-color: var(--brand-green); color: var(--brand-green); }
.ds-chip.is-active { background: var(--brand-green); border-color: var(--brand-green); color: #fff; }

.ds-body { padding: clamp(40px, 6vw, 72px) 0 var(--section-pad); background: var(--color-bg-alt); }
.ds-list { display: grid; gap: clamp(40px, 5vw, 56px); }
.ds-section { scroll-margin-top: calc(var(--nav-height) + 80px); }
.ds-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.ds-section__title { font-size: clamp(1.5rem, 3vw, 2rem); }
.ds-section__title:focus { outline: none; }
.ds-section__title:focus-visible { outline: 3px solid var(--brand-green-bright); outline-offset: 4px; }
.ds-section__count { font-size: var(--fs-small); color: var(--color-text-muted); white-space: nowrap; }

.ds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ds-link {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
  min-height: 72px;
  padding: 14px 18px;
  border-radius: 18px;
  background: var(--color-surface);
  color: var(--color-text);
  transition: box-shadow 300ms var(--ease-out), transform 300ms var(--ease-out), color 200ms ease;
}
.ds-link:hover {
  text-decoration: none;
  color: var(--brand-green);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}
.ds-link__icon { flex: none; width: 32px; height: 32px; color: #c4302b; }
.ds-link__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ds-link__name { font-weight: 600; line-height: 1.3; }
.ds-link__meta { font-size: 0.8125rem; color: var(--color-text-muted); }
.ds-link__dl { flex: none; width: 20px; height: 20px; color: var(--color-text-muted); transition: color 200ms ease; }
.ds-link:hover .ds-link__dl { color: var(--brand-green); }

.ds-empty { padding: 48px 0; text-align: center; }
.ds-empty__title { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.02em; }
.ds-empty__text { margin-top: 10px; color: var(--color-text-muted); }
.ds-empty__clear {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-green);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.cta-final__phone { color: inherit !important; text-decoration: underline; text-underline-offset: 0.12em; text-decoration-thickness: 0.06em; }

@media (prefers-reduced-motion: reduce) {
  .ds-link:hover { transform: none; }
}

/* ==========================================================================
   Inner pages (services, about, team, gallery, contact, careers, reviews)
   ========================================================================== */
.section--tight { padding-block: clamp(32px, 5vw, 56px); }
.section--flush-top { padding-top: clamp(24px, 4vw, 48px); }

/* ---------- Page hero ---------- */
.page-hero {
  padding: calc(var(--nav-height-lg) + clamp(40px, 7vw, 88px)) 0 clamp(32px, 5vw, 56px);
  background: var(--color-bg);
}
.page-hero__inner { max-width: 900px; text-align: center; }
.page-hero__title { font-size: var(--fs-display); }
.page-hero__lead {
  max-width: 720px;
  margin: 20px auto 0;
  font-size: var(--fs-lead);
  line-height: 1.45;
  color: var(--color-text-muted);
}
.page-hero__perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 10px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}
.page-hero__perks li {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-green-tint);
  color: var(--brand-green);
  font-size: 0.875rem;
  font-weight: 600;
}
.page-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.page-hero .btn--ghost:hover { background: rgba(0, 0, 0, 0.05); }
.page-hero__media {
  margin: clamp(40px, 6vw, 64px) 0 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-bg-alt);
}
.page-hero__media img {
  width: 100%;
  height: auto;
  max-height: 72vh;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- Prose ---------- */
.prose { max-width: 780px; }
.prose .section-title { margin-bottom: 28px; }
.prose p {
  margin-top: 18px;
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
  color: var(--color-text-muted);
}
.prose p a, .careers-intro p a { font-weight: 600; }
.checklist {
  display: grid;
  gap: 10px;
  margin: 20px 0 4px;
  padding: 0;
  list-style: none;
}
.checklist li {
  position: relative;
  padding-left: 32px;
  font-size: 1.0625rem;
  font-weight: 500;
}
.checklist li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.15em;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand-green-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 10.5l2.5 2.5L14 7.5' fill='none' stroke='%2314562b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
.checklist--grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin-inline: auto;
}
.checklist--grid li { padding: 20px 20px 20px 56px; border-radius: 18px; background: var(--color-surface); }
.checklist--grid li::before { left: 20px; top: 21px; }

/* ---------- Benefits ---------- */
.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.benefit-card {
  padding: 28px 26px;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.benefit-card h3 { margin-bottom: 12px; font-size: 1.1875rem; letter-spacing: -0.01em; }
.benefit-card ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; color: var(--color-text-muted); }
.benefit-card li::marker { color: var(--brand-green); }

.band__sub { margin-top: 12px; font-size: var(--fs-lead); color: var(--color-text-inverse-muted); }
.band__sub + .btn { margin-top: 28px; }

/* ---------- Data sheets on a service page ---------- */
.svc-sheets__list { max-width: 960px; margin-inline: auto; }
.svc-sheets__group { margin: 28px 0 14px; font-size: 1.25rem; }
.svc-sheets__group:first-child { margin-top: 0; }
.svc-sheets .ds-link { background: var(--color-bg-alt); }
.svc-sheets__more { margin-top: 28px; text-align: center; }

.review-single { max-width: 720px; }
.review-single .review-card { background: var(--color-surface); }

/* ---------- Services hub ---------- */
.service-card__title { font-size: 1.5rem; }
.service-card__text { color: var(--color-text-muted); }

/* ---------- About ---------- */
.about-photos {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
}
.about-photos figure {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-bg-alt);
}
.about-photos__main { grid-row: 1 / 3; }
.about-photos img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) {
  .about-photos { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .about-photos__main { grid-column: 1 / -1; grid-row: auto; }
}
.fact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}
.fact-card {
  padding: 28px 26px;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.fact-card__title {
  margin-bottom: 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.fact-card h3 { margin: 16px 0 6px; font-size: 1rem; }
.fact-card h3:first-of-type { margin-top: 0; }
.fact-card ul { display: grid; gap: 6px; margin: 0; padding-left: 18px; }
.fact-card li::marker { color: var(--brand-green); }
.fact-card__big { font-size: 3rem; font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--brand-green); }

.hours {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 18px;
  margin: 0;
}
.hours dt { color: var(--color-text-muted); }
.hours dd { margin: 0; font-weight: 600; }

/* ---------- Team ---------- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.team-card {
  overflow: hidden;
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.team-card__media { aspect-ratio: 4 / 3; background: var(--color-bg-alt); }
.team-card__media img { width: 100%; height: 100%; object-fit: cover; }
.team-card__body { padding: 24px 26px 28px; }
.team-card__name { font-size: 1.375rem; }
.team-card__role { margin-top: 4px; font-weight: 600; color: var(--brand-green); }
.team-card__bio { margin-top: 12px; color: var(--color-text-muted); line-height: 1.55; }

/* ---------- Gallery + photo viewer ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery__item {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 18px;
  background: var(--color-bg-alt);
  cursor: zoom-in;
}
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease-out);
}
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item:focus-visible { outline-offset: 3px; }

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.92);
  color: #fff;
}
.lightbox::backdrop { background: rgba(0, 0, 0, 0.6); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox__frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(1400px, 92vw);
}
.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: 14px;
  object-fit: contain;
}
.lightbox__bar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  width: 100%;
  margin-top: 14px;
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.8);
}
.lightbox__count { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lightbox__btn {
  position: fixed;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
  transition: background-color 200ms ease;
}
.lightbox__btn:hover { background: rgba(255, 255, 255, 0.26); }
.lightbox__btn svg { width: 22px; height: 22px; }
.lightbox__btn--close { top: 20px; right: 20px; }
.lightbox__btn--prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox__btn--next { right: 20px; top: 50%; transform: translateY(-50%); }
@media (max-width: 599px) {
  .lightbox__btn--prev, .lightbox__btn--next { top: auto; bottom: 20px; transform: none; }
}

/* ---------- Contact & careers ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}
@media (max-width: 899px) { .contact-layout { grid-template-columns: 1fr; } }
.contact-info {
  display: grid;
  gap: 22px;
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.contact-info__name { font-size: 1.5rem; }
.contact-info__block h3 {
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
.contact-info__block p { line-height: 1.6; }
.contact-info__block .link-arrow { margin-top: 6px; }
.socials--light a { background: #e8e8ed; color: var(--color-text) !important; }
.socials--light a:hover { background: var(--brand-green); color: #fff !important; }

.form__head { grid-column: 1 / -1; margin-bottom: 4px; }
.form__title { font-size: 1.75rem; }
.form__intro { margin-top: 6px; color: var(--color-text-muted); }
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 1.0625rem;
  resize: vertical;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.field textarea:focus { outline: none; border-color: var(--brand-green); box-shadow: 0 0 0 4px var(--brand-green-ring); }
.field.is-invalid textarea { border-color: var(--color-error); }

.careers-intro {
  padding: clamp(28px, 4vw, 40px);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.careers-intro .section-title { font-size: var(--fs-title); }
.careers-intro p { margin-top: 16px; font-size: 1.125rem; line-height: 1.6; color: var(--color-text-muted); }
.careers-intro__call { font-weight: 600; color: var(--color-text) !important; }
.careers-intro .btn { margin-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  .gallery__item:hover img { transform: none; }
}

/* Review cards on gray sections need a white card. */
.section--alt .review-card { background: var(--color-surface); }
@media (max-width: 599px) {
  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gallery__item { border-radius: 12px; }
}
