/*
 * Corsair — atomic-age technical bulletin.
 *
 * One idea, carried everywhere: the *plate*. A bordered panel with a stamped
 * label riding on its top rule and a hard offset shadow, the way a two-colour
 * press misregisters. Cards, callouts, code blocks, tables, and the sidebar
 * groups are all the same object at different sizes, so the site reads as a set
 * of panels off one machine rather than a pile of retro flourishes.
 *
 * Everything is self-contained: no webfonts, no CDN, no build step past the
 * markdown renderer in site/build.ts.
 */

/* ------------------------------------------------------------------ tokens */

:root {
  --bone: #fbf3e4;
  --bone-2: #f5ebd8;
  --plate: #fffaf0;
  --ink: #1c2530;
  --ink-soft: #55606f;
  --rule: #d9c9a8;
  --rule-soft: #e8dcc2;

  --teal: #0e8f8f;
  --teal-deep: #0a6e6e;
  --rocket: #de4b27;
  --rocket-deep: #b3391b;
  --sun: #f0b429;
  --avocado: #5f7f34;

  --link: var(--teal-deep);
  --shadow: rgba(28, 37, 48, 0.22);
  --burst: 0.3;

  --display: "Futura", "Jost", "Century Gothic", "Avenir Next", "Trebuchet MS",
    ui-sans-serif, sans-serif;
  --body: "Avenir Next", "Segoe UI", Inter, ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --measure: 44rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

/*
 * Dark is the counterpoint, not the identity: the same plates under a night
 * shift. Declared twice so the toggle wins in both directions — the media query
 * only applies when the reader has not chosen light explicitly.
 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bone: #141b25;
    --bone-2: #1a2230;
    --plate: #1e2836;
    --ink: #f3e8d5;
    --ink-soft: #a6b1c0;
    --rule: #33414f;
    --rule-soft: #2a3542;

    --teal: #35c2be;
    --teal-deep: #6fd8d2;
    --rocket: #ff7d52;
    --rocket-deep: #ff9a76;
    --sun: #ffc94d;
    --avocado: #9dc25f;

    --link: var(--teal-deep);
    --shadow: rgba(0, 0, 0, 0.5);
    --burst: 0.14;
  }
}

:root[data-theme="dark"] {
  --bone: #141b25;
  --bone-2: #1a2230;
  --plate: #1e2836;
  --ink: #f3e8d5;
  --ink-soft: #a6b1c0;
  --rule: #33414f;
  --rule-soft: #2a3542;

  --teal: #35c2be;
  --teal-deep: #6fd8d2;
  --rocket: #ff7d52;
  --rocket-deep: #ff9a76;
  --sun: #ffc94d;
  --avocado: #9dc25f;

  --link: var(--teal-deep);
  --shadow: rgba(0, 0, 0, 0.5);
  --burst: 0.14;
}

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

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

body {
  margin: 0;
  background-color: var(--bone);
  /* A faint dot grid, the ground the plates sit on. Nothing else is textured. */
  background-image: radial-gradient(var(--rule-soft) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration-style: dotted;
}

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

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--ink);
  color: var(--bone);
  padding: 0.75rem 1.25rem;
  z-index: 99;
}

.skip:focus {
  left: 0;
}

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

/* ------------------------------------------------------------- type ramp */

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.12;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.1rem);
  margin: 0 0 1.25rem;
}

h2 {
  font-size: clamp(1.5rem, 2.6vw, 1.9rem);
  margin: 3.25rem 0 0.85rem;
  padding-top: 1.1rem;
  border-top: 2px solid var(--ink);
  position: relative;
}

/* The rule above every h2 doubles, the way a bulletin separates sections. */
h2::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 0;
  width: 4.5rem;
  height: 2px;
  background: var(--rocket);
}

h3 {
  font-size: 1.2rem;
  margin: 2.25rem 0 0.5rem;
}

h4 {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  margin: 1.75rem 0 0.4rem;
}

