/* ---------- Motion on scroll ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal {
    opacity: 0;
    transform: translateY(26px);
    transition:
      opacity 0.9s var(--ease),
      transform 0.9s var(--ease);
  }
  .js .reveal.seen {
    opacity: 1;
    transform: none;
  }
}

.pill {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  padding: 0.5rem 0.95rem;
  border: 1px solid rgb(92 200 242 / 0.26);
  border-radius: 99rem;
  background: rgb(6 12 20 / 0.72);
  font: 500 0.72rem/1.3 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--soft);
}
.pill i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--faint);
}
.pill a:hover {
  color: #fff;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding-top: calc(6.6rem + env(safe-area-inset-top));
  overflow: clip;
}
/* A faint grid of array cells behind the hero: the page's one background motif. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 -10rem;
  z-index: -1;
  background:
    radial-gradient(60rem 36rem at 74% 30%, rgb(92 200 242 / 0.1), transparent 70%),
    radial-gradient(40rem 30rem at 10% 0%, rgb(111 149 255 / 0.07), transparent 70%),
    linear-gradient(rgb(170 205 240 / 0.045) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(90deg, rgb(170 205 240 / 0.045) 1px, transparent 1px) 0 0 / 44px 44px;
  mask-image: radial-gradient(80% 70% at 60% 30%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(80% 70% at 60% 30%, #000 30%, transparent 85%);
}
.hero-grid {
  display: grid;
  gap: 2.4rem clamp(2rem, 4vw, 4rem);
  align-items: center;
}
@media (min-width: 1100px) {
  .hero-grid {
    grid-template-columns: minmax(0, 5.6fr) minmax(0, 6.4fr);
  }
}
.hero-copy .pill {
  margin-bottom: 1.6rem;
}
.hero .d1 {
  font-size: clamp(2.7rem, 5.5vw, 5.4rem);
}
.hero .d1 > span {
  display: block;
  white-space: nowrap;
}
@media (max-width: 380px) {
  .hero .d1 > span {
    white-space: normal;
  }
}
.hero .lede {
  max-width: 38rem;
  margin-top: 1.6rem;
}
.swap {
  display: inline-grid;
  margin-top: 1.7rem;
  padding: 0.8rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(3 8 14 / 0.75);
  font: 500 clamp(0.86rem, 1.2vw, 1rem) / 1.7 var(--mono);
}
.swap .del {
  color: #fca5b4;
  text-decoration: line-through;
  text-decoration-color: rgb(252 165 180 / 0.55);
}
.swap .add {
  color: #9be9b6;
}
.swap .del::before,
.swap .add::before {
  display: inline-block;
  width: 1.4em;
  text-decoration: none;
}
.swap .del::before {
  content: "−";
}
.swap .add::before {
  content: "+";
}
.install-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 3rem;
  padding: 0.4rem 0.5rem 0.4rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(3 8 14 / 0.6);
  font: 500 0.9rem var(--mono);
  color: var(--soft);
}
.install-chip b {
  color: var(--accent);
  font-weight: 500;
}
.copy-btn {
  display: inline-grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 0.65rem;
  background: none;
  color: var(--muted);
  transition:
    color 0.2s,
    border-color 0.2s;
}
.copy-btn:hover {
  color: #fff;
  border-color: var(--line-3);
}
.copy-btn svg {
  width: 1rem;
  height: 1rem;
}
.copy-btn .ok {
  display: none;
}
.copy-btn[data-done] .ok {
  display: block;
  color: var(--ok);
}
.copy-btn[data-done] .cp {
  display: none;
}

/* The broadcast lattice: drawn by the hero figure, a static poster before it runs. */
.lattice-stage {
  position: relative;
  aspect-ratio: 1.12;
  min-height: 0;
}
.lattice-stage canvas {
  position: absolute;
  inset: 0 0 2.6rem;
  width: 100%;
  height: calc(100% - 2.6rem);
}
/* The key to the drawing: what solid, hollow and outlined cells mean. */
.lattice-key {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem 1.3rem;
  font: 500 0.76rem/1.4 var(--mono);
  color: var(--muted);
}
.lattice-key li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.lattice-key li::before {
  content: "";
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 0.15rem;
  transform: rotate(45deg) scale(0.82);
}
.lattice-key .k-stored::before {
  background: linear-gradient(135deg, #9fe3fb, #2f86b8);
}
.lattice-key .k-repeat::before {
  border: 1px dashed rgb(92 200 242 / 0.75);
  background: rgb(92 200 242 / 0.1);
}
.lattice-key .k-read::before {
  border: 2px solid #fff;
}
@media (max-width: 520px) {
  .lattice-stage {
    aspect-ratio: 0.95;
  }
  .lattice-stage canvas {
    inset: 0 0 3.6rem;
    height: calc(100% - 3.6rem);
  }
}
.lattice-stage .eq {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  font: 500 0.82rem/1.4 var(--mono);
  color: var(--muted);
  pointer-events: none;
}
.lattice-stage .eq b {
  font-weight: 600;
}
.lattice-stage .eq .a {
  color: var(--accent);
}
.lattice-stage .eq .b {
  color: var(--rust);
}
.lattice-stage .eq .o {
  color: #fff;
}
@media (max-width: 1099px) {
  .lattice-stage {
    max-width: 40rem;
    margin-inline: auto;
    width: 100%;
  }
}

/* ---------- The console under the hero ---------- */
.console-wrap {
  margin-top: clamp(1.6rem, 3vw, 2.4rem);
  padding-bottom: clamp(2.4rem, 4vw, 3.2rem);
}
.console {
  display: grid;
  gap: 1.4rem 2rem;
  padding: clamp(1.1rem, 2vw, 1.6rem) var(--inset);
  border: 1px solid var(--line-2);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), transparent 10rem), rgb(5 10 17 / 0.92);
}
@media (min-width: 1100px) {
  .console {
    grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  }
}
.console .micro {
  margin-bottom: 0.7rem;
}
.operands {
  display: grid;
  gap: 0.9rem;
}
.operand {
  display: grid;
  grid-template-columns: 1.4rem minmax(0, 1fr) minmax(7rem, 9rem);
  gap: 0.6rem;
  align-items: center;
}
.operand > i {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 0.22rem;
  transform: rotate(45deg) scale(0.85);
  background: var(--accent);
}
.operand.b > i {
  background: var(--rust);
}
@media (max-width: 520px) {
  .operand {
    grid-template-columns: 1rem minmax(0, 1fr) 7.6rem;
    gap: 0.45rem;
  }
  .operand select {
    padding-left: 0.6rem;
    padding-right: 1.7rem;
    background-position: right 0.45rem center;
    font-size: 0.82rem;
  }
  .field {
    padding: 0 0.65rem;
  }
}
.field {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 0.85rem;
  background: rgb(0 0 0 / 0.3);
  font: 500 0.95rem var(--mono);
  transition: border-color 0.2s;
}
.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(92 200 242 / 0.28);
}
.field span {
  color: var(--faint);
}
.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font: inherit;
  color: #fff;
}
/* A shape reads as a tuple: the closing parenthesis follows the last number, and the rest of the box still takes a click. */
.operand .field {
  cursor: text;
}
.operand .field input {
  flex: 0 1 auto;
  field-sizing: content;
  min-width: 2ch;
  max-width: 100%;
}
.field[data-bad] {
  border-color: var(--refuse);
}
.pick {
  display: grid;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--muted);
}
.pick select,
.operand select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 2.75rem;
  width: 100%;
  padding: 0 2rem 0 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 0.85rem;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2390a2b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 0.6rem center / 1rem no-repeat,
    rgb(0 0 0 / 0.3);
  font: 500 0.9rem var(--mono);
  color: #fff;
  cursor: pointer;
}
.pick select:focus-visible,
.operand select:focus-visible {
  border-color: var(--accent);
  outline-offset: 1px;
}
.pick select option,
.operand select option {
  background: #0a1420;
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.preset {
  min-height: 2.4rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  background: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--soft);
  transition:
    border-color 0.2s,
    color 0.2s,
    background-color 0.2s;
}
.preset:hover,
.preset[aria-pressed="true"] {
  border-color: var(--accent);
  color: #fff;
  background: rgb(92 200 242 / 0.08);
}
.verdict {
  display: grid;
  gap: 0.9rem;
  align-content: start;
}
.verdict-main {
  font: 600 clamp(1.6rem, 2.6vw, 2.2rem) / 1.15 var(--mono);
  letter-spacing: -0.02em;
  color: #fff;
  overflow-wrap: anywhere;
}
.verdict-main .dt {
  color: var(--accent);
}
.verdict-main.bad {
  color: var(--refuse);
  font-size: clamp(1.15rem, 1.8vw, 1.45rem);
}
.verdict-main .msg {
  display: block;
  margin-top: 0.35rem;
  font: 500 0.92rem/1.5 var(--mono);
  color: var(--soft);
}
.verdict dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.35rem 1rem;
  font-size: 0.88rem;
}
.verdict dt {
  color: var(--faint);
}
.verdict dd {
  font-family: var(--mono);
  font-size: 0.86rem;
  color: var(--soft);
  overflow-wrap: anywhere;
}
.verdict dd .z {
  color: var(--ok);
}
.verdict .numpy-says {
  padding: 0.7rem 0.85rem;
  border: 1px dashed var(--line-2);
  border-radius: 0.8rem;
  font: 400 0.82rem/1.5 var(--mono);
  color: var(--muted);
}
.verdict .numpy-says b {
  color: var(--numpy);
  font-weight: 600;
}
/* When the shapes broadcast, the same slot explains the zero strides: a plain note, not NumPy's voice. */
.verdict .numpy-says.note {
  padding: 0;
  border: 0;
  font: 400 0.9rem/1.55 var(--sans);
  color: var(--soft);
}
.engine-line {
  font: 500 0.74rem/1.4 var(--mono);
  letter-spacing: 0.04em;
  color: var(--faint);
}
.engine-line .on {
  color: var(--ok);
}

