/* apogee — NASA-punk. White hardware, graph paper, one retro stripe, small caps everywhere. */

:root {
  color-scheme: light;
  --paper: #ebe7dd;
  --panel: #f7f5ef;
  --panel-2: #e4dfd3;
  --ink: #16181b;
  --ink-2: #3b3e43;
  --mute: #7b776d;
  --rule: #cbc4b4;
  --edge: #16181b;
  --grid: rgb(22 24 27 / 0.05);
  --grid-major: rgb(22 24 27 / 0.085);
  --red: #e0402a;
  --red-ink: #b8301d;
  --red-wash: rgb(224 64 42 / 0.1);
  --s1: #d6352b;
  --s2: #ec7424;
  --s3: #f2b42b;
  --s4: #2c8d82;
  --s5: #2c5aa5;
  --hazard: #f2b42b;
  --screw: radial-gradient(circle at 40% 35%, #fff 0 1px, #b9b2a3 1.4px 3px, transparent 3.4px);
  --lift: 0 1px 0 rgb(255 255 255 / 0.8) inset, 0 1px 1px rgb(40 30 10 / 0.06), 0 12px 28px -18px rgb(40 30 10 / 0.35);
  --code-bg: #f1eee6;
  --font-sans: "Archivo", "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Consolas, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", monospace;
  /* display cut: Archivo widened, the NASA-manual / Starfield stance */
  --display-stretch: 116%;
  --rail-w: 272px;
  --top-h: 56px;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-snap: cubic-bezier(0.5, 0, 0.1, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) {
    color-scheme: dark;
    --paper: #101216;
    --panel: #171a1f;
    --panel-2: #1f2329;
    --ink: #ece7dc;
    --ink-2: #c4bfb3;
    --mute: #878379;
    --rule: #2d3138;
    --edge: #d9d4c8;
    --grid: rgb(236 231 220 / 0.035);
    --grid-major: rgb(236 231 220 / 0.06);
    --red: #ff5a3d;
    --red-ink: #ff7a61;
    --red-wash: rgb(255 90 61 / 0.12);
    --screw: radial-gradient(circle at 40% 35%, #5a5f68 0 1px, #2a2e35 1.4px 3px, transparent 3.4px);
    --lift: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 12px 30px -18px rgb(0 0 0 / 0.8);
    --code-bg: #13161a;
  }
}

:root[data-scheme="dark"] {
  color-scheme: dark;
  --paper: #101216;
  --panel: #171a1f;
  --panel-2: #1f2329;
  --ink: #ece7dc;
  --ink-2: #c4bfb3;
  --mute: #878379;
  --rule: #2d3138;
  --edge: #d9d4c8;
  --grid: rgb(236 231 220 / 0.035);
  --grid-major: rgb(236 231 220 / 0.06);
  --red: #ff5a3d;
  --red-ink: #ff7a61;
  --red-wash: rgb(255 90 61 / 0.12);
  --screw: radial-gradient(circle at 40% 35%, #5a5f68 0 1px, #2a2e35 1.4px 3px, transparent 3.4px);
  --lift: 0 1px 0 rgb(255 255 255 / 0.04) inset, 0 12px 30px -18px rgb(0 0 0 / 0.8);
  --code-bg: #13161a;
}

/* ---------- base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top-h) + 24px);
}

body {
  margin: 0;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  font-feature-settings: "tnum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

img,
svg {
  display: block;
  max-width: 100%;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

::selection {
  background: var(--red);
  color: #fff;
}

.ap-skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font: 600 12px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.ap-skip:focus {
  top: 12px;
}

.ap-label {
  margin: 0;
  color: var(--ink-2);
  font: 600 11px/1.3 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.ap-label--dim {
  color: var(--mute);
}

.ap-label__key {
  color: var(--red);
}

.ap-sep {
  color: var(--mute);
  padding: 0 0.15em;
}

.ap-ident__title,
.ap-placard__title,
.ap-dossier__title,
.ap-card__title,
.ap-year__head a,
.ap-lost__title,
.ap-route__title,
.ap-prose h2,
.ap-prose h3 {
  font-stretch: var(--display-stretch);
}

/* the stripe: five stacked bands, the one splash of colour */

.ap-stripe {
  display: grid;
  grid-template-rows: repeat(5, 2px);
  gap: 0;
  width: 100%;
}

.ap-stripe i {
  display: block;
}

.ap-stripe i:nth-child(1) { background: var(--s1); }
.ap-stripe i:nth-child(2) { background: var(--s2); }
.ap-stripe i:nth-child(3) { background: var(--s3); }
.ap-stripe i:nth-child(4) { background: var(--s4); }
.ap-stripe i:nth-child(5) { background: var(--s5); }

.ap-stripe--thin {
  height: 6px;
  background: linear-gradient(
    var(--s1) 0 20%, var(--s2) 20% 40%, var(--s3) 40% 60%, var(--s4) 60% 80%, var(--s5) 80% 100%
  );
}

.ap-hazard {
  display: inline-block;
  width: 56px;
  height: 10px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 5px, var(--ink) 5px 10px);
  border: 1px solid var(--ink);
}

/* ---------- shell ---------- */

.ap-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

.ap-scrim {
  display: none;
}

.ap-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* ---------- rail (sidebar) ---------- */

.ap-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 30;
  background: var(--panel);
  border-right: 1px solid var(--edge);
}

/* vertical stripe along the inner edge of the rail */
.ap-rail::after {
  content: "";
  position: absolute;
  top: 0;
  right: 10px;
  bottom: 0;
  width: 15px;
  background: linear-gradient(
    90deg, var(--s1) 0 20%, var(--s2) 20% 40%, var(--s3) 40% 60%, var(--s4) 60% 80%, var(--s5) 80% 100%
  );
  clip-path: inset(0 0 0 0);
  transform-origin: top;
  pointer-events: none;
}

.ap-rail__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 34px;
  scrollbar-width: none;
}