.anchor {
  margin-left: 0.5rem;
  color: var(--rule);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.75em;
  opacity: 0;
  transition: opacity 0.15s;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus {
  opacity: 1;
}

p {
  margin: 0 0 1.1rem;
}

strong {
  font-weight: 650;
}

/* The stamped label. The one type gesture the whole site is built on. */
.eyebrow,
.side-label,
.toc-title,
.colophon-label,
.code-lang,
.callout-title,
.plate-label,
.stat-label {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 600;
}

.eyebrow {
  color: var(--rocket-deep);
  margin: 0 0 0.75rem;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.9rem var(--gutter);
  background: var(--bone);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--sun);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  text-decoration: none;
}

.mark {
  width: 30px;
  height: 30px;
  overflow: visible;
  fill: none;
  stroke: var(--teal);
  stroke-width: 2;
}

.mark .nucleus {
  fill: var(--rocket);
  stroke: none;
}

.masthead:hover .mark,
.brand:focus-visible .mark {
  animation: spin 9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.mark {
  transform-origin: 50% 50%;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-family: var(--display);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}

.masthead-nav a {
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}

.masthead-nav a:hover {
  border-bottom-color: var(--rocket);
}

.masthead-nav a.on {
  border-bottom-color: var(--teal);
}

.masthead-nav .ghost {
  color: var(--ink-soft);
}

.masthead-nav .cta {
  padding: 0.42rem 1.05rem;
  background: var(--sun);
  color: #1c2530;
  border: 2px solid var(--ink);
  border-radius: 999px;
  box-shadow: 3px 3px 0 var(--ink);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.masthead-nav .cta:hover {
  border-bottom-color: var(--ink);
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  background: var(--plate);
  border: 2px solid var(--ink);
  border-radius: 50%;
  cursor: pointer;
  color: var(--ink);
}

.theme svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
}

.theme:hover {
  background: var(--sun);
  color: #1c2530;
}

.menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  width: 42px;
  height: 34px;
  padding: 7px 8px;
  background: var(--plate);
  border: 2px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
}

.menu span {
  display: block;
  height: 2px;
  background: var(--ink);
}

/* --------------------------------------------------------- plate primitive */

.plate,
.callout,
figure.code,
.table-wrap,
.side-group,
.stat {
  position: relative;
  background: var(--plate);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
}

.plate-label,
.code-lang,
.callout-title {
  position: absolute;
  top: -0.62rem;
  left: 1rem;
  padding: 0 0.5rem;
  background: var(--plate);
  color: var(--ink-soft);
  margin: 0;
}

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

.prose {
  max-width: var(--measure);
  padding: 3rem var(--gutter) 5rem;
  margin: 0 auto;
  min-width: 0;
}

.prose.plain {
  max-width: 48rem;
}

.prose ul,
.prose ol {
  margin: 0 0 1.2rem;
  padding-left: 1.4rem;
}

.prose li {
  margin-bottom: 0.45rem;
}

.prose li > p {
  margin-bottom: 0.55rem;
}

.prose li::marker {
  color: var(--teal);
  font-weight: 700;
}

.prose ol {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.prose ol > li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  margin-bottom: 0.9rem;
}

/* Ordered lists are procedures here, so the number gets a stamped chip. */
.prose ol > li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bone);
  background: var(--teal-deep);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.prose ol ol > li::before {
  background: var(--rocket-deep);
}

/* Checklist entries. The boxes are decoration, not inputs — this is a printed
   procedure, and a checkbox that loses its state on reload is worse than none. */
/* Block flow, not flex: a checklist entry can carry a command under it, and a
   flex row would sit that beside the text instead of below it. */
.prose li.task {
  list-style: none;
  position: relative;
  margin-left: -1.4rem;
  padding-left: 1.9rem;
}

.prose ul li.task {
  margin-bottom: 0.6rem;
}

.prose li.task > p {
  margin: 0;
}

.box {
  position: absolute;
  left: 0;
  top: 0.34em;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid var(--ink);
  background: var(--plate);
  color: var(--teal-deep);
  font-size: 0.8rem;
  line-height: 0.95rem;
  text-align: center;
}

