:root {
  --bg: #f4f4f2;
  --paper: #eeeeeb;
  --soft: #e6e6e3;
  --text: #242424;
  --muted: #6b6b6b;
  --line: #d5d5d2;
  --line-soft: #e2e2de;
  --accent: #a05252;
  --accent-hover: #7d3f3f;
  --accent-bg: #f5efef;
  --sans: Inter, "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Space Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

body {
  margin: 0;
  background: var(--bg);
  color: #242424;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

p, h1, h2, h3 {
  margin-top: 0;
}

/* ── Header — hidden above fold, revealed on scroll ─────── */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 244, 242, 0.96);
  backdrop-filter: blur(8px);
  transform: translateY(-100%);
  transition: transform 0.28s ease;
}

.site-header.is-visible {
  transform: translateY(0);
}

.header-inner,
.capability-page,
.site-footer .footer-inner {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand strong {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.site-nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 4px 24px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: color 0.12s;
}

.nav-links a:hover {
  color: var(--text);
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── Hero — full viewport, light, SVG diagram ─────────────── */

.hero-full {
  position: relative;
  min-height: 100vh;
  background: #f2f2f0;
  overflow: hidden;
}

/* SVG fills the hero — positioned relative to .hero-inner but spans full viewport width */
.hero-diagram {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100vw;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
}

/* Headline and bottom stay above the SVG in the stacking order */
.hero-headline,
.hero-bottom {
  position: relative;
  z-index: 1;
}

/* Beyond 1440px, freeze SVG scale — no infinite growth on ultrawide screens */
@media (min-width: 1440px) {
  .hero-diagram {
    width: 1440px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.hero-diagram .spoke {
  stroke: rgba(0, 0, 0, 0.13);
  stroke-width: 0.75;
}

.hero-diagram .spoke-label {
  font-family: "Space Mono", monospace;
  fill: rgba(0, 0, 0, 0.22);
  letter-spacing: 0.04em;
}

/* HTML overlay: flex column, full height, same horizontal rhythm */
.hero-inner {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: max(6vh, 52px) 0 max(5vh, 44px);
}

.hero-headline {
  max-width: 480px;
}

.hero-full h1 {
  color: #242424;
  max-width: 440px;
  font-size: clamp(30px, 3.8vw, 40px);
  letter-spacing: -0.025em;
  line-height: 1.06;
  margin-bottom: 0;
}

/* Bottom: three small columns, no separators */
.hero-bottom {
  display: flex;
  align-items: flex-end;
  gap: 40px;
}

.hero-bottom-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0 40px;
  align-items: end;
}

.hero-bottom-col p {
  font-size: 11px;
  line-height: 1.7;
  color: #242424;
  margin: 0;
}

/* Profile block: in-flow flex sibling of hero-bottom-cols */
.hero-profile {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-shrink: 0;
}

.hero-profile-text {
  text-align: right;
}

.hero-profile-name {
  font-size: 12px;
  font-weight: 700;
  color: #242424;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.hero-profile-meta {
  font-family: var(--mono);
  font-size: 9px;
  color: #242424;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1.6;
}

.hero-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 1;
  flex-shrink: 0;
}

/* CTAs in hero */
.hero-full .hero-actions {
  margin-top: 28px;
  gap: 24px;
}

.hero-full .hero-actions a {
  font-size: 11px;
  font-weight: 600;
  min-height: unset;
  color: #242424;
  border-bottom-color: rgba(36, 36, 36, 0.3);
}

.hero-full .hero-actions a:first-child {
  color: var(--accent);
  border-bottom-color: rgba(160, 82, 82, 0.4);
}

.hero-full .hero-actions a:hover {
  color: #242424;
}

.hero-full .hero-actions a:first-child:hover {
  color: var(--accent-hover);
}

/* ── Typography ──────────────────────────────────────────── */

.eyebrow,
.doc-label,
.work-label,
.use-label,
.profile-certs-label,
.fn-sources-label,
.fn-index-heading,
.fn-nav-section {
  margin: 0 0 10px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  line-height: 1.4;
  text-transform: uppercase;
}

.kicker,
.fn-kicker,
.panel-kicker {
  margin: 0 0 20px;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  max-width: 540px;
}

h1 {
  max-width: 600px;
  margin-bottom: 32px;
  font-size: clamp(30px, 3.6vw, 46px);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.08;
}

.h1-lead {
  display: block;
  margin-bottom: 0.4em;
  color: var(--muted);
  font-size: clamp(14px, 1.4vw, 16px);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.6;
}

.subhead,
.capability-deck {
  max-width: 580px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.section-intro,
.contact-note {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
  margin: 0;
}

.section-intro a,
.contact-note a {
  color: var(--accent);
  text-decoration: none;
}

.section-intro a:hover,
.contact-note a:hover {
  color: var(--accent-hover);
}

/* ── Hero actions ────────────────────────────────────────── */

.hero-actions,
.landing-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}

.hero-actions {
  margin-top: 36px;
}

.hero-actions a,
.landing-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  transition: color 0.15s, border-color 0.15s;
}

.hero-actions a:first-child {
  color: var(--accent);
}

.hero-actions a:first-child:hover {
  color: var(--accent-hover);
}

.hero-actions a:not(:first-child):hover,
.landing-links a:hover {
  color: var(--muted);
}

/* ── Page sections ───────────────────────────────────────── */

.capability-page {
  padding: 0 0 104px;
}

.section,
.capability-section {
  padding: 60px 0;
}

.section-head {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 36px;
}

.section h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

/* ── Doc rows ────────────────────────────────────────────── */

.doc-rows {
}

.doc-row {
  display: grid;
  grid-template-columns: 64px 210px minmax(0, 1fr);
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.doc-num {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding-top: 3px;
}

.doc-label {
  margin-bottom: 5px;
}

.doc-title {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.doc-row p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

/* ── Flow list ───────────────────────────────────────────── */

.flow-list {
}

.flow-item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.flow-item h3 {
  margin: 0 0 5px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.flow-item p {
  max-width: 580px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.flow-result {
  border-bottom: none;
  border-left: 2px solid var(--accent);
  background: var(--accent-bg);
  padding: 20px 16px;
  margin-top: 4px;
  gap: 20px;
}

/* ── Evidence ────────────────────────────────────────────── */

.evidence-list {
}

.evidence-row {
  display: grid;
  grid-template-columns: 120px minmax(200px, 0.6fr) minmax(0, 1fr) auto;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.evidence-type {
  display: block;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

.evidence-meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  margin: 0;
}

/* ── Working standard / boundary ────────────────────────── */

.boundary {
  padding: 24px 28px;
  background: var(--paper);
  border-left: 3px solid var(--accent);
}

.boundary p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  margin: 0;
}

/* ── Footer ──────────────────────────────────────────────── */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper);
  padding: 32px 0 44px;
}

.site-footer .footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px 40px;
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 4px;
}

.footer-brand strong {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.footer-brand span {
  color: var(--muted);
  font-size: 13px;
}

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
  align-items: center;
}

.footer-contact a {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.12s;
}

.footer-contact a:hover {
  color: var(--text);
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 960px) {
  .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .section-head {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .doc-row {
    grid-template-columns: 48px 1fr;
  }

  .doc-row > div:last-child {
    grid-column: 2;
  }

  .evidence-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* Below 720px: SVG scales proportionally instead of slice-cropping */
@media (max-width: 720px) {
  /* SVG in-flow on mobile: appears between CTAs and 3 texts */
  .hero-diagram {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    width: 100%;
    height: auto;
    transform: none;
    z-index: auto;
    flex-shrink: 0;
  }

  .hero-full {
    background: #f2f2f0;
  }

  .hero-inner {
    padding: 52px 0 40px;
    justify-content: flex-start;
    gap: 20px;
    min-height: 100svh;
  }

  /* 3 texts + profile pushed to bottom of hero */
  .hero-bottom {
    margin-top: auto;
    flex-direction: column;
    align-items: flex-start;
    gap: 28px;
  }

  .hero-bottom-cols {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hero-profile {
    align-items: center;
  }

  .hero-profile-text {
    text-align: left;
  }

  .hero-full h1 {
    font-size: 30px;
  }

  .site-header.is-visible {
    transform: translateY(0);
  }
}

@media (max-width: 640px) {
  .header-inner,
  .capability-page,
  .site-footer .footer-inner {
    width: min(100% - 32px, 1120px);
  }

  .section,
  .capability-section {
    padding: 44px 0;
  }

  .site-footer .footer-inner {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .site-header {
    transition: none;
  }
}

/* ════════════════════════════════════════════════════════
   INNER PAGES — layout, field notes, landing, services
   ════════════════════════════════════════════════════════ */

/* ── Inner page container ─────────────────────────────── */

.page {
  width: min(100% - 48px, 1120px);
  margin: 0 auto;
  padding: 72px 0 96px;
}

/* Two-column layout: main content + sidebar */
.profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.55fr);
  gap: 72px;
  align-items: start;
}

/* ── Field Notes — article content ─────────────────────── */

.fn-hero {
  min-width: 0;
  padding-top: 12px;
}

.fn-kicker {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.fn-title {
  margin: 0 0 12px;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}

.fn-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 13px;
}

.fn-body p {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 18px;
}

.fn-body p:last-child {
  margin-bottom: 0;
}

.fn-body h2 {
  margin: 36px 0 12px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--text);
}

.fn-body ul {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding-left: 20px;
}

.fn-body li {
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
}

.fn-sources {
  margin-top: 44px;
  padding: 18px 22px 20px;
  border: 1px dashed var(--line);
  background: var(--paper);
}

.fn-sources ol {
  margin: 0;
  padding: 0 0 0 18px;
  display: grid;
  gap: 8px;
}

.fn-sources li {
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

/* ── Field Notes — sidebar panel ─────────────────────────  */

.fn-panel {
  position: sticky;
  top: 80px;
  padding-top: 12px;
}

.fn-nav-list {
  padding-top: 4px;
}

.fn-nav-item {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.fn-nav-item:last-child {
  border-bottom: none;
}

.fn-nav-item a {
  display: block;
  text-decoration: none;
}

.fn-nav-date {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.fn-nav-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  transition: color 0.12s;
}

.fn-nav-item a:hover .fn-nav-title {
  color: var(--accent);
}

.fn-nav-item.fn-current .fn-nav-title {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ── Filter bar (sidebar.js) ───────────────────────────── */

.fn-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 0 14px;
}

.fn-filter {
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
}

.fn-filter:hover {
  color: var(--text);
  border-color: var(--line);
}

.fn-filter.fn-filter-active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Field Notes — index listing ───────────────────────── */

.fn-index-intro {
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 600px;
}

.fn-index-group {
  margin-bottom: 32px;
}

.fn-index-item {
  padding: 11px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.fn-index-item:last-child {
  border-bottom: none;
}

.fn-index-item a {
  display: block;
  text-decoration: none;
}

.fn-index-item a:hover .fn-nav-title {
  color: var(--accent);
}

.fn-index-item .fn-nav-title {
  font-size: 15px;
}

/* ── Category pages ────────────────────────────────────── */

.category-featured {
  padding: 20px 0 32px;
  border-top: 1px solid var(--line-soft);
}

.category-featured .fn-index-heading {
  margin: 0 0 16px;
  padding-bottom: 10px;
}

.category-featured .fn-kicker {
  margin-bottom: 10px;
}

.category-featured .fn-body p:last-child {
  margin-bottom: 0;
}

.category-featured .landing-links {
  margin-top: 18px;
}

.category-list {
  margin-top: 32px;
}

/* ── Report brief download block ───────────────────────── */

.work-field {
  padding: 0;
}

.work-access {
  margin-bottom: 28px;
}

.work-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 18px;
}

.work-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
  font-weight: 700;
}

.work-links a {
  color: var(--accent);
  text-decoration: none;
}

.work-links a:hover {
  color: var(--accent-hover);
}

.tlp {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
}

/* ── Report briefs ─────────────────────────────────────── */

.report-brief .fn-body h2 {
  margin: 40px 0 14px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.report-brief .fn-body ul {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding-left: 20px;
}

.report-brief .fn-body li {
  font-size: 16px;
  line-height: 1.65;
}

.report-brief .work-access {
  margin-bottom: 32px;
}

/* ── Landing sections (for-risk-consultancies, SEO pages) ─ */

.landing-section {
  margin-top: 32px;
}

.landing-section h2 {
  margin: 0 0 10px;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.landing-section p,
.landing-section li {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  margin: 0;
}

.landing-section a {
  color: var(--accent);
}

.landing-section a:hover {
  color: var(--accent-hover);
}

.landing-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

/* ── Services page ─────────────────────────────────────── */

.services-intro {
  font-size: 17px;
  line-height: 1.75;
  color: var(--muted);
  margin-bottom: 40px;
  max-width: 640px;
}

.services-section {
  margin-bottom: 44px;
}

.services-section > h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.services-engagement {
  padding: 16px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.services-engagement:last-child {
  border-bottom: none;
}

.services-engagement-name {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.services-engagement p {
  margin: 0;
  font-size: 16px;
  line-height: 1.65;
  color: var(--muted);
}

.services-deliverable {
  padding: 16px 0;
  border-bottom: 1px dashed var(--line-soft);
}

.services-deliverable:last-child {
  border-bottom: none;
}

.services-deliverable-title {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.services-deliverable p {
  margin: 0 0 8px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted);
}

.services-deliverable p:last-child {
  margin-bottom: 0;
}

.services-body-text {
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 12px;
}

/* ── Inner pages responsive ─────────────────────────────── */

@media (max-width: 900px) {
  .profile-hero {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .fn-panel {
    position: static;
    padding-top: 0;
  }
}

@media (max-width: 640px) {
  .page {
    padding-top: 60px;
    padding-bottom: 64px;
  }
}
