body[data-page="blueprint"] {
  --bp-sheet: #f3eee5;
  --bp-panel: #fffaf2;
  --bp-ink: #191714;
  --bp-mute: #6d665c;
  --bp-rule: rgb(51 42 33 / 0.14);
  --bp-rule-strong: rgb(51 42 33 / 0.28);
  --bp-signal: #e31b23;
  --bp-grid: rgb(227 27 35 / 0.045);
  background: var(--bp-sheet);
  color: var(--bp-ink);
}

body[data-page="blueprint"] .grain {
  opacity: 0.035;
  mix-blend-mode: multiply;
}

.bp-sheet {
  position: relative;
  isolation: isolate;
  padding: 6.75rem 1rem 4.5rem;
}

.bp-sheet::before {
  content: "";
  position: absolute;
  inset: 5.6rem 0.65rem 1.25rem;
  z-index: 0;
  pointer-events: none;
  border: 1px solid var(--bp-rule-strong);
  background-image:
    linear-gradient(var(--bp-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--bp-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}

.bp-crop {
  position: absolute;
  z-index: 2;
  width: 1.15rem;
  height: 1.15rem;
  pointer-events: none;
  color: var(--bp-signal);
}

.bp-crop::before,
.bp-crop::after {
  content: "";
  position: absolute;
  background: currentColor;
}

.bp-crop--tl { top: 5.35rem; left: 0.4rem; }
.bp-crop--tr { top: 5.35rem; right: 0.4rem; }
.bp-crop--bl { bottom: 1rem; left: 0.4rem; }
.bp-crop--br { bottom: 1rem; right: 0.4rem; }

.bp-crop--tl::before,
.bp-crop--bl::before,
.bp-crop--tr::before,
.bp-crop--br::before {
  width: 1.15rem;
  height: 1px;
  left: 0;
}

.bp-crop--tl::after,
.bp-crop--bl::after,
.bp-crop--tr::after,
.bp-crop--br::after {
  width: 1px;
  height: 1.15rem;
  top: 0;
}

.bp-crop--tl::before { top: 0; }
.bp-crop--tl::after { left: 0; }
.bp-crop--tr::before { top: 0; right: 0; left: auto; }
.bp-crop--tr::after { right: 0; left: auto; }
.bp-crop--bl::before { bottom: 0; top: auto; }
.bp-crop--bl::after { bottom: 0; top: auto; left: 0; }
.bp-crop--br::before { bottom: 0; top: auto; right: 0; left: auto; }
.bp-crop--br::after { bottom: 0; top: auto; right: 0; left: auto; }

.bp-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 76rem);
  margin-inline: auto;
}

.bp-titleblock {
  display: grid;
  gap: 1.15rem;
  padding: 1.15rem 1.15rem 1.25rem;
  border: 1px solid var(--bp-ink);
  background: var(--bp-panel);
  box-shadow: 0 18px 40px rgb(73 52 31 / 0.08);
}

.bp-titleblock-meta {
  display: grid;
  gap: 0.85rem;
}

.bp-meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--bp-rule);
}

.bp-meta-row dt {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bp-mute);
}

.bp-meta-row dd {
  margin: 0.2rem 0 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.78rem;
  color: var(--bp-ink);
}

.bp-titleblock h1 {
  margin: 0;
  max-width: 18ch;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.6rem, 8vw, 5.6rem);
  font-weight: 700;
  line-height: 0.86;
  letter-spacing: -0.055em;
}

.bp-titleblock-lead {
  margin: 0;
  max-width: 38rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--bp-mute);
}

.bp-stamp {
  justify-self: start;
  padding: 0.55rem 0.7rem 0.45rem;
  border: 2px solid var(--bp-signal);
  color: var(--bp-signal);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.bp-stamp small {
  display: block;
  margin-top: 0.15rem;
  letter-spacing: 0.08em;
}

.bp-layout {
  display: grid;
  gap: 1.5rem;
  margin-top: 1.35rem;
}

.bp-toc {
  padding: 1rem 0.95rem 1.1rem;
  border: 1px solid var(--bp-rule-strong);
  background: rgb(255 250 242 / 0.92);
}

.bp-toc h2 {
  margin: 0 0 0.85rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bp-mute);
}

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