/* ---------- Stats ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12.5rem), 1fr));
  border-top: 1px solid var(--line);
}
.stats li {
  border-left: 1px solid var(--line);
}
.stats li:first-child {
  border-left: 0;
}
.stats li:first-child a {
  padding-left: 0;
}
.stats a {
  display: block;
  height: 100%;
  padding: 1.5rem 1.3rem 1.8rem;
}
.stats a:hover strong {
  color: #fff;
}
.stats b {
  display: block;
  font-size: clamp(2rem, 3vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.stats b small {
  font-size: 0.55em;
  letter-spacing: -0.02em;
  color: var(--muted);
}
.stats strong {
  display: block;
  margin: 0.5rem 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: #8fdcf8;
  transition: color 0.2s;
}
.stats span {
  display: block;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--muted);
}
@media (min-width: 600px) and (max-width: 1099px) {
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats li:nth-child(3n + 1) {
    border-left: 0;
  }
  .stats li:nth-child(3n + 1) a {
    padding-left: 0;
  }
  .stats li:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 599px) {
  .stats li {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .stats a {
    display: grid;
    grid-template-columns: 5.6rem 1fr;
    column-gap: 1rem;
    padding: 1rem 0;
  }
  .stats b {
    grid-row: span 2;
    font-size: 1.9rem;
  }
  .stats strong {
    margin: 0.1rem 0 0;
  }
  .stats a > span {
    grid-column: 2;
  }
}

/* ---------- Why: the build loop ---------- */
.why {
  border-top: 1px solid var(--line);
  padding-block: clamp(4rem, 8vw, 7rem);
}
.why .kicker {
  max-width: 50rem;
  margin-top: 1.3rem;
}
.loop {
  display: grid;
  gap: 1px;
  margin-top: clamp(2rem, 4vw, 3rem);
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  overflow: hidden;
  background: var(--line);
}
@media (min-width: 900px) {
  .loop {
    grid-template-columns: repeat(4, 1fr);
  }
}
.loop li {
  position: relative;
  padding: 1.5rem 1.4rem 1.6rem;
  background: var(--raise);
}
.loop .num {
  font-size: 0.76rem;
  color: var(--accent);
  letter-spacing: 0.08em;
}
.loop b {
  display: block;
  margin: 0.55rem 0 0.4rem;
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.loop p {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--muted);
}

/* ---------- Chapters and sections ---------- */
.chapter {
  position: relative;
  border-top: 1px solid var(--line);
}
.opener {
  position: relative;
  overflow: clip;
  background: radial-gradient(70rem 34rem at 12% 0%, color-mix(in srgb, var(--chapter) 9%, transparent), transparent 70%);
}
.opener > .wrap {
  position: relative;
  padding-block: clamp(5rem, 11vw, 9rem) clamp(3rem, 6vw, 4.6rem);
  scroll-margin-top: 2rem;
}
/* The chapter's number, drawn large and hollow at the right. */
.opener > .wrap::after {
  content: attr(data-num);
  position: absolute;
  right: var(--gutter);
  top: clamp(4rem, 9vw, 7rem);
  font-size: clamp(7rem, 16vw, 15rem);
  font-weight: 800;
  line-height: 0.8;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px color-mix(in srgb, var(--chapter) 26%, transparent);
  pointer-events: none;
}
@media (max-width: 899px) {
  .opener > .wrap::after {
    display: none;
  }
}
.opener .d2 {
  max-width: 54rem;
}
.opener .lede {
  max-width: 44rem;
  margin-top: 1.5rem;
}
.kick .num {
  color: var(--chapter);
  letter-spacing: 0.04em;
}
.kick.small {
  margin-bottom: 0.9rem;
  color: var(--muted);
}
.chapter em.g {
  color: var(--chapter);
}
.opener-index {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2.1rem;
}
.opener-index a {
  display: block;
  padding: 0.5rem 1rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 26%, transparent);
  border-radius: 99rem;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: color-mix(in srgb, var(--chapter) 30%, #fff);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}
.opener-index a:hover {
  border-color: var(--chapter);
  background: color-mix(in srgb, var(--chapter) 10%, transparent);
}
.sec {
  position: relative;
  padding-block: clamp(3rem, 5.6vw, 5.2rem);
  border-top: 1px solid var(--line);
}
.sec-head.wide {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.9rem 3rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.6rem);
}
.sec-head.wide > div {
  flex: 1 1 34rem;
  min-width: 0;
}
.sec-head.wide .kicker {
  margin-top: 1rem;
}
.sec-head.wide .more {
  flex: none;
  margin: 0;
}
.kicker {
  max-width: 46rem;
  font-size: clamp(1.04rem, 1.35vw, 1.22rem);
  line-height: 1.58;
  letter-spacing: -0.011em;
  color: var(--soft);
  text-wrap: pretty;
}
.split-grid {
  display: grid;
  gap: 2rem clamp(2.4rem, 6vw, 6rem);
}
.split .kicker {
  margin-top: 1.1rem;
}
@media (min-width: 1000px) {
  .split-grid {
    grid-template-columns: minmax(0, 4.4fr) minmax(0, 7.6fr);
  }
  .split .sec-head {
    position: sticky;
    top: 7.5rem;
    align-self: start;
  }
}
.sec-body {
  min-width: 0;
}
.sec-body > * + * {
  margin-top: 1.6rem;
}
.more {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding: 0.25rem 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  color: color-mix(in srgb, var(--chapter) 62%, #fff);
  transition: color 0.2s;
}
.more svg {
  width: 1rem;
  height: 1rem;
  transition: transform 0.35s var(--ease);
}
.more:hover {
  color: #fff;
}
.more:hover svg {
  transform: translateX(0.25rem);
}

/* ---------- Figures ---------- */
.fig {
  position: relative;
  border: 1px solid var(--line-2);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.022), transparent 14rem), rgb(5 10 18 / 0.88);
  overflow: clip;
}
.fig::before,
.fig::after {
  content: "";
  position: absolute;
  top: 0.65rem;
  width: 0.6rem;
  height: 0.6rem;
  border: solid var(--line-3);
  border-width: 1px 0 0 1px;
  pointer-events: none;
}
.fig::before {
  left: 0.65rem;
}
.fig::after {
  right: 0.65rem;
  transform: scaleX(-1);
}
.fig-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem 1.4rem;
  padding: clamp(1.2rem, 2.4vw, 1.9rem) var(--inset) 0;
}
.todo {
  font-size: clamp(1rem, 1.3vw, 1.14rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #fff;
}
.fig-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.src {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  font: 500 0.74rem/1.3 var(--mono);
  color: var(--soft);
  cursor: help;
}
.src i {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--muted);
}
.tagged {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 30%, transparent);
  border-radius: 99rem;
  background: color-mix(in srgb, var(--chapter) 8%, transparent);
  font-size: 0.78rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--chapter) 55%, #fff);
}
.tagged.live::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--chapter);
  box-shadow: 0 0 10px var(--chapter);
}
.tagged.example,
.tagged.data,
.tagged.repo {
  border-color: var(--line-2);
  background: none;
  color: var(--soft);
}
.fig-body {
  padding: clamp(1.2rem, 2.4vw, 1.9rem) var(--inset);
  min-width: 0;
}
.fig-body > * + * {
  margin-top: 1.3rem;
}
.js .fig:not([data-ready]) > .fig-body {
  min-height: var(--hp, auto);
}
@media (min-width: 640px) {
  .js .fig:not([data-ready]) > .fig-body {
    min-height: var(--ht, auto);
  }
}
@media (min-width: 1000px) {
  .js .fig:not([data-ready]) > .fig-body {
    min-height: var(--hd, auto);
  }
}
.fig-foot {
  padding: 0.95rem var(--inset) 1.05rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.noscript {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line-2);
  border-radius: 0.8rem;
  color: var(--soft);
  font-size: 0.9rem;
}

