.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 720px) {
  .container {
    padding: 0 var(--space-3);
  }
}

/* ---------- Nav ---------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: auto;
  display: flex;
  align-items: flex-start;
  background: transparent;
  transition: background-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
  transform: translateY(0);
}

.nav__inner {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: flex-start;
  gap: var(--space-3);
}

.nav__logo-link {
  justify-self: start;
  align-self: center;
  position: relative;
  display: inline-flex;
}

.nav--hidden {
  transform: translateY(-100%);
}

.nav--solid,
.nav--static {
  background: var(--color-bg);
  box-shadow: var(--shadow-nav);
}

.nav__logo {
  display: block;
  height: 30px;
  width: auto;
  transition: opacity var(--transition-fast);
}

.nav__logo-dark { display: none; }
.nav__logo-light { display: block; }

.nav__logo-hover {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0;
  clip-path: inset(0 55% 0 0);
  transition: opacity var(--transition-fast);
}

.nav__logo-link:hover .nav__logo-hover { opacity: 1; }

.nav--solid .nav__logo-dark { display: block; }
.nav--solid .nav__logo-light { display: none; }

/* page without a hero (e.g. projects.html) is always solid-on-light */
.nav--static .nav__logo-dark { display: block; }
.nav--static .nav__logo-light { display: none; }

.nav__links {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}

.nav__end {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: var(--space-3);
}

.nav__link {
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-button);
  font-size: var(--font-size-sm);
  font-weight: 550;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-white);
  padding: var(--space-2) 37px;
  border-radius: 0;
  transition: color var(--transition-fast), opacity var(--transition-fast);
  opacity: 0.9;
}

.nav__link::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--nav-surface);
  transform: scaleX(0);
  transform-origin: left;
}

.nav__link:hover::before,
.nav__item--dropdown:hover > .nav__link::before,
.nav__item--dropdown:focus-within > .nav__link::before {
  transform: scaleX(1);
  transition: transform var(--transition-base);
}

.nav__link:hover,
.nav__item--dropdown:hover > .nav__link,
.nav__item--dropdown:focus-within > .nav__link {
  opacity: 1;
  color: var(--color-ink);
}

.nav--solid .nav__link,
.nav--static .nav__link {
  color: var(--color-ink);
}

.nav--solid .nav__link:hover,
.nav--static .nav__link:hover,
.nav--solid .nav__item--dropdown:hover > .nav__link,
.nav--solid .nav__item--dropdown:focus-within > .nav__link,
.nav--static .nav__item--dropdown:hover > .nav__link,
.nav--static .nav__item--dropdown:focus-within > .nav__link {
  color: var(--color-ink);
}

.nav__link.nav__link--cta {
  background-color: var(--color-gold);
  color: var(--color-white);
  font-weight: 700;
  opacity: 1;
}

.nav__link.nav__link--cta:hover {
  color: var(--color-green-dark);
}

.nav__item {
  position: relative;
  display: flex;
  align-items: flex-start;
}

.nav__item--dropdown > .nav__link::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 6px;
  margin-bottom: 2px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  margin-top: 0;
  padding: var(--space-2);
  background: var(--nav-surface);
  border-radius: 0;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.nav__item--dropdown:hover .nav__dropdown,
.nav__item--dropdown:focus-within .nav__dropdown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav__dropdown-link {
  padding: var(--space-1) var(--space-2);
  border-radius: 0;
  font-family: var(--font-button);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--color-ink-92);
  white-space: nowrap;
  transition: color var(--transition-fast);
}

.nav__dropdown-link:hover {
  color: var(--color-gold);
}

@media (max-width: 860px) {
  .nav__dropdown,
  .nav__item--dropdown > .nav__link::after {
    display: none;
  }
}

.nav__toggle {
  display: none;
  align-self: center;
  width: 28px;
  height: 20px;
  position: relative;
}

.nav__toggle span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: currentColor;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}
.nav__toggle span:nth-child(1) { top: 0; }
.nav__toggle span:nth-child(2) { top: 9px; }
.nav__toggle span:nth-child(3) { top: 18px; }

