/* Design tokens. Light is the default; dark applies from the OS setting or the toggle. */
:root {
  --bg: #fbfbf9;
  --bg-raised: #ffffff;
  --bg-sunken: #f2f2ee;
  --ink: #16181a;
  --ink-2: #4a4f55;
  --ink-3: #80868d;
  --line: #e2e2dc;
  --line-strong: #c9c9c1;
  --accent: #0a7f63;
  --accent-ink: #ffffff;
  --accent-soft: #e3f3ee;
  --warn: #9a5b00;
  --warn-soft: #fbf1e1;
  --grid: rgba(22, 24, 26, 0.045);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 10px;
  --max: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1112;
    --bg-raised: #161a1c;
    --bg-sunken: #0b0d0e;
    --ink: #eceeed;
    --ink-2: #b2b8b6;
    --ink-3: #7c8482;
    --line: #262b2d;
    --line-strong: #353c3f;
    --accent: #3fd1a6;
    --accent-ink: #062018;
    --accent-soft: #10302a;
    --warn: #f0b45a;
    --warn-soft: #2a2114;
    --grid: rgba(236, 238, 237, 0.04);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0f1112;
  --bg-raised: #161a1c;
  --bg-sunken: #0b0d0e;
  --ink: #eceeed;
  --ink-2: #b2b8b6;
  --ink-3: #7c8482;
  --line: #262b2d;
  --line-strong: #353c3f;
  --accent: #3fd1a6;
  --accent-ink: #062018;
  --accent-soft: #10302a;
  --warn: #f0b45a;
  --warn-soft: #2a2114;
  --grid: rgba(236, 238, 237, 0.04);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  /* Nothing may make the page scroll sideways on a phone. "clip" keeps position: sticky working. */
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] {
  display: none !important;
}

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

a {
  color: inherit;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.5em;
  font-weight: 650;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}
h3 {
  font-size: 1.15rem;
}
p {
  margin: 0 0 1em;
}
code,
kbd,
.mono {
  font-family: var(--font-mono);
  font-size: 0.88em;
}
code {
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.1em 0.35em;
}
pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  line-height: 1.5;
}
/* Long file names, URLs, and commands wrap at the edge of the screen. */
p code,
li code,
td code,
dd code {
  overflow-wrap: anywhere;
}
pre {
  max-width: 100%;
}

pre code {
  background: none;
  border: 0;
  padding: 0;
}
hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 48px 0;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.muted {
  color: var(--ink-2);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--bg-raised);
  color: var(--ink);
  font: 500 0.92rem/1 var(--font-sans);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.btn:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.btn.primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.btn.primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font: 500 0.75rem/1 var(--font-mono);
  color: var(--ink-2);
  white-space: nowrap;
}

.grid-bg {
  background-image: linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Images with one version for each theme. */
.art-dark {
  display: none;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .art-light {
    display: none;
  }
  :root:not([data-theme="light"]) .art-dark {
    display: block;
  }
}
:root[data-theme="dark"] .art-light {
  display: none;
}
:root[data-theme="dark"] .art-dark {
  display: block;
}

/* Site header and footer. */
.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 100;
  background: var(--bg-raised);
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand.small {
  font-size: 0.9rem;
  gap: 8px;
}
.site-header nav {
  display: flex;
  align-items: center;
  gap: clamp(10px, 3vw, 24px);
  font-size: 0.92rem;
}
.site-header nav a {
  text-decoration: none;
  color: var(--ink-2);
}
.site-header nav a:hover,
.site-header nav a[aria-current="page"] {
  color: var(--ink);
}
.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.theme-toggle .moon {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .sun {
  display: none;
}
:root[data-theme="dark"] .theme-toggle .moon {
  display: block;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .sun {
    display: none;
  }
  :root:not([data-theme="light"]) .theme-toggle .moon {
    display: block;
  }
}
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 96px;
  padding: 32px 0 48px;
  font-size: 0.85rem;
}
.foot {
  display: grid;
  gap: 6px;
}
.foot p {
  margin: 0;
}
@media (max-width: 520px) {
  .site-header nav a[rel="me"] {
    display: none;
  }
}

/* The <explode-viewer> element. */
.ev {
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}
.ev-canvas {
  position: relative;
  flex: 1;
  min-height: 0;
  cursor: grab;
  touch-action: none;
}
.ev-canvas:active {
  cursor: grabbing;
}
.ev-canvas canvas {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
}
.ev-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  color: var(--ink-3);
}
.ev-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.ev-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--bg-raised);
  border: 1px solid var(--accent);
  color: var(--accent);
  font: 600 0.72rem/1.2 var(--font-mono);
  white-space: nowrap;
  box-shadow: var(--shadow);
}
.ev-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-top: 1px solid var(--line);
  font-size: 0.75rem;
}
.ev-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.ev-slider {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 0.68rem;
}
.ev-slider input {
  width: 90px;
  accent-color: var(--accent);
}
.ev-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  font: 500 0.75rem/1 var(--font-sans);
  cursor: pointer;
}
.ev-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
@media (max-width: 640px) {
  .ev-slider span,
  .ev-btn span {
    display: none;
  }
  .ev-slider input {
    width: 70px;
  }
}

