/* 3D Printing Source
   Colors come from filament spools and 1980s computer-magazine print: a four-band
   stripe (the layers of a print) on cool white, navy ink. Dark mode is deep blue.
   Everything is driven by the tokens below; change them here and the whole site follows. */

@font-face { font-family: "Jost"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/jost-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Jost"; font-weight: 800; font-style: normal; font-display: swap; src: url("/fonts/jost-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: italic; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); }

:root {
  --paper: #f4f5f9;
  --panel: #ffffff;
  --ink: #15153b;
  --ink-soft: #4a4a6e;
  --rule: #c9cbe0;
  --link: #2230c4;
  --link-hover-bg: #fff0b3;
  --accent: #d4137a;

  --stripe-1: #d4137a; /* magenta */
  --stripe-2: #f26b1d; /* orange */
  --stripe-3: #f5b800; /* yellow */
  --stripe-4: #0aa392; /* teal */

  --footer-bg: #15153b;
  --footer-ink: #e6e6f5;
  --footer-link: #ffd23f;

  --font-display: "Jost", "Futura", "Century Gothic", "Trebuchet MS", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, monospace;

  --wrap: 72rem;
  --measure: 44rem;
  --gutter: clamp(1rem, 4vw, 2rem);
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #26236a;
    --panel: #302d80;
    --ink: #e6e4ff;
    --ink-soft: #b4b0ee;
    --rule: #4d4a9c;
    --link: #ffd23f;
    --link-hover-bg: #3c389a;
    --accent: #ff6fb5;

    --footer-bg: #1a1850;
    --footer-ink: #cfcdf5;
    --footer-link: #ffd23f;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}

img { max-width: 100%; height: auto; }

a { color: var(--link); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { background: var(--link-hover-bg); }

:focus-visible { outline: 3px solid var(--stripe-2); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: var(--paper); padding: 0.6rem 1rem;
}
.skip:focus { top: 0.5rem; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

/* The label style is used for every small heading and tag. */
.label {
  font: 700 0.8rem/1.4 var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 0.75rem;
}
.label a { color: inherit; }

/* ---- The stripe: four bands, one per layer ---- */
.stripe {
  height: 16px;
  background: linear-gradient(
    to bottom,
    var(--stripe-1) 0 4px,
    var(--stripe-2) 4px 8px,
    var(--stripe-3) 8px 12px,
    var(--stripe-4) 12px 16px
  );
}

/* ---- Header ---- */
.site-header .bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.75rem 2rem; padding-block: 1.1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font: 800 1.4rem/1 var(--font-display);
  letter-spacing: -0.01em;
  color: var(--ink); text-decoration: none;
}
.brand:hover { background: none; }
.logo { display: block; flex: none; }
.site-header ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-header nav a {
  font: 700 0.85rem/1 var(--font-display);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); text-decoration: none;
  padding-block: 0.4rem; border-bottom: 3px solid transparent;
}
.site-header nav a:hover { background: none; border-bottom-color: var(--stripe-3); }
.site-header nav a[aria-current="page"] { border-bottom-color: var(--stripe-1); }

/* ---- Home ---- */
.hero { padding-block: clamp(1.75rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.25rem); }
.hero h1 {
  font: 800 clamp(2rem, 4.5vw, 3.1rem)/1.05 var(--font-display);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem; max-width: 24ch; text-wrap: balance;
}
.lede { font-size: 1.125rem; line-height: 1.55; max-width: 38rem; margin: 0; color: var(--ink); }

.start { padding-block: 1rem 3rem; }
.start-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.75rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
}
.start-list li { border-top: 3px solid var(--ink); padding-top: 0.9rem; }
.start-list a {
  font: 700 1.45rem/1.15 var(--font-display);
  color: var(--ink); text-decoration-color: var(--stripe-1); text-decoration-thickness: 3px;
}
.start-list a:hover { background: var(--link-hover-bg); }
.start-list p { margin: 0.6rem 0 0; color: var(--ink-soft); }

.all { padding-block: 0 4rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem; margin-bottom: 0.5rem; }
.section-head .label { margin: 0; }
.topic-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin: 0; }
.topic-links a { font: 700 0.85rem/1.4 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; text-decoration: none; }
.topic-links a:hover { text-decoration: underline; }
.topic-links span { color: var(--ink-soft); }

/* ---- Contents list: title ........ topic  date ---- */
.contents { list-style: none; margin: 0; padding: 0; }
.contents li { display: flex; align-items: baseline; gap: 0.75rem; padding-block: 0.8rem; border-top: 1px solid var(--rule); }
.contents li:last-child { border-bottom: 1px solid var(--rule); }
.contents .title { font: 700 1.1rem/1.3 var(--font-body); color: var(--ink); text-decoration: none; }
.contents .title:hover { text-decoration: underline; text-decoration-color: var(--stripe-1); text-decoration-thickness: 3px; background: none; }
.contents .leader { flex: 1 1 1.5rem; min-width: 1.5rem; border-bottom: 2px dotted var(--rule); align-self: end; margin-bottom: 0.45em; }
.contents .meta { display: inline-flex; gap: 1.25rem; font: 700 0.8rem/1.4 var(--font-display); letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); white-space: nowrap; }
.contents .topic { min-width: 6.5rem; }

@media (max-width: 40rem) {
  .contents li { display: block; }
  .contents .leader { display: none; }
  .contents .meta { display: flex; margin-top: 0.2rem; }
  .contents .topic { min-width: 0; }
  .contents .topic:empty { display: none; }
}

