:root {
  --bg: #000;
  --paper: #0b0d11;
  --panel: rgba(255, 255, 255, .045);
  --panel-strong: rgba(255, 255, 255, .075);
  --line: rgba(255, 255, 255, .12);
  --line-soft: rgba(255, 255, 255, .07);
  --text: #f2f3ef;
  --muted: rgba(242, 243, 239, .66);
  --faint: rgba(242, 243, 239, .42);
  --accent: #ffad63;
  --blue: #9bd7ff;
  --green: #b6f59a;
  --violet: #b7a5ff;
  --max: 1180px;
}

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

html {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  background: #000;
  color: var(--text);
  font-family: Manrope, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-feature-settings: "liga" 1, "kern" 1;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-noise,
.ambient {
  display: none;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue), #fff, var(--accent));
  box-shadow: 0 0 20px rgba(155, 215, 255, .48);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  padding: 0 clamp(22px, 5vw, 72px);
  background: linear-gradient(to bottom, rgba(0, 0, 0, .82), rgba(0, 0, 0, .52));
  border-bottom: 1px solid rgba(255, 255, 255, .06);
  backdrop-filter: blur(20px);
}

.brand,
.top-nav {
  font-family: "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .18em;
  font-size: 11px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}

.brand-mark {
  position: relative;
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border-radius: 50%;
}

.brand-mark canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.top-nav {
  display: flex;
  gap: clamp(20px, 4vw, 42px);
  color: var(--muted);
}

.top-nav a,
.brand {
  transition: color .2s, text-shadow .2s;
}

.top-nav a:hover,
.brand:hover {
  color: #fff;
  text-shadow: 0 0 18px rgba(155, 215, 255, .32);
}

.article-shell {
  width: min(var(--max), calc(100% - 44px));
  margin: 0 auto;
}

.article-wide {
  width: min(1440px, calc(100% - 44px));
  margin: 0 auto;
}

.hero {
  padding: clamp(86px, 12vw, 156px) 0 clamp(46px, 7vw, 76px);
}

.kicker,
.section-label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--faint);
}

.hero h1 {
  max-width: 1040px;
  margin-top: 20px;
  font-family: "Space Grotesk", Manrope, system-ui, sans-serif;
  font-size: clamp(52px, 9vw, 128px);
  line-height: .9;
  letter-spacing: -.078em;
  font-weight: 600;
}

.lede {
  max-width: 820px;
  margin-top: 32px;
  color: var(--muted);
  font-size: clamp(18px, 2.2vw, 24px);
  line-height: 1.65;
}

.hero-meta,
.hero-links,
.final-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 34px;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--faint);
  background: rgba(255, 255, 255, .035);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.hero-links,
.final-links {
  margin-top: 28px;
}

.hero-links a,
.final-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: rgba(255, 255, 255, .78);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  transition: background .2s, color .2s, transform .2s;
}

.hero-links a:hover,
.final-links a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  transform: translateY(-2px);
}

.feature-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, .55fr) minmax(0, .85fr);
  gap: clamp(26px, 5vw, 72px);
  align-items: center;
  margin-bottom: clamp(88px, 11vw, 150px);
  padding: clamp(28px, 5vw, 56px);
  border: 1px solid rgba(255, 255, 255, .095);
  border-radius: 30px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(155, 215, 255, .055), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .024)),
    rgba(8, 10, 14, .78);
  box-shadow: none;
}

.feature-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 34%, rgba(255, 255, 255, .035) 34.1%, transparent 34.4%),
    linear-gradient(135deg, transparent 0 68%, rgba(255, 255, 255, .026) 68.1%, transparent 68.4%);
  opacity: .42;
}

.feature-copy,
.network-figure {
  position: relative;
  z-index: 1;
  min-width: 0;
  max-width: 100%;
}

.feature-copy h2 {
  margin-top: 16px;
  font-family: "Space Grotesk", Manrope, system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 64px);
  line-height: .96;
  letter-spacing: -.058em;
  font-weight: 500;
}

.feature-copy p:not(.section-label) {
  margin-top: 22px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.78;
}

.network-figure {
  margin: 0;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .035), transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, .028), transparent 58%),
    rgba(4, 6, 10, .34);
}

.network-figure svg {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 880 / 520;
}

.network-figure .edges line {
  vector-effect: non-scaling-stroke;
}

.network-figure .base-edges line {
  fill: none;
  stroke: rgba(255, 255, 255, .15);
  stroke-width: 1;
}

.network-figure .fiber-edges line {
  fill: none;
  stroke: rgba(255, 255, 255, .92);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-dasharray: 28 560;
  stroke-dashoffset: 588;
  opacity: 0;
  animation: fiberPulse 4.8s cubic-bezier(.66, 0, .34, 1) infinite;
  animation-delay: var(--delay);
}

.network-figure .hidden-to-output line {
  animation-name: fiberPulseSecond;
}

.network-figure .nodes circle {
  fill: rgba(255, 255, 255, .025);
  stroke: rgba(255, 255, 255, .42);
  stroke-width: 1.2;
  filter: none;
  transform-box: fill-box;
  transform-origin: center;
  animation: nodeBreathe 4.8s ease-in-out infinite;
}