@media (max-width: 860px) {
  .nav__links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    /* Sized to its own content (4 short links) rather than stretched to fill the remaining
       viewport — a max-height + scroll is just a safety net for very short screens. Note: no
       `bottom`/fixed `height` here. .nav sets `transform: translateY(0)` for its hide-on-scroll
       animation, which makes it a containing block for fixed-position descendants (any
       non-"none" transform does) — that shrinks this panel's containing block down to .nav's
       own ~58px height, so a height derived from top+bottom would resolve to 0. Auto height
       sidesteps that entirely since it doesn't depend on the containing block's size. */
    max-height: calc(100dvh - var(--nav-height));
    overflow-y: auto;
    background: var(--color-bg);
    box-shadow: var(--shadow-card);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    padding: var(--space-4) 0;
    transform: translateX(100%);
    transition: transform var(--transition-base);
  }
  .nav__links.is-open {
    transform: translateX(0);
  }
  .nav__links .nav__link {
    color: var(--color-ink);
    font-size: var(--font-size-md);
  }
  .nav__toggle {
    display: block;
    color: var(--color-white);
  }
  .nav--solid .nav__toggle,
  .nav--static .nav__toggle {
    color: var(--color-ink);
  }

  /* The desktop grid (1fr auto 1fr) sizes its middle track to the CTA button's content width
     (inflated by the 37px desktop side-padding on .nav__link), which crushes the two 1fr tracks
     holding the logo down to a sliver. Flex + space-between sidesteps that fragile track math —
     .nav__links is removed from flow anyway (position: fixed above), so this is just logo vs.
     CTA/toggle, pinned to opposite ends. */
  .nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* The 37px side padding on .nav__link is a desktop value — at this width it's wide enough
     that flexbox has to shrink the CTA below its text's natural width, wrapping "Start Estimate"
     onto two lines. */
  .nav__link--cta {
    padding: var(--space-2);
  }

  /* Full wordmark doesn't fit next to the CTA + toggle at this width — show only the "ERP"
     mark (the existing hover-reveal logo already isolates it) at a fixed crop size instead.
     The crop box must be at least ~1.9x its height (that's the "ERP" mark's own aspect ratio
     in the source image) or the right edge of the "P" gets clipped — 84x30 was too narrow for
     its height and cut it off; 74x24 keeps the full mark in frame at a smaller size. */
  .nav__logo-link {
    width: 74px;
    height: 24px;
    overflow: hidden;
  }
  /* .nav--solid/.nav--static .nav__logo-dark { display: block; } (above) outranks a plain
     .nav__logo-base rule on specificity alone (two classes beat one), regardless of source
     order — so on the scrolled/solid white nav state the full wordmark was winning back its
     display: block and showing full-size, clipped by this container, behind the emblem crop.
     Matching the same compound selectors here ties the specificity and wins on source order. */
  .nav__logo-base,
  .nav--solid .nav__logo-base,
  .nav--static .nav__logo-base {
    display: none;
  }
  .nav__logo-hover {
    opacity: 1;
    clip-path: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: left center;
  }
}

/* ---------- Section rhythm ---------- */
.section {
  padding: var(--space-7) 0 0;
}

.section--full {
  min-height: 100vh;
  min-height: 100svh; /* stable across address-bar show/hide on scroll — see .hero in home.css for why dvh isn't used here */
  display: flex;
  align-items: center;
}

.section--full > .container,
.section--full > .our-work {
  width: 100%;
}

.section--surface {
  background: var(--color-bg);
}

.section--inverse {
  background: var(--color-bg);
  color: var(--color-ink);
}

.section__header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  flex-wrap: wrap;
}

.section__eyebrow {
  display: inline-block;
  font-size: var(--font-size-sm);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold);
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.section__title {
  font-size: clamp(1.75rem, 6vw, var(--font-size-4xl));
  font-weight: 700;
  color: var(--color-green-dark);
  transition: color 500ms ease-out 0.8s;
}

@media (max-width: 640px) {
  .section__title {
    font-size: var(--font-size-2xl);
  }
}

.section__title:hover {
  color: var(--color-gold);
  transition: color var(--transition-fast);
}

.section__lede {
  color: var(--color-ink-92);
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .section__lede {
    max-width: 100%;
    text-align: left;
    white-space: normal;
  }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--color-bg);
  color: var(--color-ink);
  padding: var(--space-6) 0;
}

.footer__inner {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-areas:
    "logo nav social"
    "copyright legal contact";
  column-gap: var(--space-9);
  row-gap: var(--space-4);
  justify-content: center;
  justify-items: start;
  align-items: start;
}

.footer__logo-link {
  grid-area: logo;
  position: relative;
  display: inline-flex;
}

.footer__logo {
  display: block;
  height: 32px;
  width: auto;
}

.footer__logo-link:hover .nav__logo-hover { opacity: 1; }

.footer__copyright {
  grid-area: copyright;
  color: var(--color-ink-92);
  font-size: var(--font-size-sm);
  line-height: 1.5;
}

.footer__nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer__legal {
  grid-area: legal;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.footer__legal-link {
  color: var(--color-ink-92);
  font-size: var(--font-size-sm);
  transition: color var(--transition-fast);
}

.footer__legal-link:hover {
  color: var(--color-gold);
}

.footer__link {
  color: var(--color-ink);
  font-size: var(--font-size-base);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--color-gold);
}

.footer__social {
  grid-area: social;
  display: flex;
  gap: var(--space-2);
}

.footer__contact {
  grid-area: contact;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  color: var(--color-ink-92);
  font-size: var(--font-size-base);
}

.footer .social-icon {
  width: 47px;
  height: 47px;
}

.footer .social-icon svg {
  width: 21px;
  height: 21px;
}

@media (max-width: 720px) {
  .footer__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "logo"
      "nav"
      "social"
      "copyright"
      "legal"
      "contact";
    row-gap: var(--space-4);
  }
}
