/* ============================================================
   shared.css — site chrome (nav, footer, base) shared by every page.
   Page-specific styles live inline in each page's <style> block.
   Pair with tokens.css (loaded first).
   ============================================================ */

/* ---- Container ---- */
.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { position: relative; }
.section-pad { padding: var(--section-y) 0; }
.section-white { background: var(--color-bg-white); }
.section-warm  { background: var(--color-bg-warm); }
@media (max-width: 768px) { .section-pad { padding: var(--section-y-mobile) 0; } }

.section-head {
  display: grid; grid-template-columns: 1fr 1.4fr;
  gap: 80px; align-items: end;
  margin-bottom: 72px;
}
.section-head .kicker { color: var(--color-text-muted); }
.section-head h2 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: var(--fs-h2); line-height: var(--lh-h2);
  letter-spacing: -0.02em; margin: 16px 0 0; color: var(--color-navy);
  max-width: 16ch; text-wrap: balance;
}
.section-head .intro { color: var(--color-text-muted); font-size: var(--fs-body-lg); line-height: var(--lh-body-lg); max-width: 56ch; text-wrap: pretty; }
@media (max-width: 900px) { .section-head { grid-template-columns: 1fr; gap: 24px; } }

/* ---- Scroll reveal ----
   Default: content is visible. JS adds the `pre` flag to hide initially,
   then the observer removes it to fade in. This means content is always
   visible without JS (and to non-JS-rendering tools like html-to-image). */
.reveal {
  transition: opacity 700ms ease-out, transform 700ms ease-out;
  transition-delay: var(--rd, 0ms);
}
.reveal.pre {
  opacity: 0;
  transform: translateY(30px);
}

/* hero-in: above-the-fold animation. Content is visible from frame 0 —
   we only animate transform so opacity never dips, even if the animation
   never plays (paused iframes, html-to-image, etc.). */
@keyframes heroIn { from { transform: translateY(14px); } to { transform: none; } }
.hero-in { opacity: 1; }
html.js-anim .hero-in {
  animation: heroIn 700ms cubic-bezier(.2,.6,.2,1) both;
  animation-delay: var(--rd, 0ms);
}

/* ============================================================
   NAVBAR
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 60;
  background: #FFFFFF;
  border-bottom: 1px solid transparent;
  transition: border-color 240ms ease, background 240ms ease;
}
.nav.scrolled {
  border-bottom-color: var(--color-divider);
  background: #FFFFFF;
}
.nav-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 22px var(--gutter);
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px;
}
.brand {
  display: inline-flex; align-items: baseline; gap: 0;
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.04em;
  color: var(--color-navy);
}
.brand .dot {
  display: inline-block; width: 6px; height: 6px;
  background: var(--color-gold); border-radius: 50%;
  margin-left: 4px; transform: translateY(-2px);
}
.nav-links {
  display: flex; align-items: center; gap: 36px;
  font-size: 14px; letter-spacing: 0.01em;
  color: var(--color-text-primary);
  white-space: nowrap;
}
.nav-links > * { white-space: nowrap; }
/* Tighter gap at medium widths so labels don't wrap before the breakpoint */
@media (max-width: 1024px) {
  .nav-links { gap: 24px; font-size: 13px; }
}
.nav-links a { position: relative; padding: 4px 0; }
.nav-links a:hover { color: var(--color-gold); }
.nav-links .has-dd { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.nav-links .has-dd svg { width: 10px; height: 10px; transition: transform 240ms; }
.nav-links .has-dd[aria-expanded="true"] svg { transform: rotate(180deg); }

.nav-cta {
  color: var(--color-gold);
  font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px;
}
.nav-cta::after {
  content: ""; width: 14px; height: 1px; background: var(--color-gold);
  transition: width 280ms ease;
}
.nav-cta:hover::after { width: 22px; }

/* Lean nav dropdown — single-column, typographic */
.nav-dd {
  position: fixed;
  top: var(--dd-top, 70px);
  left: var(--dd-left, 50%);
  background: var(--color-bg-white);
  border: 1px solid var(--color-divider);
  min-width: 240px;
  padding: 10px 0;
  box-shadow: 0 20px 40px -20px rgba(8,35,58,0.18);
  opacity: 0; pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 80;
}
.nav-dd.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.nav-dd a {
  display: block;
  padding: 10px 22px;
  font-size: 14px;
  color: var(--color-text-primary);
  white-space: nowrap;
  transition: color 180ms ease, background 180ms ease, padding-left 220ms ease;
}
.nav-dd a:hover {
  color: var(--color-gold);
  background: rgba(30,98,153,0.05);
  padding-left: 28px;
}
.nav-dd a.dd-all {
  margin-top: 6px;
  padding: 14px 22px 12px;
  border-top: 1px solid var(--color-divider);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-gold);
}
.nav-dd a.dd-all:hover { color: var(--color-gold-hover); padding-left: 28px; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--color-gold);
  color: #fff;
  padding: 16px 24px;
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.02em;
  border-radius: 1px;
  transition: background 240ms ease, transform 240ms ease;
}
.btn-primary:hover { background: var(--color-gold-hover); }
.btn-primary svg { width: 14px; height: 14px; transition: transform 240ms ease; }
.btn-primary:hover svg { transform: translateX(3px); }