.ap-rail__inner::-webkit-scrollbar {
  display: none;
}

.ap-ident {
  position: relative;
  padding: 30px 0 26px 24px;
  border-bottom: 1px solid var(--edge);
}

.ap-ident .ap-label {
  margin-bottom: 18px;
}

.ap-ident__title {
  display: block;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.ap-ident__title:hover {
  color: var(--red);
}

.ap-ident__tag {
  margin: 10px 0 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.5;
}

/* calibration swatches */
.ap-ident__plate {
  display: flex;
  gap: 3px;
  margin-top: 20px;
}

.ap-ident__plate span {
  width: 14px;
  height: 14px;
  border: 1px solid var(--edge);
  background: var(--panel);
}

.ap-ident__plate span:nth-child(1) { background: var(--ink); }
.ap-ident__plate span:nth-child(2) { background: var(--mute); }
.ap-ident__plate span:nth-child(3) { background: var(--rule); }
.ap-ident__plate span:nth-child(4) { background: var(--paper); }
.ap-ident__plate span:nth-child(5) { background: var(--red); }

.ap-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-nav li {
  border-bottom: 1px solid var(--rule);
}

.ap-nav__link {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr 16px;
  align-items: center;
  height: 46px;
  padding: 0 18px 0 24px;
  overflow: hidden;
  transition: background-color 0.18s;
}

.ap-nav__idx {
  color: var(--mute);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.06em;
  transition: color 0.18s;
}

.ap-nav__label {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ap-nav__tick {
  justify-self: end;
  width: 10px;
  height: 2px;
  background: var(--ink);
  transform: translateX(36px);
  transition: transform 0.28s var(--ease);
}

.ap-nav__link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--red);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform 0.3s var(--ease-snap);
}

.ap-nav__link:hover {
  background: var(--panel-2);
}

.ap-nav__link:hover .ap-nav__idx {
  color: var(--red);
}

.ap-nav__link:hover .ap-nav__tick {
  transform: none;
}

.ap-nav__link[aria-current="page"] {
  background: var(--panel-2);
}

.ap-nav__link[aria-current="page"]::before {
  transform: none;
}

.ap-nav__link[aria-current="page"] .ap-nav__idx {
  color: var(--red);
}

/* status lamp on the current item */
.ap-nav__link[aria-current="page"] .ap-nav__tick {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px var(--red-wash);
  transform: none;
  animation: ap-lamp 2.8s ease-in-out infinite;
}

.ap-rail__foot {
  margin-top: auto;
  padding: 22px 0 22px 24px;
  display: grid;
  gap: 14px;
}

.ap-met {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--edge);
  background: var(--paper);
}

.ap-met .ap-label {
  color: var(--red);
}

.ap-met__value {
  font: 500 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  text-align: right;
  white-space: nowrap;
}

.ap-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.ap-seg {
  display: inline-flex;
  border: 1px solid var(--edge);
}

.ap-seg__opt {
  padding: 6px 9px;
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
  color: var(--mute);
  transition: background-color 0.18s, color 0.18s;
}

.ap-seg__opt + .ap-seg__opt {
  border-left: 1px solid var(--edge);
}

.ap-seg__opt:hover {
  color: var(--ink);
}

.ap-seg__opt[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

.ap-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.12em;
  cursor: pointer;
}

.ap-switch__track {
  position: relative;
  width: 34px;
  height: 18px;
  border: 1px solid var(--edge);
  background: var(--panel-2);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.12);
}

.ap-switch__knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: var(--ink);
  transition: transform 0.25s var(--ease-snap), background-color 0.25s;
}

:root[data-scheme-active="dark"] .ap-switch__knob {
  transform: translateX(16px);
  background: var(--red);
}

.ap-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ap-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 0.18s, color 0.18s;
}

.ap-chip:hover {
  border-color: var(--red);
  color: var(--red);
}

/* ---------- top bar ---------- */

.ap-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--top-h);
  padding: 0 32px 0 40px;
  background: var(--paper);
  border-bottom: 1px solid var(--edge);
}

.ap-top__menu {
  display: none;
}

.ap-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--mute);
}

.ap-crumb a {
  transition: color 0.18s;
}

.ap-crumb a:hover {
  color: var(--red);
}