/* Home page. */
.page-home {
    .intro {
      padding-top: clamp(56px, 12vw, 128px);
      padding-bottom: clamp(40px, 8vw, 80px);
    }
    .intro h1 {
      max-width: 18ch;
    }
    .lede {
      font-size: clamp(1.05rem, 2vw, 1.25rem);
      color: var(--ink-2);
      max-width: 56ch;
    }
    .group + .group {
      margin-top: 64px;
    }
    .list-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      border-bottom: 1px solid var(--line);
      padding-bottom: 12px;
      margin-bottom: 24px;
    }
    .list-head h2 {
      margin: 0;
    }
    .cards {
      list-style: none;
      margin: 0;
      padding: 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
      gap: 20px;
    }
    .card {
      display: flex;
      flex-direction: column;
      height: 100%;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-raised);
      text-decoration: none;
      overflow: hidden;
      transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    }
    .card:hover {
      color: inherit;
      border-color: var(--line-strong);
      transform: translateY(-2px);
      box-shadow: var(--shadow);
    }
    .thumb {
      aspect-ratio: 16 / 10;
      display: grid;
      place-items: center;
      border-bottom: 1px solid var(--line);
      background-color: var(--bg-sunken);
      overflow: hidden;
    }
    .thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
    .thumb img.art {
      box-sizing: border-box;
      min-height: 0;
      object-fit: contain;
      padding: 20px;
      transition: transform 0.3s;
    }
    .card:hover .thumb img.art {
      transform: scale(1.04);
    }
    .thumb span {
      color: var(--ink-3);
      font-size: 0.85rem;
    }
    .body {
      padding: 18px 20px 20px;
      display: flex;
      flex-direction: column;
      flex: 1;
    }
    .meta {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      margin-bottom: 12px;
    }
    .body h3 {
      font-size: 1.2rem;
      margin-bottom: 6px;
    }
    .body p {
      font-size: 0.95rem;
    }
    .more {
      margin-top: auto;
      font-size: 0.8rem;
      color: var(--accent);
    }
}

/* About page. */
.page-about {
    .about {
      max-width: 760px;
      padding-top: clamp(48px, 10vw, 104px);
    }
    .lede {
      font-size: clamp(1.1rem, 2.2vw, 1.3rem);
      color: var(--ink-2);
    }
    h2 {
      margin-top: 48px;
    }
    .list {
      padding-left: 1.2em;
    }
    .list li {
      padding: 4px 0;
    }
}

/* 404 page. */
.page-404 {
    .nf {
      padding-top: clamp(64px, 14vw, 160px);
      min-height: 50vh;
    }
}