.btn-text {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--color-navy);
  font-size: 14px; font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--color-divider);
  padding: 6px 0;
  transition: border-color 280ms ease, color 240ms ease;
}
.btn-text:hover { border-color: var(--color-navy); color: var(--color-gold); }
.btn-text svg { width: 12px; height: 12px; transition: transform 240ms ease; }
.btn-text:hover svg { transform: translateX(3px); }

/* ============================================================
   SECTOR MARK + TAGS — used everywhere a sector is identified
   ============================================================ */
.sector-mark {
  display: inline-block;
  width: 11px; height: 11px;
  background: var(--accent, var(--color-text-muted));
  flex-shrink: 0;
}
.sector-mark[data-s="ai"]             { clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%); }
.sector-mark[data-s="energy"]         { clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.sector-mark[data-s="water"]          { clip-path: polygon(0% 0%, 100% 0%, 50% 100%); }
.sector-mark[data-s="security"]       { clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%); }
.sector-mark[data-s="transportation"] { clip-path: polygon(0% 0%, 100% 50%, 0% 100%); }
.sector-mark[data-s="realestate"]     { /* square — no clip-path */ }

.sector-tag {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* MaturityTag — still available, not used on homepage */
.maturity {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-muted);
  font-weight: 500;
}
.maturity .mark { display: inline-block; flex-shrink: 0; }
.maturity[data-m="Established"] .mark { width: 9px; height: 9px; background: var(--color-gold); }
.maturity[data-m="Active"] .mark { width: 10px; height: 10px; background: var(--color-navy); border-radius: 50%; }
.maturity[data-m="Building"] .mark {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--color-text-muted);
  transform: translateY(-1px);
}

/* ============================================================
   HERO BASE (page variant) — for inner pages
   ============================================================ */
.hero {
  position: relative;
  padding: 96px 0 96px;
  overflow: hidden;
}
.hero.hero--page { padding: 80px 0 64px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--color-text-muted);
  margin-bottom: 28px;
}
.hero .eyebrow .bar { width: 28px; height: 1px; background: var(--color-gold); }
.hero h1 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: var(--fs-h1);
  line-height: var(--lh-h1);
  letter-spacing: -0.02em;
  color: var(--color-navy);
  margin: 0 0 28px;
  max-width: 22ch;
  text-wrap: balance;
}
.hero h1 em { font-style: italic; color: var(--color-gold); font-weight: 300; }
.hero .lede {
  font-size: 21px;
  line-height: 32px;
  color: var(--color-text-muted);
  max-width: 60ch;
  margin: 0 0 36px;
  text-wrap: pretty;
}
.hero-ctas { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.hero .accent-stripe { position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--accent, var(--color-gold)); }

/* meta / eyebrow text variant */
.meta {
  font-size: var(--fs-meta);
  line-height: var(--lh-meta);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 500;
}
.kicker { color: var(--color-text-muted); font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 500; }

/* ============================================================
   COMMON: ProjectCard, InsightCard
   ============================================================ */
