/* Knot Atlas: rigging-loft spec sheet. Grid paper ground, ink, manila rope accent. */
:root {
  --bg: #eceee9; --panel: #f7f8f4; --ink: #172326; --muted: #536165; --line: #cfd5cf; --chip: #e1e5de;
  --rope: #b47a16; --over: #1f6f78; --under: #a2401f; --wood: #d8c39a; --wood-edge: #8a734b; --metal: #8f989b;
  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111a1c; --panel: #182427; --ink: #e4e9e4; --muted: #9aa8a8; --line: #2c3b3e; --chip: #22302f;
    --rope: #dc9c35; --over: #4fb0b8; --under: #e2805c; --wood: #6b5a3c; --wood-edge: #a68c5c; --metal: #6c7477;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--f-body);
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--f-display); line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1 { font-size: clamp(40px, 7vw, 68px); font-weight: 700; text-transform: uppercase; }
h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 700; text-transform: uppercase; }
h3 { font-size: 21px; font-weight: 600; }
p { margin: 0; }
img, svg { max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--rope); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 10px 14px; z-index: 10; }
.skip:focus { left: 16px; }
.eyebrow { font: 500 12px/1.2 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.eyebrow a { text-decoration: none; }
.lede { font-size: 18px; color: var(--muted); max-width: 64ch; }

/* header / footer */
.top {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px;
  max-width: 1160px; margin: 0 auto; padding: 14px 16px; border-bottom: 2px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 24px/1 var(--f-display); text-transform: uppercase; letter-spacing: .03em; min-height: 44px; }
.brand svg { width: 30px; height: 30px; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { text-decoration: none; font: 500 14px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; padding: 0 12px; min-height: 44px; display: inline-flex; align-items: center; border-radius: 4px; }
.top nav a:hover { background: var(--chip); }
.top nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
main { max-width: 1160px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 44px; }
.foot { max-width: 1160px; margin: 0 auto; padding: 20px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; display: flex; gap: 6px 24px; flex-wrap: wrap; justify-content: space-between; }

/* buttons, chips */
.btn, .tools button, .side button.learn, .chiprow button, .tabs button {
  min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); cursor: pointer;
  font: 500 15px var(--f-body); display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
}
.btn { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.ghost { background: transparent; color: var(--ink); }
button:hover { border-color: var(--ink); }
button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
button:disabled { opacity: .45; cursor: default; }
.chip { font: 500 12px/1 var(--f-mono); padding: 7px 9px; border-radius: 3px; background: var(--chip); text-decoration: none; letter-spacing: .02em; }
.chip-ch { background: var(--ink); color: var(--bg); }
.meta { display: flex; gap: 6px; flex-wrap: wrap; }
.dots { font-family: var(--f-mono); letter-spacing: .1em; color: var(--rope); }

/* index */
.hero { display: grid; gap: 14px; padding-top: 8px; }
.hero-links { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.filterbar { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: end; justify-content: space-between; }
.chiprow { display: flex; gap: 6px; flex-wrap: wrap; }
.fields { display: flex; gap: 12px; flex-wrap: wrap; }
.fields label, .fq label { display: grid; gap: 4px; font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
select, input[type="search"] {
  min-height: 44px; font-size: 16px; padding: 0 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--ink);
  text-transform: none; letter-spacing: 0; font-family: var(--f-body);
}
.count { font: 13px var(--f-mono); color: var(--muted); margin-top: -28px; }
.catalogue { display: grid; gap: 40px; }
.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.card a { display: grid; gap: 8px; align-content: start; height: 100%; padding: 14px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; }
.card a:hover { border-color: var(--ink); }
.card .thumb { height: 150px; display: grid; place-items: center; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
.card .thumb svg { max-height: 140px; width: auto; }
.card p { font-size: 14px; color: var(--muted); line-height: 1.45; }
.card .tick { color: var(--over); margin-left: 6px; font-size: 18px; }
.dots-line { font-size: 13px; color: var(--muted); }
.upcoming { border-top: 2px solid var(--ink); padding-top: 14px; display: grid; gap: 10px; }
.upcoming ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.upcoming span { color: var(--muted); }

/* diagrams */
.diagram { display: block; width: 100%; height: auto; }
.obj-pole { fill: var(--wood); stroke: var(--wood-edge); stroke-width: 1.5; }
.obj-ring { stroke: var(--metal); }
.obj-pole.thin { fill: var(--metal); stroke: none; }
.obj-pole.rope { fill: #e7c88a; stroke: #8a6a2c; }
.tg-over rect, .tg-over path { fill: var(--over); }
.tg-under rect, .tg-under path { fill: var(--under); }
.tg-over text, .tg-under text { fill: #fff; font: 600 11px var(--f-mono); text-anchor: middle; letter-spacing: .06em; }

/* knot page */
.knot { display: grid; gap: 36px; }
.knot-head { display: grid; gap: 12px; }
.aka { font-style: italic; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 4px 0 0; }
.facts div { display: grid; gap: 2px; }
.facts dt { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; }
.bench { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); background: var(--panel); border: 1px solid var(--line); }
@media (max-width: 880px) { .bench { grid-template-columns: 1fr; } }
.stage {
  position: relative; min-height: 460px; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 32px 32px; background-position: -1px -1px;
}
@media (max-width: 880px) { .stage { border-right: 0; border-bottom: 1px solid var(--line); min-height: 380px; } }
.view3d { position: relative; flex: 1; min-height: 380px; overflow: hidden; }
.view3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: grab; }
.view3d canvas:active { cursor: grabbing; }
.view2d { flex: 1; display: grid; place-items: center; padding: 16px; min-height: 380px; }
.view2d .dg { margin: 0; width: 100%; max-height: 520px; display: grid; place-items: center; }
.view2d .dg svg { max-height: 500px; width: auto; max-width: 100%; }
.view2d.mirrored svg { transform: scaleX(-1); }
.view2d.mirrored svg text { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
.hint { position: absolute; top: 12px; left: 12px; right: 12px; font: 12px var(--f-mono); color: var(--muted); pointer-events: none; z-index: 1; }
.tags { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute; transform: translate(-50%, -150%); font: 600 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 8px; border-radius: 3px; color: #fff; white-space: nowrap; transition: opacity .2s;
}
.tag.over { background: var(--over); } .tag.under { background: var(--under); }
.tag::after { content: ""; position: absolute; left: 50%; bottom: -5px; margin-left: -5px; border: 5px solid transparent; border-bottom: 0; }
.tag.over::after { border-top-color: var(--over); } .tag.under::after { border-top-color: var(--under); }
.tools { display: flex; gap: 8px; flex-wrap: wrap; padding: 12px; }
.tools .primary { background: var(--ink); color: var(--bg); border-color: var(--ink); min-width: 92px; justify-content: center; }
.side { padding: 18px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.scrub { display: grid; gap: 6px; }
.scrub label { font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.scrub input { width: 100%; accent-color: var(--rope); min-height: 36px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.step {
  width: 100%; text-align: left; display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 9px 10px;
  border: 1px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; font-size: 15px; line-height: 1.45; min-height: 44px;
}
.step b { font: 600 13px/30px var(--f-mono); text-align: center; border-radius: 50%; width: 30px; height: 30px; background: var(--chip); }
.step:hover { border-color: var(--line); }
.step.on { border-color: var(--ink); background: var(--bg); }
.step.on b { background: var(--rope); color: #1a1205; }
.step.done b { background: var(--ink); color: var(--bg); }
.keys { font-size: 13px; color: var(--muted); }
.tg-o { color: var(--over); font-weight: 600; } .tg-u { color: var(--under); font-weight: 600; }
.safety { border-left: 4px solid var(--under); padding: 10px 0 10px 16px; max-width: 72ch; font-weight: 500; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 28px; }
.cols section { display: grid; gap: 10px; align-content: start; min-width: 0; }
.cols ul, .related ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.learn { justify-self: start; margin-top: 6px; }
.related { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; }
.related li span { color: var(--muted); }
.related .soon { color: var(--ink); font-weight: 500; }

/* finder */
.page-head { display: grid; gap: 12px; }
.finder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 24px; background: var(--panel); border: 1px solid var(--line); padding: 20px; }
@media (max-width: 760px) { .finder { grid-template-columns: 1fr; } }
.fq { display: grid; gap: 8px; align-content: start; }
.fq select { width: 100%; margin-bottom: 8px; }
.fq .check { display: flex; gap: 10px; align-items: center; min-height: 44px; text-transform: none; letter-spacing: 0; font: 15px var(--f-body); color: var(--ink); }
.fq .check input { width: 22px; height: 22px; accent-color: var(--rope); }
.answers { display: grid; gap: 0; align-content: start; }
.ans { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.ans:last-child { border-bottom: 0; }
.ans .rank { font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); padding-top: 5px; }
.ans a { font: 600 22px var(--f-display); text-decoration: none; }
.ans a:hover { text-decoration: underline; }
.ans p { font-size: 14px; color: var(--muted); }
.note { border-left: 3px solid var(--under); padding: 4px 0 4px 14px; }

/* basics + prose */
.prose { display: grid; gap: 16px; max-width: 760px; }
.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.prose h2 { margin-top: 14px; }
.small { font-size: 14px; color: var(--muted); }
.subnav { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.subnav a { font: 500 13px var(--f-mono); text-transform: uppercase; letter-spacing: .06em; text-decoration: none; padding: 0 10px; min-height: 40px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 4px; }
.subnav a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.basics-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.basics-grid a { display: grid; gap: 8px; padding: 18px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; height: 100%; }
.basics-grid a:hover { border-color: var(--ink); }
.basics-grid p { color: var(--muted); font-size: 15px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 18px; }
.pager a { display: grid; gap: 2px; text-decoration: none; padding: 12px; border: 1px solid var(--line); background: var(--panel); font-weight: 500; }
.pager a span { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pager a.next { text-align: right; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.pane { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 24px; background: var(--panel); border: 1px solid var(--line); padding: 20px; align-items: start; }
@media (max-width: 640px) { .pane { grid-template-columns: 1fr; } }
.pane .pics { display: flex; gap: 16px; align-items: center; }
.pane .ptext { display: grid; gap: 10px; min-width: 0; }
.pane dl { margin: 0; display: grid; gap: 4px; }
.pane dt { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.pane dd { margin: 0 0 6px; }
.xsec { width: 170px; height: 170px; }
.side { }
svg.side { width: 64px; height: 200px; }
.xsec .s0, .side .s0 { fill: #d39a2c; stroke: #7a4f0c; }
.xsec .s1, .side .s1 { fill: #e9c27a; stroke: #7a4f0c; }
.xsec .s2, .side .s2 { fill: #2f7f8a; stroke: #14424a; }
.xsec circle { stroke-width: 1.2; }
.xsec .yarn { fill: rgba(255,255,255,.28); stroke: rgba(0,0,0,.25); stroke-width: .8; }
svg.side .bg { fill: #d39a2c; }
svg.side .edge { stroke: #7a4f0c; stroke-width: 2; }
svg.side path.b0 { stroke: #7a4f0c; stroke-width: 7; }
svg.side path.b1 { stroke: #f1d39a; stroke-width: 7; }
.tbl { overflow-x: auto; border: 1px solid var(--line); background: var(--panel); }
table { border-collapse: collapse; width: 100%; min-width: 720px; font-size: 14px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 500 11px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.checklist { list-style: none; padding-left: 0 !important; }
.checklist label { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; padding-top: 8px; cursor: pointer; }
.checklist input { width: 22px; height: 22px; flex: none; accent-color: var(--rope); margin: 0; }
.numbered li::marker { font-family: var(--f-mono); color: var(--muted); }
.gloss { display: grid; grid-template-columns: minmax(120px, max-content) 1fr; gap: 8px 20px; margin: 0; }
.gloss dt { font-weight: 600; }
.gloss dd { margin: 0; color: var(--muted); }
@media (max-width: 520px) { .gloss { grid-template-columns: 1fr; gap: 2px; } .gloss dd { margin-bottom: 10px; } }
.anat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 20px; background: var(--panel); border: 1px solid var(--line); padding: 18px; }
@media (max-width: 760px) { .anat { grid-template-columns: 1fr; } }
.anat-terms { display: grid; gap: 6px; align-content: start; }
.anat-terms button { text-align: left; display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--bg); cursor: pointer; min-height: 44px; }
.anat-terms button span { font-size: 14px; color: var(--muted); }
.anat-terms button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.anat-terms button[aria-pressed="true"] span { color: inherit; opacity: .85; }
.anat-fig { display: grid; place-items: center; }
.hl { fill: none; stroke: var(--over); stroke-width: 26; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .2s; mix-blend-mode: multiply; }
@media (prefers-color-scheme: dark) { .hl { mix-blend-mode: screen; } }
.hl.on { opacity: .55; }
.turns { margin: 0; display: grid; gap: 10px; background: var(--panel); border: 1px solid var(--line); padding: 16px; }
.turns svg { max-height: 300px; width: auto; justify-self: center; }
.turns figcaption { font-size: 15px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  .top nav, .tools, .scrub, .keys, .learn, .foot { display: none; }
  .view3d { display: none; }
  .view2d { display: grid !important; }
  .bench { grid-template-columns: 1fr; }
}

.term { text-decoration: underline dotted; text-underline-offset: 3px; color: inherit; }
.acts { align-items: center; font: 500 12px var(--f-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); gap: 8px; }
.acts .chip { text-transform: none; letter-spacing: 0; font-size: 13px; padding: 9px 11px; }

.redraw{margin:0 0 14px;padding:12px 14px;border-left:4px solid #c8261d;background:rgba(200,38,29,.08);font-size:15px;line-height:1.5}
