/* IBM Plex Mono, self-hosted (SIL OFL 1.1, assets/fonts/IBM-Plex-OFL.txt). */
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-regular.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("../assets/fonts/ibm-plex-mono-medium.woff2") format("woff2"); }

:root {
  --paper: #ece7db;
  --paper-2: #e2dccd;
  --ink: #0b0c0a;
  --ink-2: #44463f;
  --bone: #f1eee6;
  --bone-dim: #8f8d86;
  --fail: #ff4b1f;
  --rule: rgba(11, 12, 10, .18);
  --sans: "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --head: 64px;
  --band: 0px;
  --gut: clamp(20px, 4vw, 72px);
  --gap: clamp(64px, 10vh, 120px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(1.02rem, 1.1vw, 1.2rem);
  line-height: 1.55;
  overflow-x: hidden;
}
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 5px; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

.kicker {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Skip link */
.skip {
  position: fixed; left: 12px; top: 12px; z-index: 50;
  background: var(--ink); color: var(--bone);
  font-family: var(--mono); font-size: .8rem; padding: 12px 16px;
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

/* Header: opaque surface */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  height: var(--head);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gut);
  background: var(--paper-2);
  border-bottom: 1px solid var(--rule);
}
.top__name {
  font-family: var(--mono); font-size: .78rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  white-space: nowrap; padding: 12px 0;
}
.top__name .short { display: none; }
.top__nav ul { display: flex; gap: clamp(14px, 2vw, 32px); }
.top__nav a {
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  text-decoration: none; padding: 12px 0; border-bottom: 2px solid transparent;
}
.top__nav a .n { color: var(--ink-2); font-size: .66rem; }
.top__nav a:hover { border-bottom-color: var(--rule); }
.top__nav a[aria-current="true"] { border-bottom-color: var(--ink); }
.top__compact { display: none; gap: 8px; }

.btn {
  font: 500 .74rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink); background: transparent;
  border: 1px solid var(--ink); border-radius: 0;
  min-height: 44px; min-width: 44px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--ink); color: var(--paper); }