/* Project pages. */
.page-project {
    .hero {
      padding-top: clamp(40px, 8vw, 88px);
      padding-bottom: 32px;
    }
    .hero.has-art {
      display: grid;
      grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
      gap: 48px;
      align-items: center;
    }
    .hero-art {
      margin: 0;
      display: grid;
      place-items: center;
    }
    .hero-art img {
      width: 100%;
      max-height: 520px;
      object-fit: contain;
    }
    @media (max-width: 860px) {
      .hero.has-art {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
      }
      .hero-art img {
        max-height: 320px;
      }
    }
    .hero .eyebrow a {
      text-decoration: none;
    }
    .lede {
      font-size: clamp(1.1rem, 2.2vw, 1.35rem);
      color: var(--ink-2);
      max-width: 44ch;
    }
    .stats {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      margin: 32px 0;
      border-top: 1px solid var(--line);
      border-bottom: 1px solid var(--line);
    }
    .stats > div {
      padding: 14px 16px 14px 0;
    }
    .stats > div + div {
      border-left: 1px solid var(--line);
      padding-left: 16px;
    }
    .stats dt {
      font: 500 0.7rem/1 var(--font-mono);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--ink-3);
      margin-bottom: 6px;
    }
    .stats dd {
      margin: 0;
      font-weight: 600;
    }
    .actions {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }
    .overview {
      display: grid;
      grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
      gap: 48px;
      padding-top: 48px;
    }
    .about p {
      max-width: 65ch;
    }
    .highlights {
      align-self: start;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 20px 22px;
      background: var(--bg-raised);
    }
    .highlights ul {
      list-style: none;
      padding: 0;
      margin: 12px 0 0;
    }
    .highlights li {
      padding: 8px 0 8px 22px;
      border-top: 1px solid var(--line);
      position: relative;
      font-size: 0.95rem;
    }
    .highlights li::before {
      content: "";
      position: absolute;
      left: 2px;
      top: 17px;
      width: 8px;
      height: 8px;
      border-radius: 2px;
      background: var(--accent);
    }
    .block {
      padding-top: 64px;
    }
    .prose p {
      max-width: 70ch;
    }
    .table-wrap {
      overflow-x: auto;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-raised);
    }
    .bom {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.93rem;
    }
    .bom th {
      text-align: left;
      font: 500 0.7rem/1 var(--font-mono);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--ink-3);
      padding: 12px 16px;
      border-bottom: 1px solid var(--line);
    }
    .bom td {
      padding: 12px 16px;
      border-bottom: 1px solid var(--line);
      vertical-align: top;
    }
    .bom tbody tr:last-child td {
      border-bottom: 0;
    }
    .bom tfoot td {
      border-top: 1px solid var(--line-strong);
      border-bottom: 0;
      font-weight: 600;
    }
    .bom .spec,
    .bom .note {
      display: block;
      color: var(--ink-2);
      font-size: 0.85rem;
    }
    .bom .note {
      color: var(--ink-3);
    }
    .bom .get {
      white-space: nowrap;
    }
    .bom .get a {
      display: block;
      color: var(--accent);
      text-decoration: none;
      font-weight: 500;
    }
    .bom .get a:hover {
      text-decoration: underline;
    }
    .price {
      color: var(--ink-3);
      font-size: 0.8rem;
    }
    .kind {
      font: 500 0.7rem/1 var(--font-mono);
      padding: 4px 7px;
      border-radius: 5px;
      border: 1px solid var(--line);
      color: var(--ink-2);
    }
    .kind-print {
      border-color: var(--accent);
      color: var(--accent);
    }
    .cols {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 48px;
      margin-top: 40px;
    }
    .plain {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    .plain li {
      padding: 8px 0;
      border-bottom: 1px solid var(--line);
      font-size: 0.93rem;
    }
    .kv {
      display: grid;
      grid-template-columns: max-content 1fr;
      gap: 0;
      margin: 0;
      font-size: 0.93rem;
    }
    .kv dt,
    .kv dd {
      padding: 8px 0;
      border-bottom: 1px solid var(--line);
      margin: 0;
    }
    .kv dt {
      padding-right: 20px;
      color: var(--ink-2);
    }

    /* Build section */
    .build {
      padding-top: 72px;
    }
    .build-head {
      display: flex;
      flex-wrap: wrap;
      align-items: end;
      justify-content: space-between;
      gap: 16px;
      margin-bottom: 20px;
    }
    .build-head h2 {
      margin: 0;
    }
    .progress {
      display: flex;
      align-items: center;
      gap: 12px;
      font-size: 0.78rem;
      color: var(--ink-2);
    }
    .progress-bar {
      width: 160px;
      height: 4px;
      background: var(--line);
      border-radius: 2px;
      overflow: hidden;
    }
    .progress-bar span {
      display: block;
      height: 100%;
      width: 0;
      background: var(--accent);
      transition: width 0.3s;
    }
    .build-grid {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
      gap: 32px;
      align-items: start;
    }
    .viewer-col {
      order: 2;
      position: sticky;
      top: 76px;
    }
    .viewer-sticky {
      height: calc(100vh - 110px);
      min-height: 420px;
      display: flex;
      flex-direction: column;
    }
    .viewer-sticky explode-viewer {
      flex: 1;
      min-height: 0;
    }
    .viewer-hint {
      margin: 8px 0 0;
      font-size: 0.7rem;
      color: var(--ink-3);
      text-align: center;
    }
    .steps {
      list-style: none;
      margin: 0;
      padding: 0 0 30vh;
      display: grid;
      gap: 16px;
    }
    .step {
      border: 1px solid var(--line);
      border-radius: var(--radius);
      padding: 20px 22px;
      background: var(--bg-raised);
      transition: border-color 0.2s, box-shadow 0.2s;
    }
    .step.is-active {
      border-color: var(--accent);
      box-shadow: var(--shadow);
    }
    @media (min-width: 901px) {
      .step:not(.is-active) {
        cursor: pointer;
      }
      .step:not(.is-active):hover {
        border-color: var(--line-strong);
      }
    }
    .step.is-done .step-num {
      background: var(--accent);
      color: var(--accent-ink);
      border-color: var(--accent);
    }
    .step-head {
      display: flex;
      align-items: center;
      gap: 12px;
    }
    .step-head h3 {
      flex: 1;
      margin: 0;
    }
    .step-num {
      display: grid;
      place-items: center;
      width: 34px;
      height: 34px;
      flex: none;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      font-size: 0.8rem;
      font-weight: 600;
    }
    .step.is-active .step-num {
      border-color: var(--accent);
      color: var(--accent);
    }
    .step.is-done.is-active .step-num {
      color: var(--accent-ink);
    }
    .done {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.78rem;
      color: var(--ink-3);
      cursor: pointer;
      user-select: none;
    }
    .done input {
      accent-color: var(--accent);
      width: 16px;
      height: 16px;
    }
    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      list-style: none;
      padding: 0;
      margin: 14px 0 0;
    }
    .chips a {
      display: inline-block;
      max-width: 100%;
      overflow-wrap: anywhere;
      font: 500 0.72rem/1 var(--font-mono);
      padding: 5px 9px;
      border-radius: 999px;
      background: var(--accent-soft);
      color: var(--accent);
      text-decoration: none;
    }
    .do {
      margin: 14px 0 0;
      padding-left: 1.3em;
    }
    .do li {
      padding: 3px 0;
    }
    .do li::marker {
      color: var(--ink-3);
      font-family: var(--font-mono);
      font-size: 0.85em;
    }
    .step-img {
      margin-top: 14px;
      border-radius: 8px;
      border: 1px solid var(--line);
    }
    div.step-img {
      background-color: var(--bg);
      padding: 12px;
    }
    div.step-img img {
      max-height: 360px;
      margin: 0 auto;
      object-fit: contain;
    }
    .callout {
      margin: 14px 0 0;
      padding: 10px 14px;
      border-radius: 8px;
      font-size: 0.9rem;
      border-left: 3px solid;
    }
    .callout strong {
      font: 600 0.7rem/1 var(--font-mono);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      margin-right: 6px;
    }
    .callout.tip {
      background: var(--accent-soft);
      border-color: var(--accent);
    }
    .callout.tip strong {
      color: var(--accent);
    }
    .callout.warn {
      background: var(--warn-soft);
      border-color: var(--warn);
    }
    .callout.warn strong {
      color: var(--warn);
    }
    .show-step {
      display: none;
      margin-top: 14px;
      background: none;
      border: 1px solid var(--line-strong);
      border-radius: 6px;
      padding: 6px 10px;
      font-size: 0.72rem;
      color: var(--ink-2);
      cursor: pointer;
    }
    .credits p {
      max-width: 75ch;
      font-size: 0.9rem;
    }
    .downloads {
      list-style: none;
      padding: 0;
      margin: 0;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 10px;
    }
    .downloads a {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 14px 16px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-raised);
      text-decoration: none;
      font-size: 0.93rem;
    }
    .downloads a:hover {
      border-color: var(--accent);
    }

    @media (max-width: 900px) {
      .overview,
      .cols {
        grid-template-columns: 1fr;
        gap: 28px;
      }
      .build-grid {
        grid-template-columns: 1fr;
        gap: 16px;
      }
      .viewer-col {
        order: 0;
        top: 60px;
        z-index: 5;
        background: var(--bg);
        padding-bottom: 8px;
        margin: 0 calc(-1 * var(--gutter));
        padding-left: var(--gutter);
        padding-right: var(--gutter);
      }
      .viewer-sticky {
        height: 44vh;
        min-height: 280px;
      }
      .viewer-hint {
        display: none;
      }
      .steps {
        padding-bottom: 20vh;
      }
      .stats > div + div {
        border-left: 0;
        padding-left: 0;
      }
    }
}