.network-figure .nodes.hidden circle {
  animation-delay: .8s;
}

.network-figure .nodes.output circle {
  animation-delay: 1.55s;
}

.network-figure text {
  fill: rgba(255, 255, 255, .82);
  font-family: "IBM Plex Mono", monospace;
  font-size: 22px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.network-figure .nodes.input text {
  text-anchor: end;
}

.network-figure .nodes text {
  animation: nodeTextPulse 4.8s ease-in-out infinite;
}

.network-figure .nodes.hidden text {
  animation-delay: .8s;
}

.network-figure .nodes.output text {
  animation-delay: 1.55s;
}

.network-figure .compute-logic path {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.network-figure .logic-focus {
  stroke: rgba(255, 255, 255, .38);
  stroke-width: 1.15;
  stroke-dasharray: 7 12;
  opacity: .46;
  animation: logicTrace 4.8s ease-in-out infinite;
}

.network-figure .logic-focus.bias {
  animation-delay: .28s;
}

.network-figure .logic-bias,
.network-figure .logic-activation {
  stroke: rgba(255, 255, 255, .24);
  stroke-width: 1;
  stroke-dasharray: 5 10;
  opacity: .62;
}

.network-figure .logic-gate rect,
.network-figure .logic-gate circle {
  fill: rgba(4, 6, 10, .78);
  stroke: rgba(255, 255, 255, .38);
  stroke-width: 1;
  animation: gatePulse 4.8s ease-in-out infinite;
}

.network-figure .logic-gate.sum circle {
  animation-delay: .62s;
}

.network-figure .logic-gate text,
.network-figure .logic-label {
  fill: rgba(255, 255, 255, .68);
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  letter-spacing: .04em;
  animation: logicTextPulse 4.8s ease-in-out infinite;
}

.network-figure .logic-gate.sum text {
  font-size: 15px;
  animation-delay: .62s;
}

.network-figure .bias-label {
  font-size: 13px;
  text-anchor: start;
  animation-delay: .92s;
}

.network-figure .activation-label {
  font-size: 12px;
  text-anchor: start;
  animation-delay: 1.24s;
}

.network-figure .layer-labels text {
  fill: rgba(255, 255, 255, .45);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.network-figure figcaption {
  margin-top: 8px;
  color: var(--faint);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.figure-equation {
  margin-top: 14px;
  padding: 14px 16px 12px;
  border-top: 1px solid rgba(255, 255, 255, .075);
  background: linear-gradient(90deg, rgba(255, 255, 255, .045), transparent 62%);
}

.figure-equation > span {
  display: block;
  margin-bottom: 4px;
  color: rgba(255, 255, 255, .64);
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.figure-equation mjx-container[jax="CHTML"][display="true"] {
  text-align: left !important;
  margin: 0;
  padding: 0;
}

@keyframes fiberPulse {
  0%, 7% {
    opacity: 0;
    stroke-dashoffset: 588;
  }
  14% {
    opacity: .95;
  }
  42% {
    opacity: .75;
  }
  58%, 100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

@keyframes fiberPulseSecond {
  0%, 5% {
    opacity: 0;
    stroke-dashoffset: 588;
  }
  12% {
    opacity: .92;
  }
  40% {
    opacity: .72;
  }
  56%, 100% {
    opacity: 0;
    stroke-dashoffset: 0;
  }
}

@keyframes nodeBreathe {
  0%, 100% {
    fill: rgba(255, 255, 255, .025);
    stroke: rgba(255, 255, 255, .36);
    transform: scale(1);
  }
  20% {
    fill: rgba(255, 255, 255, .055);
    stroke: rgba(255, 255, 255, .72);
    transform: scale(1.018);
  }
  46% {
    fill: rgba(255, 255, 255, .035);
    stroke: rgba(255, 255, 255, .48);
    transform: scale(1);
  }
}

@keyframes nodeTextPulse {
  0%, 100% {
    fill: rgba(255, 255, 255, .72);
  }
  22% {
    fill: rgba(255, 255, 255, .96);
  }
  48% {
    fill: rgba(255, 255, 255, .78);
  }
}

@keyframes logicTrace {
  0%, 100% {
    opacity: .22;
    stroke-dashoffset: 24;
  }
  28% {
    opacity: .72;
  }
  58% {
    opacity: .38;
    stroke-dashoffset: 0;
  }
}

@keyframes gatePulse {
  0%, 100% {
    fill: rgba(4, 6, 10, .78);
    stroke: rgba(255, 255, 255, .34);
  }
  30% {
    fill: rgba(255, 255, 255, .045);
    stroke: rgba(255, 255, 255, .78);
  }
  58% {
    fill: rgba(4, 6, 10, .72);
    stroke: rgba(255, 255, 255, .44);
  }
}

@keyframes logicTextPulse {
  0%, 100% {
    fill: rgba(255, 255, 255, .54);
  }
  32% {
    fill: rgba(255, 255, 255, .95);
  }
  62% {
    fill: rgba(255, 255, 255, .64);
  }
}

.article-grid {
  display: grid;
  grid-template-columns: 190px minmax(0, 820px);
  gap: clamp(38px, 7vw, 92px);
  align-items: start;
  min-width: 0;
}

.article-grid > * {
  min-width: 0;
  max-width: 100%;
}

.toc {
  position: sticky;
  top: 116px;
  display: grid;
  gap: 11px;
  padding-top: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
}

.toc a {
  transition: color .2s, transform .2s;
}

.toc a:hover,
.toc a.active {
  color: #fff;
  transform: translateX(4px);
}

.prose-section {
  padding-bottom: clamp(70px, 10vw, 126px);
}

.prose-section h2 {
  margin-top: 16px;
  font-family: "Space Grotesk", Manrope, system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1;
  letter-spacing: -.055em;
  font-weight: 500;
}

.prose-section p:not(.section-label) {
  margin-top: 22px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.82;
}

blockquote {
  margin-top: 34px;
  padding: 26px 30px;
  border-left: 2px solid var(--accent);
  border-radius: 0 22px 22px 0;
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .84);
  font-family: "Space Grotesk", Manrope, sans-serif;
  font-size: clamp(21px, 3vw, 32px);
  line-height: 1.28;
  letter-spacing: -.035em;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.equation-card,
.code-card {
  position: relative;
  width: 100%;
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 20px;
  background:
    linear-gradient(90deg, rgba(155, 215, 255, .035), transparent 42%),
    rgba(10, 12, 17, .52);
  box-shadow: none;
  overflow: hidden;
}

.equation-card::before,
.code-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px) 0 0 / 42px 100%,
    linear-gradient(180deg, rgba(255, 255, 255, .04) 1px, transparent 1px) 0 0 / 100% 42px;
  opacity: .18;
}

.equation-card > span,
.code-card > span {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.article-body {
  --math-panel-width: 100%;
  min-width: 0;
}

.prose-section,
.formula-grid,
.equation-card,
.code-card,
.status-panel,
blockquote {
  min-width: 0;
}

.article-body .equation-card,
.article-body .code-card,
.article-body .formula-grid {
  width: var(--math-panel-width);
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
}

.prose-section h2,
.prose-section p:not(.section-label),
blockquote {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.wide-equation {
  width: 100%;
  max-width: 100%;
}

.formula-grid .equation-card {
  width: 100%;
  max-width: none;
  margin-top: 0;
}

.status-panel .equation-card,
.status-panel .code-card {
  width: 100%;
  max-width: 100%;
}

mjx-container {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .9);
  max-width: 100%;
  padding: 2px 0;
}

mjx-container[jax="CHTML"][display="true"] {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 8px 0 4px;
  overflow: hidden;
  text-align: center;
}

.code-card pre {
  position: relative;
  z-index: 1;
  overflow-x: auto;
  color: rgba(244, 245, 240, .86);
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.72;
  tab-size: 2;
}

.compact-code pre {
  white-space: pre-wrap;
}

.status-panel {
  padding: 34px;
  margin-bottom: 90px;
  border: 1px solid var(--line-soft);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .065), rgba(255, 255, 255, .035));
}

@media (max-width: 1000px) {
  .feature-panel,
  .article-grid,
  .formula-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .toc {
    display: none;
  }

  .article-body {
    --math-panel-width: 100%;
  }
}

@media (max-width: 620px) {
  .site-header {
    height: 68px;
    padding-inline: 18px;
  }

  .brand span:last-child {
    display: none;
  }

  .top-nav,
  .brand {
    font-size: 10px;
    letter-spacing: .1em;
  }

  .article-shell,
  .article-wide {
    width: calc(100% - 28px);
    max-width: calc(100% - 28px);
  }

  .article-grid,
  .article-body,
  .prose-section,
  .formula-grid,
  .equation-card,
  .code-card,
  .status-panel,
  blockquote {
    width: 100%;
    max-width: 100%;
  }

  .hero {
    padding-top: 76px;
  }

  .hero h1 {
    font-size: clamp(46px, 16vw, 78px);
  }

  .prose-section h2 {
    font-size: clamp(30px, 10vw, 42px);
    line-height: 1.04;
    letter-spacing: -.05em;
  }

  .prose-section p:not(.section-label) {
    font-size: 15px;
    line-height: 1.72;
    overflow-wrap: anywhere;
  }

  blockquote {
    padding: 22px 20px;
    font-size: 20px;
    line-height: 1.36;
  }

  .feature-panel,
  .equation-card,
  .code-card,
  .status-panel {
    border-radius: 22px;
  }

  .feature-panel,
  .status-panel {
    padding: 18px;
  }

  .equation-card,
  .code-card {
    padding: 17px;
  }

  .network-figure {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 8px;
    border-radius: 20px;
    overflow: hidden;
  }

  .network-figure svg {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 0;
  }

  .figure-equation,
  .equation-card {
    overflow: hidden;
  }

  mjx-container[jax="CHTML"][display="true"] {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .code-card pre {
    white-space: pre-wrap;
    overflow-x: hidden;
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .001ms !important;
  }

  .network-figure .fiber-edges line {
    opacity: 0;
  }
}