/* Index dialog (compact) */
.index {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper); color: var(--ink);
  display: flex; flex-direction: column;
  padding: 0 20px 24px; overflow-y: auto;
}
.index[hidden] { display: none; }
.index__bar {
  height: 56px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--rule);
}
.index__list { margin-top: 12px; }
.index__list a {
  display: grid; grid-template-columns: 3rem 1fr; column-gap: 8px;
  padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none;
}
.index__label { font-size: 1.9rem; font-weight: 500; letter-spacing: -.03em; line-height: 1.1; }
.index__list .kicker { padding-top: .6rem; grid-row: span 2; }
.index__note { color: var(--ink-2); font-size: .95rem; }
.index__list a[aria-current="true"] .index__label { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.index__hint { margin-top: 20px; color: var(--ink-2); }

/* Frame: copy left, stage right */
.frame {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding-top: var(--head);
}
.copy { grid-column: 1; grid-row: 1; min-width: 0; padding: 0 var(--gut) 0 var(--gut); }
.stage {
  grid-column: 2; grid-row: 1;
  position: sticky; top: var(--head);
  height: calc(100vh - var(--head));
  height: calc(100svh - var(--head));
  background: var(--ink); color: var(--bone);
  overflow: hidden;
  align-self: start;
}
html:not(.js) .stage { display: none; }
html:not(.js) .frame { grid-template-columns: 1fr; }
.stage__canvas { display: block; width: 100%; height: 100%; }
.stage__bar {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 clamp(16px, 2.4vw, 32px);
  height: 64px;
  background: var(--ink);
  border-top: 1px solid rgba(241, 238, 230, .16);
}
.stage__kicker { color: var(--bone); }
.stage__pause-ico { display: none; box-sizing: border-box; width: 11px; height: 13px; border-left: 4px solid currentColor; border-right: 4px solid currentColor; }
.stage__pause[aria-pressed="true"] .stage__pause-ico { width: 0; height: 0; border-style: solid; border-width: 7px 0 7px 11px; border-color: transparent transparent transparent currentColor; }
.stage__pause {
  font: 500 .72rem/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
  color: var(--bone); background: var(--ink);
  border: 1px solid rgba(241, 238, 230, .5); border-radius: 0;
  min-height: 44px; padding: 0 14px; cursor: pointer;
}
.stage__pause:hover { border-color: var(--bone); }
.reduce .stage__pause { display: none; }

/* Sections: one left edge, one scale */
.sec {
  max-width: 38rem;
  padding: var(--gap) 0;
  border-top: 1px solid var(--rule);
  scroll-margin-top: calc(var(--head) + var(--band));
}
.sec:focus { outline: none; }
.sec > .kicker, .method__pin > .kicker { margin-bottom: clamp(20px, 3.5vh, 40px); color: var(--ink-2); }
.sec--intro {
  border-top: 0;
  min-height: calc(100vh - var(--head));
  min-height: calc(100svh - var(--head));
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(48px, 10vh, 120px) 0 clamp(56px, 10vh, 120px);
}
.sec--intro > .kicker { margin-bottom: 20px; }
/* With JS the stage corner already shows 00 / Start. */
.js .sec--intro > .kicker { display: none; }
.eyebrow {
  font-family: var(--mono); font-size: .8rem; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 18px;
}
h1 {
  font-size: clamp(2.9rem, 7vw, 8rem);
  font-weight: 500; letter-spacing: -.045em; line-height: .94;
}
.lead {
  margin-top: clamp(24px, 4vh, 40px);
  font-size: clamp(1.15rem, 1.5vw, 1.5rem); line-height: 1.45;
  max-width: 40ch;
}
/* Hero proof: the Cortex facts, verbatim, above the fold. */
.proof { margin-top: clamp(28px, 5vh, 48px); padding-top: 16px; border-top: 1px solid var(--rule); max-width: 36rem; }
.proof__k { color: var(--ink-2); }
.proof__line { margin-top: 8px; font-size: clamp(.98rem, 1.05vw, 1.1rem); line-height: 1.5; }
.contents { display: none; margin-top: 40px; font-family: var(--mono); font-size: .8rem; }
html:not(.js) .contents { display: block; }
.contents li { padding: 6px 0; }

h2 {
  font-size: clamp(1.9rem, 3.2vw, 3.4rem);
  font-weight: 500; letter-spacing: -.03em; line-height: 1.04;
}
h2.kicker { font-size: .72rem; letter-spacing: .08em; line-height: 1.4; font-weight: 500; }
.body { margin-top: 24px; max-width: 36rem; }

/* Practice */
.statements { counter-reset: s; }
.statements li {
  font-size: clamp(1.35rem, 2vw, 1.9rem); line-height: 1.3; letter-spacing: -.015em;
  padding: 22px 0 22px 3rem; position: relative;
  border-top: 1px solid var(--rule);
}
.statements li:first-child { border-top: 0; padding-top: 0; }
.statements li::before {
  counter-increment: s; content: counter(s, decimal-leading-zero);
  position: absolute; left: 0; top: 30px;
  font: 500 .72rem/1 var(--mono); letter-spacing: .08em; color: var(--ink-2);
}
.statements li:first-child::before { top: 8px; }

/* Systems facts */
.facts { margin-top: 40px; border-top: 1px solid var(--ink); }
.facts div {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--rule);
}
.facts dt, .colophon dt {
  font: 500 .72rem/1.6 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}

