:root {
  --paper: #faf7f0;
  --paper-deep: #f2ede3;
  --paper-light: #fffdf8;
  --ink: #1c1917;
  --ink-soft: #44403c;
  --muted: #78716c;
  --faint: #b8b0a4;
  --line: #c8c0b5;
  --accent: #42be65;
  --serif: "Source Serif 4", Georgia, serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 280px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  content: "";
  opacity: 0.065;
  pointer-events: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  width: auto;
  height: auto;
  overflow: visible;
  padding: 10px 14px;
  border: 1px solid var(--ink);
  background: var(--paper-light);
  clip: auto;
  clip-path: none;
  color: var(--ink);
  font: 500 0.75rem var(--mono);
}

main {
  width: min(100%, 1240px);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 64px);
}

.hero {
  display: grid;
  min-height: 100svh;
  padding: clamp(32px, 6vw, 72px) 0 64px;
  border-bottom: 1px solid var(--ink);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  isolation: isolate;
}

.hero-field {
  position: absolute;
  inset: 0 0 auto;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100svh;
  pointer-events: none;
}

.factory-mote {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 3;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  place-items: center;
  transform: translate3d(-100px, -100px, 0);
  will-change: transform;
}

.factory-mote[hidden] {
  display: none;
}

.factory-mote::before {
  position: absolute;
  width: 25px;
  height: 23px;
  border: 2px solid rgb(66 190 101 / 55%);
  border-radius: 48% 52% 46% 54%;
  content: "";
  box-shadow: 0 0 8px rgb(66 190 101 / 24%);
  animation: factory-mote-halo 2.2s ease-in-out infinite;
}

.factory-mote-spark {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--paper-light);
  box-shadow:
    -8px 3px 0 rgb(66 190 101 / 96%),
    7px -5px 0 rgb(66 190 101 / 94%),
    9px 5px 0 rgb(255 253 248 / 96%),
    -3px -8px 0 rgb(66 190 101 / 92%);
  filter: drop-shadow(0 0 7px rgb(66 190 101 / 92%));
  animation: factory-mote-breathe 1.8s ease-in-out infinite;
}

.factory-mote:hover .factory-mote-spark {
  filter: drop-shadow(0 0 10px rgb(66 190 101 / 98%));
}

.factory-mote:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.factory-mote[aria-busy="true"],
.factory-mote[aria-disabled="true"] {
  cursor: default;
}

.factory-mote.is-paused::before,
.factory-mote.is-paused .factory-mote-spark,
.factory-mote:focus-visible::before,
.factory-mote:focus-visible .factory-mote-spark {
  animation-play-state: paused;
}

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

@keyframes factory-mote-halo {
  0%,
  100% {
    opacity: 0.56;
    transform: scale(0.82) rotate(-5deg);
  }

  50% {
    opacity: 0.92;
    transform: scale(1.1) rotate(4deg);
  }
}

@keyframes factory-mote-breathe {
  0%,
  100% {
    opacity: 0.78;
    transform: scale(0.84);
  }

  50% {
    opacity: 1;
    transform: scale(1.18);
  }
}

.section-index,
.instruction,
.detail-index {
  margin: 0;
  color: var(--muted);
  font: 500 0.68rem/1.4 var(--mono);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.nori-mark {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  z-index: 2;
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
  margin: 0;
  color: var(--ink);
  opacity: 0.42;
  text-decoration: none;
  transition:
    opacity 220ms ease,
    transform 220ms var(--ease);
}

.nori-mark rect {
  fill: var(--accent);
  stroke: currentColor;
  stroke-width: 1.5;
}

.nori-wordmark {
  color: var(--ink);
  font: 600 1.05rem/1 var(--mono);
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.nori-prompt {
  margin-left: 2px;
  color: var(--accent);
}

.nori-cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.95em;
  margin-left: 3px;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: nori-blink 1.1s steps(1) infinite;
}

@keyframes nori-blink {
  50% {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nori-cursor {
    animation: none;
  }
}

.nori-mark:hover {
  opacity: 0.75;
  transform: translateY(-1px);
}

.nori-mark:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  opacity: 0.9;
}

.hero-copy {
  position: relative;
  z-index: 1;
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  max-width: 920px;
}

.hero h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(4rem, 9.2vw, 8.4rem);
  font-weight: 600;
  letter-spacing: -0.065em;
  line-height: 0.84;
}