/* ---------- Controls ---------- */
.seg {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  max-width: 100%;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.28);
}
.seg button {
  min-height: 2.5rem;
  padding: 0.3rem 0.95rem;
  border: 0;
  border-radius: 0.78rem;
  background: none;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition:
    background-color 0.2s,
    color 0.2s;
}
.seg button:hover {
  color: #fff;
}
.seg button[aria-pressed="true"] {
  background: color-mix(in srgb, var(--chapter) 17%, transparent);
  color: #fff;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--chapter) 42%, transparent);
}
@media (max-width: 640px) {
  .seg {
    display: flex;
  }
  .seg button {
    flex: 1 1 auto;
    min-height: 2.75rem;
    padding-inline: 0.65rem;
  }
}
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 1rem 1.4rem;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 2.6rem;
  padding: 0.3rem 0.95rem 0.3rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  background: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--soft);
  transition:
    border-color 0.2s,
    background-color 0.2s;
}
.toggle i {
  position: relative;
  width: 1.9rem;
  height: 1.1rem;
  border-radius: 99rem;
  background: rgb(170 205 240 / 0.16);
  transition: background-color 0.2s;
}
.toggle i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(1.1rem - 4px);
  height: calc(1.1rem - 4px);
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease);
}
.toggle[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--chapter) 55%, transparent);
  background: color-mix(in srgb, var(--chapter) 9%, transparent);
  color: #fff;
}
.toggle[aria-pressed="true"] i {
  background: var(--chapter);
}
.toggle[aria-pressed="true"] i::after {
  transform: translateX(0.8rem);
}
.reads {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}
.read {
  padding: 0.85rem 1rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
}
.read small {
  display: block;
  font-size: 0.78rem;
  color: var(--faint);
}
.read b {
  display: block;
  margin-top: 0.15rem;
  font: 500 1.3rem/1.3 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.read span {
  display: block;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1.1rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.legend li::before {
  content: "";
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  margin-right: 0.5rem;
  border-radius: 0.2rem;
  background: var(--k);
}
.k-fnp {
  --k: var(--accent);
}
.k-numpy {
  --k: var(--numpy);
}
.k-ok {
  --k: var(--ok);
}
.k-refuse {
  --k: var(--refuse);
}
.k-warn {
  --k: var(--warn);
}
.k-rust {
  --k: var(--rust);
}
table.data {
  width: 100%;
  border-collapse: collapse;
  font: 400 0.8rem/1.5 var(--mono);
  font-variant-numeric: tabular-nums;
}
.data th {
  padding: 0.45rem 0.7rem 0.45rem 0;
  text-align: left;
  font-weight: 500;
  color: var(--faint);
  border-bottom: 1px solid var(--line-2);
}
.data td {
  padding: 0.4rem 0.7rem 0.4rem 0;
  border-bottom: 1px solid var(--line);
  color: var(--soft);
  vertical-align: top;
}
.scroll-x {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
svg.chart {
  width: 100%;
  height: auto;
  overflow: visible;
}
.chart text {
  font: 500 11px var(--mono);
  fill: var(--muted);
}
.chart .axis {
  stroke: var(--line-2);
  fill: none;
}
.chart .grid {
  stroke: var(--line);
  fill: none;
}
.tip {
  position: fixed;
  z-index: 70;
  max-width: 20rem;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--line-2);
  border-radius: 0.8rem;
  background: #0a1420;
  box-shadow: 0 18px 40px -12px rgb(0 0 0 / 0.8);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--soft);
  pointer-events: none;
}
.tip b {
  color: #fff;
}
.tip .num {
  font-size: 0.78rem;
}

/* ---------- Code ---------- */
pre.code {
  position: relative;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(2 6 11 / 0.8);
  overflow-x: auto;
  font: 400 0.84rem/1.65 var(--mono);
  color: #d6e2ee;
  tab-size: 4;
}
pre.code .c {
  color: var(--faint);
}
pre.code .k {
  color: #f0a6ff;
}
pre.code .s {
  color: #a5e3b3;
}
pre.code .n {
  color: #ffc98b;
}
pre.code .f {
  color: #8fdcf8;
}
pre.code .t {
  color: #ffd580;
}
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.9rem;
}

/* ---------- Closing ---------- */
.close {
  position: relative;
  overflow: clip;
  border-top: 1px solid var(--line);
  padding-block: clamp(5rem, 11vw, 9rem);
  background: radial-gradient(60rem 30rem at 80% 0%, rgb(92 200 242 / 0.08), transparent 70%);
}
.close .lede {
  max-width: 46rem;
  margin-top: 1.4rem;
}
.get {
  display: grid;
  gap: 1.2rem;
  margin-top: clamp(2.4rem, 5vw, 3.6rem);
}
@media (min-width: 1000px) {
  .get {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.get > div {
  min-width: 0;
  padding: 1.4rem var(--inset) 1.5rem;
  border: 1px solid var(--line-2);
  border-radius: 1.3rem;
  background: rgb(5 10 18 / 0.8);
}
.get h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.get h3 svg {
  width: 1.35rem;
  height: 1.35rem;
  color: var(--accent);
}
.get .crab {
  color: var(--rust);
}
.get p {
  margin: 0.6rem 0 1rem;
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--muted);
}
.limits {
  margin-top: clamp(2.4rem, 5vw, 3.6rem);
}
.limits h3 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.4rem;
}
.limits ul {
  display: grid;
  gap: 0.1rem;
  margin-top: 0.8rem;
}
@media (min-width: 900px) {
  .limits ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 2.4rem;
  }
}
.limits li {
  position: relative;
  padding: 0.7rem 0 0.7rem 1.4rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--soft);
}
.limits li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 1.25rem;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 1px;
  transform: rotate(45deg);
  background: var(--warn);
}
.fine {
  margin-top: 1.6rem;
  font-size: 0.86rem;
  color: var(--faint);
  max-width: 52rem;
}

/* ---------- dropin.css ---------- */
/* ---------- The surface: every name in numpy.__all__ ---------- */
.field.filter {
  flex: 1 1 16rem;
  max-width: 24rem;
}
.surface-count {
  margin-left: auto;
  font: 500 0.82rem/1.4 var(--mono);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.surface-count::after {
  content: " names";
}
.surface-grid {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.3rem;
  height: 26rem;
  padding: 0.6rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.25);
  scrollbar-width: thin;
}
@media (max-width: 640px) {
  .surface-grid {
    height: 24rem;
  }
}
.surface-grid.empty::after {
  content: "No name matches. Try a shorter piece of it.";
  padding: 0.6rem;
  font-size: 0.9rem;
  color: var(--muted);
}
.nm {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  min-height: 1.9rem;
  padding: 0.15rem 0.55rem 0.15rem 0.3rem;
  border: 1px solid transparent;
  border-radius: 0.5rem;
  font: 500 0.78rem/1.3 var(--mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition:
    border-color 0.15s,
    background-color 0.15s,
    color 0.15s;
}
.nm i {
  flex: none;
  min-width: 1.85rem;
  padding: 0.05rem 0.25rem;
  border-radius: 0.3rem;
  font: 600 0.62rem/1.4 var(--mono);
  font-style: normal;
  letter-spacing: 0.04em;
  text-align: center;
}
.nm.fnp {
  background: rgb(92 200 242 / 0.1);
  color: #cdeffc;
}
.nm.fnp i {
  background: rgb(92 200 242 / 0.2);
  color: var(--accent);
}
.nm.numpy {
  background: rgb(143 161 184 / 0.07);
  color: var(--muted);
}
.nm.numpy i {
  background: rgb(143 161 184 / 0.14);
  color: var(--numpy);
}
.nm:hover,
.nm[aria-pressed="true"] {
  border-color: var(--line-3);
  color: #fff;
}
.nm.fnp:hover,
.nm.fnp[aria-pressed="true"] {
  border-color: var(--accent);
}
.nm:focus-visible {
  outline-offset: 1px;
}
.surface-detail {
  min-height: 3.2em;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--soft);
}
.surface-detail .sep {
  margin: 0 0.5rem;
  color: var(--faint);
}
.surface-detail .who.fnp {
  color: #bfe9fb;
}
.surface-legend .kinds::before {
  display: none;
}
.surface-legend .kinds {
  color: var(--faint);
}
.surface-legend .kinds b {
  margin: 0 0.25rem 0 0.6rem;
  font: 600 0.68rem var(--mono);
  color: var(--soft);
}
.surface-legend .kinds b:first-child {
  margin-left: 0;
}