code {
  font-family: var(--mono);
  font-size: 0.87em;
  background: var(--bone-2);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 0.05em 0.35em;
  overflow-wrap: break-word;
}

figure.code {
  margin: 1.6rem 0;
  padding: 1.35rem 1.1rem 1.1rem;
  background: var(--bone-2);
}

figure.code .code-lang {
  background: var(--bone-2);
  color: var(--rocket-deep);
}

figure.code pre {
  margin: 0;
  overflow-x: auto;
}

figure.code code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.83rem;
  line-height: 1.65;
  display: block;
}

.copy {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  font-family: var(--display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: var(--plate);
  border: 2px solid var(--rule);
  border-radius: 3px;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

figure.code:hover .copy,
.copy:focus {
  opacity: 1;
}

.copy:hover {
  border-color: var(--ink);
  color: var(--ink);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.2rem 0 0.2rem 1.4rem;
  border-left: 4px solid var(--sun);
  color: var(--ink-soft);
  font-style: italic;
}

blockquote p:last-child {
  margin-bottom: 0;
}

hr.rule {
  border: 0;
  height: 2px;
  background: var(--ink);
  margin: 3rem 0;
  position: relative;
}

hr.rule::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -5px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--bone);
  border: 2px solid var(--ink);
}

/* ---------------------------------------------------------------- callouts */

.callout {
  margin: 1.75rem 0;
  padding: 1.4rem 1.25rem 0.6rem;
  border-left-width: 8px;
}

.callout .callout-title {
  background: var(--plate);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.callout-note {
  border-left-color: var(--teal);
}
.callout-note .callout-title span {
  color: var(--teal);
}

.callout-tip {
  border-left-color: var(--avocado);
}
.callout-tip .callout-title span {
  color: var(--avocado);
}

.callout-warning {
  border-left-color: var(--sun);
}
.callout-warning .callout-title span {
  color: var(--sun);
}

.callout-danger {
  border-left-color: var(--rocket);
}
.callout-danger .callout-title span {
  color: var(--rocket);
}

.callout > :last-child {
  margin-bottom: 0.8rem;
}

/* ------------------------------------------------------------------ tables */

.table-wrap {
  margin: 1.75rem 0;
  overflow-x: auto;
  background: var(--plate);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  text-align: left;
  background: var(--ink);
  color: var(--bone);
  padding: 0.65rem 0.85rem;
  white-space: nowrap;
}

td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}

tbody tr:nth-child(even) {
  background: var(--bone-2);
}

tbody tr:last-child td {
  border-bottom: 0;
}

td code {
  white-space: nowrap;
}

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

.docs-shell {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr) 13rem;
  gap: 0 var(--gutter);
  max-width: 84rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
  align-items: start;
}

.docs-shell .prose {
  padding-left: 0;
  padding-right: 0;
  max-width: var(--measure);
}

.sidebar {
  position: sticky;
  top: 5.2rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding: 2.5rem 0 3rem;
  font-size: 0.92rem;
}

.side-group {
  padding: 1.25rem 1rem 0.9rem;
  margin-bottom: 1.35rem;
  box-shadow: 4px 4px 0 var(--shadow);
}

.side-label {
  position: absolute;
  top: -0.6rem;
  left: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  padding: 0 0.45rem;
  background: var(--plate);
  color: var(--ink);
}

.side-num {
  font-family: var(--mono);
  color: var(--rocket-deep);
}

.sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar li {
  margin: 0;
}

.sidebar a {
  display: block;
  padding: 0.28rem 0.5rem 0.28rem 0.85rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  line-height: 1.4;
}

.sidebar a:hover {
  color: var(--ink);
  border-left-color: var(--rule);
}

.sidebar a.active {
  color: var(--ink);
  font-weight: 650;
  border-left-color: var(--rocket);
  background: var(--bone-2);
}

.toc {
  position: sticky;
  top: 5.2rem;
  max-height: calc(100vh - 7rem);
  overflow-y: auto;
  padding: 3.4rem 0 3rem;
  font-size: 0.84rem;
  line-height: 1.45;
}

