/* The look of the ns-brain one-pager (docs/marketing/investor/ns-brain.html):
   off-white paper, near-black ink, one ochre accent, condensed Archivo headlines,
   Source Sans 3 text, JetBrains Mono labels. Light only, on every device. */
:root {
  color-scheme: light;
  --paper: #fbfbf8;
  --ink: #16181d;
  --ink-soft: #3b4049;
  --muted: #5a606b;
  --rule: #d8dad6;
  --panel: #f1f1ec;
  --code-bg: #16181d;
  --code-ink: #e8e6df;
  --accent: #9a6414;
  --accent-soft: #f3e7cf;
  --code-accent: #e9b46a;

  --display: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --body: "Source Sans 3", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;

  --measure: 42rem;
  --wide: 70rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --edge: max(var(--gutter), calc((100% - var(--wide)) / 2));
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1.08rem, 1rem + 0.35vw, 1.22rem);
  line-height: 1.62;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

::selection { background: var(--accent-soft); color: var(--ink); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.hero-kicker, .section-label, .kicker, .feature-kicker, .li-kicker {
  font-family: var(--mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
}

/* Reading progress, driven by scroll alone (no script). */
.progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
  transform-origin: 0 50%;
  transform: scaleX(0);
  z-index: 60;
}
@supports (animation-timeline: scroll()) {
  .progress { animation: progress linear both; animation-timeline: scroll(root); }
}
@keyframes progress { to { transform: scaleX(1); } }

/* ---------- masthead: the one-pager's top line ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem var(--edge);
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.top::after {
  content: "";
  position: absolute;
  left: var(--edge);
  right: var(--edge);
  bottom: 0;
  height: 2px;
  background: var(--ink);
}
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; white-space: nowrap; }
.brand b { font-family: var(--mono); font-weight: 700; font-size: 1rem; }
.brand-mark { width: .62rem; height: .62rem; background: var(--accent); }
.brand-sub {
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.top nav {
  display: flex;
  align-items: center;
  gap: clamp(.6rem, 2.4vw, 1.6rem);
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.top nav a {
  text-decoration: none;
  color: var(--muted);
  padding: .25rem 0;
  border-bottom: 2px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.top nav a:hover { color: var(--ink); border-bottom-color: var(--accent); }
.top nav a.contact { color: var(--ink); font-weight: 700; border-bottom-color: var(--accent); }
.top nav a.contact:hover { color: var(--accent); }
@media (max-width: 560px) {
  .top nav a[href^="https://fightclub"] { display: none; }
  .brand-sub { display: none; }
}

main { flex: 1; width: 100%; }

/* ---------- home ---------- */
.home { padding: 0 var(--edge) 5rem; }

.hero { padding: clamp(2.8rem, 8vw, 5.5rem) 0 0; }
.hero-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: clamp(2.8rem, 1.5rem + 6vw, 6.4rem);
  line-height: .98;
  letter-spacing: -.02em;
  margin: 1rem 0 1.4rem;
  max-width: 14ch;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { max-width: 44rem; font-size: clamp(1.15rem, 1rem + .5vw, 1.4rem); line-height: 1.45; margin: 0; }

.hero-curve {
  margin: clamp(2.2rem, 5vw, 3.5rem) 0 0;
  padding: 1.4rem 1.6rem 1rem;
  background: var(--panel);
  border-left: 3px solid var(--accent);
}
.curve { display: block; width: 100%; height: clamp(100px, 14vw, 180px); overflow: visible; }
.curve-area { fill: var(--accent-soft); }
.curve-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  animation: draw 2.2s cubic-bezier(.6, .05, .25, 1) .3s forwards;
}
.curve-dots circle {
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  animation: pop .4s ease forwards;
}
.curve-dots circle:nth-child(1) { animation-delay: .35s; }
.curve-dots circle:nth-child(2) { animation-delay: .7s; }
.curve-dots circle:nth-child(3) { animation-delay: .95s; }
.curve-dots circle:nth-child(4) { animation-delay: 1.25s; }
.curve-dots circle:nth-child(5) { animation-delay: 1.65s; }
.curve-dots circle:nth-child(6) { animation-delay: 2.4s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes pop { to { opacity: 1; } }

.curve-labels {
  position: relative;
  height: 1.3rem;
  margin-top: .5rem;
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.curve-labels span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.curve-labels span:nth-child(1) { left: 5.3%; }
.curve-labels span:nth-child(2) { left: 12.5%; }
.curve-labels span:nth-child(3) { left: 25%; }
.curve-labels span:nth-child(4) { left: 46.6%; }
.curve-labels span:nth-child(5) { left: 100%; transform: translateX(-100%); }
@media (max-width: 640px) {
  .curve-labels span:nth-child(1), .curve-labels span:nth-child(4) { display: none; }
}
.hero-curve figcaption { margin-top: .7rem; font-size: .92rem; color: var(--muted); }

.section-label { margin: clamp(3rem, 7vw, 4.5rem) 0 1rem; }

.feature {
  display: grid;
  grid-template-columns: minmax(5rem, 11rem) 1fr;
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: start;
  text-decoration: none;
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  transition: background .25s ease;
}
.feature:hover { background: #efdfbf; }
.feature-num {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: clamp(4.5rem, 3rem + 6vw, 8.5rem);
  line-height: .82;
  letter-spacing: -.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.feature-body { display: flex; flex-direction: column; gap: .75rem; }
.feature-kicker { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.feature-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: clamp(2rem, 1.3rem + 2.6vw, 3.2rem);
  line-height: 1.02;
  letter-spacing: -.015em;
}
.feature-desc { font-size: 1.12rem; max-width: 40rem; }
.feature-meta {
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .04em;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}
.feature-meta .read {
  margin-left: auto;
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  border-bottom: 2px solid var(--accent);
}
@media (max-width: 680px) {
  .feature { grid-template-columns: 1fr; }
  .feature-meta .read { margin-left: 0; margin-top: .4rem; }
}

.series { color: var(--muted); }
.part { color: var(--accent); }

.list { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--ink); }
.list li { border-bottom: 1px solid var(--rule); }
.list a {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.4rem;
  align-items: baseline;
  padding: 1.3rem 0;
  text-decoration: none;
  transition: background .2s ease, padding .2s ease;
}
.list a:hover { background: var(--panel); padding-left: .8rem; }
.list .num {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--accent);
}
.li-body { display: flex; flex-direction: column; gap: .25rem; }
.li-kicker { color: var(--muted); font-weight: 600; }
.li-title {
  font-family: var(--display);
  font-weight: 700;
  font-stretch: 92%;
  font-size: clamp(1.35rem, 1.1rem + .9vw, 1.75rem);
  line-height: 1.12;
}
.li-meta { font-family: var(--mono); font-size: .72rem; color: var(--muted); }

/* ---------- article ---------- */
.article { padding: clamp(2.6rem, 7vw, 4.5rem) var(--gutter) 5rem; }
.art-head, .prose, .discuss, .cta, .prevnext {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
.art-head { margin-bottom: clamp(2rem, 5vw, 3rem); animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.kicker { display: flex; flex-wrap: wrap; gap: .3rem .9rem; }
.kicker .part::before {
  content: "";
  display: inline-block;
  width: .5rem; height: .5rem;
  background: var(--accent);
  margin-right: .9rem;
  vertical-align: .05em;
}
.art-head h1 {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: clamp(2.5rem, 1.4rem + 4.6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -.02em;
  margin: 1rem 0 1.4rem;
  text-wrap: balance;
}
.byline {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1.2rem;
  font-family: var(--mono);
  font-size: .76rem;
  letter-spacing: .03em;
  color: var(--muted);
  margin: 0;
  padding-top: .9rem;
  border-top: 2px solid var(--ink);
}
.byline span:first-child { color: var(--ink); font-weight: 700; }

.prose { animation: rise .7s cubic-bezier(.2, .7, .2, 1) .1s both; }
.prose p { margin: 0 0 1.35em; text-wrap: pretty; }

.prose p.lede::first-letter {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  float: left;
  font-size: 4.1em;
  line-height: .82;
  margin: .07em .12em 0 0;
  color: var(--accent);
}
.prose ul {
  list-style: none;
  padding: 1.2rem 1.4rem;
  margin: 0 0 1.5em;
  background: var(--panel);
  border-left: 3px solid var(--accent);
}
.prose li { position: relative; padding-left: 1.3rem; margin: 0 0 .8em; }
.prose li:last-child { margin-bottom: 0; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .62em;
  width: .45rem;
  height: .45rem;
  background: var(--accent);
}

.discuss {
  margin-top: 3rem;
  padding: 1.5rem 1.6rem;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .3rem 1.5rem;
  align-items: center;
}
.discuss-title {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 1.5rem;
  line-height: 1.1;
  margin: 0;
}
.discuss p { margin: 0; color: var(--ink-soft); font-size: 1rem; grid-column: 1; }
.discuss-btn {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--mono);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--accent);
  padding: .8rem 1.2rem;
  white-space: nowrap;
  transition: background .2s ease;
}
.discuss-btn:hover { background: var(--ink); }
@media (max-width: 560px) {
  .discuss { grid-template-columns: 1fr; }
  .discuss-btn { grid-column: 1; grid-row: auto; margin-top: .8rem; justify-self: start; }
}

/* The one dark element, like the one-pager's "THE BRAIN" band. */
.cta {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .25rem 1rem;
  margin-top: 1.5rem;
  padding: 1.2rem 1.5rem;
  text-decoration: none;
  background: var(--code-bg);
  color: var(--code-ink);
}
.cta-label {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--code-accent);
}
.cta-host { grid-row: 2; font-family: var(--mono); font-size: 1rem; }
.cta-arrow { grid-row: 1 / span 2; grid-column: 2; font-size: 1.5rem; color: var(--code-accent); transition: transform .25s ease; }
.cta:hover .cta-arrow { transform: translateX(5px); }

.prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2.5rem;
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
}
.pn { display: flex; flex-direction: column; gap: .2rem; text-decoration: none; padding: .4rem 0; }
.pn.next { text-align: right; grid-column: 2; }
.pn-dir {
  font-family: var(--mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}
.pn-title { font-family: var(--display); font-weight: 700; font-stretch: 92%; font-size: 1.2rem; line-height: 1.2; }
a.pn:hover .pn-title { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
@media (max-width: 560px) {
  .prevnext { grid-template-columns: 1fr; }
  .pn.next { grid-column: 1; text-align: left; }
  .pn.empty { display: none; }
}

.notfound { max-width: 40rem; margin: 0 auto; padding: 7rem var(--gutter); }
.notfound h1 { font-family: var(--display); font-weight: 800; font-stretch: 88%; font-size: clamp(2.4rem, 6vw, 4rem); line-height: 1; }
.notfound a { color: var(--accent); }

/* ---------- footer: the one-pager's bottom line ---------- */
.foot { margin-top: auto; padding: 0 var(--edge); }
.foot-inner {
  padding: 1.6rem 0 2.2rem;
  border-top: 2px solid var(--ink);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .4rem 2rem;
}
.foot p { margin: 0; color: var(--muted); font-size: .95rem; }
.foot-brand {
  font-family: var(--display);
  font-weight: 800;
  font-stretch: 88%;
  font-size: 1.5rem !important;
  color: var(--ink) !important;
}
.foot-brand em { font-style: normal; color: var(--accent); }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.2rem; grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.foot-links a {
  font-family: var(--mono);
  font-size: .74rem;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 2px solid var(--accent);
}
.foot-links a:hover { color: var(--accent); }
.foot-small { font-family: var(--mono); font-size: .7rem !important; grid-column: 1 / -1; margin-top: .8rem !important; }
@media (max-width: 640px) {
  .foot-inner { grid-template-columns: 1fr; }
  .foot-links { grid-column: 1; grid-row: auto; margin-top: .8rem; }
}

@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.hero > * { animation: rise .7s cubic-bezier(.2, .7, .2, 1) both; }
.hero > :nth-child(2) { animation-delay: .06s; }
.hero > :nth-child(3) { animation-delay: .12s; }
.hero > :nth-child(4) { animation-delay: .18s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .curve-line { stroke-dashoffset: 0; }
  .curve-dots circle { opacity: 1; }
  html { scroll-behavior: auto; }
}

@media print {
  .top, .foot, .progress, .discuss, .prevnext { display: none; }
}