/* ---------- NumPy's own tests, with the swap made ---------- */
.suite-tally {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}
.suite-tally .read.big {
  grid-column: span 2;
}
@media (max-width: 520px) {
  .suite-tally {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .suite-tally .read {
    padding: 0.7rem 0.8rem 0.8rem;
  }
  .suite-tally .read b {
    font-size: 1.1rem;
  }
}
.suite-tally .read.big b {
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--ok);
}
.suite-tally .read.big b span {
  font-size: 0.6em;
  color: var(--muted);
}
.suite-map {
  position: relative;
  min-height: 20rem;
  border-radius: 0.9rem;
  overflow: hidden;
  background: rgb(0 0 0 / 0.3);
}
.suite-map .pkg {
  position: absolute;
  border: 1px solid var(--line-2);
  border-radius: 0.4rem;
  pointer-events: none;
}
.pkg-name {
  position: absolute;
  top: 1px;
  left: 6px;
  right: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 600 0.66rem/16px var(--mono);
  letter-spacing: 0.06em;
  color: var(--soft);
}
.st {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.1rem;
  padding: 0.25rem 0.35rem;
  border: 0;
  border-radius: 0.25rem;
  overflow: hidden;
  text-align: left;
  font: 500 0.7rem/1.2 var(--mono);
  color: #052514;
  transition: filter 0.15s;
}
.st {
  background: color-mix(in srgb, var(--ok) 72%, #06140c);
}
/* Tests that differ: a band at the foot of the tile, striped as well as coloured so it reads without colour. */
.st-diff {
  position: absolute;
  inset: auto 0 0;
  background:
    repeating-linear-gradient(135deg, rgb(0 0 0 / 0.28) 0 3px, transparent 3px 7px),
    var(--warn);
  box-shadow: 0 -1px 0 rgb(0 0 0 / 0.35);
}
.st:hover,
.st:focus-visible {
  filter: brightness(1.18);
  outline: 2px solid #fff;
  outline-offset: -2px;
  z-index: 1;
}
.st-name {
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Dark on the tile's green, at full strength: 5.9:1 rather than the 3.7:1 a faded label gave. */
.st-n {
  color: #021309;
  font-size: 0.68rem;
  white-space: nowrap;
}
#fig-suite .legend .k-ok {
  --k: color-mix(in srgb, var(--ok) 72%, #06140c);
}
#fig-suite .legend .k-warn::before {
  background:
    repeating-linear-gradient(135deg, rgb(0 0 0 / 0.3) 0 2px, transparent 2px 4px),
    var(--warn);
}

/* ---------- Three ways a name gets answered ---------- */
.tiers {
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  overflow: hidden;
  background: var(--line);
}
@media (min-width: 1000px) {
  .tiers {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.tiers li {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.5rem var(--inset) 1.6rem;
  background: var(--raise);
}
.tiers .num {
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--chapter);
}
.tiers b {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  color: #fff;
}
.tiers p {
  font-size: 0.93rem;
  line-height: 1.6;
  color: var(--soft);
}
.tiers .eg {
  margin-top: auto;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--line-2);
  font-size: 0.84rem;
  color: var(--muted);
}

/* ---------- exact.css ---------- */
/* ---------- Exact: shared ---------- */
.k-b {
  --k: #a9b6c6;
}
.k-i {
  --k: #5cc8f2;
}
.k-u {
  --k: #2dd4bf;
}
.k-f {
  --k: #fbbf24;
}
.k-c {
  --k: #c4a7ff;
}
.draws-tally,
.promo-tally,
.npy-verdict {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
}
.draws-tally b,
.promo-tally b,
.npy-verdict b {
  font-weight: 650;
}
.draws-tally b.all,
.promo-tally b.all,
.npy-verdict b.all {
  color: var(--ok);
}
.draws-tally b.some,
.promo-tally b.some,
.npy-verdict b.some {
  color: var(--warn);
}
.draws-tally .ms,
.promo-tally .ms,
.npy-verdict .ms {
  display: inline-block;
  margin-left: 0.4rem;
  font: 500 0.76rem/1.4 var(--mono);
  color: var(--faint);
}

/* ---------- Random streams ---------- */
.seed-pick {
  min-width: 0;
}
.seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.seed-row .preset {
  font-family: var(--mono);
  font-weight: 500;
}
.seed-field {
  width: 9.5rem;
  min-height: 2.4rem;
  border-radius: 99rem;
  font-size: 0.86rem;
}
.seed-field[data-bad] {
  border-color: var(--refuse);
}
pre.code.call {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.82rem;
}
.draws {
  border-top: 1px solid var(--line-2);
}
.draw-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) minmax(0, 1fr) 1.8rem;
  align-items: center;
  gap: 0.15rem 1.2rem;
  padding: 0.5rem 0.4rem;
  border-bottom: 1px solid var(--line);
}
.draws.solo .draw-row {
  grid-template-columns: 2rem minmax(0, 1fr);
}
.draw-head {
  padding-block: 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--soft);
}
.draw-head small {
  font-weight: 400;
  color: var(--faint);
}
.draw-row.off {
  background: rgb(251 113 133 / 0.06);
}
.draw-row .idx {
  font: 500 0.78rem var(--mono);
  color: var(--faint);
}
.draw-row .val {
  min-width: 0;
}
.draw-row .val b {
  display: block;
  font: 500 0.94rem/1.35 var(--mono);
  font-variant-numeric: tabular-nums;
  color: #fff;
  overflow-wrap: anywhere;
}
.draw-row .val.theirs b {
  color: var(--soft);
}
.draw-row .bits {
  display: block;
  margin-top: 0.1rem;
  padding: 0;
  background: none;
  font: 400 0.74rem/1.3 var(--mono);
  letter-spacing: 0.05em;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.draw-row .bits mark {
  border-radius: 2px;
  background: rgb(251 113 133 / 0.3);
  color: #fff;
}
.draw-row .who {
  display: none;
}
.draw-row .mark {
  font-weight: 700;
  text-align: center;
  color: var(--ok);
}
.draw-row.off .mark {
  color: var(--refuse);
}
@media (max-width: 640px) {
  .draw-row {
    grid-template-columns: 1.4rem minmax(0, 1fr) 1.4rem;
    grid-template-areas: "i a m" ". b m";
    gap: 0.35rem 0.7rem;
  }
  .draws.solo .draw-row {
    grid-template-columns: 1.4rem minmax(0, 1fr);
    grid-template-areas: "i a";
  }
  .draw-row .idx {
    grid-area: i;
    align-self: start;
    padding-top: 0.15rem;
  }
  .draw-row .ours {
    grid-area: a;
  }
  .draw-row .theirs {
    grid-area: b;
  }
  .draw-row .mark {
    grid-area: m;
  }
  .draw-head span:nth-child(3),
  .draw-head span:nth-child(4) {
    display: none;
  }
  .draw-head {
    grid-template-columns: 1.4rem minmax(0, 1fr);
    grid-template-areas: none;
  }
  .draws:not(.solo) .draw-row .who {
    display: inline-block;
    width: 3.2rem;
    font: 500 0.68rem var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
  }
  .draws:not(.solo) .draw-row .val b {
    display: inline;
  }
  .draws:not(.solo) .draw-row .bits {
    padding-left: 3.2rem;
    font-size: 0.7rem;
  }
  .draw-row .val b {
    font-size: 0.86rem;
  }
}

/* ---------- Type promotion ---------- */
.promo {
  display: grid;
  gap: 1.6rem 2rem;
}
@media (min-width: 1100px) {
  .promo {
    grid-template-columns: minmax(0, 1fr) 18.5rem;
    align-items: start;
  }
}
.promo-table {
  padding-bottom: 0.3rem;
}
.promo-grid {
  display: grid;
  grid-template-columns: 2.6rem repeat(var(--n), minmax(2.35rem, 1fr));
  gap: 3px;
  min-width: 38rem;
}
.promo-grid .corner,
.promo-grid .ch,
.promo-grid .rh {
  display: grid;
  place-items: center;
  min-height: 2rem;
  font: 600 0.72rem var(--mono);
  color: color-mix(in srgb, var(--k, var(--muted)) 70%, #fff);
  transition: color 0.15s;
}
.promo-grid .corner {
  color: var(--faint);
}
.promo-grid .ch.line,
.promo-grid .rh.line {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--k);
  text-underline-offset: 0.3em;
}
.promo-grid .cell {
  min-height: 2.35rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0.4rem;
  background: color-mix(in srgb, var(--k) 13%, transparent);
  font: 500 0.72rem var(--mono);
  color: color-mix(in srgb, var(--k) 62%, #fff);
  transition:
    background-color 0.15s,
    color 0.15s;
}
.promo-grid .cell.line {
  background: color-mix(in srgb, var(--k) 24%, transparent);
  color: #fff;
}
.promo-grid .cell.on {
  background: color-mix(in srgb, var(--k) 42%, transparent);
  color: #fff;
  box-shadow: 0 0 0 2px #fff;
}
.promo-grid .cell.off {
  border-color: var(--refuse);
}
.promo-grid .cell:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 1px;
  border-radius: 0.4rem;
}
.promo-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}
.promo-pick {
  min-height: 9.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.25);
}
.promo-pick .formula {
  font: 600 1.12rem/1.4 var(--mono);
  color: #fff;
}
.promo-pick .formula .dt {
  color: color-mix(in srgb, var(--k) 70%, #fff);
}
.promo-pick .op {
  color: var(--faint);
}
.promo-pick .agree {
  margin-top: 0.55rem;
  font: 500 0.8rem/1.45 var(--mono);
}
.promo-pick .agree.yes {
  color: var(--ok);
}
.promo-pick .agree.no {
  color: var(--refuse);
}
.promo-pick .reason {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
}
.promo-names {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- .npy bytes ---------- */
.r-magic {
  --k: #c4a7ff;
}
.r-version {
  --k: #f2884b;
}
.r-hlen {
  --k: #fbbf24;
}
.r-dict {
  --k: #5cc8f2;
}
.r-pad {
  --k: #73849a;
}
.r-payload {
  --k: #e6eef7;
}
.npy-legend li::before {
  background: var(--k);
}
.npy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.4rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.npy-meta b {
  font: 600 0.95rem var(--mono);
  color: #fff;
}
.npy-meta .note {
  flex-basis: 100%;
  font-size: 0.84rem;
  color: var(--faint);
}
.npy-dump {
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(2 6 11 / 0.8);
}
.npy-dump .dump {
  display: grid;
  gap: 0.15rem;
  width: max-content;
  font: 400 0.8rem/1.6 var(--mono);
}
.npy-dump .dump-row {
  display: grid;
  grid-template-columns: 3rem auto auto;
  gap: 1.2rem;
  align-items: baseline;
}
.npy-dump .dump-row .off {
  color: var(--faint);
}
.npy-dump .dump-row .hex {
  display: flex;
  gap: 0.42em;
}
.npy-dump .dump-row .b {
  width: 1.45em;
  text-align: center;
  color: color-mix(in srgb, var(--k) 85%, transparent);
}
.npy-dump .dump-row .b:nth-child(8n):not(:last-child) {
  margin-right: 0.55em;
}
.npy-dump .dump-row .b.r-pad {
  color: var(--faint);
}
.npy-dump .dump-row .asc {
  white-space: pre;
  letter-spacing: 0.02em;
}
.npy-dump .dump-row .asc span {
  color: color-mix(in srgb, var(--k) 70%, transparent);
}
.npy-dump .dump-row .diff {
  border-radius: 2px;
  background: rgb(251 113 133 / 0.35);
  color: #fff;
}
.npy-header {
  display: grid;
  gap: 0.35rem;
}
.npy-header code {
  font: 400 0.84rem/1.55 var(--mono);
  color: #8fdcf8;
  overflow-wrap: anywhere;
  background: none;
  padding: 0;
}
@media (max-width: 640px) {
  .npy-dump .dump {
    font-size: 0.74rem;
  }
  .npy-dump .dump-row {
    grid-template-columns: 2.4rem auto auto;
    gap: 0.7rem;
  }
  .npy-dump .dump-row .hex {
    gap: 0.3em;
  }
}

/* ---------- hardened.css ---------- */
/* ---------- Crafted files ---------- */
.hostile {
  display: grid;
  /* An explicit track that may shrink: an implicit one would grow to the hex dump's unwrapped width. */
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem 2rem;
  min-width: 0;
}
@media (min-width: 1000px) {
  .hostile {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    align-items: start;
  }
}
.hostile .files {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.hostile .file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 2.75rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 0.8rem;
  background: none;
  text-align: left;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--muted);
  transition:
    color 0.2s,
    background-color 0.2s,
    border-color 0.2s;
}
.hostile .file .num {
  flex: none;
  font-size: 0.74rem;
  color: var(--faint);
}
.hostile .file:hover {
  color: #fff;
  background: rgb(255 255 255 / 0.035);
}
.hostile .file[aria-pressed="true"] {
  color: #fff;
  border-color: color-mix(in srgb, var(--chapter) 45%, transparent);
  background: color-mix(in srgb, var(--chapter) 10%, transparent);
}
.hostile .file[aria-pressed="true"] .num {
  color: var(--chapter);
}
/* Below the desktop layout the list becomes a strip that scrolls on its own, never the page. */
@media (max-width: 999px) {
  .hostile .files {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding-bottom: 0.4rem;
    scrollbar-width: thin;
  }
  .hostile .files li {
    flex: none;
    scroll-snap-align: start;
  }
  .hostile .file {
    width: auto;
    white-space: nowrap;
    border-color: var(--line-2);
    border-radius: 99rem;
    padding-inline: 0.9rem;
  }
}
.hostile-out {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.1rem;
  min-width: 0;
}
.hostile-out .what {
  max-width: 46rem;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--soft);
}
.hostile-out .what b {
  color: #fff;
  font-weight: 650;
}
.hostile .hx-box {
  min-width: 0;
}
.hexdump {
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgb(1 5 10 / 0.75);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  font: 400 0.8rem/1.75 var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.hx-row {
  display: flex;
  gap: 1.1rem;
}
.hx-row .off {
  flex: none;
  color: var(--faint);
  opacity: 0.8;
}
.hx-row .hx {
  display: inline-flex;
  gap: 0.42em;
  flex: none;
}
.hx-row .asc {
  display: inline-flex;
  flex: none;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.hexdump .b,
.hexdump .a {
  border-radius: 0.2rem;
  color: #b9c7d6;
}
.hexdump .b.pad {
  visibility: hidden;
}
.hexdump .magic {
  color: #9ddff8;
  background: rgb(92 200 242 / 0.12);
}
.hexdump .sig {
  color: #b9c8ff;
  background: rgb(111 149 255 / 0.15);
}
.hexdump .len {
  color: #fde68a;
  background: rgb(251 191 36 / 0.14);
}
.hexdump .hot {
  color: #fff;
  background: color-mix(in srgb, var(--chapter) 42%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--chapter) 70%, transparent);
}
.hx-gap {
  padding: 0.15rem 0 0.15rem 3.4rem;
  color: var(--faint);
  font-style: italic;
}
.hx-legend {
  margin-top: 0.7rem;
}
.hx-legend .hk-magic {
  --k: rgb(92 200 242 / 0.55);
}
.hx-legend .hk-sig {
  --k: rgb(111 149 255 / 0.6);
}
.hx-legend .hk-len {
  --k: rgb(251 191 36 / 0.6);
}
.hx-legend .hk-hot {
  --k: var(--chapter);
}
.hx-legend .size {
  margin-left: auto;
  font-family: var(--mono);
  color: var(--faint);
}
.hx-legend .size::before {
  content: none;
}
.hostile-out .hdr {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}
.hostile-out .hdr code {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 0.7rem;
  background: rgb(170 205 240 / 0.05);
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--soft);
  overflow-wrap: anywhere;
}
.hostile-out .hdr mark {
  padding: 0.05em 0.15em;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--chapter) 38%, transparent);
  color: #fff;
}
.verdicts-2 {
  display: grid;
  gap: 0.8rem;
}
@media (min-width: 640px) {
  .verdicts-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.verdict-panel {
  --tone: var(--line-3);
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-width: 0;
  padding: 0.95rem 1.05rem 1rem;
  border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent);
  border-radius: 1rem;
  background: color-mix(in srgb, var(--tone) 7%, rgb(0 0 0 / 0.25));
}
.verdict-panel.ok {
  --tone: var(--ok);
}
.verdict-panel.refuse {
  --tone: var(--refuse);
}
.verdict-panel .who {
  font: 500 0.74rem/1.4 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--soft);
}
.verdict-panel .who span {
  color: var(--faint);
  text-transform: none;
  letter-spacing: 0.02em;
}
.verdict-panel .state {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}
.verdict-panel.ok .state,
.verdict-panel.refuse .state {
  color: color-mix(in srgb, var(--tone) 75%, #fff);
}
.verdict-panel .state svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}
.verdict-panel.wait .state {
  color: var(--muted);
  font-weight: 600;
}
.verdict-panel .detail {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--soft);
  overflow-wrap: anywhere;
}
.verdict-panel .detail code {
  font-size: 0.82rem;
}
.verdict-panel .code {
  display: inline-block;
  margin-top: 0.15rem;
  padding: 0.05rem 0.45rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  font: 500 0.74rem/1.5 var(--mono);
  color: var(--muted);
}
.verdict-panel .msg {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}
.verdict-panel .ms {
  margin-top: 0.2rem;
  font: 500 0.72rem/1.4 var(--mono);
  color: var(--faint);
}
.hostile-out .contrast {
  max-width: 48rem;
  padding-left: 0.9rem;
  border-left: 2px solid var(--chapter);
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text);
}

