/* Gridfinity: a parts library on a 42 mm grid. Ink on cool paper; grey is printed, blue is what it holds (the
   renders' pair, which stays apart for red-green colour blindness); amber only says "print the coupon first". */

:root {
  --paper: #eef0f1;
  --paper-2: #e4e7e9;
  --card: #f7f8f8;
  --ink: #17212b;
  --ink-2: #4a5561;
  --rule: #c3c9cf;
  --plate: #aeb6bd;
  --pocket: #e3e6e9;
  --pocket-edge: #9aa3ab;
  --blue: #1f5fa6;
  --blue-strong: #174b85;
  --on-blue: #ffffff;
  --amber: #7d4c00;
  --amber-bg: #f4e5c6;
  --shade: rgba(23, 33, 43, 0.08);
  --radius: 10px;
  --wrap: 1240px;
  --gutter: 16px;
  --display: "Barlow Condensed", "Barlow", "Arial Narrow", sans-serif;
  --text: "Barlow", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11161b;
    --paper-2: #182029;
    --card: #151c23;
    --ink: #e3e8ec;
    --ink-2: #a2acb6;
    --rule: #2e3842;
    --plate: #1c242c;
    --pocket: #232c35;
    --pocket-edge: #34404b;
    --blue: #7fb2ea;
    --blue-strong: #a9cbf2;
    --on-blue: #0d1620;
    --amber: #ecbd6c;
    --amber-bg: #2b2213;
    --shade: rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}
@media (min-width: 720px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--text);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--blue-strong); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
code { font: 500 0.92em/1 ui-monospace, "SF Mono", Menlo, monospace; background: var(--paper-2); padding: 0.12em 0.32em; border-radius: 4px; overflow-wrap: anywhere; }
h1, h2, h3, h4 { margin: 0; line-height: 1.1; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: -0.005em; }
h3, h4 { font-weight: 600; }
p { margin: 0 0 1em; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 10; }
.skip:focus { top: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* --- the bar ------------------------------------------------------------------------------------------------------- */
.masthead { border-bottom: 1px solid var(--rule); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 600 1.45rem/1 var(--display); letter-spacing: 0.01em; }
.brand svg { width: 26px; height: 26px; fill: var(--ink-2); }
.brand svg .on { fill: var(--blue); }
.bar nav { display: flex; gap: 4px; flex-wrap: wrap; }
.bar nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 6px; font-weight: 500; }
.bar nav a:hover { background: var(--paper-2); }
.bar nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--ink); border-radius: 0; }

main { padding-bottom: 72px; }

/* --- the landing page ----------------------------------------------------------------------------------------------- */
.intro { padding: 56px 0 32px; }
.intro h1 { font-size: clamp(2.6rem, 1.4rem + 5vw, 5.25rem); line-height: 0.94; max-width: 12ch; margin-bottom: 24px; }
.dek { font-size: clamp(1.125rem, 1rem + 0.4vw, 1.3rem); line-height: 1.5; color: var(--ink-2); max-width: 58ch; }
.count { color: var(--ink-2); margin: 0; font-size: 0.95rem; }
@media (min-width: 960px) {
  .intro { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: 56px; align-items: end; padding-top: 72px; }
  .intro h1 { grid-row: 1 / 3; margin: 0; }
  .intro .count { grid-column: 2; }
}