.bp-toc a {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 0.45rem;
  padding: 0.42rem 0.2rem;
  border-top: 1px solid var(--bp-rule);
  color: inherit;
  text-decoration: none;
  font-size: 0.92rem;
  line-height: 1.3;
}

.bp-toc a[aria-current="true"] {
  color: var(--bp-signal);
}

.bp-toc a span {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--bp-mute);
}

.bp-main {
  min-width: 0;
  display: grid;
  gap: 1.15rem;
}

.bp-section {
  padding: 1.2rem 1.05rem 1.3rem;
  border: 1px solid var(--bp-rule-strong);
  background: rgb(255 250 242 / 0.88);
}

.bp-section > header {
  display: grid;
  gap: 0.55rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--bp-ink);
}

.bp-kicker {
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--bp-signal);
}

.bp-section h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.bp-section h3 {
  margin: 1.35rem 0 0.55rem;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
}

.bp-section h3:first-child {
  margin-top: 0;
}

.bp-section > header p,
.bp-prose {
  margin: 0;
  max-width: 46rem;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--bp-ink);
}

.bp-prose + .bp-prose,
.bp-prose + .bp-pairs,
.bp-pairs + .bp-prose,
.bp-gain + .bp-prose {
  margin-top: 0.9rem;
}

.bp-pairs {
  display: grid;
  gap: 0.75rem;
  margin: 0.95rem 0 0;
}

.bp-pair {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem 0.85rem 0.9rem;
  border-left: 3px solid var(--bp-signal);
  background: rgb(243 238 229 / 0.72);
}

.bp-pair dt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.7rem;
  margin: 0;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.bp-pair dt small {
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bp-mute);
}

.bp-pair dd {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.bp-tech,
.bp-plain {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.6;
}

.bp-plain {
  color: #3d3832;
}

.bp-plain strong {
  display: inline;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bp-signal);
}

.bp-gain {
  margin-top: 1.1rem;
  padding: 0.9rem 0.95rem;
  border: 1px dashed var(--bp-ink);
  background: var(--bp-panel);
}

.bp-gain h4 {
  margin: 0 0 0.4rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bp-signal);
}

.bp-gain p {
  margin: 0;
  font-size: 0.97rem;
  line-height: 1.6;
}

.bp-list {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  max-width: 46rem;
}

.bp-list li {
  margin: 0.35rem 0;
  line-height: 1.55;
}

.bp-list li strong {
  font-weight: 600;
}

.bp-file {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.84em;
}

@media (min-width: 720px) {
  .bp-titleblock {
    grid-template-columns: minmax(0, 1.4fr) minmax(12rem, 0.55fr);
    align-items: end;
    padding: 1.25rem 1.35rem 1.35rem;
  }

  .bp-stamp {
    justify-self: end;
    align-self: start;
  }

  .bp-meta-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1080px) {
  .bp-sheet {
    padding: 7.1rem 1.5rem 5rem;
  }

  .bp-layout {
    grid-template-columns: 16.5rem minmax(0, 1fr);
    align-items: start;
    gap: 1.25rem;
  }

  .bp-toc {
    position: sticky;
    top: 6.2rem;
  }
}

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

@media print {
  body[data-page="blueprint"] .site-header,
  body[data-page="blueprint"] .menu-overlay,
  body[data-page="blueprint"] .menu-btn,
  body[data-page="blueprint"] .grain,
  body[data-page="blueprint"] footer,
  .bp-crop {
    display: none !important;
  }

  .bp-sheet {
    padding: 0;
  }

  .bp-sheet::before,
  .bp-toc {
    position: static;
    background: none;
  }

  .bp-layout {
    display: block;
  }

  .bp-section,
  .bp-titleblock,
  .bp-pair,
  .bp-gain {
    break-inside: avoid;
  }
}