.ap-crumb [aria-current] {
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ap-query {
  position: relative;
  display: flex;
  align-items: stretch;
  margin-left: auto;
  height: 32px;
  border: 1px solid var(--edge);
  background: var(--panel);
  transition: box-shadow 0.2s;
}

.ap-query:focus-within {
  box-shadow: 4px 4px 0 var(--red);
}

.ap-query__label {
  display: grid;
  place-items: center;
  padding: 0 8px;
  background: var(--ink);
  color: var(--paper);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.ap-query input {
  width: 200px;
  padding: 0 30px 0 10px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 13px var(--font-sans);
  outline: none;
  transition: width 0.3s var(--ease);
}

.ap-query input:focus {
  width: 260px;
}

.ap-query input::-webkit-search-cancel-button {
  display: none;
}

.ap-query__icon {
  position: absolute;
  right: 9px;
  top: 50%;
  translate: 0 -50%;
  color: var(--mute);
  pointer-events: none;
}

.ap-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  overflow: hidden;
  pointer-events: none;
}

.ap-progress span {
  display: block;
  height: 100%;
  background: linear-gradient(
    90deg, var(--s1) 0 20%, var(--s2) 20% 40%, var(--s3) 40% 60%, var(--s4) 60% 80%, var(--s5) 80% 100%
  );
  transform: scaleX(var(--p, 0));
  transform-origin: left;
  will-change: transform;
}

.ap:not(.ap--post):not(.ap--page) .ap-progress {
  display: none;
}

/* ---------- grid ---------- */

.ap-grid {
  display: grid;
  grid-template-columns: minmax(0, 780px);
  justify-content: center;
  gap: 48px;
  width: 100%;
  padding: 44px 40px 72px;
  flex: 1;
}

.ap--panel .ap-grid {
  grid-template-columns: minmax(0, 780px) 260px;
}

.ap-main {
  min-width: 0;
  outline: none;
}

.ap-panel {
  position: sticky;
  top: calc(var(--top-h) + 32px);
  align-self: start;
  display: grid;
  gap: 28px;
  max-height: calc(100vh - var(--top-h) - 56px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ---------- placard (page header) ---------- */

.ap-placard {
  position: relative;
  margin-bottom: 36px;
  padding: 27px 33px 41px;
  background-color: var(--panel);
  background-image: var(--screw), var(--screw), var(--screw), var(--screw);
  background-size: 8px 8px;
  background-position: 8px 8px, calc(100% - 8px) 8px, 8px calc(100% - 8px), calc(100% - 8px) calc(100% - 8px);
  background-repeat: no-repeat;
  box-shadow: var(--lift);
}

/* Frame and registration crosses are one set of continuous lines in one layer.
   A real border gets snapped to device pixels (0.67px at 150% scaling) while
   separately positioned crosses do not, so they drifted apart on the right/bottom.
   Here each edge line simply runs 10px past its corner: top and left past the
   top-left, bottom and right past the bottom-right. */
.ap-placard::before {
  content: "";
  position: absolute;
  inset: -10px;
  pointer-events: none;
  background:
    linear-gradient(var(--edge), var(--edge)) 0 10px / calc(100% - 10px) 1px no-repeat,
    linear-gradient(var(--edge), var(--edge)) 10px 0 / 1px calc(100% - 10px) no-repeat,
    linear-gradient(var(--edge), var(--edge)) 10px calc(100% - 10px) / calc(100% - 10px) 1px no-repeat,
    linear-gradient(var(--edge), var(--edge)) calc(100% - 10px) 10px / 1px calc(100% - 10px) no-repeat;
}

.ap-placard__head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 26px;
  padding: 0 4px 12px;
  border-bottom: 1px dashed var(--rule);
}

.ap-placard__title {
  margin: 0;
  font-size: clamp(30px, 4.4vw, 46px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.ap-placard__lede {
  max-width: 46ch;
  margin: 14px 0 0;
  color: var(--ink-2);
  font-size: 16px;
}

.ap-placard--hero .ap-placard__title,
.ap-placard--hero .ap-placard__lede {
  max-width: calc(100% - 230px);
}

.ap-orbit {
  position: absolute;
  right: 26px;
  top: 64px;
  width: 220px;
  height: auto;
  overflow: visible;
  color: var(--ink);
}

.ap-orbit__axis {
  stroke: var(--rule);
  stroke-width: 1;
}

.ap-orbit__path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1;
  stroke-dasharray: 2 4;
}

.ap-orbit__path--alt {
  stroke: var(--mute);
  stroke-dasharray: 1 3;
}

.ap-orbit__body {
  fill: var(--panel);
  stroke: currentColor;
  stroke-width: 1.2;
}

.ap-orbit__shade {
  fill: var(--rule);
}

.ap-orbit__craft {
  fill: var(--red);
  stroke: var(--panel);
  stroke-width: 1.5;
}

.ap-orbit text {
  fill: var(--mute);
  font: 600 7px var(--font-mono);
  letter-spacing: 0.12em;
}

.ap-placard .ap-stripe {
  position: absolute;
  right: 32px;
  bottom: 18px;
  width: 168px;
  transform-origin: right;
}

/* ---------- cards ---------- */

.ap-cards {
  display: grid;
  gap: 14px;
}

.ap-card {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) 44px;
  background: var(--panel);
  border: 1px solid var(--rule);
  transition: border-color 0.2s, box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

.ap-card::before {
  content: "";
  position: absolute;
  left: -1px;
  right: -1px;
  top: -1px;
  height: 6px;
  background: linear-gradient(
    var(--s1) 0 20%, var(--s2) 20% 40%, var(--s3) 40% 60%, var(--s4) 60% 80%, var(--s5) 80% 100%
  );
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease-snap);
  /* above the cover image, which is positioned and would otherwise paint over it */
  z-index: 2;
  pointer-events: none;
}

.ap-card:hover {
  border-color: var(--edge);
  box-shadow: var(--lift);
  transform: translateY(-2px);
}

.ap-card:hover::before,
.ap-card:focus-within::before {
  transform: none;
}

.ap-card__rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 14px 18px 18px;
  border-right: 1px dashed var(--rule);
  font: 500 11px/1.3 var(--font-mono);
  letter-spacing: 0.08em;
  color: var(--mute);
}

.ap-card--cover {
  grid-template-columns: 128px 208px minmax(0, 1fr) 44px;
}

.ap-card__cover {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--rule);
  background: var(--panel-2);
}

/* the whole image is shown; a blurred copy of it fills the letterbox */
.ap-card__cover::before {
  content: "";
  position: absolute;
  inset: -16px;
  background: var(--cover) center / cover no-repeat;
  filter: blur(14px) saturate(0.9);
  opacity: 0.55;
}

.ap-card__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.45s var(--ease);
}

.ap-card:hover .ap-card__cover img {
  transform: scale(1.04);
}