/* the drawer: a baseplate of cells drawn as the real one is, every part on it from above at true scale */
.drawer { margin: 8px 0 72px; }
.plate {
  position: relative;
  aspect-ratio: var(--cols) / var(--rows);
  background-color: var(--plate);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 42'%3E%3Crect x='1.6' y='1.6' width='38.8' height='38.8' rx='3.6' fill='%23000' fill-opacity='.045'/%3E%3Crect x='3.4' y='3.4' width='35.2' height='35.2' rx='2.2' fill='none' stroke='%23000' stroke-opacity='.10' stroke-width='.35'/%3E%3C/svg%3E");
  background-size: calc(100% / var(--cols)) calc(100% / var(--rows));
  border-radius: 1.2%/1.8%;
  box-shadow: inset 0 0 0 1px var(--pocket-edge);
}
@media (prefers-color-scheme: dark) {
  .plate { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 42 42'%3E%3Crect x='1.6' y='1.6' width='38.8' height='38.8' rx='3.6' fill='%23fff' fill-opacity='.035'/%3E%3Crect x='3.4' y='3.4' width='35.2' height='35.2' rx='2.2' fill='none' stroke='%23fff' stroke-opacity='.10' stroke-width='.35'/%3E%3C/svg%3E"); }
}
.slot {
  position: absolute;
  left: calc(100% * var(--x) / var(--cols));
  top: calc(100% * var(--y) / var(--rows));
  width: calc(100% * var(--w) / var(--cols));
  height: calc(100% * var(--h) / var(--rows));
  padding: 0.25%;
  border-radius: 6px;
}
.slot img { width: 100%; height: 100%; object-fit: fill; transition: transform 160ms ease, filter 160ms ease; filter: drop-shadow(0 1px 0 var(--shade)); }
.slot:hover img, .slot:focus-visible img { transform: translateY(-3px); filter: drop-shadow(0 6px 6px var(--shade)); }
.slot:focus-visible { outline-offset: 0; }
.tag {
  position: absolute; left: 4px; bottom: 4px; z-index: 2;
  background: var(--ink); color: var(--paper);
  font: 500 0.85rem/1.2 var(--text); padding: 4px 8px; border-radius: 5px; white-space: nowrap;
  display: none; pointer-events: none;
}
.slot.east .tag { left: auto; right: 4px; }
.tag b { font-weight: 600; margin-left: 4px; }
.slot:hover .tag, .slot:focus-visible .tag { display: block; }
.drawer figcaption { margin-top: 12px; color: var(--ink-2); font-size: 0.95rem; max-width: 70ch; }

.library-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.library-head h2 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.75rem); }
.filters { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--card); }
.filters button {
  font: 500 0.98rem/1 var(--text); color: var(--ink); background: none; border: 0; border-left: 1px solid var(--rule);
  padding: 10px 14px; min-height: 40px; cursor: pointer;
}
.filters button:first-child { border-left: 0; }
.filters button:hover { background: var(--paper-2); }
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.filters button:focus-visible { outline-offset: -3px; border-radius: 0; }

.family { padding: 32px 0 8px; }
.family + .family { border-top: 1px solid var(--rule); margin-top: 32px; }
.family[hidden] { display: none; }
.family header { margin-bottom: 20px; }
.family header h2 { font-size: 1.75rem; margin-bottom: 6px; }
.family header p { margin: 0; color: var(--ink-2); max-width: 60ch; }
@media (min-width: 900px) {
  .family { display: grid; grid-template-columns: 15rem minmax(0, 1fr); column-gap: 40px; align-items: start; }
  .family header { position: sticky; top: 24px; margin: 0; }
}
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 272px), 1fr)); gap: 16px; }
.card a {
  display: flex; flex-direction: column; height: 100%;
  color: var(--ink); text-decoration: none;
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 10px 16px;
}
.card a:hover { border-color: var(--ink); }
.card a:focus-visible { outline-offset: 3px; border-radius: var(--radius); }
.shot { display: block; background: var(--pocket); border-radius: 6px; margin-bottom: 14px; }
.shot img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: contain; }
.name { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.name h3 { font: 600 1.4rem/1.1 var(--display); }
.card p { padding: 0 6px; margin: 8px 0 12px; color: var(--ink-2); font-size: 0.98rem; line-height: 1.45; }
.meta { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; color: var(--ink-2); }
.meta .time { white-space: nowrap; }
.fp { flex: none; fill: var(--ink-2); width: auto; height: 22px; }

/* --- collections ---------------------------------------------------------------------------------------------------- */
.collections { margin: 8px 0 64px; }
.collections .lede { margin: 16px 0 20px; color: var(--ink-2); max-width: 70ch; }
.cards.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.kicker { margin: 0 0 4px; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; }
.kicker a { color: var(--ink-2); text-decoration: none; }
.kicker a:hover { color: var(--ink); text-decoration: underline; }
.collection-about { margin-bottom: 40px; }
.fp.inline { display: inline-block; height: 14px; vertical-align: -1px; margin-left: 8px; fill: var(--blue); }

/* --- a model's page ------------------------------------------------------------------------------------------------- */
.crumbs { display: flex; gap: 8px; padding-top: 24px; font-size: 0.95rem; color: var(--ink-2); }
.crumbs a { color: var(--ink-2); }
.part-head { padding: 12px 0 24px; }
.part-head h1 { font-size: clamp(2.4rem, 1.6rem + 3.2vw, 4rem); line-height: 0.98; margin-bottom: 12px; }
.purpose { font-size: clamp(1.1rem, 1rem + 0.35vw, 1.25rem); color: var(--ink-2); max-width: 62ch; margin: 0; }

.part-top { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1000px) { .part-top { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 32px; } }

.stage {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  background-color: var(--card);
  background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px);
  background-size: 42px 42px; background-position: -1px -1px;
  border: 1px solid var(--rule);
}
.stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 45%, transparent 35%, var(--card) 85%); pointer-events: none; }
.stage .poster, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage canvas { opacity: 0; transition: opacity 250ms ease; }
.stage[data-state="live"] canvas { opacity: 1; }
.stage[data-state="live"] .poster { visibility: hidden; }
.stage canvas:focus-visible { outline: 3px solid var(--blue); outline-offset: -3px; border-radius: var(--radius); }
.loading { position: absolute; left: 12px; top: 10px; margin: 0; font-size: 0.9rem; color: var(--ink-2); }
.hint { position: absolute; left: 12px; bottom: 10px; margin: 0; font-size: 0.88rem; color: var(--ink-2); max-width: calc(100% - 230px); line-height: 1.3; }
.stage[data-state="poster"] .hint { visibility: hidden; }
.turns { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 6px; }
.round, .tog, .seg button {
  font: 500 0.95rem/1 var(--text); color: var(--ink); background: var(--card);
  border: 1px solid var(--rule); border-radius: 8px; min-height: 40px; padding: 0 12px; cursor: pointer;
}
.round { width: 40px; padding: 0; display: grid; place-items: center; }
.round svg { width: 20px; height: 20px; }
.round:hover, .tog:hover, .seg button:hover { border-color: var(--ink); }
.round:disabled, .tog:disabled { opacity: 0.45; cursor: default; border-color: var(--rule); }
.tog[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin-top: 12px; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-left: 1px solid var(--rule); border-radius: 0; }
.seg button:first-child { border-left: 0; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }
.seg button:focus-visible { outline-offset: -3px; }
@media (max-width: 520px) {
  .hint { display: none; }
  .turns { left: 10px; right: 10px; justify-content: flex-end; }
}