/* ---------- Strict and hardened ---------- */
.guards {
  display: grid;
  gap: 0.8rem;
}
@media (min-width: 900px) {
  .guards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.guard {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  min-width: 0;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
}
.guard-head {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.guard .call {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.65rem;
  background: rgb(170 205 240 / 0.06);
  font-size: 0.82rem;
  line-height: 1.55;
  color: #e8f1fa;
  overflow-wrap: anywhere;
}
.guard .row-id {
  font: 500 0.7rem/1.3 var(--mono);
  letter-spacing: 0.04em;
  color: var(--faint);
  overflow-wrap: anywhere;
}
.guard .out {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--soft);
}
.mode-tag {
  display: inline-block;
  margin-right: 0.55rem;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  font: 600 0.7rem/1.6 var(--mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  vertical-align: 0.08em;
}
.guard .out.hardened .mode-tag {
  border-color: color-mix(in srgb, var(--chapter) 55%, transparent);
  color: color-mix(in srgb, var(--chapter) 70%, #fff);
}
.guard .out.hardened code {
  display: block;
  margin-top: 0.5rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 35%, transparent);
  border-radius: 0.65rem;
  background: color-mix(in srgb, var(--chapter) 9%, rgb(0 0 0 / 0.3));
  font-size: 0.8rem;
  line-height: 1.55;
  color: #ffd9df;
  overflow-wrap: anywhere;
}
.guards .out {
  transition: opacity 0.16s ease;
}
.guards.fading .out {
  opacity: 0;
}
@media (prefers-reduced-motion: reduce) {
  .guards .out {
    transition: none;
  }
}

/* ---------- Where unsafe lives ---------- */
.cb-list {
  display: grid;
  gap: 0.15rem;
}
.cb {
  display: grid;
  grid-template-columns: minmax(10rem, 17rem) minmax(0, 1fr) 5.2rem;
  align-items: center;
  gap: 0.4rem 1rem;
  padding: 0.45rem 0.6rem;
  border-radius: 0.7rem;
  cursor: default;
  transition: background-color 0.2s;
}
.cb:hover,
.cb.on {
  background: rgb(255 255 255 / 0.04);
}
.cb:focus-visible {
  outline-offset: 1px;
}
.cb-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  min-width: 0;
}
.cb-name code {
  padding: 0;
  background: none;
  font-size: 0.86rem;
  color: #fff;
}
.cb-badge {
  padding: 0.02rem 0.45rem;
  border: 1px solid rgb(74 222 128 / 0.35);
  border-radius: 99rem;
  font: 500 0.66rem/1.6 var(--mono);
  color: #a7f3c4;
  white-space: nowrap;
}
.cb-badge.edge {
  border-color: rgb(242 136 75 / 0.45);
  color: #f9c19d;
}
.cb-track {
  position: relative;
  height: 0.75rem;
  border-radius: 99rem;
  background: rgb(170 205 240 / 0.06);
  overflow: hidden;
}
.cb-track i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 99rem;
  background: linear-gradient(90deg, rgb(74 222 128 / 0.55), var(--ok));
}
.cb.edge .cb-track i {
  background: linear-gradient(90deg, rgb(242 136 75 / 0.6), var(--rust));
}
.cb-num {
  text-align: right;
  font-size: 0.8rem;
  color: var(--muted);
}
.cb.on .cb-num {
  color: #fff;
}
@media (max-width: 640px) {
  .cb {
    grid-template-columns: minmax(0, 1fr) auto;
    padding-inline: 0.2rem;
  }
  .cb-name {
    grid-column: 1 / -1;
  }
  .cb-track {
    grid-column: 1;
  }
}
.cb-detail {
  min-height: 3.1em;
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--soft);
}
.cb-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.4rem;
}
.cb-scale {
  font-size: 0.8rem;
  color: var(--faint);
}