/* Versions of a project. */
.page-project {
  .versions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: -4px 0 14px;
  }
  .versions .eyebrow {
    margin: 0 4px 0 0;
  }
  .version {
    font: 500 0.75rem/1 var(--font-mono);
    padding: 5px 9px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    text-decoration: none;
    color: var(--ink-2);
  }
  a.version:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  .version.is-current {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
  }
  .archived-note {
    margin: 24px 0 0;
    padding: 12px 16px;
    border: 1px solid var(--warn);
    border-left-width: 3px;
    border-radius: 8px;
    background: var(--warn-soft);
    font-size: 0.92rem;
  }
  .archived-note a {
    margin-left: 6px;
    font-weight: 600;
  }
  .history {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 2px solid var(--line);
  }
  .history li {
    position: relative;
    padding: 4px 0 18px 20px;
  }
  .history li::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--line-strong);
  }
  .history li.is-current::before {
    border-color: var(--accent);
    background: var(--accent);
  }
  .history-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .history p {
    margin: 4px 0 0;
    max-width: 70ch;
  }
}

/* Images in a section, for example app screens. */
.page-project {
  .section-images {
    margin: 32px 0 0;
  }
  .section-images h3 {
    margin-bottom: 4px;
  }
  .section-images p {
    margin: 0 0 14px;
    font-size: 0.93rem;
  }
  .section-caption {
    margin-top: 16px;
    font-size: 0.75rem;
  }
  .section-images ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr));
    gap: 16px;
  }
  .section-images img {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
  }
}

