/* latches.nclr.eu. Same datasheet look as the 3D gallery and the explorers: Archivo Narrow headings,
   Archivo text, IBM Plex Mono for numbers and labels. Orange = printed parts, teal = TPU seal, blue-grey = lid. */
:root {
  --bg: #eceff2;
  --panel: #ffffff;
  --code: #f5f7f9;
  --ink: #1a1e23;
  --muted: #5a636d;
  --line: #d3d9df;
  --accent: #d9581a;
  --accent-ink: #b0440e;
  --accent-strong: #c04c12;
  --accent-soft: #fbe3d6;
  --tpu: #0d8a76;
  --tpu-ink: #0a6b5c;
  --tpu-soft: rgba(13, 138, 118, 0.13);
  --lid: #4f6b88;
  --lid-soft: rgba(92, 120, 150, 0.16);
  --stage: #e3e7eb;
  --font-display: "Archivo Narrow", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 12px;
  --max: 1200px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121519; --panel: #1b1f25; --code: #161a1f; --ink: #e7eaee; --muted: #98a2ad; --line: #2b323a;
    --accent: #f0793a; --accent-ink: #f59a66; --accent-strong: #e0662a; --accent-soft: #3a2418;
    --tpu: #2fb59c; --tpu-ink: #5fd0b9; --tpu-soft: rgba(47, 181, 156, 0.16);
    --lid: #9db5cf; --lid-soft: rgba(125, 152, 182, 0.18); --stage: #171b20; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121519; --panel: #1b1f25; --code: #161a1f; --ink: #e7eaee; --muted: #98a2ad; --line: #2b323a;
  --accent: #f0793a; --accent-ink: #f59a66; --accent-strong: #e0662a; --accent-soft: #3a2418;
  --tpu: #2fb59c; --tpu-ink: #5fd0b9; --tpu-soft: rgba(47, 181, 156, 0.16);
  --lid: #9db5cf; --lid-soft: rgba(125, 152, 182, 0.18); --stage: #171b20; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--font-body); }
img, video { max-width: 100%; height: auto; display: block; }
a { color: var(--accent-ink); text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 30; background: var(--panel); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 16px; }
.container {
  max-width: var(--max); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: -0.005em; }
h1 { font-size: clamp(32px, 5.2vw, 54px); font-weight: 700; }
h2 { font-size: clamp(26px, 3.2vw, 32px); font-weight: 700; }
h3 { font-size: 21px; font-weight: 700; }
.mono { font-family: var(--font-data); }
.muted { color: var(--muted); }

/* ---------------------------------------------------------------- header and footer */
.site-header {
  position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px);
}
.site-header .container { display: flex; align-items: center; gap: 4px 20px; min-height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 19px/1.05 var(--font-display); }
.brand svg { width: 30px; height: 30px; flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font: 500 14.5px/1 var(--font-body); color: var(--muted); text-decoration: none; padding: 10px 11px; border-radius: 8px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--stage); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }
.nav a.lang { font-family: var(--font-data); font-size: 13px; }
@media (max-width: 940px) {
  .site-header .container { flex-wrap: wrap; padding-top: 10px; }
  .nav { margin-left: 0; width: 100%; padding-bottom: 8px; }
  .nav a:first-child { padding-left: 0; }
}
.site-footer { border-top: 1px solid var(--line); background: var(--panel); padding: 28px 0 36px; font-size: 14.5px; color: var(--muted); }
.site-footer .container { display: grid; gap: 14px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.site-footer nav a { color: var(--ink); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer p { margin: 0; max-width: 80ch; }

/* ---------------------------------------------------------------- page scaffolding */
main { padding: 28px 0 64px; }
.crumbs { font: 13px/1.4 var(--font-data); color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--muted); }
.eyebrow { font: 500 12.5px/1.3 var(--font-data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); margin: 0 0 8px; }
.lede { font-size: 18.5px; line-height: 1.55; color: var(--muted); max-width: 70ch; margin: 14px 0 0; }
.page-head { margin-bottom: 28px; }
.page-head .tags { margin-top: 14px; }
.section { margin-top: 56px; }
.section > h2 { margin-bottom: 8px; }
.section > .lede { margin: 0 0 20px; font-size: 16.5px; }
.panel { background: var(--panel); border-radius: var(--radius); padding: 20px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; font: 600 15px/1 var(--font-body); padding: 12px 16px;
  border-radius: 9px; text-decoration: none; border: 1px solid var(--line); color: var(--ink); background: var(--panel);
}
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { font-size: 13.5px; padding: 8px 11px; border-radius: 7px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; font: 500 11.5px/1 var(--font-data); letter-spacing: 0.04em;
  text-transform: uppercase; padding: 5px 7px; border-radius: 5px; background: var(--stage); color: var(--muted); white-space: nowrap;
}
.tag.pick { background: var(--tpu-soft); color: var(--tpu-ink); }
.tag.round { background: var(--lid-soft); color: var(--lid); }
.tag.hot { background: var(--accent-soft); color: var(--accent-ink); }
.notice { border-left: 3px solid var(--lid); background: var(--panel); border-radius: 0 10px 10px 0; padding: 12px 16px; margin: 0 0 20px; }

/* ---------------------------------------------------------------- cards */
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); }
.card {
  background: var(--panel); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column;
  text-decoration: none; color: inherit; border: 1px solid transparent; transition: border-color 0.15s;
}
a.card:hover { border-color: var(--accent); }
.card .pic { aspect-ratio: 4 / 3; width: 100%; object-fit: cover; background: var(--stage); }
.card .pic.contain { object-fit: contain; }
.card .body { padding: 14px 16px 16px; display: grid; gap: 8px; align-content: start; flex: 1; }
.card h3 { font-size: 20px; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.card .force { font: 600 15px/1 var(--font-data); color: var(--ink); }
.card .force small { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.card .num { font: 500 12px/1 var(--font-data); color: var(--muted); }
.card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.filters button {
  font: 500 14px/1 var(--font-body); padding: 9px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel); color: var(--ink); cursor: pointer;
}
.filters button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------------------------------------------------------------- home */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 32px; align-items: center; }
.hero .bottom-line { margin: 20px 0 0; padding: 14px 16px; background: var(--panel); border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; font-size: 15.5px; line-height: 1.55; }
.hero .bottom-line p { margin: 0; }
.hero figure { margin: 0; }
.hero figure img { border-radius: var(--radius); background: var(--panel); }
.hero figcaption { font: 12.5px/1.4 var(--font-data); color: var(--muted); margin-top: 8px; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }

.fchart { list-style: none; margin: 0; padding: 8px 0; background: var(--panel); border-radius: var(--radius); }
.fchart li a {
  display: grid; grid-template-columns: 56px minmax(0, 15em) minmax(0, 1fr) 4.5em; gap: 14px; align-items: center;
  padding: 7px 18px; color: inherit; text-decoration: none;
}
.fchart li a:hover { background: var(--code); }
.fchart img { width: 56px; height: 42px; object-fit: cover; border-radius: 4px; background: var(--stage); }
.fchart .n { font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.fchart .n small { display: block; font: 400 12px/1.3 var(--font-data); color: var(--muted); margin-top: 3px; }
.fchart .track { position: relative; height: 22px; }
.fchart .track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--line); }
.fchart .fill { position: absolute; left: 0; top: 5px; height: 12px; border-radius: 0 3px 3px 0; background: var(--accent); }
.fchart .range { position: absolute; top: 10px; height: 2px; background: var(--ink); opacity: 0.55; }
.fchart .range::before, .fchart .range::after { content: ""; position: absolute; top: -4px; width: 2px; height: 10px; background: inherit; }
.fchart .range::before { left: 0; } .fchart .range::after { right: 0; }
.fchart .base { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 1.5px dashed var(--lid); }
.fchart .v { font: 600 14px/1 var(--font-data); text-align: right; }
.fchart .axis a { padding-top: 2px; padding-bottom: 2px; }
.fchart .axis .track::before { display: none; }
.fchart .axis .track span { position: absolute; top: 3px; transform: translateX(-50%); font: 11.5px/1 var(--font-data); color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font: 12.5px/1.4 var(--font-data); color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.legend .lf { width: 16px; height: 10px; background: var(--accent); border-radius: 2px; }
.legend .lr { width: 16px; height: 2px; background: var(--ink); opacity: 0.55; }
.legend .lb { width: 0; height: 12px; border-left: 1.5px dashed var(--lid); }
@media (max-width: 700px) {
  .fchart li a { grid-template-columns: 44px minmax(0, 1fr) 4em; padding: 8px 12px; gap: 10px; }
  .fchart img { width: 44px; height: 33px; }
  .fchart .track { grid-column: 2 / 4; grid-row: 2; height: 18px; }
  .fchart .fill { top: 4px; height: 10px; } .fchart .range { top: 8px; }
  .fchart .axis a { grid-template-columns: minmax(0, 1fr); }
  .fchart .axis img, .fchart .axis .n, .fchart .axis .v { display: none; }
  .fchart .axis .track { grid-column: 1; grid-row: 1; margin-left: 54px; }
}

.videos { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.videos figure { margin: 0; background: var(--panel); border-radius: 10px; overflow: hidden; }
.videos video { width: 100%; aspect-ratio: 1080 / 1380; background: #000; }
.videos figcaption { padding: 9px 12px 11px; font-size: 14px; }
.videos figcaption a { font-weight: 600; }

/* ---------------------------------------------------------------- mechanism page */
.mech-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .mech-hero { grid-template-columns: minmax(0, 1fr); } }
.viewer { background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.viewer model-viewer { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; background: var(--stage); --progress-bar-color: var(--accent); }
.viewer .bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; }
.viewer .bar .hint { font: 12.5px/1.4 var(--font-data); color: var(--muted); margin-right: auto; }
.viewer .note { margin: 0; padding: 0 14px 14px; font-size: 14px; color: var(--muted); }
.sheet { background: var(--panel); border-radius: var(--radius); padding: 20px 20px 22px; display: grid; gap: 18px; }
.sheet .label { font: 500 12px/1.2 var(--font-data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.bignum { font: 700 clamp(48px, 7vw, 68px)/0.95 var(--font-display); letter-spacing: -0.01em; }
.bignum small { font-size: 0.42em; font-weight: 600; color: var(--muted); margin-left: 4px; }
.sheet .range { font: 14px/1.4 var(--font-data); color: var(--muted); margin-top: 6px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; font-size: 14.5px; }
.kv dt, .kv dd { padding: 7px 0; border-top: 1px solid var(--line); margin: 0; }
.kv dt { color: var(--muted); padding-right: 12px; }
.kv dd { font-family: var(--font-data); text-align: right; }
.scores { display: grid; gap: 8px; }
.score { display: grid; grid-template-columns: 10.5em minmax(0, 1fr) 2.2ch; gap: 10px; align-items: center; font-size: 14px; }
.score .bar { height: 8px; background: var(--stage); border-radius: 4px; overflow: hidden; }
.score .bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.score b { font: 600 14px/1 var(--font-data); text-align: right; }
.verdict { margin-top: 18px; display: grid; gap: 12px; }
.verdict p { margin: 0; max-width: 85ch; }
.media { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); margin-top: 18px; align-items: start; }
.media figure { margin: 0; background: var(--panel); border-radius: var(--radius); overflow: hidden; }
.media figure img { width: 100%; background: var(--stage); }
.media figure video { width: 100%; max-height: 560px; background: #000; object-fit: contain; }
.media figcaption { padding: 10px 14px 12px; font-size: 14px; color: var(--muted); }
.media figcaption b { color: var(--ink); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.pager a { background: var(--panel); border-radius: 10px; padding: 14px 16px; text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.pager a:hover { border-color: var(--accent); }
.pager a span { display: block; font: 12px/1.3 var(--font-data); color: var(--muted); margin-bottom: 4px; }
.pager a:last-child { text-align: right; }
.pager a.empty { visibility: hidden; }

/* ---------------------------------------------------------------- long text from the markdown */
.with-toc { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 44px; align-items: start; }
.toc { position: sticky; top: 92px; font-size: 14px; max-height: calc(100vh - 110px); overflow: auto; }
.toc .label { font: 500 12px/1.2 var(--font-data); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; padding: 5px 0 5px 12px; margin-left: -1px; color: var(--muted); text-decoration: none; border-left: 2px solid transparent; line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); }
.toc-m { display: none; background: var(--panel); border-radius: 10px; padding: 10px 14px; margin-bottom: 20px; }
.toc-m summary { cursor: pointer; font: 500 13px/1.4 var(--font-data); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.toc-m ol { margin: 8px 0 4px; padding-left: 1.3em; }
.toc-m li + li { margin-top: 4px; }
@media (max-width: 1040px) {
  .with-toc { grid-template-columns: minmax(0, 1fr); }
  .toc { display: none; }
  .toc-m { display: block; }
}

.prose { min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose .table-wrap, .prose pre { margin: 0 0 1em; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose h2, .prose h3, .prose h4 { max-width: 78ch; }
.prose h2 { margin: 2.1em 0 0.7em; padding-top: 0.75em; border-top: 1px solid var(--line); max-width: none; }
.prose h3 { margin: 1.7em 0 0.55em; }
.prose h4 { margin: 1.4em 0 0.5em; font-size: 18px; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.4em; }
.prose li > ul, .prose li > ol { margin: 0.4em 0 0; }
.prose blockquote { border-left: 3px solid var(--accent); background: var(--panel); padding: 12px 16px; border-radius: 0 10px 10px 0; }
.prose blockquote > :last-child { margin-bottom: 0; }
.prose code { font: 0.88em/1 var(--font-data); background: var(--code); padding: 0.15em 0.35em; border-radius: 4px; overflow-wrap: anywhere; }
.prose pre { background: var(--code); padding: 12px 14px; border-radius: 8px; overflow-x: auto; }
.prose pre code { background: none; padding: 0; font-size: 13.5px; line-height: 1.5; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose p > img, .prose p > a > img { border-radius: 10px; background: var(--panel); }
.prose a { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; background: var(--panel); border-radius: 10px; border: 1px solid var(--line); }
.prose table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.45; }
.prose th { font: 600 11.5px/1.3 var(--font-data); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--code); text-align: left; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose td img { width: 96px; max-width: none; border-radius: 4px; }
.prose td a { overflow-wrap: normal; }
.prose td[style*="right"], .prose th[style*="right"] { white-space: nowrap; }
.prose td:has(> img), .prose td:has(> a > img) { width: 110px; }
.dl-btn { margin: 0 0 1.2em; }

/* ---------------------------------------------------------------- downloads */
.files { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.files th { font: 600 11.5px/1.3 var(--font-data); text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); text-align: left; background: var(--code); }
.files th, .files td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.files td.links { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.files .size { font: 12px/1 var(--font-data); color: var(--muted); }