/* Record */
.record { margin-top: 32px; }
.ev { padding: clamp(36px, 6vh, 60px) 0; border-top: 1px solid var(--ink); }
.ev:last-child { padding-bottom: 0; }
.ev__meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  font: 500 .72rem/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2);
}
.ev__title {
  margin-top: 16px;
  font-size: clamp(1.8rem, 3vw, 3rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.05;
  overflow-wrap: anywhere;
}
.signals { margin-top: 20px; font: 400 .8rem/1.6 var(--mono); color: var(--ink-2); }
.ext {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 20px; min-height: 44px;
  font: 500 .82rem/1.3 var(--mono); letter-spacing: 0; text-transform: none;
  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;
}
.ext:hover { text-decoration-thickness: 2px; }
svg[viewBox="0 0 12 12"] {
  width: 11px; height: 11px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: butt; stroke-linejoin: miter;
}

/* Method */
.method li {
  display: grid; grid-template-columns: 3rem 1fr; column-gap: 8px;
  padding: 26px 0; border-top: 1px solid var(--rule);
}
.method li:first-child { border-top: 1px solid var(--ink); }
.method__n { grid-row: span 2; font: 500 .72rem/2.4 var(--mono); letter-spacing: .08em; color: var(--ink-2); }
.method h3 { font-size: clamp(1.4rem, 2.1vw, 2rem); font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.method p { margin-top: 8px; color: var(--ink); }
.method li[data-principle="0"] .method__n { color: #b8300f; }
/* The active principle (the one the stage lights) is marked; the others step back. */
.method.has-on li:not(.is-on) h3, .method.has-on li:not(.is-on) p { color: var(--ink-2); }
.method li.is-on .method__n { color: var(--ink); }
.method li[data-principle="0"].is-on .method__n { color: #b8300f; }
.method li.is-on .method__n::before { content: ""; display: inline-block; width: .5rem; height: .5rem; margin-right: .45rem; background: currentColor; vertical-align: .02rem; }
/* Step mode (JS, wide screens where the list fits): the list is pinned, each principle gets its share of scroll. */
#approach[data-steps] .method__track { min-height: calc(100vh - var(--head) + 140vh); }
#approach[data-steps] .method__pin { position: sticky; top: calc(var(--head) + 16px); }

/* Contact */
.sec--contact { padding-bottom: 28vh; }
.scope { font-size: clamp(1.15rem, 1.5vw, 1.5rem); max-width: 28ch; }
.email {
  display: inline-block; margin-top: 28px;
  font-size: clamp(1.7rem, 4.6vw, 4.4rem); font-weight: 500; letter-spacing: -.035em; line-height: 1.05;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .14em;
  overflow-wrap: anywhere;
}
.email:hover { text-decoration-thickness: 4px; }
.profiles { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 36px; }
.profiles a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 1.2rem; text-transform: none; letter-spacing: 0;
  text-decoration: underline; text-underline-offset: 5px;
}
.colophon { margin-top: 64px; border-top: 1px solid var(--rule); }
.colophon div { display: grid; grid-template-columns: 8.5rem 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: .95rem; color: var(--ink-2); }

/* Mobile coda: an in-flow ink plate after Contact where the mark is drawn large. Hidden on wide screens and without JS. */
.coda { display: none; }
.coda__canvas { display: block; width: 100%; height: 100%; }

/* Compact: stage becomes a band under the header */
@media (max-width: 899px) {
  /* The stage opens as a tall plate over the hero, then slides under the header into a band.
     Sticky with a negative top: no layout shift, and the copy always starts below it. */
  :root { --head: 56px; --band: clamp(150px, 26vh, 210px); --plate: max(var(--band), min(48svh, 440px)); }
  .top__nav { display: none; }
  .js .top__compact { display: flex; }
  html:not(.js) .top { position: static; height: auto; flex-wrap: wrap; padding: 8px 20px; }
  html:not(.js) .top__nav { display: block; }
  html:not(.js) .top__nav ul { flex-wrap: wrap; }
  html:not(.js) .frame { padding-top: 0; }
  .frame { grid-template-columns: 1fr; }
  .stage {
    grid-column: 1; grid-row: 1;
    top: calc(var(--head) + var(--band) - var(--plate));
    height: var(--plate); z-index: 20;
    border-bottom: 1px solid var(--ink);
  }
  .copy { grid-row: 2; padding: 0 20px; }
  /* The bar overlays the art: a small kicker bottom left, pause as a 44 px icon button bottom right. */
  .stage__bar { --inset: 22; height: 44px; padding: 0 0 0 10px; border-top: 0; background: transparent; pointer-events: none; }
  .stage__bar > * { pointer-events: auto; }
  .stage__kicker { font-size: .7rem; background: var(--ink); padding: 2px 6px; }
  .stage__pause { width: 44px; min-width: 44px; min-height: 44px; height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
  .stage__pause:focus-visible { outline-offset: -6px; }
  .stage__pause-ico { display: block; }
  .stage__pause-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  h1 { font-size: clamp(2.9rem, 14vw, 4.4rem); }
  .sec { scroll-margin-top: calc(var(--head) + var(--band) + 8px); padding: clamp(48px, 8vh, 80px) 0; }
  .sec--intro { min-height: 0; padding: 28px 0 72px; }
  .sec--contact { padding-bottom: 30vh; }
  .js .sec--contact { padding-bottom: 72px; }
  .js .coda {
    display: block; position: relative; z-index: 21;
    height: min(82svh, 640px); min-height: 320px;
    background: var(--ink); border-top: 1px solid var(--ink);
  }
}
@media (max-width: 480px) {
  .top { padding: 0 12px; }
  .top__name .long { display: none; }
  .top__name .short { display: inline; }
  .copy { padding: 0 16px; }
  .facts div, .colophon div { grid-template-columns: 1fr; gap: 2px; }
  .statements li { padding-left: 2.4rem; }
  .method li { grid-template-columns: 2.4rem 1fr; }
}

@media (min-width: 1800px) {
  .copy { padding-left: calc(var(--gut) + 4vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .skip { transform: none; left: -9999px; }
  .skip:focus { left: 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (forced-colors: active) {
  .stage { border: 1px solid CanvasText; }
  .top, .index { border-color: CanvasText; }
}

@media print {
  .top, .stage, .skip, .index, .top__compact, .coda { display: none !important; }
  .frame { display: block; padding: 0; }
  body { background: #fff; }
}