.insight {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--color-divider);
  padding-top: 28px;
  min-height: 280px;
  transition: border-color 240ms ease;
  color: var(--color-text-primary);
}
.insight:hover { border-color: var(--color-navy); }
.insight .stag {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--color-text-muted);
}
.insight h3 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 26px; line-height: 32px; letter-spacing: -0.01em;
  color: var(--color-navy);
  margin: 18px 0 14px;
  max-width: 22ch;
  transition: color 240ms ease;
}
.insight:hover h3 { color: var(--color-gold); }
.insight .dek { color: var(--color-text-muted); font-size: 15px; line-height: 24px; margin: 0 0 24px; }
.insight .by { margin-top: auto; color: var(--color-text-muted); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.insight .by .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--color-divider); }

/* ProjectCard */
.project-card {
  display: flex; flex-direction: column;
  background: var(--color-bg-warm);
  padding: 32px 28px;
  border: 1px solid var(--color-divider);
  transition: border-color 280ms ease, transform 280ms ease;
  color: var(--color-text-primary);
}
.project-card:hover { border-color: var(--color-navy); transform: translateY(-2px); }
.project-card .pc-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.project-card h3 {
  font-family: var(--font-serif); font-weight: 400;
  font-size: 24px; line-height: 30px; letter-spacing: -0.01em;
  color: var(--color-navy); margin: 0 0 12px; max-width: 22ch;
}
.project-card p { color: var(--color-text-muted); font-size: 14px; line-height: 22px; margin: 0; }
.project-card .pc-stats { margin-top: 22px; display: flex; gap: 24px; }
.project-card .pc-stats span { font-variant-numeric: tabular-nums; color: var(--color-navy); font-size: 14px; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--color-navy-deep);
  color: var(--color-text-inverse-muted);
  padding: 80px 0 40px;
}
footer .top {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 64px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(247,245,240,0.12);
}
footer .brand-block .brand { color: var(--color-text-inverse); font-size: 36px; }
footer .brand-block p { color: var(--color-text-inverse-muted); margin: 24px 0 0; max-width: 32ch; font-size: 14px; line-height: 22px; }
footer .socials { display: flex; gap: 22px; margin-top: 28px; }
footer .socials a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  color: var(--color-text-inverse-muted);
  transition: color 220ms ease, transform 240ms cubic-bezier(.2,.6,.2,1);
}
footer .socials a:hover { color: var(--color-gold); transform: translateY(-2px); }
footer .socials svg { width: 18px; height: 18px; }

footer h5 {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-gold);
  margin: 0 0 18px; font-weight: 500;
}
footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
footer ul a { color: var(--color-text-inverse-muted); font-size: 14px; transition: color 200ms; }
footer ul a:hover { color: var(--color-text-inverse); }

footer .addresses {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 24px;
  padding: 40px 0;
  border-bottom: 1px solid rgba(247,245,240,0.12);
}
footer .addr {
  font-family: var(--font-serif); font-style: italic;
  font-size: 13px; line-height: 19px; color: var(--color-text-inverse-muted);
}
footer .addr strong { display: block; font-style: normal; color: var(--color-text-inverse); margin-bottom: 4px; font-weight: 400; }

footer .legal {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  font-size: 12px;
  color: var(--color-text-inverse-muted);
}
footer .legal .links { display: flex; gap: 24px; }
@media (max-width: 1000px) { footer .top { grid-template-columns: 1fr 1fr; } footer .addresses { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { footer .top { grid-template-columns: 1fr; } footer .addresses { grid-template-columns: 1fr; } footer .legal { flex-direction: column; gap: 12px; align-items: flex-start; } }

/* ============================================================
   MOBILE NAV — hamburger drawer, injected by shared.js
   ============================================================ */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 10px;
  margin: -10px;
  cursor: pointer;
  color: var(--color-navy);
  transition: color 200ms ease;
}
.nav-toggle:hover { color: var(--color-gold); }
.nav-toggle svg { display: block; width: 24px; height: 24px; }

.nav-drawer {
  position: fixed;
  inset: 0;
  background: var(--color-bg-warm);
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 220ms ease, transform 220ms ease;
  overflow-y: auto;
}
.nav-drawer.open { opacity: 1; pointer-events: auto; transform: none; }
.nav-drawer .drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--color-divider);
}
.nav-drawer .drawer-head .brand { font-size: 28px; }
.nav-drawer .drawer-close {
  background: transparent; border: 0; padding: 10px; margin: -10px;
  cursor: pointer; color: var(--color-navy);
}
.nav-drawer .drawer-close svg { width: 22px; height: 22px; display: block; }
.nav-drawer .group { padding: 24px 0; border-bottom: 1px solid var(--color-divider); }
.nav-drawer .group h4 {
  font-family: var(--font-sans);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--color-text-muted); margin: 0 0 12px;
}
.nav-drawer .group a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-serif);
  font-size: 20px; letter-spacing: -0.01em;
  color: var(--color-navy);
}
.nav-drawer .group a:hover { color: var(--color-gold); }
.nav-drawer .drawer-cta {
  margin-top: auto;
  padding: 20px 0;
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--color-gold);
}
body.nav-locked { overflow: hidden; }