/* ---------- proof.css ---------- */
/* ---------- Four layers: plant a bug ---------- */
.layers {
  display: grid;
  gap: 1.3rem;
}
.bugs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.layers .preset:hover,
.layers .preset[aria-pressed="true"] {
  border-color: var(--chapter);
  background: color-mix(in srgb, var(--chapter) 10%, transparent);
}
.layer-list {
  display: grid;
  gap: 0.6rem;
}
@media (min-width: 900px) {
  .layer-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.layer-list li {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 1rem 1.05rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  background: rgb(0 0 0 / 0.22);
  transition:
    border-color 0.45s var(--ease),
    background-color 0.45s var(--ease),
    opacity 0.45s var(--ease);
}
.layer-list b {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}
.layer-list p {
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
.verdict-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  align-self: flex-start;
  margin-top: auto;
  padding: 0.25rem 0.7rem 0.25rem 0.5rem;
  border: 1px solid var(--line-2);
  border-radius: 99rem;
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--faint);
}
.verdict-chip svg {
  width: 0.95rem;
  height: 0.95rem;
}
.layer-list li.passed {
  opacity: 0.62;
}
.layer-list li.caught {
  border-color: color-mix(in srgb, var(--ok) 60%, transparent);
  background: color-mix(in srgb, var(--ok) 8%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ok) 25%, transparent) inset;
}
.layer-list li.caught .verdict-chip {
  border-color: var(--ok);
  background: color-mix(in srgb, var(--ok) 14%, transparent);
  color: var(--ok);
}
/* The bug passes down the layers in order: each verdict lands a beat after the last. */
@media (prefers-reduced-motion: no-preference) {
  .fig.run .layer-list li {
    animation: layer-in 0.5s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 0.14s);
  }
  .fig.run .layer-list li.caught .verdict-chip {
    animation: chip-in 0.6s var(--ease) both;
    animation-delay: calc(var(--i, 0) * 0.14s + 0.18s);
  }
}
@keyframes layer-in {
  from {
    opacity: 0.25;
    transform: translateY(6px);
  }
}
@keyframes chip-in {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
}
.bug-note {
  min-height: 3.2em;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--soft);
}
.bug-note b {
  color: #fff;
}