.ap-card__no {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.ap-card__body {
  padding: 18px 22px 18px;
  min-width: 0;
}

.ap-card__title {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* the whole card is the hit target */
.ap-card__title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.ap-card__title a:focus-visible {
  outline: none;
}

.ap-card:has(.ap-card__title a:focus-visible) {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.ap-card__sum {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.65;
}

.ap-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.ap-card__meta .ap-tags {
  position: relative;
  z-index: 2;
}

.ap-card__read {
  color: var(--mute);
  font: 600 10.5px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ap-card__go {
  display: grid;
  place-items: center;
  border-left: 1px solid var(--rule);
  color: var(--mute);
  transition: background-color 0.25s, color 0.25s;
}

.ap-card__go svg {
  transition: transform 0.35s var(--ease);
}

.ap-card:hover .ap-card__go {
  background: var(--red);
  border-left-color: var(--red);
  color: #fff;
}

.ap-card:hover .ap-card__go svg {
  transform: translateX(3px);
}

.ap-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px 4px 6px;
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink-2);
  font: 600 10.5px/1 var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}

.ap-tag::before {
  content: "";
  width: 5px;
  height: 5px;
  background: var(--red);
}

.ap-tag:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.ap-empty {
  padding: 28px;
  border: 1px dashed var(--rule);
  color: var(--mute);
  font: 600 12px/1.5 var(--font-mono);
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

/* ---------- buttons & pager ---------- */

.ap-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--edge);
  background: var(--panel);
  color: var(--ink);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--edge);
  transition: transform 0.12s var(--ease-snap), box-shadow 0.12s var(--ease-snap), background-color 0.18s;
}

a.ap-btn:hover {
  background: var(--panel-2);
}

a.ap-btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 var(--edge);
}

.ap-btn[aria-disabled="true"] {
  color: var(--mute);
  border-color: var(--rule);
  box-shadow: none;
}

.ap-btn--hot {
  background: var(--red);
  border-color: var(--ink);
  color: #fff;
}

a.ap-btn--hot:hover {
  background: var(--red-ink);
}

.ap-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 36px;
}

.ap-pager__pages {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-pager__pages a {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--rule);
  font: 600 11px/1 var(--font-mono);
  transition: border-color 0.18s;
}

.ap-pager__pages a:hover {
  border-color: var(--edge);
}

.ap-pager__pages a[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* ---------- article ---------- */

.ap-dossier {
  position: relative;
  margin-bottom: 44px;
  padding: 0 0 34px;
  background-color: var(--panel);
  background-image: var(--screw), var(--screw);
  background-size: 8px 8px;
  background-position: 8px calc(100% - 8px), calc(100% - 8px) calc(100% - 8px);
  background-repeat: no-repeat;
  border: 1px solid var(--edge);
  box-shadow: var(--lift);
}

.ap-dossier__cover {
  margin: 0;
  border-bottom: 1px solid var(--edge);
  background: var(--panel-2);
}

.ap-dossier__cover img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.ap-dossier__bar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--edge);
  background: var(--panel-2);
}

.ap-dossier__bar .ap-hazard {
  margin-left: auto;
}

.ap-dossier__title {
  margin: 0;
  padding: 30px 32px 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.ap-dossier__sum {
  margin: 14px 32px 0;
  max-width: 52ch;
  color: var(--ink-2);
  font-size: 16px;
}

.ap-spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  margin: 28px 32px 0;
  border-top: 1px solid var(--edge);
  border-left: 1px solid var(--rule);
}

.ap-spec > div {
  padding: 10px 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.ap-spec dt {
  color: var(--mute);
  font: 600 10px/1.2 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ap-spec dd {
  margin: 6px 0 0;
  font: 600 13.5px/1.2 var(--font-mono);
  letter-spacing: 0.04em;
}

.ap-dossier .ap-stripe {
  position: absolute;
  left: 32px;
  bottom: 12px;
  width: 112px;
  transform-origin: left;
}

/* ---------- prose ---------- */

.ap-prose {
  counter-reset: ap-h2;
  color: var(--ink);
  font-size: 16.5px;
  line-height: 1.86;
  overflow-wrap: break-word;
}

.ap-prose > * {
  margin-top: 0;
  margin-bottom: 1.15em;
}

.ap-prose h2,
.ap-prose h3,
.ap-prose h4 {
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.ap-prose h2 {
  counter-increment: ap-h2;
  counter-reset: ap-h3;
  position: relative;
  margin: 2.6em 0 0.8em;
  padding-top: 18px;
  border-top: 1px solid var(--edge);
  font-size: 25px;
  font-weight: 800;
}

.ap-prose h2::before {
  content: "§" counter(ap-h2, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  color: var(--red);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.16em;
}

/* ruler ticks riding the heading rule */
.ap-prose h2::after {
  content: "";
  position: absolute;
  top: -1px;
  right: 0;
  width: 132px;
  height: 7px;
  background:
    repeating-linear-gradient(90deg, var(--edge) 0 1px, transparent 1px 12px) top / 100% 7px no-repeat,
    repeating-linear-gradient(90deg, var(--edge) 0 1px, transparent 1px 4px) top / 100% 4px no-repeat;
  opacity: 0.55;
}

.ap-prose h3 {
  counter-increment: ap-h3;
  margin: 2em 0 0.6em;
  font-size: 19px;
  font-weight: 750;
}

.ap-prose h3::before {
  content: counter(ap-h2, decimal-leading-zero) "." counter(ap-h3);
  margin-right: 10px;
  color: var(--red);
  font: 700 12px/1 var(--font-mono);
  letter-spacing: 0.08em;
  vertical-align: 0.15em;
}

.ap-prose h4 {
  margin: 1.8em 0 0.5em;
  font: 700 13px/1.4 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ap-prose .heading-anchor {
  color: inherit;
  text-decoration: none;
  background: none;
}

.ap-prose a:not(.heading-anchor) {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  transition: background-color 0.18s, color 0.18s;
}

.ap-prose a:not(.heading-anchor):hover {
  background: var(--red-wash);
  color: var(--red-ink);
}

.ap-prose strong {
  font-weight: 750;
}

.ap-prose ul,
.ap-prose ol {
  padding-left: 1.5em;
}

.ap-prose li {
  margin: 0.35em 0;
  padding-left: 0.3em;
}

.ap-prose ul {
  list-style: square;
}

.ap-prose ul li::marker {
  color: var(--red);
}

.ap-prose ol {
  list-style: decimal-leading-zero;
}

.ap-prose ol li::marker {
  color: var(--red);
  font: 700 0.78em var(--font-mono);
}

.ap-prose blockquote {
  position: relative;
  margin-left: 0;
  margin-right: 0;
  padding: 18px 22px 18px 34px;
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--ink-2);
}

.ap-prose blockquote::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 10px;
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 6px, var(--ink) 6px 12px);
}

.ap-prose blockquote::after {
  content: "NOTE";
  position: absolute;
  top: -8px;
  right: 14px;
  padding: 0 6px;
  background: var(--paper);
  color: var(--red);
  font: 700 10px/16px var(--font-mono);
  letter-spacing: 0.18em;
}

.ap-prose blockquote > :last-child {
  margin-bottom: 0;
}

.ap-prose :not(pre) > code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--rule);
  background: var(--panel-2);
  font: 0.86em var(--font-mono);
  border-radius: 2px;
}