/* the title block, as on a drawing: a ruled box of fields, each a small label over its value */
.titleblock { margin: 0; display: grid; grid-template-columns: 1fr 1fr; border: 2px solid var(--ink); border-radius: 4px; background: var(--card); }
.titleblock[hidden] { display: none; }
.titleblock div { padding: 8px 12px 10px; border-top: 1px solid var(--rule); min-width: 0; }
.titleblock div:nth-child(-n+1) { border-top: 0; }
.titleblock div:not(.wide) + div:not(.wide) { border-left: 1px solid var(--rule); }
.titleblock .wide { grid-column: 1 / -1; }
.titleblock dt { font: 500 0.82rem/1.2 var(--display); letter-spacing: 0.02em; color: var(--ink-2); margin-bottom: 2px; }
.titleblock dd { margin: 0; font-weight: 500; }
.dl-jump { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 16px 0 0; }
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 8px; background: var(--blue); color: var(--on-blue); text-decoration: none; font-weight: 600; }
.button:hover { background: var(--blue-strong); color: var(--on-blue); }
.quiet { color: var(--ink-2); font-size: 0.95rem; }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 16px; margin: 32px 0 8px; }
.gallery figure { margin: 0; }
.gallery img { width: 100%; height: auto; background: var(--pocket); border-radius: 6px; }
.gallery figcaption { margin-top: 6px; font-size: 0.9rem; color: var(--ink-2); }

