/* ════════════════════════════════════════════════════
   EnergyLab — Site styles
   Brand: ENERGYLAB · Commercial Energy Advisory
   System: Outfit · Ink #0a0a0a · Cream #f4f3ef · White
   No accent color — rhythm comes from weight + scale.
   ENERGY (heavy) ↔ LAB (light, faded) is the
   visual signature applied across the site.
   ════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@200;300;400;500;600;700;800;900&display=swap');

:root {
  /* surfaces */
  --paper: #ffffff;              /* base */
  --paper-2: #f4f4f4;            /* subtle gray panel */
  --paper-3: #ebebeb;            /* deeper gray panel */
  --ink: #0a0a0a;
  --ink-soft: #1a1a18;
  --ink-2: rgba(10,10,10,0.58);
  --ink-3: rgba(10,10,10,0.34);
  --ink-4: rgba(10,10,10,0.16);
  --rule: rgba(10,10,10,0.10);
  --rule-strong: rgba(10,10,10,0.22);

  /* On dark surfaces */
  --on-dark: #ffffff;
  --on-dark-2: rgba(255,255,255,0.62);
  --on-dark-3: rgba(255,255,255,0.34);
  --on-dark-4: rgba(255,255,255,0.18);
  --rule-dark: rgba(255,255,255,0.12);
  --rule-dark-strong: rgba(255,255,255,0.28);

  /* "accent" — neutralised. Used in places that previously had orange.
     Keeping the var so existing references still resolve; it now reads
     as a quiet weight-shift rather than a colour. */
  --accent: #0a0a0a;
  --accent-deep: #0a0a0a;

  --display: 'Outfit', system-ui, sans-serif;
  --sans:    'Outfit', system-ui, sans-serif;
  --mono:    'Outfit', system-ui, sans-serif;

  --maxw: 1320px;
  --gutter: clamp(24px, 4vw, 56px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { overflow-x: clip; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
/* Grid/flex children should be allowed to shrink below their min-content size
   so long unbreakable words (emails, URLs) don't force horizontal overflow. */
.contact-grid > *,
.channels, .channel,
.work-grid > *,
.faq-grid > *,
.about-block > *,
.approach-grid > *,
.hero-grid > *,
.featured-grid > *,
.footer-grid > * { min-width: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* ══════════════════ TYPE ══════════════════
   The ENERGY/LAB visual signature is encoded
   in two pieces:
   .display = all-caps, tracked, heavy
   em / .em inside a display = light + faded
   ============================================ */

/* eyebrows / section labels */
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow .dot,
.eyebrow .bar {
  display: inline-block;
  width: 14px; height: 2px;
  background: var(--ink);
  opacity: 0.5;
  font-size: 0;
  vertical-align: middle;
  overflow: hidden;
  color: transparent;
}

/* Display — ENERGYLAB style.
   All caps, heavy, tracked. */
.display, .h1, .h2, .h3 {
  font-family: var(--display);
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 0.96;
  color: var(--ink);
  margin: 0;
}
.h1 { font-size: clamp(48px, 9vw, 132px); letter-spacing: 0.045em; line-height: 0.94; }
.h2 { font-size: clamp(36px, 5.4vw, 76px); letter-spacing: 0.05em; line-height: 0.98; }
.h3 { font-size: clamp(24px, 3vw, 38px); letter-spacing: 0.06em; line-height: 1.04; }
.h4 { font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }

/* "Italic"-equivalent inside a display headline:
   light weight + opacity 0.32 — same treatment as LAB. */
.display em, .display i,
.h1 em, .h2 em, .h3 em,
h1 em, h2 em, h3 em,
.hero-headline em, .hero-headline i {
  font-style: normal;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--ink);
  opacity: 0.32;
}

/* Lede / pull text — sentence case, kept readable */
.lede {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.45;
  letter-spacing: 0.005em;
  color: var(--ink);
  text-transform: none;
  max-width: 40ch;
}
.lede em { font-style: normal; font-weight: 500; color: var(--ink); opacity: 1; }

/* Body */
.body-text {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink);
  max-width: 60ch;
  font-weight: 400;
  text-transform: none;
}
.body-text p { margin: 0 0 1.1em; }
.body-text p:last-child { margin-bottom: 0; }
.body-text em { font-style: normal; font-weight: 600; color: var(--ink); opacity: 1; }

.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum'; }

/* ══════════════════ Rules ══════════════════ */
.rule { border: 0; border-top: 1px solid var(--rule); margin: 0; }
.rule-strong { border-top: 1px solid var(--rule-strong); }

/* ══════════════════ Three-bar E mark ══════════════════
   Reusable inline SVG via a CSS background; or use the
   <svg class="elmark"> component in markup. Sizing via
   width attribute on the svg. */
.elmark { display:inline-block; }
.elmark rect { fill: currentColor; }

/* ══════════════════ Nav ══════════════════ */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in oklab, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  gap: 32px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  color: var(--ink);
}
.brand .elmark { color: var(--ink); }
.brand-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}
.brand-word .lab { font-weight: 300; opacity: 0.4; }

.nav-links { display: flex; gap: 32px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.16em; font-weight: 500; }
.nav-links a {
  color: var(--ink-2);
  transition: color .15s ease;
  position: relative;
  padding: 4px 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute; left: 0; right: 40%;
  bottom: -2px; height: 2px; background: var(--ink);
}

.nav-cta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 18px;
  border: 1.5px solid var(--ink);
  display: inline-flex; align-items: center; gap: 10px;
  transition: background .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav-cta:hover { background: var(--ink); color: var(--paper); }