/* Lookout Marine demo block. */
.lookout-demo {
    .demo-block {
      padding-top: 64px;
    }
    .demo-head p.muted,
    .narrow {
      max-width: 62ch;
    }
    .demo-frame {
      position: relative;
      aspect-ratio: 16 / 10;
      max-height: 78vh;
      width: 100%;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      overflow: hidden;
      background: var(--bg-sunken);
      margin-top: 20px;
    }
    .demo-frame img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      filter: saturate(0.9);
    }
    .demo-frame iframe {
      width: 100%;
      height: 100%;
      border: 0;
      display: block;
      background: #fff;
    }
    .demo-frame:fullscreen {
      max-height: none;
      border-radius: 0;
    }
    .demo-cover {
      position: absolute;
      inset: 0;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 12px;
      background: color-mix(in srgb, var(--bg) 55%, transparent);
      backdrop-filter: blur(2px);
      text-align: center;
      padding: 16px;
    }
    .demo-cover .mono {
      font-size: 0.78rem;
      color: var(--ink-2);
      background: var(--bg-raised);
      padding: 4px 10px;
      border-radius: 6px;
    }
    .demo-start {
      height: 46px;
      padding: 0 22px;
      font-size: 1rem;
    }
    .demo-tools {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
      gap: 8px 16px;
      margin-top: 10px;
      font-size: 0.8rem;
    }
    .demo-links {
      display: flex;
      gap: 16px;
    }
    .link-btn {
      background: none;
      border: 0;
      padding: 0;
      color: inherit;
      font: inherit;
      text-decoration: underline;
      text-decoration-color: var(--line-strong);
      text-underline-offset: 3px;
      cursor: pointer;
    }
    .link-btn:disabled {
      opacity: 0.4;
      cursor: default;
    }
    .shots {
      list-style: none;
      padding: 0;
      margin: 24px 0 0;
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 16px;
    }
    .shots figure {
      margin: 0;
    }
    .shots img {
      width: 100%;
      aspect-ratio: 16 / 11;
      object-fit: contain;
      background: var(--bg-sunken);
      border: 1px solid var(--line);
      border-radius: 8px;
    }
    .shots figcaption {
      margin-top: 8px;
      font-size: 0.88rem;
    }
    .shots figcaption .mono {
      font-size: 0.72rem;
      margin-left: 6px;
    }
    .arch {
      margin: 24px 0 0;
      padding: 20px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-raised);
    }
    .arch svg {
      width: 100%;
      height: auto;
    }
    .arch text {
      fill: var(--ink);
    }
    .arch .note {
      fill: var(--ink-3);
      font-family: var(--font-mono);
    }
    .arch .box {
      fill: var(--bg);
      stroke: var(--line-strong);
    }
    .arch .box.strong {
      stroke: var(--ink-2);
    }
    .arch .box.accent {
      fill: var(--accent-soft);
      stroke: var(--accent);
    }
    .arch .accent-text {
      fill: var(--accent);
      font-weight: 600;
    }
    .arch .wire {
      stroke: var(--line-strong);
      stroke-width: 1.5;
      fill: none;
    }
    @media (max-width: 760px) {
      .shots {
        grid-template-columns: repeat(2, 1fr);
      }
      .demo-frame {
        aspect-ratio: 3 / 4;
      }
    }
}