/* ---- Articles and pages ---- */
.article { padding-block: clamp(1.75rem, 5vw, 3.5rem) 4rem; }
.article-head { margin-bottom: 2rem; }
.article-head h1, .topic-page h1 {
  font: 800 clamp(2rem, 5vw, 3.3rem)/1.04 var(--font-display);
  letter-spacing: -0.02em; margin: 0 0 1rem; max-width: 24ch; text-wrap: balance;
}
.article-head h1 { max-width: none; }
.topics { display: flex; flex-wrap: wrap; gap: 0 0.6rem; }
.topics a + a::before { content: "/"; margin-right: 0.6rem; color: var(--ink-soft); }
.byline { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; margin: 0; font: 400 0.9rem/1.4 var(--font-body); color: var(--ink-soft); }

.notice {
  margin: 3rem 0 0; max-width: var(--measure);
  background: var(--panel); border: 1px solid var(--rule); border-left: 5px solid var(--stripe-3);
  padding: 0.7rem 1rem; font-size: 0.95rem; line-height: 1.5;
}

.topic-page { padding-block: clamp(1.75rem, 5vw, 3.5rem) 4rem; }
.topic-page .lede { margin-bottom: 2rem; }

/* The article contents is a closed box above the text; open it to jump to a section. */
.toc { margin: 0 0 2.25rem; background: var(--panel); border: 1px solid var(--rule); }
.toc summary {
  cursor: pointer; padding: 0.7rem 1rem;
  font: 700 0.8rem/1.4 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.toc summary span { color: var(--ink-soft); margin-left: 0.75rem; }
.toc ol { list-style: none; margin: 0; padding: 0 1rem 0.75rem; border-top: 1px solid var(--rule); }
.toc li { margin: 0; }
.toc a { display: block; padding: 0.4rem 0; font-size: 0.95rem; line-height: 1.35; color: var(--ink); text-decoration: none; }
.toc a:hover { background: none; text-decoration: underline; text-decoration-color: var(--stripe-1); text-decoration-thickness: 2px; }

/* The prose styles apply to anything written in Markdown. */
.prose { max-width: var(--measure); min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote { margin: 0 0 1.1rem; }
.prose h2, .prose h3, .prose h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -0.01em; scroll-margin-top: 1.5rem; }
.prose h2 { font-size: clamp(1.6rem, 3.2vw, 2.1rem); font-weight: 800; margin: 2.75rem 0 0.9rem; }
.prose h3 { font-size: 1.3rem; font-weight: 700; margin: 2rem 0 0.6rem; }
.prose h4 { font-size: 1.1rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
.prose h2 + h3 { margin-top: 1rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35rem; }
.prose li::marker { color: var(--accent); }
.prose li > ul, .prose li > ol { margin: 0.35rem 0 0.5rem; }
.prose strong { font-weight: 700; }
.prose blockquote { border-left: 4px solid var(--stripe-4); padding: 0.1rem 0 0.1rem 1rem; color: var(--ink-soft); }
.prose code { font: 400 0.9em var(--font-mono); background: var(--panel); border: 1px solid var(--rule); padding: 0.05em 0.35em; }
.prose img { display: block; margin: 0.5rem 0 1.25rem; border: 1px solid var(--rule); background: #fff; }

/* A horizontal rule in the text is a short run of layers. */
.prose hr {
  border: 0; width: 5rem; height: 8px; margin: 2.5rem 0 0;
  background: linear-gradient(to bottom, var(--stripe-1) 0 2px, var(--stripe-2) 2px 4px, var(--stripe-3) 4px 6px, var(--stripe-4) 6px 8px);
}
.prose hr + h2 { margin-top: 1.25rem; }

.table-wrap { overflow-x: auto; margin: 1.5rem 0; border: 1px solid var(--rule); background: var(--panel); }
.table-wrap:focus-visible { outline-offset: 0; }
.prose table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; line-height: 1.45; }
.prose th {
  background: var(--ink); color: var(--paper); text-align: left;
  font: 700 0.8rem/1.3 var(--font-display); letter-spacing: 0.06em; text-transform: uppercase;
  padding: 0.65rem 0.85rem;
}
.prose td { padding: 0.65rem 0.85rem; border-top: 1px solid var(--rule); vertical-align: top; }
.prose tr:first-child td { border-top: 0; }

.more { margin-top: 4rem; max-width: var(--measure); }

/* ---- Footer ---- */
.site-footer { margin-top: 2rem; background: var(--footer-bg); color: var(--footer-ink); }
.site-footer .cols { display: grid; gap: 2rem 3rem; grid-template-columns: 2fr 1fr 1fr; padding-block: 2.75rem; }
@media (max-width: 40rem) { .site-footer .cols { grid-template-columns: 1fr; } }
.site-footer a { color: var(--footer-link); }
.site-footer a:hover { background: none; text-decoration-thickness: 3px; }
.site-footer .label { color: var(--footer-ink); opacity: 0.75; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.45rem; }
.brand-small { display: flex; align-items: center; gap: 0.7rem; margin: 0 0 0.9rem; font: 800 1.2rem/1 var(--font-display); }
.fine { font-size: 0.9rem; line-height: 1.55; max-width: 32rem; margin: 0; }

@media print {
  .site-header, .site-footer, .toc, .more, .skip { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .prose a { color: #000; }
}