.hero-copy > p {
  max-width: 610px;
  margin: clamp(28px, 4vw, 48px) 0 0;
  color: var(--ink-soft);
  font-size: clamp(1.2rem, 2vw, 1.65rem);
  line-height: 1.35;
}

.hero-scroll-cue {
  position: absolute;
  right: clamp(20px, 4vw, 64px);
  bottom: 16px;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--accent);
  font: 500 0.62rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-scroll-cue span {
  font-size: 0.9rem;
}

.stack-section {
  padding: clamp(64px, 10vw, 120px) 0 96px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(44px, 7vw, 76px);
}

.section-heading h2 {
  max-width: 660px;
  margin: 10px 0 0;
  font-size: clamp(2.1rem, 4.5vw, 4.25rem);
  font-weight: 400;
  letter-spacing: -0.045em;
  line-height: 1;
}

.instruction {
  flex: 0 0 auto;
  padding-bottom: 5px;
  color: var(--accent);
}

.instruction span {
  display: inline-block;
  margin-right: 8px;
  font-size: 1rem;
}

.stack-frame {
  position: relative;
  padding-left: clamp(42px, 7vw, 82px);
}

.ownership {
  position: absolute;
  left: 0;
  margin: 0;
  color: #9c8f7f;
  font-size: 0.8rem;
  font-style: italic;
  letter-spacing: 0.04em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.ownership::before {
  display: block;
  width: 1px;
  height: 76px;
  margin: 0 auto 12px;
  background: var(--line);
  content: "";
}

.ownership-yours {
  top: 18px;
}

.ownership-provider {
  top: 57%;
}

.stack {
  width: 100%;
}

.layer {
  position: relative;
  min-width: 0;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
}

.layer h2 {
  margin: 0;
}

.layer-trigger {
  display: flex;
  width: 100%;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 19px clamp(18px, 3vw, 32px);
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 240ms ease,
    background-color 240ms ease,
    color 240ms ease,
    transform 240ms var(--ease);
}

.layer-trigger:hover {
  background: color-mix(in srgb, var(--paper-light) 72%, transparent);
  transform: translateY(-1px);
}

.layer-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.layer.is-active > h2 .layer-trigger {
  border-color: var(--accent);
  background: var(--paper-light);
  color: var(--accent);
}

.layer-heading {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.layer-name {
  font-size: clamp(1.32rem, 2.1vw, 1.75rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
}

.layer-name-small {
  font-size: clamp(1.12rem, 1.8vw, 1.4rem);
}

.layer-subtitle {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 0.76rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.35;
}

.layer-action {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font: 500 0.6rem var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.toggle-mark {
  position: relative;
  display: block;
  width: 25px;
  height: 25px;
  border: 1px solid currentColor;
  border-radius: 50%;
}

.toggle-mark::before,
.toggle-mark::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 1px;
  background: currentColor;
  content: "";
  transform: translate(-50%, -50%);
  transition: transform 300ms var(--ease);
}

.toggle-mark::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.layer.is-active > h2 .toggle-mark::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.layer.is-active > h2 .layer-action {
  color: var(--accent);
}

.layer-panel {
  display: grid;
  visibility: hidden;
  overflow: hidden;
  grid-template-rows: 0fr;
  opacity: 0;
  transition:
    grid-template-rows 420ms var(--ease),
    opacity 260ms ease,
    visibility 0s linear 420ms;
}

.layer.is-active > .layer-panel {
  visibility: visible;
  grid-template-rows: 1fr;
  opacity: 1;
  transition-delay: 0s;
}

.layer-panel-inner {
  min-height: 0;
  overflow: hidden;
}

.layer-detail {
  display: grid;
  gap: clamp(20px, 3vw, 36px);
  padding: 24px clamp(18px, 3vw, 32px) 28px;
  border: 1px solid var(--accent);
  border-top: 0;
  background: color-mix(in srgb, var(--paper-light) 82%, transparent);
  grid-template-columns: minmax(0, 1.05fr) minmax(220px, 0.95fr);
}

.layer-detail p {
  margin: 0;
}

.layer-explanation {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.layer-explanation > p:not(.detail-index) {
  max-width: 68ch;
  color: var(--ink-soft);
  font-size: 1rem;
  line-height: 1.55;
}

.detail-index {
  color: var(--accent);
}

.example-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}

.example-strip-list {
  padding: 0;
  list-style: none;
}

.example-strip span,
.example-strip-list li,
.reference-grid a {
  padding: 7px 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font: 500 0.64rem/1.25 var(--mono);
}

.reference-grid {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.reference-grid a {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    color 180ms ease;
}

.reference-grid a::after {
  color: var(--accent);
  content: "↗";
}

.reference-grid a:hover,
.reference-grid a:focus-visible {
  border-color: var(--accent);
  color: var(--accent);
}

.reference-grid a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.system-figure {
  position: relative;
  align-self: start;
  min-width: 0;
  min-height: 190px;
  overflow: hidden;
  margin: 0;
  padding: 42px 16px 16px;
  border: 1px solid var(--line);
  background:
    linear-gradient(color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--line) 22%, transparent) 1px, transparent 1px),
    var(--paper);
  background-size: 16px 16px;
  color: var(--ink-soft);
  font: 500 0.64rem/1.25 var(--mono);
}

.system-figure figcaption {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  min-height: 30px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-light) 94%, transparent);
  color: var(--muted);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.interface-figure {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr);
}