/* ---------- Nine gates, cheapest first ---------- */
.gates {
  position: relative;
  display: grid;
  gap: 0.7rem;
  counter-reset: gate;
}
@media (min-width: 640px) {
  .gates {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) {
  .gates {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.gates li {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.3rem 0.85rem;
  align-items: baseline;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line-2);
  border-radius: 1rem;
  /* Heavier gates sit on a slightly stronger tint, cheapest to heaviest. */
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--chapter) calc(var(--w, 0) * 1%), transparent),
    transparent 75%
  );
}
.gates li:nth-child(1) { --w: 2; }
.gates li:nth-child(2) { --w: 3; }
.gates li:nth-child(3) { --w: 4; }
.gates li:nth-child(4) { --w: 5; }
.gates li:nth-child(5) { --w: 6; }
.gates li:nth-child(6) { --w: 7; }
.gates li:nth-child(7) { --w: 8; }
.gates li:nth-child(8) { --w: 9; }
.gates li:nth-child(9) { --w: 10; }
.gates .num {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid color-mix(in srgb, var(--chapter) 45%, transparent);
  border-radius: 0.7rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--chapter);
}
.gates b {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #fff;
}
.gates p {
  grid-column: 2;
  font-size: 0.86rem;
  line-height: 1.55;
  color: var(--muted);
}
/* Arrows between consecutive gates, along the reading direction. */
.gates li:not(:last-child)::after {
  content: "";
  position: absolute;
  width: 0.5rem;
  height: 0.5rem;
  border: solid var(--line-3);
  border-width: 1.5px 1.5px 0 0;
  left: 50%;
  bottom: -0.55rem;
  transform: translateX(-50%) rotate(135deg);
}
@media (min-width: 640px) {
  .gates li:not(:last-child)::after {
    left: auto;
    right: -0.55rem;
    top: 1.75rem;
    bottom: auto;
    transform: rotate(45deg);
  }
  .gates li:nth-child(2n)::after {
    display: none;
  }
}
@media (min-width: 1000px) {
  .gates li:nth-child(2n)::after {
    display: block;
  }
  .gates li:nth-child(3n)::after {
    display: none;
  }
}
.aside {
  max-width: 52rem;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- The divergence ledger ---------- */
.ledger {
  display: grid;
  gap: 0.5rem;
}
.ledger .row {
  border: 1px solid var(--line-2);
  border-radius: 0.95rem;
  background: rgb(0 0 0 / 0.2);
  transition: border-color 0.2s;
}
.ledger .row.own {
  --tone: var(--chapter);
}
.ledger .row.up {
  --tone: var(--warn);
}
.ledger .row:hover,
.ledger .row[open] {
  border-color: color-mix(in srgb, var(--tone) 55%, transparent);
}
.ledger summary {
  display: grid;
  grid-template-columns: minmax(0, auto) auto;
  gap: 0.35rem 0.9rem;
  align-items: center;
  padding: 0.85rem 1rem 0.85rem 2.2rem;
  position: relative;
  cursor: pointer;
  list-style: none;
}
.ledger summary::-webkit-details-marker {
  display: none;
}
.ledger summary::before {
  content: "";
  position: absolute;
  left: 1rem;
  top: 1.25rem;
  width: 0.45rem;
  height: 0.45rem;
  border: solid var(--muted);
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(-45deg);
  transition: transform 0.25s var(--ease);
}
.ledger .row[open] summary::before {
  transform: rotate(45deg);
}
.ledger summary code {
  background: none;
  padding: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--tone) 60%, #fff);
  overflow-wrap: anywhere;
}
.ledger .disp {
  justify-self: end;
  padding: 0.15rem 0.6rem;
  border: 1px solid color-mix(in srgb, var(--tone) 40%, transparent);
  border-radius: 99rem;
  background: color-mix(in srgb, var(--tone) 9%, transparent);
  font-size: 0.74rem;
  font-weight: 650;
  white-space: nowrap;
  color: color-mix(in srgb, var(--tone) 55%, #fff);
}
.ledger .what {
  grid-column: 1 / -1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--soft);
}
.ledger dl {
  display: grid;
  grid-template-columns: 7.5rem minmax(0, 1fr);
  gap: 0.6rem 1rem;
  padding: 0.2rem 1rem 1.1rem 2.2rem;
  font-size: 0.86rem;
  line-height: 1.58;
}
.ledger dt {
  font: 500 0.72rem/1.9 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.ledger dd {
  color: var(--soft);
  overflow-wrap: anywhere;
}
@media (max-width: 560px) {
  .ledger summary {
    grid-template-columns: 1fr;
  }
  .ledger .disp {
    justify-self: start;
  }
  .ledger dl {
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding-left: 1rem;
  }
  .ledger dd + dt {
    margin-top: 0.6rem;
  }
}

/* ---------- rust.css ---------- */
/* ---------- Rust: the crate map ---------- */
.crates {
  display: grid;
  gap: 1.4rem;
}
@media (min-width: 1100px) {
  .crates {
    grid-template-columns: minmax(0, 1fr) 20rem;
    align-items: start;
  }
}
.crate-map {
  position: relative;
  display: grid;
  gap: 2.2rem;
}
.crate-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.crate-lines path {
  fill: none;
  stroke: rgb(170 205 240 / 0.13);
  stroke-width: 1.2;
}
.crate-lines path.uses {
  stroke: var(--chapter);
  stroke-width: 2;
  opacity: 0.9;
}
.crate-lines path.usedby {
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-dasharray: 5 4;
  opacity: 0.85;
}
.crate-layer {
  position: relative;
  z-index: 1;
}
.crate-layer .micro {
  display: table;
  margin: 0 auto 0.6rem;
  padding: 0.1rem 0.6rem;
  border-radius: 0.4rem;
  background: #050a12;
  font-size: 0.68rem;
  color: var(--faint);
}
.crate-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
}
.crate-tile {
  position: relative;
  display: grid;
  gap: 0.2rem;
  min-width: 9.5rem;
  padding: 0.7rem 0.95rem 0.75rem;
  border: 1px solid var(--line-2);
  border-radius: 0.95rem;
  background: #07101b;
  text-align: left;
  color: inherit;
  transition:
    border-color 0.2s,
    background-color 0.2s,
    opacity 0.2s,
    transform 0.35s var(--ease);
}
.crate-tile b {
  font: 600 0.9rem/1.2 var(--mono);
  color: #fff;
}
.crate-tile .meta {
  font-size: 0.74rem;
  color: var(--muted);
}
.crate-tile .meta .num {
  color: var(--muted);
}
.crate-tile .rel {
  font: 500 0.68rem/1.2 var(--mono);
  letter-spacing: 0.04em;
  color: var(--chapter);
}
.crate-tile .rel:empty {
  display: none;
}
.crate-tile.boundary {
  border-style: dashed;
}
.crate-tile:hover {
  border-color: var(--line-3);
  transform: translateY(-1px);
}
.crate-tile[data-state="on"] {
  border-color: var(--chapter);
  background: color-mix(in srgb, var(--chapter) 13%, #07101b);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--chapter) 40%, transparent), 0 10px 30px -12px var(--chapter);
}
.crate-tile[data-state="dep"] {
  border-color: color-mix(in srgb, var(--chapter) 60%, transparent);
}
.crate-tile[data-state="user"] {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.crate-tile[data-state="user"] .rel {
  color: var(--accent);
}
.crate-card {
  padding: 1.2rem 1.25rem 1.3rem;
  border: 1px solid var(--line-2);
  border-radius: 1.1rem;
  background: rgb(0 0 0 / 0.25);
}
@media (min-width: 1100px) {
  .crate-card {
    position: sticky;
    top: 6rem;
  }
}
.crate-card .micro {
  margin-bottom: 0.3rem;
  font-size: 0.66rem;
  color: var(--chapter);
}
.crate-card h4 {
  font: 700 1.25rem/1.2 var(--mono);
  letter-spacing: -0.02em;
  color: #fff;
}
.crate-card .role {
  margin: 0.5rem 0 0.9rem;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--soft);
}
.crate-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0 0 0.9rem;
}
.crate-stats div {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
}
.crate-stats dt {
  font-size: 0.7rem;
  color: var(--faint);
}
.crate-stats dd {
  margin: 0;
  font-size: 0.95rem;
  color: #fff;
}
.links-to {
  margin: 0.35rem 0;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--muted);
}
.links-to span {
  display: inline-block;
  min-width: 4.2rem;
  color: var(--faint);
}
.links-to code {
  font-size: 0.78rem;
  white-space: nowrap;
}
.crate-card .safety {
  margin: 0.8rem 0 1rem;
  font-size: 0.84rem;
  line-height: 1.55;
  color: var(--muted);
}
.crate-card .install-chip {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
}
.crate-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
  font-size: 0.86rem;
}
@media (max-width: 719px) {
  .crate-map {
    gap: 1.2rem;
  }
  .crate-layer .micro {
    margin-left: 0;
    padding-left: 0;
  }
  .crate-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    gap: 0.45rem;
  }
  .crate-tile {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    width: 100%;
  }
  .crate-tile .meta {
    grid-column: 1;
  }
  .crate-tile .rel {
    grid-row: 1 / span 2;
    grid-column: 2;
  }
}

