/* HE Perform — shared site chrome.
   Design tokens, nav, footer, buttons, type scale and the back-to-top control,
   shared by every page (homepage + /insights/). Page-specific styles stay
   inline in each page's own <style> block. Token documentation: DESIGN.md. */

:root {
  /* Direction B — "Light instrument": a cool near-white ground (chroma toward a
     cool hue, deliberately NOT a warm cream/sand), near-black ink, and a single
     deep-amber accent that doubles as the benchmark marker. Reads as a precision
     analytics instrument rather than a dark editorial essay. */
  --bg: oklch(0.975 0.003 250);      /* page ground — cool near-white */
  --bg-2: oklch(0.945 0.005 250);    /* raised panels (problem, contact) */
  --ink: oklch(0.20 0.015 264);      /* primary text — near-black */
  --ink-2: oklch(0.38 0.012 264);    /* secondary text */
  --ink-3: oklch(0.52 0.012 264);    /* muted labels / captions (AA at small sizes) */
  --rule: oklch(0.88 0.006 264);     /* hairline dividers */
  --rule-2: oklch(0.92 0.005 264);   /* subtler dividers */
  --accent: oklch(0.55 0.13 68);     /* deep amber — links, CTA hover, benchmark marker (AA as small text) */
  --accent-ink: oklch(0.48 0.12 65); /* deeper amber for tiny fills */
  --accent-bg: oklch(0.94 0.035 75); /* accent-tinted wash for hovers/highlights */

  /* One grotesque family across the site, separated on a weight + size axis
     (display 600 vs body 400) rather than a second typeface. */
  --f-display: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-body: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1240px;
  --pad: clamp(24px, 4vw, 56px);
  --shadow-float: 0 8px 24px -12px rgba(20, 24, 40, 0.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
html { -webkit-text-size-adjust: 100%; }
img, svg { max-width: 100%; }
/* Guard against long tokens forcing horizontal overflow under zoom */
p, h1, h2, h3, h4, h5, li, a, span, div { overflow-wrap: break-word; word-wrap: break-word; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip-link {
  position: fixed; left: 12px; top: -56px; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 8px;
  font-size: 14px; font-weight: 500; text-decoration: none;
  transition: top .16s ease;
}
.skip-link:focus { top: 12px; }
img { max-width: 100%; display: block; }

/* ------- Layout ------- */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.rule-top { border-top: 1px solid var(--rule); }
.rule-bot { border-bottom: 1px solid var(--rule); }

/* ------- Nav ------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--rule);
}
.nav-row {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 19px;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.brand-mark {
  width: 26px; height: 26px;
  background: var(--ink);
  position: relative;
  border-radius: 2px;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; background: var(--bg);
}
.brand-mark::before { inset: 6px 6px auto 6px; height: 2px; }
.brand-mark::after { inset: 12px 6px auto 6px; height: 2px; width: 8px; }

.nav-links {
  display: flex; gap: 36px; align-items: center;
  font-size: 14.5px; color: var(--ink-2);
}
.nav-links a { text-decoration: none; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  display: inline-flex; align-items: center;
  font-size: 14px;
  padding: 11px 18px;
  background: var(--ink);
  color: var(--bg);
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: -0.005em;
  transition: transform .15s ease, background .15s ease;
}
.nav-cta:hover { background: var(--accent); }
.nav-right { display: flex; align-items: center; gap: 12px; }
.nav-toggle {
  display: none;
  width: 42px; height: 42px; flex: none;
  align-items: center; justify-content: center;
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px;
  cursor: pointer; transition: border-color .15s ease;
}
.nav-toggle:hover { border-color: var(--ink); }
.nav-links a.active { color: var(--ink); }

/* Back-to-top — appears after scrolling a long page */
.to-top {
  position: fixed; right: clamp(16px, 4vw, 32px); bottom: clamp(16px, 4vw, 32px);
  z-index: 20; width: 46px; height: 46px;
  display: grid; place-items: center;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 999px; cursor: pointer;
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, border-color .15s ease;
  box-shadow: var(--shadow-float);
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { border-color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .to-top { transition: opacity .15s ease; transform: none; } }

/* ------- Type ------- */
h1, h2, h3 {
  font-family: var(--f-display);
  font-weight: 500;
  letter-spacing: -0.025em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.h-display {
  font-size: clamp(44px, 6.4vw, 92px);
  line-height: 0.98;
  letter-spacing: -0.032em;
  font-weight: 600;
}
.h-section {
  font-size: clamp(32px, 3.6vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.028em;
}
.h-3 {
  font-size: clamp(22px, 1.8vw, 26px);
  line-height: 1.15;
  letter-spacing: -0.018em;
  font-weight: 500;
}
.lede {
  font-family: var(--f-display);
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.35;
  color: var(--ink-2);
  letter-spacing: -0.012em;
  font-weight: 400;
  max-width: 58ch;
  text-wrap: pretty;
}
p { text-wrap: pretty; }

/* ------- Buttons ------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: all .18s ease;
  cursor: pointer;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--accent); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-ghost:hover { border-color: var(--ink); }
.btn .arrow {
  width: 14px; height: 14px; flex: none;
}

/* ------- Section shell ------- */
section.block { padding: clamp(80px, 9vw, 140px) 0; }
.section-head {
  margin-bottom: clamp(48px, 6vw, 80px);
  max-width: 64ch;
}
.section-head .lede { margin-top: 18px; }

/* ------- Footer ------- */
footer {
  padding: 72px 0 40px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 56px;
}
.footer-grid h2 {
  font-family: var(--f-body);
  font-size: 11px;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--ink-3);
  margin: 0 0 16px;
  font-weight: 400;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 10px; }
.footer-grid a { color: var(--ink); text-decoration: none; font-size: 15px; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand-note {
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.55;
  max-width: 40ch;
  margin: 14px 0 0;
}
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  border-top: 1px solid var(--rule);
  color: var(--ink-3);
  font-size: 13px;
  flex-wrap: wrap; gap: 16px;
}

/* ---- tablet + below (shared chrome) ---- */
@media (max-width: 1024px) {
  :root { --pad: clamp(20px, 4vw, 40px); }
  .section-head { grid-template-columns: 1fr; gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    padding: 4px var(--pad) 14px;
    box-shadow: 0 14px 26px -16px color-mix(in oklch, var(--ink) 40%, transparent);
  }
  .nav.open .nav-links { display: flex; }
  .nav-links a { padding: 13px 2px; font-size: 16px; border-top: 1px solid var(--rule-2); }
  .nav-links a:first-child { border-top: 0; }
}

/* ---- phone (shared chrome) ---- */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .nav-row { height: 60px; }
  .brand { font-size: 17px; }
  .nav-cta { padding: 12px 14px; font-size: 13.5px; }
  .h-display { font-size: clamp(38px, 11vw, 56px); letter-spacing: -0.03em; }
  section.block { padding: 64px 0; }
  .h-section { font-size: clamp(30px, 7.5vw, 40px); }
  .lede { font-size: 17px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; font-size: 12px; }
}

/* ---- ultra-narrow / high zoom (WCAG 1.4.10 reflow, shared chrome) ---- */
@media (max-width: 400px) {
  :root { --pad: 16px; }
  .nav-row { height: 56px; }
  .nav-cta { padding: 12px 12px; font-size: 13px; }
  .brand-mark { width: 22px; height: 22px; }
  .brand { font-size: 16px; gap: 10px; }
  .h-display { font-size: clamp(30px, 10vw, 42px); }
  .h-section { font-size: clamp(26px, 8vw, 34px); }
  .lede { font-size: 16px; }
  section.block { padding: 48px 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
}