@media (max-width: 820px) {
  .nav-links { display: none !important; }
  .nav-toggle { display: inline-flex !important; }
  .nav-dd { display: none !important; } /* drawer takes over on mobile */
}
@media (min-width: 821px) {
  .nav-drawer { display: none !important; }
  .nav-toggle { display: none !important; }
}

/* ============================================================
   GLOBAL MOBILE FINE-TUNING
   ============================================================ */

/* Never let any element force the page to be wider than the viewport.
   Scoped to body only — overflow-x: hidden on html breaks position: sticky on iOS. */
body { max-width: 100%; overflow-x: hidden; }

/* Hero typographic scale at narrow widths */
@media (max-width: 600px) {
  .cap-hero h1,
  .pf-hero h1,
  .aud-hero h1,
  .team-hero h1,
  .con-hero h1,
  .ins-hero h1,
  .art-header h1,
  .proj-hero h1,
  .pillar-hero h1,
  .pillar-hero .hero-row .hero-copy h1 {
    font-size: 44px;
    line-height: 52px;
  }
  .legal-doc h1 { font-size: 36px; line-height: 44px; }
}
@media (max-width: 400px) {
  .cap-hero h1,
  .pf-hero h1,
  .aud-hero h1,
  .team-hero h1,
  .con-hero h1,
  .ins-hero h1,
  .art-header h1,
  .proj-hero h1,
  .pillar-hero h1,
  .pillar-hero .hero-row .hero-copy h1 {
    font-size: 38px;
    line-height: 46px;
  }
}

/* Stat number clamps so $1.8B / 945 TWh don't overflow */
@media (max-width: 600px) {
  .why-stat .num,
  .pf-stats .num,
  .proof .stat {
    font-size: 48px;
  }
  .why-stat .num .sub,
  .pf-stats .num .sub,
  .proof .stat .sub {
    font-size: 18px;
  }
}

/* Section heads and h2 — also clamp */
@media (max-width: 600px) {
  .section-head h2,
  .why-grid h2,
  .adj h2,
  .team-cta h2 {
    font-size: 32px;
    line-height: 40px;
  }
}

/* Make all images max-width: 100% by default in mobile to avoid overflow */
@media (max-width: 600px) {
  img, svg, video, picture { max-width: 100%; height: auto; }
}

/* Tighten section padding more aggressively */
@media (max-width: 480px) {
  :root { --section-y-mobile: 48px; }
}

/* Capability-page adjacency rows: stack on mobile (was 140px | 1fr) */
@media (max-width: 600px) {
  .adj-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
    padding-top: 22px !important;
    padding-bottom: 22px !important;
  }
  .adj-row .who { font-size: 18px; }
  .adj-row .why-line { font-size: 14px; line-height: 22px; }
}

/* Why-stat numbers don't wrap awkwardly */
.why-stat .num { word-break: keep-all; white-space: nowrap; }

/* Team CTA inner grid — was 1.4fr/1fr at 900 already, but copy can wrap weirdly */
@media (max-width: 600px) {
  .team-cta { padding-top: 64px !important; padding-bottom: 64px !important; }
  .team-cta h2 { font-size: 28px !important; line-height: 36px !important; }
  .team-cta p { font-size: 15px !important; line-height: 24px !important; }
}

/* Project / insight cards on capability pages */
@media (max-width: 600px) {
  .pillar-projects, .pillar-insights, .subcaps-sec, .adj, .why {
    padding-top: 64px !important; padding-bottom: 64px !important;
  }
}
