/* Green & Co. - global base. Tokens live in tokens.css (:root vars). */

*, *::before, *::after { box-sizing: border-box; }
:root { --nav-h: 68px; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }

/* Lenis smooth scroll (required rules; JS falls back to native when reduced-motion). */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-smooth iframe { pointer-events: none; }

body {
  margin: 0;
  /* clip, not hidden: `overflow-x: hidden` forces overflow-y to `auto`, making <body> a
     scroll container, which breaks position:fixed on mobile Chrome (the mobile menu
     detached from the viewport after scrolling). `clip` stops horizontal overflow the
     same way without turning body into a scroller, so fixed stays viewport-relative. */
  overflow-x: clip;
  font-family: var(--gc-font-sans);
  font-size: var(--gc-fs-body);
  line-height: var(--gc-leading-body);
  font-weight: var(--gc-weight-body);
  color: var(--gc-text-on-light);
  background: var(--gc-bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-kerning: normal;
  font-feature-settings: "kern" 1, "liga" 1;
}

h1, h2, h3 {
  font-family: var(--gc-font-serif);
  font-weight: var(--gc-weight-display);
  letter-spacing: var(--gc-tracking-heading);
  line-height: 1.1;
  text-wrap: balance;
  margin: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

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

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: var(--gc-target-min); padding: 0 1.5em;
  border: 1px solid transparent; border-radius: var(--gc-radius);
  font-family: var(--gc-font-sans); font-weight: var(--gc-weight-label);
  font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--gc-motion-fast) var(--gc-motion-ease),
              color var(--gc-motion-fast) var(--gc-motion-ease),
              border-color var(--gc-motion-fast) var(--gc-motion-ease);
}
.btn-sm { min-height: 40px; padding: 0 1.1em; font-size: .74rem; }
.btn-primary { background: var(--gc-cta-bg); color: var(--gc-cta-text); }
.btn-primary:hover { background: var(--gc-gold-soft); }
.btn-ghost { background: transparent; color: var(--gc-text-on-dark); border-color: rgba(245,245,245,.55); }
.btn-ghost:hover { border-color: var(--gc-gold); color: var(--gc-gold); }
.btn-outline { background: transparent; color: var(--gc-text-on-light); border-color: rgba(13,13,13,.48); }
.btn-outline:hover { border-color: var(--gc-black); background: var(--gc-black); color: var(--gc-offwhite); }

/* Focus + skip link */
:focus-visible { outline: 2px solid var(--gc-focus-dark); outline-offset: 3px; }
/* On light surfaces the gold ring under-contrasts; use the dark focus token. */
.commercial :focus-visible, .contact :focus-visible, .about__wrap :focus-visible { outline-color: var(--gc-focus-light); }
/* Sticky bar hugs 3 viewport edges: inset the ring so it isn't clipped. */
.call-bar__btn:focus-visible { outline-offset: -3px; }
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--gc-black); color: var(--gc-offwhite);
  padding: 10px 16px; text-decoration: none;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Site header (sticky charcoal bar) */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--gc-charcoal);
  border-bottom: 1px solid var(--gc-rule-soft);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: var(--nav-h); padding-block: 12px;
}
.wordmark {
  display: inline-flex; align-items: center; gap: 12px;
  font-family: var(--gc-font-serif); color: var(--gc-text-on-dark);
  font-size: 1.4rem; font-weight: 500; letter-spacing: .14em;
  text-decoration: none; line-height: 1;
  /* The logo must never be squeezed. Its children are now <img>, and an img with width:auto
     contributes ~0 to min-content, so min-width:auto CANNOT hold this open the way live text
     did: the flex parent would shrink the anchor below its content and the art would silently
     overflow into the nav. Measured: anchor clientWidth 170px vs scrollWidth 197px. */
  flex-shrink: 0;
}
/* Emblem + wordmark are approved vector art (brand/logo-greenco-final/), not live text.
   Sized by height; width follows. The old .amp gold rule is gone: the wordmark's ampersand
   is white in the art itself, matching the brand board. */
.wordmark__mark { display: block; height: 44px; width: auto; }
.wordmark__text { display: block; height: 16px; width: auto; }
/* Gaps were 30px. Restoring the emblem widened the lockup by ~25px (the mark costs 54.7 + a
   12px gap; swapping live text for the wordmark art gave back ~41), and the header had NO room
   to give: usable width is 1032px (--gc-maxw 1080 less two 24px gutters) and lockup + nav wanted
   1058.6, i.e. it overlapped.

   30 -> 24 stopped the overlap but left only 9px between the wordmark and "Services", so the
   logo read as the first nav item rather than as the logo. 16/20 frees 40px and gives it ~49px
   of clearance. The two values are a deliberate hierarchy, keep it: 16 within the links < 20
   between the nav's three groups < ~49 logo-to-nav. Tightening the links also helps on purpose,
   it groups the nav as one unit against the logo instead of one long even-spaced row.

   The logo is NOT the lever here: the mark stays 44px because that is both the board's ~2.8x
   wordmark-cap ratio and the exact header content box. Shrinking it buys gap by weakening the
   thing the gap exists to set apart. */