.part-body { display: grid; grid-template-columns: minmax(0, 1fr); column-gap: 56px; }
.flow { min-width: 0; max-width: 860px; }
.flow section { padding-top: 48px; }
.toc { display: none; }
@media (min-width: 1120px) {
  .part-body { grid-template-columns: minmax(0, 860px) minmax(0, 1fr); }
  .toc { display: block; position: sticky; top: 24px; align-self: start; margin-top: 56px; padding-left: 20px; border-left: 2px solid var(--ink); }
  .toc ul { list-style: none; margin: 0 0 20px; padding: 0 !important; }
  .toc li { margin: 0 0 4px; }
  .toc a:not(.button) { color: var(--ink-2); text-decoration: none; display: inline-block; padding: 4px 0; }
  .toc a:not(.button):hover { color: var(--ink); text-decoration: underline; }
}
.part-body h2 { font-size: 2rem; margin-bottom: 16px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.part-body h3 { font-size: 1.15rem; margin: 28px 0 10px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol, .part-body ul { padding-left: 1.2em; }
.prose li, .part-body li { margin-bottom: 6px; }

.table { overflow-x: auto; margin: 0 0 12px; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--rule); }
thead th { font: 600 0.95rem/1.2 var(--display); letter-spacing: 0.02em; color: var(--ink-2); border-bottom: 2px solid var(--ink); }
tbody th { font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.nums td { font-weight: 500; }
.note { color: var(--ink-2); font-size: 0.93rem; }
.note p { margin: 0 0 6px; max-width: 75ch; }
.fine { display: block; color: var(--ink-2); font-size: 0.88rem; margin-top: 4px; max-width: 46ch; }

.checks { list-style: none; padding: 0 !important; margin: 0 0 20px; }
.checks li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.checks li::before {
  content: ""; position: absolute; left: 0; top: 0.15em; width: 20px; height: 20px; border-radius: 5px;
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 20px no-repeat;
}
@media (prefers-color-scheme: dark) {
  .checks li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 10.5l3.2 3.2L15 6.8' fill='none' stroke='%230d1620' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
}
.report { border: 1px solid var(--rule); border-radius: 8px; background: var(--card); }
.report summary { cursor: pointer; padding: 12px 16px; font-weight: 500; }
.report[open] summary { border-bottom: 1px solid var(--rule); }
.report h3 { margin: 18px 16px 8px; font-size: 1rem; }
.raw { list-style: none; padding: 0 16px 8px !important; margin: 0; font-size: 0.93rem; }
.raw li { display: grid; grid-template-columns: 18px minmax(0, 1fr); column-gap: 10px; padding: 6px 0; border-top: 1px solid var(--rule); margin: 0 !important; }
.raw .mark::before { content: "✓"; font-weight: 700; color: var(--blue); }
.raw .fail .mark::before { content: "✕"; color: var(--amber); }
.raw .detail { grid-column: 2; color: var(--ink-2); font-size: 0.88rem; overflow-wrap: anywhere; }

.callout { background: var(--amber-bg); border-left: 4px solid var(--amber); border-radius: 6px; padding: 14px 18px 2px; margin: 0 0 20px; }
.callout strong { color: var(--amber); }
.spec { margin: 0 0 16px; }
.spec div { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.spec dt { color: var(--ink-2); font-weight: 500; }
.spec dd { margin: 0; }
@media (max-width: 560px) { .spec div { grid-template-columns: 1fr; gap: 2px; } }

.files td, .files th { vertical-align: middle; }
.file {
  display: inline-flex; align-items: baseline; gap: 8px; margin: 2px 6px 2px 0; padding: 7px 12px; min-height: 40px;
  border: 1px solid var(--rule); border-radius: 8px; background: var(--card); color: var(--ink); text-decoration: none; white-space: nowrap;
}
.file:hover { border-color: var(--blue); color: var(--ink); }
.file .kind { font-weight: 600; color: var(--blue); }
.file .size { font-size: 0.88rem; color: var(--ink-2); }
.coupons { list-style: none; padding: 0 !important; margin: 0; }
.coupons li { border-top: 1px solid var(--rule); padding: 14px 0 6px; }
.coupons h4 { font-size: 1.05rem; margin-bottom: 4px; }
.coupons p { margin: 0 0 8px; }
.source { color: var(--ink-2); }

/* --- standards, about, 404 ---------------------------------------------------------------------------------------- */
.standards, .about { max-width: 860px; }
.standards .part-head, .about .part-head { padding-top: 48px; }
@media (min-width: 640px) { .standards td:nth-child(-n+2) { white-space: nowrap; } }
.standards h2, .about h2 { font-size: 2rem; margin: 48px 0 16px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.standards h3, .about h3 { margin: 28px 0 8px; }
.steps { list-style: none; counter-reset: step; padding: 0 !important; }
.steps li { counter-increment: step; position: relative; padding: 0 0 18px 64px; margin: 0; min-height: 52px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 8px;
  display: grid; place-items: center; font: 600 1.4rem/1 var(--display);
  background: var(--card); border: 2px solid var(--ink);
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 22px; top: 46px; bottom: 2px; width: 2px; background: var(--rule); }
.steps h3 { margin: 10px 0 6px !important; font-size: 1.15rem; }
.chip { display: inline-block; width: 1em; height: 1em; border-radius: 3px; background: var(--c); vertical-align: -0.12em; box-shadow: inset 0 0 0 1px var(--rule); }
.lost { padding: 96px 0; max-width: 40rem; }
.lost h1 { font-size: clamp(2.6rem, 2rem + 3vw, 4rem); margin-bottom: 16px; }

/* --- the foot ------------------------------------------------------------------------------------------------------- */
.foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; color: var(--ink-2); font-size: 0.93rem; }
.foot p { max-width: 82ch; }
.foot a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .slot:hover img, .slot:focus-visible img { transform: none; }
}

/* downloads on a phone: each size a block of file buttons (each button names its kind, so the columns' heads go) */
@media (max-width: 640px) {
  .files thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .files, .files tbody, .files tr, .files th, .files td { display: block; }
  .files tr { padding: 12px 0 8px; border-bottom: 1px solid var(--rule); }
  .files th, .files td { border: 0; padding: 0; }
  .files tbody th { margin-bottom: 6px; color: var(--ink); font-weight: 600; }
  .files td { display: inline; }
}