.toc-title {
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ink);
}

.toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc li {
  margin-bottom: 0.35rem;
}

.toc a {
  color: var(--ink-soft);
  text-decoration: none;
}

.toc a:hover,
.toc a.here {
  color: var(--rocket-deep);
}

.toc .toc-h3 {
  padding-left: 0.85rem;
  font-size: 0.95em;
}

/* ------------------------------------------------------------------- pager */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
}

.pager a {
  display: block;
  padding: 0.9rem 1.1rem;
  background: var(--plate);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.pager a:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--shadow);
}

.pager span {
  display: block;
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.64rem;
  color: var(--rocket-deep);
  margin-bottom: 0.2rem;
}

.pager strong {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1rem;
}

.pager-next {
  text-align: right;
}

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

.home {
  padding-bottom: 4rem;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(3rem, 7vw, 5rem);
  border-bottom: 2px solid var(--ink);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 62rem;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero h1 em {
  font-style: normal;
  color: var(--rocket-deep);
}

.hero .lede {
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  max-width: 46ch;
  color: var(--ink-soft);
}

.starburst {
  position: absolute;
  fill: var(--sun);
  opacity: var(--burst);
  pointer-events: none;
}

.hero .starburst {
  z-index: 1;
  width: min(42rem, 85vw);
  height: min(42rem, 85vw);
  right: -9rem;
  top: 50%;
  transform: translateY(-50%);
}

@media (prefers-reduced-motion: no-preference) {
  .hero .starburst {
    animation: bloom 1.1s cubic-bezier(0.16, 0.9, 0.3, 1) backwards;
  }
  @keyframes bloom {
    from {
      opacity: 0;
      transform: translateY(-50%) rotate(-22deg) scale(0.85);
    }
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-inner > * {
    animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  }
  .hero-inner > *:nth-child(2) {
    animation-delay: 0.06s;
  }
  .hero-inner > *:nth-child(3) {
    animation-delay: 0.12s;
  }
  .hero-inner > *:nth-child(4) {
    animation-delay: 0.18s;
  }
  @keyframes rise {
    from {
      opacity: 0;
      transform: translateY(0.8rem);
    }
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin: 2rem 0 0;
}

.btn {
  display: inline-block;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.5rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  background: var(--plate);
  box-shadow: 4px 4px 0 var(--ink);
  transition:
    transform 0.12s,
    box-shadow 0.12s;
}

.btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink);
  text-decoration: none;
}

.btn-primary {
  background: var(--rocket);
  color: #fff8f0;
}

.band {
  padding: clamp(3rem, 6vw, 4.5rem) var(--gutter);
  border-bottom: 2px solid var(--ink);
}

.band-tint {
  background: var(--bone-2);
}

.band-inner {
  max-width: 68rem;
  margin: 0 auto;
}

.band h2 {
  border: 0;
  padding-top: 0;
  margin-top: 0;
}

.band h2::before {
  display: none;
}

.band-head {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}

.band-head p {
  color: var(--ink-soft);
  margin-bottom: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: 1.75rem 1.5rem;
}

.plate {
  padding: 1.6rem 1.25rem 1.25rem;
  /* Corner rivets. Only the feature plates get them — a panel that is screwed
     down, not every box on the page. */
  background-image:
    radial-gradient(circle at 9px 9px, var(--rule) 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 9px) 9px, var(--rule) 2px, transparent 2.5px),
    radial-gradient(circle at 9px calc(100% - 9px), var(--rule) 2px, transparent 2.5px),
    radial-gradient(circle at calc(100% - 9px) calc(100% - 9px), var(--rule) 2px, transparent 2.5px);
  background-repeat: no-repeat;
  transition:
    transform 0.14s,
    box-shadow 0.14s;
}

.plate:hover {
  transform: translate(2px, 2px);
  box-shadow: 3px 3px 0 var(--shadow);
}

.plate h3 {
  margin: 0 0 0.5rem;
  font-size: 1.08rem;
}