.main-nav { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; gap: 16px; }
.main-nav a.nav, .nav-links a {
  color: var(--gc-text-on-dark); text-decoration: none;
  font-size: .78rem; letter-spacing: .16em; text-transform: uppercase;
  font-weight: 500; opacity: .82;
}
.nav-links a:hover { color: var(--gc-gold); opacity: 1; }

.nav-phone {
  display: inline-flex; align-items: center; gap: .45em;
  color: var(--gc-text-on-dark); text-decoration: none;
  font-weight: 600; font-size: .92rem; letter-spacing: .02em;
}
.nav-phone__icon { color: var(--gc-gold); flex: none; }
.nav-phone:hover { color: var(--gc-gold); }

/* Hamburger toggle (mobile only). */
.nav-toggle {
  display: none;
  background: transparent; border: 0; cursor: pointer;
  width: 44px; height: 44px; padding: 10px; margin-right: -10px;
  color: var(--gc-text-on-dark);
}
.nav-toggle__box { display: block; position: relative; width: 24px; height: 16px; }
.nav-toggle__box span {
  position: absolute; left: 0; width: 100%; height: 2px; background: currentColor;
  border-radius: 2px; transition: transform .25s var(--gc-motion-ease), opacity .2s;
}
.nav-toggle__box span:nth-child(1) { top: 0; }
.nav-toggle__box span:nth-child(2) { top: 7px; }
.nav-toggle__box span:nth-child(3) { top: 14px; }
.menu-open .nav-toggle { color: var(--gc-gold); }
.menu-open .nav-toggle__box span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-open .nav-toggle__box span:nth-child(2) { opacity: 0; }
.menu-open .nav-toggle__box span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Collapse to the hamburger before the full nav can overflow. Measured intrinsic width
   of wordmark + 5 links + phone + CTA is ~1081px of viewport; below that the CTA clipped
   off the right edge (seen on a Z Fold open). 1100 leaves a comfortable margin.
   2026-07-14 recheck, with the emblem restored and nav gaps at 16/20: lockup 197 + nav 785.6
   = 982.6 against 1032 usable, so the full nav clears this breakpoint with ~49px spare (which
   is the logo-to-nav gap itself; space-between hands all slack to that one spot).
   Careful: --gc-maxw caps the container at 1080, so usable is 1032 at EVERY viewport past
   ~1128 and this is not a "wide screens are fine" situation. Re-measure if the nav gains an
   item or the lockup grows: a 6th link would eat most of that 49px and the logo would start
   crowding "Services" again. */