.ap-prose hr {
  height: 10px;
  margin: 3em auto;
  width: 120px;
  border: 0;
  background: linear-gradient(
    var(--s1) 0 20%, var(--s2) 20% 40%, var(--s3) 40% 60%, var(--s4) 60% 80%, var(--s5) 80% 100%
  );
}

.ap-prose img {
  height: auto;
  border: 1px solid var(--edge);
  background: var(--panel);
  padding: 6px;
}

/* code: an instrument readout with a header strip (added by site.js) */

.ap-code {
  position: relative;
  margin: 0 0 1.4em;
  border: 1px solid var(--edge);
  background: var(--code-bg);
  box-shadow: var(--lift);
}

.ap-code__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 32px;
  padding: 0 6px 0 12px;
  border-bottom: 1px solid var(--edge);
  background: var(--panel-2);
}

.ap-code__lang {
  color: var(--red);
  font: 700 10.5px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ap-code__lines {
  color: var(--mute);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
}

.ap-code__copy {
  margin-left: auto;
  padding: 5px 8px;
  border: 1px solid var(--edge);
  background: var(--panel);
  color: var(--ink);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.14em;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--edge);
  transition: transform 0.1s, box-shadow 0.1s;
}

.ap-code__copy:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.ap-code__copy[data-done] {
  background: var(--s4);
  color: #fff;
}

.ap-prose pre {
  margin: 0 0 1.4em;
  padding: 16px 18px;
  overflow-x: auto;
  background: var(--code-bg) !important;
  border: 1px solid var(--edge);
  font: 13.5px/1.7 var(--font-mono);
  tab-size: 2;
}

.ap-code pre {
  margin: 0;
  border: 0;
  counter-reset: ap-line;
}

.ap-code pre .line {
  counter-increment: ap-line;
}

.ap-code pre .line::before {
  content: counter(ap-line, decimal-leading-zero);
  display: inline-block;
  width: 2.4em;
  margin-right: 1.1em;
  color: var(--mute);
  opacity: 0.6;
  text-align: right;
  user-select: none;
}

.shiki span {
  color: var(--shiki-light);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-scheme="light"]) .shiki span {
    color: var(--shiki-dark);
  }
}

:root[data-scheme="dark"] .shiki span {
  color: var(--shiki-dark);
}

.ap-prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14.5px;
}

.ap-prose thead th {
  padding: 9px 14px;
  background: var(--ink);
  color: var(--paper);
  font: 700 10.5px/1.2 var(--font-mono);
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}

.ap-prose td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.ap-prose tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
}

.ap-prose tbody tr:hover td {
  background: var(--red-wash);
}

.ap-prose .katex-display {
  margin: 0 0 1.4em;
  padding: 18px 12px;
  overflow-x: auto;
  border: 1px solid var(--rule);
  background-color: var(--panel);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px);
  background-size: 12px 12px;
}

/* KaTeX's numbered-equation column hangs 2px past the edge (.vlist-t2 has
   margin-right: -2px); under overflow-x: auto that is a scrollbar per equation */
.katex-display .tag .vlist-t2 {
  margin-right: 0;
}

.ap-article__foot {
  margin-top: 56px;
  display: grid;
  gap: 26px;
}

.ap-article__tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--edge);
}

.ap-route {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ap-route__btn {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--edge);
  background: var(--panel);
  box-shadow: 4px 4px 0 var(--edge);
  transition: transform 0.14s var(--ease-snap), box-shadow 0.14s var(--ease-snap), background-color 0.2s;
}

.ap-route__btn--next {
  text-align: right;
}

.ap-route__btn--next .ap-label {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.ap-route__btn--void {
  border-style: dashed;
  border-color: var(--rule);
  background: transparent;
  box-shadow: none;
}

a.ap-route__btn:hover {
  background: var(--panel-2);
}

a.ap-route__btn:hover .ap-label {
  color: var(--red);
}

a.ap-route__btn:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 var(--edge);
}

.ap-route__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

/* ---------- panel modules ---------- */

.ap-module__head {
  display: flex;
  justify-content: space-between;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--edge);
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.ap-module__count {
  color: var(--red);
}