.plate p:last-child {
  margin-bottom: 0;
}

.plate p {
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.plate .plate-label {
  color: var(--teal-deep);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem;
}

.stat {
  padding: 1.1rem 1rem 0.9rem;
  text-align: center;
}

.stat-value {
  display: block;
  font-family: var(--display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  color: var(--rocket-deep);
}

.stat-label {
  display: block;
  margin-top: 0.5rem;
  color: var(--ink-soft);
}

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 2.5rem;
  align-items: start;
}

/* A grid track sizes to its widest content by default, so a long transcript
   would push the column past the band instead of scrolling inside it. */
.split > *,
.grid > * {
  min-width: 0;
}

.terminal {
  background: #14202b;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--teal);
  padding: 1.5rem 1.25rem 1.25rem;
  position: relative;
}

.terminal::before {
  content: "SESSION";
  position: absolute;
  top: -0.62rem;
  left: 1rem;
  padding: 0 0.5rem;
  background: #14202b;
  color: var(--sun);
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.7rem;
  font-weight: 600;
}

/* The scroll lives on the pre, not the panel: a panel with `overflow` clips the
   stamped label riding on its top border. */
.terminal pre {
  margin: 0;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.6;
  color: #cfe3d8;
}

.terminal b {
  color: var(--sun);
  font-weight: 600;
}

.terminal i {
  color: #7fd6c6;
  font-style: normal;
}

/* --------------------------------------------------------------- colophon */

.colophon {
  position: relative;
  overflow: hidden;
  border-top: 2px solid var(--ink);
  background: var(--bone-2);
  padding: 3.5rem var(--gutter) 2.5rem;
}

.colophon-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.colophon-burst .starburst {
  width: 34rem;
  height: 34rem;
  left: -13rem;
  bottom: -17rem;
  opacity: 0.2;
}

.colophon-grid {
  position: relative;
  z-index: 2;
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2rem;
}

.colophon-brand p {
  font-size: 0.9rem;
  color: var(--ink-soft);
  max-width: 30ch;
}

.colophon-brand .brand {
  margin-bottom: 0.9rem;
}

.plaque {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.6rem;
  border: 2px solid var(--ink);
  background: var(--plate);
}

.colophon-label {
  color: var(--ink);
  margin: 0 0 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--ink);
}

.colophon ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9rem;
}

.colophon li {
  margin-bottom: 0.4rem;
}

.colophon a {
  color: var(--ink-soft);
  text-decoration: none;
}

.colophon a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* ------------------------------------------------------------ smtp lookup */

.lookup {
  margin: 1.5rem 0 2rem;
}

.lookup input {
  width: 100%;
  padding: 0.75rem 1rem;
  font: inherit;
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--plate);
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow);
}

.lookup input:focus {
  outline: none;
  box-shadow: 4px 4px 0 var(--rocket);
}

.lookup-empty {
  padding: 1rem;
  text-align: center;
  color: var(--ink-soft);
}

tr[hidden] {
  display: none;
}

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

@media (max-width: 1180px) {
  .docs-shell {
    grid-template-columns: 15rem minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}

@media (max-width: 900px) {
  .colophon-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .menu {
    display: flex;
  }

  .masthead {
    flex-wrap: wrap;
  }

  .masthead-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1rem 0 0.5rem;
  }

  .masthead-nav.open {
    display: flex;
  }

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

  .sidebar {
    position: static;
    max-height: none;
    padding: 1.5rem 0 0;
    order: 2;
    border-top: 2px solid var(--ink);
    margin-top: 2rem;
  }

  .docs-shell .prose {
    order: 1;
    padding-bottom: 1rem;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 16px;
  }
  .colophon-grid {
    grid-template-columns: 1fr;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager-next {
    text-align: left;
  }
}

@media print {
  .masthead,
  .sidebar,
  .toc,
  .pager,
  .colophon,
  .skip {
    display: none;
  }
  body {
    background: #fff;
    color: #000;
  }
  .docs-shell {
    display: block;
  }
}