/* DIMS URL builder block. */
.dims-demo {
    &.demo-block {
      padding-top: 56px;
    }
    .lead {
      max-width: 62ch;
    }
    .dims {
      display: grid;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
      gap: 24px;
      margin-top: 24px;
      border: 1px solid var(--line);
      border-radius: var(--radius);
      background: var(--bg-raised);
      padding: 22px;
    }
    .dims-controls {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }
    .field {
      display: flex;
      flex-direction: column;
      gap: 6px;
    }
    .label {
      font: 500 0.7rem/1 var(--font-mono);
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--ink-3);
    }
    input,
    select,
    .ops input {
      font: 0.85rem/1.3 var(--font-mono);
      color: var(--ink);
      background: var(--bg);
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      padding: 8px 10px;
      min-width: 0;
    }
    input:focus,
    select:focus,
    .ops input:focus {
      outline: 2px solid var(--accent);
      outline-offset: -1px;
    }
    .seg {
      display: flex;
      border: 1px solid var(--line-strong);
      border-radius: 8px;
      overflow: hidden;
    }
    .seg button {
      flex: 1;
      font: 0.85rem/1.2 var(--font-sans, inherit);
      padding: 8px 10px;
      background: var(--bg);
      color: var(--ink-2);
      border: 0;
      cursor: pointer;
    }
    .seg button + button {
      border-left: 1px solid var(--line-strong);
    }
    .seg button[aria-checked="true"] {
      background: var(--accent);
      color: var(--accent-ink);
    }
    .seg code {
      font-size: 0.78rem;
      background: none;
      border: 0;
      color: inherit;
      padding: 0;
    }
    .ops {
      list-style: none;
      margin: 0;
      padding: 0;
      display: flex;
      flex-direction: column;
      gap: 6px;
      counter-reset: op;
    }
    .ops li {
      display: grid;
      grid-template-columns: 6.5rem minmax(0, 1fr) auto;
      align-items: center;
      gap: 8px;
    }
    .ops .op-name {
      font-size: 0.82rem;
      background: none;
      border: 0;
      padding: 0;
      color: var(--accent);
    }
    .ops li.bad input {
      border-color: #c0392b;
    }
    .ops .op-btns {
      display: flex;
      gap: 2px;
    }
    .ops .op-btns button {
      width: 28px;
      height: 28px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--bg);
      color: var(--ink-2);
      cursor: pointer;
    }
    .ops .op-btns button:hover {
      border-color: var(--line-strong);
      color: var(--ink);
    }
    .add {
      display: flex;
      gap: 8px;
      margin-top: 4px;
    }
    .add select {
      flex: 1;
    }
    .dims-out {
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-width: 0;
    }
    .url-box {
      display: flex;
      gap: 12px;
      align-items: flex-start;
      border: 1px solid var(--line);
      border-radius: 8px;
      background: var(--bg-sunken);
      padding: 10px 12px;
    }
    .url {
      flex: 1;
      font-size: 0.78rem;
      line-height: 1.5;
      word-break: break-all;
      background: none;
      border: 0;
      padding: 0;
    }
    .link-btn {
      background: none;
      border: 0;
      padding: 0;
      color: var(--accent);
      font: 0.8rem var(--font-mono);
      cursor: pointer;
    }
    .preview {
      margin: 0;
      border: 1px solid var(--line);
      border-radius: 8px;
      min-height: 280px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      gap: 10px;
      padding: 16px;
    }
    .preview canvas {
      max-width: 100%;
      max-height: 460px;
      object-fit: contain;
      box-shadow: var(--shadow);
    }
    .preview .live {
      max-width: 100%;
      max-height: 460px;
      object-fit: contain;
      box-shadow: var(--shadow);
    }
    .live-bar {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 12px;
    }
    .preview figcaption,
    .small {
      font-size: 0.72rem;
      margin: 0;
    }
    @media (max-width: 860px) {
      .dims {
        grid-template-columns: minmax(0, 1fr);
        padding: 16px;
      }
    }
}