.ap-recent {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-recent a {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 13.5px;
  line-height: 1.45;
  transition: color 0.18s;
}

.ap-recent a:hover {
  color: var(--red);
}

.ap-recent__code {
  color: var(--mute);
  font: 600 10.5px/1.9 var(--font-mono);
  letter-spacing: 0.06em;
}

.ap-check {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-check a {
  display: grid;
  grid-template-columns: 14px 34px 1fr;
  align-items: start;
  gap: 8px;
  padding: 6px 0;
  color: var(--mute);
  font-size: 13px;
  line-height: 1.45;
  transition: color 0.2s;
}

.ap-check__item[data-level="1"] a {
  padding-left: 22px;
  grid-template-columns: 14px 34px 1fr;
}

.ap-check a:hover {
  color: var(--ink);
}

.ap-check__box {
  position: relative;
  width: 12px;
  height: 12px;
  margin-top: 3px;
  border: 1px solid currentColor;
  transition: background-color 0.25s, border-color 0.25s;
}

.ap-check__box::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 0;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.25s var(--ease-snap);
}

.ap-check__no {
  font: 600 10.5px/1.9 var(--font-mono);
  letter-spacing: 0.04em;
}

.ap-check a.is-passed {
  color: var(--ink-2);
}

.ap-check a.is-passed .ap-check__box {
  background: var(--ink);
  border-color: var(--ink);
}

.ap-check a.is-passed .ap-check__box::after {
  transform: rotate(45deg) scale(1);
}

:root[data-scheme-active="dark"] .ap-check__box::after {
  border-color: var(--paper);
}

.ap-check a.is-active {
  color: var(--ink);
  font-weight: 700;
}

.ap-check a.is-active .ap-check__box {
  border-color: var(--red);
  background: var(--red);
  box-shadow: 0 0 0 3px var(--red-wash);
}

.ap-check a.is-active .ap-check__box::after {
  transform: rotate(45deg) scale(1);
  border-color: #fff;
}

.ap-check a.is-active .ap-check__no {
  color: var(--red);
}

/* ALT: a ruler, not a stretched bar. Ticks stay put; the fill is uncovered with a
   clip and the pointer rides on container units, so nothing gets squashed. */
.ap-gauge {
  display: grid;
  gap: 8px;
  padding: 12px 14px 10px;
  border: 1px solid var(--edge);
  background: var(--panel);
}

.ap-gauge__head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ap-gauge .ap-label {
  color: var(--red);
}

.ap-gauge__value {
  font: 700 22px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.ap-gauge__value small {
  margin-left: 2px;
  color: var(--mute);
  font-size: 11px;
  font-weight: 600;
}

.ap-gauge__sec {
  margin-left: auto;
  color: var(--mute);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
}

.ap-gauge__track {
  position: relative;
  height: 18px;
  margin-top: 6px;
  container-type: inline-size;
  border-bottom: 1px solid var(--edge);
  background:
    linear-gradient(90deg, var(--edge) 0 1px, transparent 1px) 0 100% / 25% 12px repeat-x,
    linear-gradient(90deg, var(--rule) 0 1px, transparent 1px) 0 100% / 5% 6px repeat-x;
}

/* the 100 tick that the 25% repeat cannot reach */
.ap-gauge__track::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 1px;
  height: 12px;
  background: var(--edge);
}

.ap-gauge__fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: var(--ink);
  clip-path: inset(0 calc(100% - var(--p, 0) * 100%) 0 0);
}

.ap-gauge__mark {
  position: absolute;
  left: 0;
  top: -7px;
  bottom: -1px;
  width: 0;
  transform: translateX(calc(var(--p, 0) * 100cqw));
  will-change: transform;
}

.ap-gauge__mark::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 0;
  border: 4px solid transparent;
  border-top: 6px solid var(--red);
}

.ap-gauge__mark::after {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 0;
  width: 1px;
  background: var(--red);
}

/* each label is centred under its tick rather than spread by width */
.ap-gauge__scale {
  position: relative;
  height: 9px;
  color: var(--mute);
  font: 600 8.5px/1 var(--font-mono);
}

.ap-gauge__scale span {
  position: absolute;
  top: 0;
  left: var(--at);
  transform: translateX(-50%);
}

/* ---------- archive / tags / search / 404 ---------- */

.ap-manifest {
  display: grid;
  gap: 40px;
}

.ap-year__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--edge);
}

.ap-year__head a {
  font-size: 40px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  transition: color 0.18s;
}

.ap-year__head a:hover {
  color: var(--red);
}

.ap-ledger {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-ledger__row {
  position: relative;
  display: grid;
  grid-template-columns: 56px 64px 1fr;
  align-items: baseline;
  gap: 12px;
  padding: 12px 8px;
  border-bottom: 1px dashed var(--rule);
  transition: background-color 0.18s;
}

.ap-ledger__row time,
.ap-ledger__code {
  color: var(--mute);
  font: 600 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}

.ap-ledger__code {
  color: var(--red);
}

.ap-ledger__row a {
  font-weight: 650;
}

.ap-ledger__row a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.ap-ledger__row:hover {
  background: var(--panel);
}

.ap-bank {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-bank__cell {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 16px 14px 20px;
  border: 1px solid var(--rule);
  background: var(--panel);
  transition: border-color 0.2s, transform 0.25s var(--ease);
}

.ap-bank__cell:hover {
  border-color: var(--edge);
  transform: translateY(-2px);
}

.ap-bank__no,
.ap-bank__count {
  color: var(--mute);
  font: 600 11px/1 var(--font-mono);
}

.ap-bank__count {
  color: var(--red);
}

.ap-bank__name {
  font-weight: 700;
}

.ap-bank__bar {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 8px;
  height: 3px;
  background: var(--panel-2);
}

.ap-bank__bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(var(--w, 0));
  transform-origin: left;
  transition: transform 0.6s var(--ease);
}

.ap-bank__cell:hover .ap-bank__bar::after {
  background: var(--red);
}

.ap-console {
  padding: 22px;
  border: 1px solid var(--edge);
  background: var(--panel);
  box-shadow: var(--lift);
}

.ap-console__field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  height: 52px;
  border: 1px solid var(--edge);
  background: var(--paper);
}

.ap-console__field .ap-label {
  color: var(--red);
}

.ap-console__field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: none;
  color: var(--ink);
  font: 17px var(--font-sans);
  outline: none;
}

