:root {
  --bg: #0f0f10;
  --text: #d6d6d4;
  --muted: #9a9a98;
  --rule: rgba(214, 214, 212, 0.15);
  --rule-strong: rgba(214, 214, 212, 0.45);

  --page-pad: clamp(28px, 6vw, 64px);
  --content-max: 2000px;
  --section-gap: clamp(64px, 9vh, 112px);

  --gap-wordmark-divider: clamp(20px, 3.5vh, 44px);
  --gap-after-divider: clamp(28px, 4vh, 52px);

  /* wordmark dimensions — aspect ratio derived from the SVG viewBox (110.47 / 384.69 ≈ 0.287) */
  --wordmark-aspect: 0.287;
  --wordmark-max: 1200px;
  --wordmark-w-actual: min(calc(100vw - 2 * var(--page-pad)), var(--wordmark-max));
  --wordmark-h-actual: calc(var(--wordmark-w-actual) * var(--wordmark-aspect));
  --masthead-h: calc(var(--page-pad) + var(--wordmark-h-actual) + var(--gap-wordmark-divider) + 1px);

  --datum-rail-w: clamp(200px, 20vw, 320px);
  --rail-pad-r: clamp(20px, 2vw, 40px);
  --content-pad-l: clamp(48px, 5vw, 88px);
  --section-max: 920px;

  --font-body: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Geist";
  src: url("fonts/geist-sans-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: inherit;
  font-size: inherit;
  line-height: inherit;
}

a { color: inherit; }

/* ── masthead ── wordmark + divider, sticky at top throughout the page ── */
.masthead {
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
  padding: var(--page-pad) var(--page-pad) 0;
}

.wordmark-wrap {
  max-width: var(--wordmark-max);
  margin: 0 auto;
}

.wordmark {
  width: 100%;
  display: block;
}

.wordmark-link {
  display: block;
  max-width: var(--wordmark-max);
  margin: 0 auto;
}

.wordmark-link .wordmark {
  width: 100%;
  display: block;
}

.hero-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: var(--gap-wordmark-divider) 0 0;
}

/* ── content grid ── two columns: sticky left rail + scrolling content ── */
.content-grid {
  display: grid;
  grid-template-columns: var(--datum-rail-w) minmax(0, 1fr);
  gap: 0;
  padding: 0 var(--page-pad) clamp(120px, 18vh, 200px);
}

/* sticky left rail (datum on index, can hold other left-rail content elsewhere) */
.left-rail {
  position: sticky;
  top: var(--masthead-h);
  align-self: start;
  height: calc(100vh - var(--masthead-h));
  display: flex;
  flex-direction: column;
  padding-top: var(--gap-after-divider);
  padding-right: var(--rail-pad-r);
  z-index: 1;
}

.datum {
  display: grid;
  grid-template-columns: max-content auto;
  column-gap: clamp(14px, 1.6vw, 24px);
  row-gap: clamp(6px, 0.8vw, 12px);
  align-items: baseline;
}

.datum dt {
  font-family: var(--font-mono);
  font-size: clamp(10px, 0.85vw, 12px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.55;
}

.datum dd {
  font-size: clamp(13px, 1vw, 15px);
  line-height: 1.55;
  color: var(--text);
}

.datum a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: border-color 160ms ease;
}

.datum a:hover,
.datum a:focus-visible {
  border-bottom-color: var(--rule-strong);
  outline: none;
}

/* ── content (right column, scrolls normally) ── */
.content {
  max-width: calc(var(--content-max) + var(--content-pad-l));
  border-left: 1px solid var(--rule);
  padding-top: var(--gap-after-divider);
  padding-left: var(--content-pad-l);
}

.section {
  max-width: var(--section-max);
  padding-top: var(--section-gap);
}

.section:first-child {
  padding-top: 0;
}

.section-header {
  margin-bottom: clamp(14px, 2vh, 24px);
}

.section-num {
  display: block;
  font-family: var(--font-mono);
  font-size: clamp(11px, 0.95vw, 13px);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.6em;
}

.section-title {
  display: block;
  font-family: var(--font-body);
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text);
  line-height: 1.2;
}

.section-rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 0 0 clamp(24px, 3vh, 36px);
}

.section-body {
  font-size: clamp(15px, 1.15vw, 17px);
  line-height: 1.65;
}

.section-body p {
  margin-bottom: 1em;
}

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

.section-body strong {
  font-weight: 500;
  color: var(--text);
}

.section-body a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 1px;
  transition: border-color 160ms ease;
}

.section-body a:hover,
.section-body a:focus-visible {
  border-bottom-color: var(--text);
  outline: none;
}

.tagline {
  font-weight: 500;
  margin-top: 1em;
}

/* ── two-column split (in-house / managed) ── */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(24px, 3vw, 40px);
}

@media (min-width: 880px) {
  .split { grid-template-columns: 1fr 1fr; }
}

.split h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: inherit;
  margin-bottom: 0.5em;
  color: var(--text);
}

/* ── equipment list (capabilities § 1.0) ── */
.equipment {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 2.5vw, 32px);
}

.equipment article h3 {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: inherit;
  margin-bottom: 0.3em;
  color: var(--text);
}

.equipment article p {
  margin: 0;
}

/* ── contact list (index § 5.0) ── */
.contact-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4em;
  margin-bottom: 1.4em;
}

.contact-note {
  color: var(--muted);
  font-style: italic;
}

/* ── QED mark ── closing logo at the end of the content (after § 5.0) ── */
.qed-mark {
  margin-top: clamp(64px, 9vh, 120px);
  max-width: var(--section-max);
  display: flex;
  justify-content: flex-end;
  color: var(--text);
}

.qed-mark svg {
  width: clamp(40px, 4vw, 56px);
  height: auto;
  display: block;
  fill: currentColor;
}

/* ── mobile: collapse the grid to a single column ── */
@media (max-width: 720px) {
  .content-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .left-rail {
    position: static;
    height: auto;
    display: block;
    padding-top: var(--gap-after-divider);
    padding-right: 0;
    padding-bottom: clamp(28px, 5vh, 56px);
    border-bottom: 1px solid var(--rule);
  }

  .content {
    max-width: none;
    border-left: 0;
    padding-top: clamp(28px, 5vh, 56px);
    padding-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .datum a,
  .section-body a {
    transition: none;
  }
}