.client-grid {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
}

.client-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.client-card > strong {
  color: var(--ink);
  font-size: 0.6rem;
  letter-spacing: 0.04em;
}

/* Each preview is a drawn likeness of the client, not a screenshot. */
.client-preview {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 0 0 6px;
  border: 1px solid var(--ink-soft);
  background: var(--paper-light);
  font-size: 0.5rem;
  line-height: 1.5;
}

.client-preview code,
.client-chrome {
  overflow: hidden;
  padding: 0 6px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-chrome {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 3px;
  padding-top: 3px;
  padding-bottom: 3px;
  border-bottom: 1px solid color-mix(in srgb, var(--ink-soft) 45%, transparent);
  background: color-mix(in srgb, var(--ink-soft) 12%, transparent);
  color: var(--muted);
  font-size: 0.46rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.client-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink-soft);
}

.client-dot:last-of-type {
  margin-right: 4px;
}

.client-preview-terminal {
  background: color-mix(in srgb, var(--ink) 94%, transparent);
  color: var(--paper-light);
}

.client-preview-terminal .client-chrome {
  border-bottom-color: color-mix(in srgb, var(--paper-light) 22%, transparent);
  background: color-mix(in srgb, var(--paper-light) 10%, transparent);
  color: color-mix(in srgb, var(--paper-light) 70%, transparent);
}

.client-prompt {
  color: var(--paper-light);
}

.client-tool {
  color: var(--accent);
}

.client-preview-terminal .client-out {
  color: color-mix(in srgb, var(--paper-light) 62%, transparent);
}

.client-del {
  background: color-mix(in srgb, #b4432f 14%, transparent);
  color: #8c331f;
}

.client-add {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: #185b2c;
}

.client-msg {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--ink);
  font-weight: 600;
}

.client-msg em {
  padding: 0 3px;
  background: color-mix(in srgb, var(--ink-soft) 22%, transparent);
  color: var(--muted);
  font-size: 0.42rem;
  font-style: normal;
  letter-spacing: 0.06em;
}

.client-avatar {
  width: 8px;
  height: 8px;
  flex: none;
  background: var(--accent);
}

.client-thread {
  color: #2f6bd8;
}

.client-bubble {
  align-self: flex-start;
  margin: 0 6px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--ink);
}

.client-preview .client-out {
  color: var(--muted);
}

.interface-request {
  padding: 8px;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--paper-light));
  color: var(--accent);
  text-align: center;
  grid-column: 1 / -1;
}