@media (max-width: 1100px) {
  .nav-links, .nav-phone, .site-header .btn { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
}

/* Mobile menu overlay */
.mobile-menu[hidden] { display: none; }   /* author display:flex below would otherwise beat the UA [hidden] rule, leaving an invisible full-screen click-trap */
.mobile-menu {
  position: fixed; inset: var(--nav-h) 0 0 0; z-index: 48;
  background: var(--gc-black);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(24px, 6vw, 44px) var(--gc-gutter) calc(env(safe-area-inset-bottom) + 32px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;   /* short/landscape viewports: let the phone + CTA scroll into reach instead of clipping */
  opacity: 0; transform: translateY(-8px);
  transition: opacity .24s var(--gc-motion-ease), transform .24s var(--gc-motion-ease);
}
.menu-open { overflow: hidden; }
.menu-open .mobile-menu { opacity: 1; transform: none; }
.mobile-menu__nav { display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.mobile-menu__nav a {
  color: var(--gc-text-on-dark); text-decoration: none;
  font-family: var(--gc-font-serif); font-weight: var(--gc-weight-display);
  font-size: 1.6rem; letter-spacing: .02em; padding: 12px 0;
  border-bottom: 1px solid var(--gc-rule-soft);
}
.mobile-menu__nav a:hover, .mobile-menu__nav a:focus-visible { color: var(--gc-gold); }
.mobile-menu__foot { display: grid; gap: 16px; }
.mobile-menu__phone {
  display: inline-flex; align-items: center; gap: .5em;
  color: var(--gc-gold); text-decoration: none;
  font-weight: 600; font-size: 1.15rem; letter-spacing: .02em;
}
.mobile-menu__foot .btn { width: 100%; }

/* Sticky mobile quick-contact bar: dark bar, gold accent (not a full gold slab). */
.call-bar { display: none; }
@media (max-width: 700px) {
  .call-bar {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    position: fixed; inset: auto 0 0 0; z-index: 46;
    padding: 10px var(--gc-gutter) calc(env(safe-area-inset-bottom) + 10px);
    background: rgba(13,13,13,.94); backdrop-filter: blur(8px);
    border-top: 1px solid var(--gc-rule);
  }
  .call-bar__btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45em;
    min-height: 48px; border-radius: var(--gc-radius);
    font-weight: 600; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase;
    text-decoration: none;
  }
  .call-bar__btn--call { background: transparent; color: var(--gc-gold); border: 1px solid var(--gc-gold); }
  .call-bar__btn--est { background: var(--gc-gold); color: var(--gc-black); }
  .menu-open .call-bar { display: none; }
}

/* Site footer (dark) */
.site-footer {
  background: var(--gc-black);
  color: var(--gc-text-on-dark);
  padding-block: clamp(48px, 7vw, 80px) 32px;
  border-top: 1px solid var(--gc-rule);
}
.site-footer__top {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr;
  gap: clamp(28px, 5vw, 64px);
  padding-bottom: clamp(32px, 4vw, 48px);
  border-bottom: 1px solid var(--gc-rule-soft);
}
.wordmark--footer { margin-bottom: 14px; }
.wordmark--footer .wordmark__mark { height: 52px; }
.wordmark--footer .wordmark__text { height: 19px; }
.site-footer__tag { margin: 0; color: var(--gc-text-muted); font-size: .9rem; letter-spacing: .04em; }
.site-footer__nav { display: grid; gap: 11px; align-content: start; }
.site-footer__nav a {
  color: var(--gc-text-on-dark); text-decoration: none;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; opacity: .82;
}
.site-footer__nav a:hover { color: var(--gc-gold); opacity: 1; }
.site-footer__contact { display: grid; gap: 9px; align-content: start; }
.site-footer__contact a { color: var(--gc-text-on-dark); text-decoration: none; font-size: .95rem; }
.site-footer__contact a:hover { color: var(--gc-gold); }
.site-footer__contact p { margin: 6px 0 0; color: var(--gc-text-muted); font-size: .9rem; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px;
  padding-top: 24px;
}
.site-footer__bottom p { margin: 0; color: var(--gc-text-muted); font-size: .8rem; letter-spacing: .03em; }
.site-footer__bottom a { color: var(--gc-text-muted); text-decoration: none; font-size: .8rem; letter-spacing: .03em; }
.site-footer__bottom a:hover { color: var(--gc-gold); }
.site-footer__legal { display: flex; align-items: center; gap: 20px; }
.site-footer__cookie-btn {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--gc-text-muted); font: inherit;
  font-size: .8rem; letter-spacing: .03em;
  font-family: var(--gc-font-sans);
}
.site-footer__cookie-btn:hover { color: var(--gc-gold); }
@media (max-width: 700px) {
  .site-footer { padding-bottom: 92px; }   /* clear the fixed mobile call-bar */
  .site-footer__top { grid-template-columns: 1fr; gap: 30px; }
}

/* Long-form document pages (privacy policy, terms). Readable measure + restored
   list markers, since the global reset strips them for the one-pager layout. */
.page-doc { padding-block: clamp(48px, 7vw, 88px) clamp(56px, 8vw, 104px); }
.container--reading { max-width: 760px; }
.page-doc__head { margin-bottom: clamp(28px, 4vw, 40px); padding-bottom: 24px; border-bottom: 1px solid var(--gc-rule); }
.page-doc__title { font-size: clamp(2rem, 5vw, 3rem); }
.page-doc__body { color: var(--gc-text-on-light); font-size: 1.02rem; line-height: 1.7; }
.page-doc__body > *:first-child { margin-top: 0; }
.page-doc__body h2 {
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  letter-spacing: .06em; margin: 2.2em 0 .6em;
}
.page-doc__body p { margin: 0 0 1.1em; }
.page-doc__body ul { list-style: disc; padding-left: 1.4em; margin: 0 0 1.2em; }
.page-doc__body li { margin-bottom: .5em; }
.page-doc__body a { color: var(--gc-black); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--gc-gold); }
.page-doc__body a:hover { color: var(--gc-gold); }
.page-doc__body code {
  font-size: .9em; background: rgba(13,13,13,.06);
  padding: .1em .4em; border-radius: 3px; word-break: break-word;
}
.page-doc__body strong { font-weight: 600; }

/* Scroll reveals (only active once ui.js confirms JS + motion allowed). */
.js-reveal-ready [data-reveal] {
  opacity: 0; transform: translateY(18px);
  transition: opacity .7s var(--gc-motion-ease), transform .7s var(--gc-motion-ease);
}
.js-reveal-ready [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .js-reveal-ready [data-reveal] { opacity: 1 !important; transform: none !important; }
}