.ap-console__status {
  min-height: 1.6em;
  margin: 14px 0 6px;
  color: var(--mute);
  font: 600 11px/1.6 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ap-results {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-results .search-result {
  padding: 14px 0;
  border-top: 1px dashed var(--rule);
}

.ap-results .search-result > a {
  font-size: 17px;
  font-weight: 700;
}

.ap-results .search-result > a:hover {
  color: var(--red);
}

.search-excerpt {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.search-excerpt mark {
  background: var(--s3);
  color: #16181b;
  padding: 0 2px;
}

.ap-lost {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 40px 0;
}

.ap-lost__scope {
  position: relative;
  width: 180px;
  height: 180px;
  margin-bottom: 18px;
  border: 1px solid var(--edge);
  border-radius: 50%;
  background:
    linear-gradient(var(--rule), var(--rule)) center / 100% 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) center / 1px 100% no-repeat,
    var(--panel);
  overflow: hidden;
}

.ap-lost__ring {
  position: absolute;
  inset: 30px;
  border: 1px dashed var(--rule);
  border-radius: 50%;
}

.ap-lost__ring + .ap-lost__ring {
  inset: 60px;
}

.ap-lost__sweep {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 300deg, var(--red-wash) 330deg, var(--red) 360deg);
  mask: radial-gradient(circle, #000 0 69%, transparent 70%);
  animation: ap-sweep 3.2s linear infinite;
}

.ap-lost__title {
  margin: 0;
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.03em;
}

.ap-lost__body {
  max-width: 44ch;
  margin: 0 0 12px;
  color: var(--ink-2);
}

/* ---------- profile home ---------- */

.ap-crew {
  display: flex;
  align-items: flex-end;
  gap: 26px;
}

.ap-crew__id {
  flex: 1;
  min-width: 0;
}

.ap-crew__photo {
  flex: none;
  margin: 30px 0 0 32px;
  padding: 6px 6px 0;
  border: 1px solid var(--edge);
  background: var(--paper);
}

.ap-crew__photo img {
  width: 120px;
  height: 120px;
  object-fit: cover;
  filter: grayscale(0.25) contrast(1.05);
}

.ap-crew__photo figcaption {
  padding: 6px 0;
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: 0.14em;
  text-align: center;
}

.ap-spec dd a {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.ap-spec dd a:hover {
  color: var(--red);
}

.ap-latest {
  margin-top: 64px;
}

.ap-latest__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--edge);
}

.ap-cats {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-cats a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--rule);
  font-size: 13.5px;
  transition: color 0.18s;
}

.ap-cats a:hover {
  color: var(--red);
}

.ap-cats__mark {
  width: 10px;
  height: 6px;
  background: linear-gradient(var(--s1) 0 33%, var(--s3) 33% 66%, var(--s5) 66%);
}

/* ---------- publications ---------- */

.ap-pubs__intro {
  margin-bottom: 28px;
}