.context-figure {
  display: grid;
  align-items: center;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.file-tree {
  display: flex;
  padding: 10px;
  border: 1px solid var(--ink-soft);
  background: var(--paper-light);
  flex-direction: column;
  gap: 5px;
}

.file-tree span:nth-child(n + 2) {
  padding-left: 8px;
}

.file-tree b {
  color: var(--accent);
  font-weight: 500;
}

.context-load-arrow {
  color: var(--accent);
  font-size: 1.1rem;
}

.context-load-target {
  padding: 9px;
  border: 1px solid var(--accent);
  background: var(--paper-light);
  color: var(--accent);
  text-align: center;
  grid-column: 1 / -1;
}

.harness-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 16px;
}

.retl-cycle {
  display: grid;
  width: 100%;
  align-items: center;
  gap: 5px;
  grid-template-columns: 1fr auto 1fr auto 1fr;
}

.retl-step {
  min-width: 0;
  padding: 11px 5px;
  border: 1px solid var(--ink-soft);
  background: var(--paper-light);
  color: var(--ink);
  text-align: center;
}

.retl-arrow {
  color: var(--accent);
}

.retl-return {
  position: absolute;
  margin: 76px 0 0 -112px;
  font-size: 1.4rem;
  transform: rotate(35deg);
}

.retl-finish {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.tool-card-grid {
  display: grid;
  margin: 0;
  padding: 0;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  list-style: none;
}

.tool-card-grid li {
  display: flex;
  min-width: 0;
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--ink-soft);
  background: var(--paper-light);
  flex-direction: column;
  gap: 7px;
}

.tool-card-grid strong {
  color: var(--ink);
  font-size: 0.64rem;
}

.tool-card-grid span {
  color: var(--muted);
  font-size: 0.54rem;
}

.api-figure,
.inference-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.api-node,
.api-gateway,
.inference-step {
  display: flex;
  min-width: 0;
  min-height: 66px;
  padding: 9px 6px;
  border: 1px solid var(--ink-soft);
  background: var(--paper-light);
  flex: 1 1 0;
  flex-direction: column;
  gap: 8px;
  justify-content: center;
  text-align: center;
}

.api-gateway {
  border-color: var(--accent);
  color: var(--accent);
}

.api-node span,
.api-gateway span,
.inference-step span {
  color: var(--muted);
  font-size: 0.5rem;
}

.api-arrow,
.inference-figure > span {
  color: var(--accent);
}

.hyperscaler-figure {
  padding-right: 12px;
  padding-left: 12px;
}

.infra-level {
  position: relative;
  padding: 12px;
  border: 1px solid var(--ink-soft);
  background: color-mix(in srgb, var(--paper-light) 92%, transparent);
}

.infra-level > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.58rem;
  text-transform: uppercase;
}

.infra-datacenter {
  padding-top: 20px;
}

.infra-hall {
  margin-top: 8px;
}

.infra-rack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-style: dashed;
}

.infra-rack > strong {
  margin: 0;
}

.infra-rack span {
  color: var(--accent);
  font-size: 0.52rem;
}

.cooling-row {
  position: absolute;
  top: 7px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.cooling-row i {
  width: 13px;
  height: 7px;
  border: 1px solid var(--line);
  background: var(--paper-deep);
}

.cache-figure {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.cache-row {
  display: grid;
  align-items: center;
  gap: 4px;
  grid-template-columns: minmax(74px, 1fr) repeat(4, 24px);
}

.cache-row > strong {
  color: var(--ink);
  font-size: 0.55rem;
}

.prefix-block,
.suffix-block {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 11%, var(--paper-light));
  color: var(--accent);
}

.suffix-block {
  border-color: var(--ink-soft);
  background: var(--paper-light);
  color: var(--ink-soft);
}

.suffix-new {
  border-color: #b57832;
  color: #8a561a;
}

.cache-legend {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.5rem;
}

.cache-legend strong {
  color: var(--accent);
}

.inference-figure {
  flex-wrap: wrap;
}

.inference-step {
  min-width: 76px;
  min-height: 58px;
}

.gpu-figure {
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: 54px minmax(110px, 1fr) 54px;
}

.hbm-stack,
.gpu-die {
  display: flex;
  padding: 8px;
  border: 1px solid var(--ink-soft);
  background: var(--paper-light);
  flex-direction: column;
  gap: 5px;
  text-align: center;
}

.hbm-stack i {
  height: 8px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 12%, var(--paper));
}