/* ---------- Rust: the code examples ---------- */
.codetabs .seg {
  margin-bottom: 1rem;
}
.codepane .micro {
  margin-bottom: 0.5rem;
  color: var(--chapter);
}
.codepane pre.code {
  font-size: 0.84rem;
  line-height: 1.7;
}
.codepane pre.code:focus-visible {
  outline-offset: 2px;
}

/* ---------- Rust: other crates ---------- */
table.compare {
  width: 100%;
  min-width: 40rem;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.55;
}
.compare th,
.compare td {
  padding: 0.9rem 1.2rem 0.9rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.compare thead th {
  padding-top: 0;
  font: 500 0.72rem/1.4 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom-color: var(--line-2);
}
.compare tbody th {
  font: 600 0.92rem var(--mono);
  white-space: nowrap;
}
.compare td {
  width: 44%;
  color: var(--soft);
}
.compare td:last-child {
  color: var(--muted);
}
/* Phones: each crate becomes a short card, the "use it instead when" line under what it is. */
@media (max-width: 699px) {
  table.compare {
    min-width: 0;
  }
  .compare thead {
    display: none;
  }
  .compare tr {
    display: block;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
  }
  .compare th,
  .compare td {
    display: block;
    width: auto;
    padding: 0;
    border: 0;
  }
  .compare tbody th {
    margin-bottom: 0.3rem;
  }
  .compare td:last-child {
    margin-top: 0.45rem;
  }
  .compare td:last-child::before {
    content: "Use it instead when: ";
    color: var(--faint);
  }
}

/* ---------- speed.css ---------- */
/* ---------- Speed: the scorecard ---------- */
.scorecard {
  --label: 17rem;
  display: grid;
  gap: 0.2rem;
}
.sc-axis,
.sc-row {
  display: grid;
  grid-template-columns: var(--label) minmax(0, 1fr);
  align-items: center;
  column-gap: 1rem;
}
.sc-axis {
  position: sticky;
  top: 4.3rem;
  z-index: 2;
  padding: 0.4rem 0 0.5rem;
  background: linear-gradient(180deg, rgb(5 10 18 / 0.97) 70%, rgb(5 10 18 / 0));
}
.sc-track {
  position: relative;
  display: block;
  height: 1.7rem;
}
.sc-axis .sc-track {
  height: 1.2rem;
}
.sc-tlabel {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font: 500 0.72rem/1.2 var(--mono);
  color: var(--faint);
  white-space: nowrap;
}
.sc-tlabel.one {
  color: var(--numpy);
  transform: translateX(-12%);
}
.sc-group {
  padding-top: 0.9rem;
}
.sc-group + .sc-group {
  margin-top: 0.4rem;
  border-top: 1px solid var(--line);
}
.sc-gname {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.25rem;
  font-size: 0.86rem;
}
.sc-gname b {
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}
.sc-gname span {
  font: 500 0.72rem var(--mono);
  color: var(--faint);
}
.sc-row {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.15rem 0;
  border: 0;
  border-radius: 0.5rem;
  background: none;
  text-align: left;
  color: inherit;
  cursor: default;
  transition: background-color 0.2s;
}
.sc-row:hover,
.sc-row:focus-visible {
  background: rgb(255 255 255 / 0.035);
}
.sc-label {
  min-width: 0;
  overflow-wrap: anywhere;
  font: 500 0.82rem/1.3 var(--mono);
  color: var(--soft);
}
.sc-tick {
  position: absolute;
  top: -0.25rem;
  bottom: -0.25rem;
  width: 1px;
  background: var(--line);
}
.sc-tick.one {
  width: 1.5px;
  background: var(--numpy);
  opacity: 0.75;
}
.sc-bar {
  position: absolute;
  top: 0.3rem;
  bottom: 0.3rem;
  border-radius: 0.3rem;
  background: linear-gradient(90deg, color-mix(in srgb, var(--chapter) 55%, transparent), var(--chapter));
  box-shadow: 0 0 18px -6px var(--chapter);
}
.sc-val {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding-left: 0.45rem;
  font: 600 0.78rem/1 var(--mono);
  color: #fff;
  white-space: nowrap;
}
.sc-row.far .sc-val {
  padding: 0 0.45rem 0 0;
  color: #1c1405;
}
.sc-row.tie .sc-bar {
  background: var(--numpy);
  box-shadow: none;
  opacity: 0.7;
}
.sc-row.tie .sc-val {
  font-weight: 500;
  color: var(--muted);
}
.sc-row.tie .sc-label {
  color: var(--muted);
}
@media (max-width: 760px) {
  .sc-axis,
  .sc-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 0.1rem;
  }
  .sc-axis .sc-label {
    display: none;
  }
  .sc-row {
    padding: 0.35rem 0;
  }
  .sc-label {
    white-space: normal;
  }
  .sc-axis {
    top: 3.6rem;
  }
}
@media (max-width: 480px) {
  .sc-tlabel:not(.one):nth-of-type(even) {
    display: none;
  }
}

/* ---------- Speed: the loss map ---------- */
.field.filter {
  flex: 1 1 15rem;
  max-width: 22rem;
}
.lossmap {
  position: relative;
  min-height: 18rem;
}
.lossmap canvas {
  display: block;
  width: 100%;
  touch-action: pan-y;
}
.lossmap .lm-empty {
  padding: 2rem 0;
  color: var(--muted);
}
.lossmap-reads .read b {
  font-size: 1.15rem;
}
.reads .read.k-band {
  border-left: 3px solid var(--k);
}
@media (max-width: 720px) {
  [data-fig="lossmap"] .reads {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  [data-fig="lossmap"] .read {
    padding: 0.7rem 0.8rem 0.75rem;
  }
}

/* ---------- Speed: whole jobs ---------- */
.jobs {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .jobs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.jobs li {
  display: grid;
  align-content: start;
  gap: 0.6rem;
  padding: 1.3rem 1.3rem 1.4rem;
  border: 1px solid var(--line-2);
  border-radius: 1.2rem;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.022), transparent 10rem), rgb(5 10 18 / 0.88);
}
.jobs .micro {
  margin: 0;
  letter-spacing: 0.08em;
}
.jobs b {
  font-size: 1.18rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: #fff;
}
.jobs .steps {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  color: var(--faint);
}
.jobs .range {
  margin-top: 0.3rem;
  font-size: 0.92rem;
  color: var(--soft);
}
.jobs .range .num {
  font-size: 1.5rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--chapter);
}
.jobs .job-bar {
  position: relative;
  display: block;
  height: 0.55rem;
  margin-top: 0.2rem;
  border-radius: 99rem;
  background:
    linear-gradient(90deg, transparent calc(20% - 1px), var(--numpy) calc(20% - 1px), var(--numpy) calc(20% + 1px), transparent calc(20% + 1px)),
    rgb(170 205 240 / 0.1);
}
.jobs .job-bar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--lo);
  width: calc(var(--hi) - var(--lo));
  min-width: 0.4rem;
  border-radius: 99rem;
  background: var(--chapter);
  box-shadow: 0 0 14px -3px var(--chapter);
}
.jobs .scale {
  position: relative;
  display: block;
  height: 1rem;
  font: 500 0.68rem/1 var(--mono);
  color: var(--faint);
}
.jobs .scale span {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  white-space: nowrap;
}
.jobs .scale span:last-child {
  transform: translateX(-100%);
}
.aside {
  max-width: 52rem;
  margin-top: 1.4rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--muted);
}