.ap-pubs {
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ap-pub {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  border: 1px solid var(--rule);
  background: var(--panel);
}

.ap-pub__rail {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 14px;
  border-right: 1px dashed var(--rule);
}

.ap-pub__no {
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.1em;
}

.ap-pub__year {
  font-size: 28px;
  font-weight: 800;
  font-stretch: var(--display-stretch);
  line-height: 1;
  letter-spacing: -0.03em;
}

.ap-pub__body {
  padding: 18px 22px 18px;
  min-width: 0;
}

.ap-pub__type {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 7px;
  background: var(--ink);
  color: var(--paper);
  font: 700 10px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.ap-pub__title {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  font-stretch: var(--display-stretch);
  line-height: 1.35;
}

.ap-pub__authors,
.ap-pub__venue,
.ap-pub__note {
  margin: 6px 0 0;
  color: var(--ink-2);
  font-size: 14px;
}

.ap-pub__authors strong {
  color: var(--ink);
  font-weight: 750;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.ap-pub__venue {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.02em;
}

.ap-pub__note {
  color: var(--mute);
  font-size: 13px;
}

.ap-pub__links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 0;
}

@media (max-width: 640px) {
  .ap-crew {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .ap-crew__photo {
    margin: 22px 0 0 20px;
  }

  .ap-pub {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-pub__rail {
    flex-direction: row;
    align-items: baseline;
    border-right: 0;
    border-bottom: 1px dashed var(--rule);
    padding: 12px 16px;
  }

  .ap-pub__body {
    padding: 14px 16px;
  }
}

/* ---------- footer ---------- */

.ap-foot {
  border-top: 1px solid var(--edge);
  background: var(--panel);
}

.ap-foot__plate {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 20px 40px 24px;
}

.ap-foot__grid {
  display: grid;
  grid-template-columns: repeat(4, auto);
  margin: 0;
  border: 1px solid var(--edge);
}

.ap-foot__grid > div {
  padding: 7px 12px;
}

.ap-foot__grid > div + div {
  border-left: 1px solid var(--rule);
}

.ap-foot__grid dt {
  color: var(--mute);
  font: 600 9.5px/1 var(--font-mono);
  letter-spacing: 0.18em;
}

.ap-foot__grid dd {
  margin: 5px 0 0;
  font: 600 12px/1 var(--font-mono);
  white-space: nowrap;
}

.ap-foot__note {
  margin: 0;
  color: var(--mute);
  font-size: 12.5px;
}

.ap-foot__note a {
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-underline-offset: 3px;
}

.ap-foot__serial {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--mute);
  font: 600 10px/1 var(--font-mono);
  letter-spacing: 0.16em;
}

.ap-foot__serial span {
  padding: 5px 7px;
  border: 1.5px solid var(--red);
  color: var(--red);
  font-weight: 800;
  letter-spacing: 0.2em;
}

/* ---------- motion ---------- */

@keyframes ap-lamp {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

@keyframes ap-sweep {
  to { transform: rotate(360deg); }
}

@keyframes ap-draw {
  from { transform: scaleX(0); }
}

@keyframes ap-drop {
  from { transform: scaleY(0); }
}

@keyframes ap-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes ap-slide {
  from { opacity: 0; transform: translateX(-12px); }
}

@media (prefers-reduced-motion: no-preference) {
  .ap-rail::after {
    animation: ap-drop 0.9s var(--ease-snap) both;
  }

  .ap-nav li {
    animation: ap-slide 0.5s var(--ease) both;
  }

  .ap-nav li:nth-child(1) { animation-delay: 0.08s; }
  .ap-nav li:nth-child(2) { animation-delay: 0.13s; }
  .ap-nav li:nth-child(3) { animation-delay: 0.18s; }
  .ap-nav li:nth-child(4) { animation-delay: 0.23s; }
  .ap-nav li:nth-child(5) { animation-delay: 0.28s; }
  .ap-nav li:nth-child(6) { animation-delay: 0.33s; }

  .ap-placard .ap-stripe,
  .ap-dossier .ap-stripe {
    animation: ap-draw 0.8s 0.25s var(--ease-snap) both;
  }

  .js [data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
    transition-delay: calc(min(var(--i, 0), 8) * 50ms);
  }

  .js [data-reveal].is-in {
    opacity: 1;
    transform: none;
  }
}

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

/* ---------- responsive ---------- */

@media (max-width: 1240px) {
  .ap--panel .ap-grid {
    grid-template-columns: minmax(0, 780px);
  }

  .ap-panel {
    display: none;
  }
}

@media (max-width: 960px) {
  .ap-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-rail {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: min(300px, 86vw);
    transform: translateX(-102%);
    transition: transform 0.38s var(--ease-snap);
    box-shadow: 20px 0 60px -30px rgb(0 0 0 / 0.5);
  }

  .ap-rail[data-open] {
    transform: none;
  }

  .ap-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 25;
    background: rgb(10 12 14 / 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .ap-rail[data-open] ~ .ap-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .ap-top {
    padding: 0 16px;
    gap: 12px;
  }

  .ap-top__menu {
    display: grid;
    align-content: center;
    gap: 4px;
    width: 36px;
    height: 32px;
    padding: 0 9px;
    border: 1px solid var(--edge);
    background: var(--panel);
    cursor: pointer;
  }

  .ap-top__menu span {
    height: 2px;
    background: var(--ink);
  }

  .ap-top__menu span:nth-child(2) {
    width: 60%;
    background: var(--red);
  }

  .ap-grid {
    padding: 28px 16px 56px;
  }

  .ap-foot__plate {
    grid-template-columns: 1fr;
    padding: 20px 16px 24px;
  }
}

@media (max-width: 640px) {
  body {
    background-size: 96px 96px, 96px 96px, 16px 16px, 16px 16px;
  }

  .ap-query input,
  .ap-query input:focus {
    width: 100%;
  }

  .ap-query {
    flex: 1;
    min-width: 0;
  }

  .ap-crumb {
    display: none;
  }

  .ap-placard {
    padding: 21px 21px 37px;
  }

  .ap-orbit {
    display: none;
  }

  .ap-placard--hero .ap-placard__title,
  .ap-placard--hero .ap-placard__lede {
    max-width: none;
  }

  .ap-placard__head {
    flex-direction: column;
    gap: 6px;
  }

  .ap-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-card__rail {
    flex-direction: row;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: 1px dashed var(--rule);
  }

  .ap-card__go {
    display: none;
  }

  .ap-card--cover {
    grid-template-columns: minmax(0, 1fr);
  }

  .ap-card__cover {
    aspect-ratio: 16 / 9;
    border-right: 0;
    border-bottom: 1px solid var(--rule);
  }

  .ap-card__body {
    padding: 14px 16px 16px;
  }

  .ap-dossier__title,
  .ap-dossier__sum {
    padding-left: 20px;
    padding-right: 20px;
    margin-left: 0;
    margin-right: 0;
  }

  .ap-dossier__sum {
    margin-left: 20px;
    padding-left: 0;
  }

  .ap-spec {
    margin: 22px 20px 0;
  }

  .ap-dossier .ap-stripe {
    left: 20px;
  }

  .ap-dossier__bar .ap-label--dim {
    display: none;
  }

  .ap-prose {
    font-size: 16px;
  }

  .ap-route {
    grid-template-columns: 1fr;
  }

  .ap-foot__grid {
    grid-template-columns: repeat(2, auto);
  }

  .ap-foot__grid > div:nth-child(3) {
    border-left: 0;
  }

  .ap-foot__grid > div:nth-child(n + 3) {
    border-top: 1px solid var(--rule);
  }

  .ap-ledger__row {
    grid-template-columns: 48px 1fr;
  }

  .ap-ledger__code {
    display: none;
  }
}

@media print {
  .ap-rail,
  .ap-top,
  .ap-panel,
  .ap-foot,
  .ap-route {
    display: none !important;
  }

  .ap-shell {
    display: block;
  }

  body {
    background: #fff;
  }
}

/* embedded PDF: ![label](file.pdf) on its own line, framed like the prose images */

.ap-prose .pdf-embed {
  margin: 28px 0;
}

.pdf-embed__frame {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1.3;
  max-height: 85vh;
  border: 1px solid var(--edge);
  background: var(--panel);
}

.pdf-embed__fallback {
  display: block;
  padding: 16px;
  font: 600 12px/1.5 var(--font-mono);
  letter-spacing: 0.06em;
}

.pdf-embed__caption {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--mute);
  font: 600 11px/1.4 var(--font-mono);
  letter-spacing: 0.08em;
}

.pdf-embed__type {
  padding: 3px 6px;
  border: 1px solid var(--rule);
  font-size: 10px;
  letter-spacing: 0.12em;
}

@media print {
  .pdf-embed__frame {
    display: none;
  }
}

/* encrypted post: the password form shown until unlock.js swaps in the content */

.dxbe-locked {
  margin: 2rem 0;
  padding: 1.6rem 1.4rem;
  border: 1px solid var(--edge);
  background: var(--panel);
}

.dxbe-locked__title {
  margin: 0 0 0.3rem;
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dxbe-locked__hint {
  margin: 0 0 1rem;
  color: var(--mute);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.dxbe-locked__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.dxbe-locked__input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--edge);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
}

.dxbe-locked__input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 1px;
}

.dxbe-locked__button {
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--red);
  border-radius: 0;
  background: var(--red);
  color: var(--panel);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.dxbe-locked__button:disabled {
  opacity: 0.6;
  cursor: progress;
}

.dxbe-locked__error {
  margin: 0.7rem 0 0;
  color: var(--red);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}