.gpu-die {
  min-height: 118px;
  border-color: var(--accent);
}

.matrix-grid {
  display: grid;
  gap: 3px;
  margin: 4px 0;
  grid-template-columns: repeat(3, 1fr);
}

.matrix-grid i {
  height: 12px;
  background: color-mix(in srgb, var(--accent) 24%, var(--paper-deep));
}

.gpu-die span {
  color: var(--muted);
  font-size: 0.52rem;
}

.weights-figure {
  min-height: 210px;
}

.weights-network {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 8px;
}

.network-edges path {
  fill: none;
  stroke: var(--line);
  stroke-width: 1.5;
}

.network-nodes circle {
  fill: var(--paper-light);
  stroke: var(--ink-soft);
  stroke-width: 2;
}

.network-nodes circle:last-child {
  fill: color-mix(in srgb, var(--accent) 18%, var(--paper-light));
  stroke: var(--accent);
}

.network-labels {
  display: grid;
  align-items: center;
  color: var(--muted);
  font-size: 0.5rem;
  grid-template-columns: 0.8fr 1.7fr 1fr 0.55fr;
}

.network-labels span,
.network-labels strong {
  text-align: center;
}

.network-labels strong {
  color: var(--accent);
}

.weights-wave {
  position: absolute;
  top: 54px;
  bottom: 32px;
  left: -20%;
  z-index: 1;
  width: 22%;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 28%, transparent), transparent);
  pointer-events: none;
  animation: forward-pass 2.4s linear infinite;
}

@keyframes forward-pass {
  from { transform: translateX(0); }
  to { transform: translateX(560%); }
}

.connector {
  position: relative;
  width: 1px;
  height: 34px;
  margin: 0 auto;
  background: var(--ink);
}

.connector-two-way::before,
.connector-two-way::after {
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  content: "";
  transform: translateX(-50%);
}

.connector-two-way::before {
  top: 0;
  border-bottom: 6px solid var(--ink);
}

.connector-two-way::after {
  bottom: 0;
  border-top: 6px solid var(--ink);
}