.nav-cta .arrow { display: inline-block; font-weight: 400; }

@media (max-width: 880px) {
  .nav-links { display: none; }
}

/* ══════════════════ Mobile menu ══════════════════
   On <760px the brand mark itself becomes the menu
   toggle (the three-bar E is already a hamburger by
   visual design). A small chevron next to the wordmark
   signals interactivity; it rotates 180° when open. */
.nav-burger { display: none; }  /* unused — brand is the toggle */

.brand .nav-chev {
  display: none;
  margin-left: 6px;
  font-size: 11px;
  color: var(--ink-3);
  transition: transform .2s ease;
}

.nav-mobile {
  display: none;
  /* Fixed to the viewport (not absolute to a sticky parent) so the menu
     appears under the visible header on iOS Safari even after scrolling.
     --nav-h is set by scripts/nav.js based on the live header height. */
  position: fixed;
  top: var(--nav-h, 60px);
  left: 0; right: 0;
  max-height: calc(100vh - var(--nav-h, 60px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: var(--paper);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule-strong);
  box-shadow: 0 18px 30px -18px rgba(0,0,0,0.15);
  padding: 4px 0 8px;
  font-family: var(--display);
  z-index: 60;
}
.nav-mobile.is-open { display: block; }
.nav-mobile a {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px var(--gutter);
  border-top: 1px solid var(--rule);
  font-family: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.005em;
  text-transform: none;
  line-height: 1;
  color: var(--ink-2);
}
.nav-mobile a:first-child { border-top: 0; }
.nav-mobile a:hover { color: var(--ink); }
.nav-mobile a.active {
  font-family: var(--display);
  font-style: normal;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
}
.nav-mobile a .arrow {
  font-family: var(--display);
  font-style: normal;
  font-weight: 400;
  font-size: 16px;
  color: var(--ink-3);
}
.nav-mobile a[href^="mailto"] {
  font-family: var(--display);
  font-style: normal;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}

@media (max-width: 880px) {
  .nav-inner { padding-top: 14px; padding-bottom: 14px; gap: 16px; }
  .nav-cta { display: none; }
  .brand .nav-chev { display: inline-block; }
  .brand[aria-expanded="true"] .nav-chev { transform: rotate(180deg); }
  /* No body scroll lock when the menu is open. Fixing <body> on iOS Safari
     interacts badly with the sticky <header>, pushing the toggle off-screen
     and freezing the input layer. The menu is fixed-position so it stays
     visible regardless; scrolling the page behind it is harmless. */
}

/* ══════════════════ Buttons ══════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 22px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  border: 1.5px solid var(--ink); color: var(--ink); background: transparent;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: transparent; color: var(--ink); }
.btn .arrow { display: inline-block; font-weight: 400; transition: transform .15s ease; }
.btn:hover .arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase;
  border-bottom: 1.5px solid var(--ink);
  padding-bottom: 6px;
  transition: gap .15s ease;
  color: var(--ink);
}
.link-arrow:hover { gap: 16px; }
.link-arrow .arrow { display: inline-block; font-weight: 400; }

/* ══════════════════ Sections ══════════════════ */
.section { padding: clamp(80px, 11vw, 144px) 0; }
.section-tight { padding: clamp(48px, 6vw, 80px) 0; }

.section-head {
  display: flex; flex-direction: column;
  gap: 28px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule-strong);
  margin-bottom: 64px;
}
.section-head .lead { max-width: none; }

/* ══════════════════ Footer ══════════════════ */
.footer {
  border-top: 1px solid var(--rule-strong);
  padding: 64px 0 36px;
  background: var(--paper);
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
.footer h5 {
  font-family: var(--sans); font-size: 11px;
  font-weight: 600; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--ink-3);
  margin: 0 0 18px;
}
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.footer ul a {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-transform: none;
}
.footer ul a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--rule);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.footer-mark {
  display: flex; align-items: center; gap: 28px;
  margin-bottom: 36px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}
.footer-mark .word {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 9vw, 120px);
  letter-spacing: 0.06em;
  line-height: 0.9;
  text-transform: uppercase;
}
.footer-mark .word .lab { font-weight: 300; opacity: 0.32; }

@media (max-width: 880px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-mark { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ══════════════════ Placeholder imagery ══════════════════ */
.imgph {
  position: relative;
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(10,10,10,0.05) 9px 10px),
    var(--paper-2);
  border: 1px solid var(--rule-strong);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.imgph::before {
  content: ''; position: absolute; inset: 12px;
  border: 1px dashed var(--rule-strong);
  pointer-events: none;
}
.imgph .label { z-index: 1; padding: 6px 14px; background: var(--paper); border: 1px solid var(--rule-strong); }

/* dark variant — for use on .approach / .principles blocks */
.imgph-dark {
  background:
    repeating-linear-gradient(45deg, transparent 0 9px, rgba(255,255,255,0.04) 9px 10px),
    #111;
  border-color: var(--rule-dark-strong);
  color: var(--on-dark-3);
}
.imgph-dark::before { border-color: var(--rule-dark-strong); }
.imgph-dark .label { background: #0a0a0a; border-color: var(--rule-dark-strong); color: var(--on-dark-3); }

/* selection */
::selection { background: var(--ink); color: var(--paper); }

/* ══════════════════ Helpers ══════════════════ */
.flex { display: flex; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.wrap { flex-wrap: wrap; }

/* Tiny lockup used in tight spaces */
.brand-lockup {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  line-height: 1;
}
.brand-lockup .lab { font-weight: 300; opacity: 0.4; }