.core-grid {
  display: grid;
  align-items: stretch;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.core-grid:has(.layer-core.is-active) {
  align-items: start;
}

.core-grid:not(:has(.layer-core.is-active)) .layer-core > h2,
.core-grid:not(:has(.layer-core.is-active)) .layer-core .layer-trigger {
  height: 100%;
}

.layer-core {
  min-height: 0;
  border: 1px solid var(--ink);
}

.layer-core .layer-trigger {
  min-height: 100px;
  align-items: flex-start;
  border: 0;
  border-bottom: 1px solid var(--line);
}

.layer-core.is-active > h2 .layer-trigger {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.layer-core .layer-detail {
  border-right: 0;
  border-left: 0;
  grid-template-columns: 1fr;
}

.layer-preview {
  display: flex;
  padding: 24px clamp(16px, 2vw, 25px) 26px;
  color: var(--ink-soft);
  flex-direction: column;
  gap: 12px;
  font: 400 0.75rem/1.35 var(--mono);
}

.layer-preview-centered {
  align-items: stretch;
  text-align: center;
}

.retl {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 4px;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 1rem;
  font-weight: 600;
}

.retl i {
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 400;
}

.tools-list {
  gap: 14px;
  font-size: 0.8rem;
}

.flow-bridge {
  position: relative;
  height: 44px;
}

.flow-center {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--line);
}

.flow-left,
.flow-right {
  position: absolute;
  top: 0;
  width: calc(33.333% - 12px);
  height: 22px;
  border-bottom: 1px solid var(--line);
}

.flow-left {
  left: calc(16.666% + 6px);
  border-left: 1px solid var(--line);
}

.flow-right {
  right: calc(16.666% + 6px);
  border-right: 1px solid var(--line);
}

.provider-boundary {
  width: min(62%, 640px);
  margin: 0 auto;
  padding: 12px;
  border: 1px dashed var(--ink);
}

.layer-provider .layer-trigger {
  border-style: dashed;
}

.provider-inset {
  margin: 12px auto 0;
}

.provider-cache {
  width: calc(100% - 22px);
}

.inference-boundary {
  width: calc(100% - 22px);
  margin: 12px auto 0;
  padding: 12px;
  border: 1px dashed var(--line);
}

.inference-boundary .provider-inset {
  width: 100%;
}

.layer-gpu .layer-trigger {
  min-height: 96px;
}

.layer-weights .layer-trigger,
.layer-weights .layer-detail {
  border-color: var(--accent);
}

.layer-weights .layer-name {
  color: var(--accent);
}

@media (max-width: 860px) {
  .hero {
    min-height: 100svh;
    grid-template-columns: 1fr;
    grid-template-rows: 68px 1fr 90px;
  }

  .hero-copy {
    grid-row: 2;
  }

  .core-grid {
    gap: 12px;
  }

  .layer-core {
    min-height: 0;
  }

  .layer-core .layer-trigger {
    min-height: 118px;
    align-items: flex-start;
    padding: 18px 16px;
  }

  .layer-core .layer-action > span:first-child {
    display: none;
  }

  .layer-preview {
    padding: 20px 16px;
    font-size: 0.68rem;
  }

  .provider-boundary {
    width: 76%;
  }
}

@media (max-width: 640px) {
  main {
    padding: 0 14px;
  }

  .hero {
    min-height: max(540px, 100svh);
    padding: 26px 0 32px;
  }

  .hero-field {
    height: max(540px, 100svh);
  }

  .hero h1 {
    /* Sized so the title sets on two lines and leaves the drawing its room. */
    font-size: clamp(2.9rem, 17vw, 5rem);
    line-height: 0.9;
  }

  .hero-copy > p {
    max-width: 30ch;
    margin-top: 28px;
    font-size: 1.1rem;
  }

  .stack-section {
    padding: 64px 0 72px;
  }

  .section-heading {
    display: block;
    margin-bottom: 40px;
  }

  .section-heading h2 {
    font-size: 2.35rem;
  }

  .instruction {
    margin-top: 24px;
  }

  .stack-frame {
    padding-left: 0;
  }

  .ownership {
    position: static;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0 10px;
    font: italic 0.72rem var(--serif);
    writing-mode: initial;
    transform: none;
  }

  .ownership::before {
    width: 28px;
    height: 1px;
    margin: 0;
  }

  .ownership-provider {
    display: none;
  }

  .layer-trigger {
    min-height: 74px;
    gap: 14px;
    padding: 16px;
  }

  .layer-action > span:first-child {
    display: none;
  }

  .toggle-mark {
    width: 28px;
    height: 28px;
  }

  .layer-name,
  .layer-name-small {
    font-size: 1.25rem;
  }

  .layer-subtitle {
    font-size: 0.68rem;
  }

  .layer-detail {
    gap: 8px;
    padding: 18px 16px 22px;
    grid-template-columns: 1fr;
  }

  .detail-index {
    padding: 0;
  }

  .layer-explanation > p:not(.detail-index) {
    font-size: 0.95rem;
  }

  .core-grid {
    grid-template-columns: 1fr;
  }

  .layer-core {
    min-height: 0;
  }

  .layer-core .layer-trigger {
    min-height: 78px;
    align-items: flex-start;
  }

  .layer-core .layer-preview {
    display: none;
  }

  .flow-bridge {
    height: 34px;
  }

  .flow-left,
  .flow-right {
    display: none;
  }

  .provider-boundary {
    width: 100%;
    padding: 8px;
  }

  .provider-boundary::before {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -30px 0 12px -8px;
    color: #9c8f7f;
    content: "The provider’s";
    font: italic 0.72rem var(--serif);
  }

  .provider-boundary::before {
    padding-left: 38px;
    background-image: linear-gradient(var(--line), var(--line));
    background-repeat: no-repeat;
    background-position: 0 50%;
    background-size: 28px 1px;
  }

  .provider-inset,
  .provider-cache,
  .inference-boundary {
    width: 100%;
    margin-top: 8px;
  }

  .inference-boundary {
    padding: 8px;
  }

  .layer-gpu .layer-trigger {
    min-height: 80px;
  }

}

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

  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
