/* Quipu site — palette after natural Andean dyes: cotton, walnut brown,
   cochineal red, indigo, ochre, chilca green, undyed alpaca. */

:root {
  --bg: #f6f1e7;
  --surface: #fffdf8;
  --surface-2: #eee6d6;
  --text: #261c16;
  --muted: #5e5046;
  --line: #ddd2c0;
  --red: #a23b27;
  --indigo: #2c4673;
  --ochre: #85600f;
  --green: #4b5e31;
  --brown: #765843;
  /* cord colours (graphics) */
  --c-main: #5a4334;
  --c-main-twist: #8b6d55;
  --c-red: #a8412c;
  --c-indigo: #2f4c7e;
  --c-ochre: #b5841f;
  --c-green: #5a6e37;
  --c-brown: #7e604a;
  --twist: rgba(255, 250, 240, .26);
  --knot-shade: rgba(20, 12, 8, .28);
  --shadow: 0 1px 2px rgba(38, 28, 22, .06), 0 8px 24px -12px rgba(38, 28, 22, .18);
  --on-accent: #fffdf8;
  --radius: 10px;
  --serif: "Charter", "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, "Source Han Serif SC", "Noto Serif CJK SC", "Songti SC", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #17120f;
  --surface: #211a15;
  --surface-2: #2b221c;
  --text: #efe6d8;
  --muted: #b3a592;
  --line: #3b3029;
  --red: #e8836a;
  --indigo: #9bb2e0;
  --ochre: #e2b457;
  --green: #afc087;
  --brown: #c9a88a;
  --c-main: #cdb497;
  --c-main-twist: #8f7660;
  --c-red: #d9705a;
  --c-indigo: #7f9bd3;
  --c-ochre: #d7a743;
  --c-green: #98ab6e;
  --c-brown: #b39274;
  --twist: rgba(20, 12, 8, .35);
  --knot-shade: rgba(0, 0, 0, .35);
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --on-accent: #17120f;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17120f;
    --surface: #211a15;
    --surface-2: #2b221c;
    --text: #efe6d8;
    --muted: #b3a592;
    --line: #3b3029;
    --red: #e8836a;
    --indigo: #9bb2e0;
    --ochre: #e2b457;
    --green: #afc087;
    --brown: #c9a88a;
    --c-main: #cdb497;
    --c-main-twist: #8f7660;
    --c-red: #d9705a;
    --c-indigo: #7f9bd3;
    --c-ochre: #d7a743;
    --c-green: #98ab6e;
    --c-brown: #b39274;
    --twist: rgba(20, 12, 8, .35);
    --knot-shade: rgba(0, 0, 0, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px -14px rgba(0, 0, 0, .6);
  --on-accent: #17120f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--indigo); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .08em .35em; border-radius: 4px; }
pre code { background: none; padding: 0; border-radius: 0; font-size: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
h3 { font-size: 1.05rem; font-weight: 650; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--text); color: var(--bg); padding: 8px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }
.nav { display: flex; gap: 22px; margin-left: 12px; }
.nav a { color: var(--muted); text-decoration: none; font-size: .95rem; }
.nav a:hover { color: var(--text); }
.header-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--text);
  font: 500 .9rem var(--sans); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--surface-2); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }

/* Hero */
.hero { padding: 64px 0 56px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; align-items: start; }
.hero-copy { padding-top: 24px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 .82rem var(--sans); color: var(--muted);
  border: 1px solid var(--line); background: var(--surface);
  padding: 4px 12px 4px 10px; border-radius: 99px; margin-bottom: 22px;
}
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ochre); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ochre) 25%, transparent); }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); margin-bottom: .45em; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 36em; }

.terminal {
  margin: 28px 0 12px; max-width: 30rem;
  background: #1d1612; color: #efe6d8;
  border-radius: var(--radius); box-shadow: var(--shadow);
  border: 1px solid #3b3029; overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-bottom: 1px solid #3b3029; font-size: .8rem; color: #b3a592; }
.terminal-title { font-family: var(--mono); }
.terminal .soon { background: #3a2a15; color: #e2b457; border-color: #5a4520; }
.terminal pre { margin: 0; padding: 14px 16px 16px; font: .95rem/1.7 var(--mono); overflow-x: auto; }
.terminal .prompt { color: #e8836a; user-select: none; }
.copy {
  margin-left: auto; font: 500 .78rem var(--sans); color: #efe6d8;
  background: transparent; border: 1px solid #4a3d33; border-radius: 6px;
  padding: 4px 10px; cursor: pointer;
}
.copy:hover { background: #2b221c; }
.soon {
  display: inline-block; font: 600 .7rem/1.6 var(--sans); text-transform: uppercase; letter-spacing: .06em;
  padding: 0 7px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--ochre) 45%, transparent);
  color: var(--ochre); color: color-mix(in srgb, var(--ochre) 80%, var(--text)); background: color-mix(in srgb, var(--ochre) 8%, transparent); vertical-align: middle;
}
.hero-note { font-size: .9rem; color: var(--muted); max-width: 30rem; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px;
  border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text); font-weight: 600; font-size: .95rem; text-decoration: none;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--on-accent); }
.btn-primary:hover { background: color-mix(in srgb, var(--red) 88%, var(--text)); border-color: transparent; }

/* Quipu figure */
.hero-figure { margin: 0; }
.quipu-stage { aspect-ratio: 560 / 430; width: 100%; }
.quipu-stage svg { width: 100%; height: 100%; overflow: visible; }
.noscript { padding: 24px; color: var(--muted); }
.q-main { fill: none; stroke: var(--c-main); stroke-width: 8; stroke-linecap: round; }
.q-main-twist { fill: none; stroke: var(--c-main-twist); stroke-width: 8; stroke-dasharray: 2.5 4.5; opacity: .55; }
.q-cord { fill: none; stroke-width: 3.6; stroke-linecap: round; }
.q-twist { fill: none; stroke: var(--twist); stroke-width: 3.6; stroke-dasharray: 1.2 4; }
.q-hitch { fill: none; stroke-width: 3; }
.q-label { font: 500 12.5px var(--mono); fill: var(--muted); stroke: none; text-anchor: middle; }
.q-proj { font: 600 13px var(--mono); fill: var(--muted); }
.q-fray { stroke: var(--c-main); stroke-width: 2; stroke-linecap: round; fill: none; }
.cord-red { stroke: var(--c-red); color: var(--c-red); }
.cord-indigo { stroke: var(--c-indigo); color: var(--c-indigo); }
.cord-ochre { stroke: var(--c-ochre); color: var(--c-ochre); }
.cord-green { stroke: var(--c-green); color: var(--c-green); }
.cord-brown { stroke: var(--c-brown); color: var(--c-brown); }
.q-pendant { transition: opacity .25s ease; }
.quipu-stage.has-focus .q-pendant:not(.is-active) { opacity: .45; }
.knot { cursor: pointer; outline: none; }
.knot .k-body { fill: currentColor; stroke: var(--knot-shade); stroke-width: 1; }
.knot .k-eight { fill: none; stroke: currentColor; stroke-width: 3; stroke-linejoin: round; }
.knot .k-hit { fill: transparent; }
.knot .k-ring { fill: none; stroke: var(--text); stroke-width: 1.6; stroke-dasharray: 3 3; opacity: 0; transition: opacity .2s; }
.knot .k-shape { transition: transform .2s ease; transform-box: fill-box; transform-origin: center; }
.knot:hover .k-shape, .knot.is-selected .k-shape { transform: scale(1.22); }
.knot.is-selected .k-ring { opacity: 1; }
.knot:focus-visible .k-ring { opacity: 1; stroke: var(--red); stroke-dasharray: none; stroke-width: 2.4; }

.memcard {
  min-height: 232px; margin-top: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px 12px;
}
.memcard-eyebrow { font: 600 .72rem var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.memcard-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { font: 500 .75rem/1.7 var(--mono); padding: 0 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.chip.tag { color: var(--on-accent); }
.chip.tag-red { background: var(--red); } .chip.tag-indigo { background: var(--indigo); } .chip.tag-ochre { background: var(--ochre); }
.chip.tag-green { background: var(--green); } .chip.tag-brown { background: var(--brown); }
.chip.trust-human { color: var(--green); }
.chip.trust-agent { color: var(--ochre); }
.chip.pending { color: var(--red); }
.memcard-content { font-size: 1rem; line-height: 1.5; margin-bottom: 10px; }
.memcard-meta { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0 0 8px; font-size: .82rem; }
.memcard-meta dt { color: var(--muted); font-family: var(--mono); font-size: .78rem; padding-top: 1px; }
.memcard-meta dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.memcard-nav { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); padding-top: 8px; font-size: .8rem; color: var(--muted); }
.memcard-nav button {
  width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer; font-size: 1rem; line-height: 1;
}
.memcard-nav button:hover { background: var(--surface-2); }
.memcard-nav .count { margin-right: auto; font-family: var(--mono); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; font-size: .82rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-item b { font-weight: 600; color: var(--text); }
.lg-knot { fill: none; stroke: var(--c-brown); stroke-width: 2.4; }
.lg-fill { fill: var(--c-brown); }

/* Textile band (stepped motif) */
.band {
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--c-red) 0 120px, var(--c-indigo) 120px 240px, var(--c-ochre) 240px 360px, var(--c-green) 360px 480px, var(--c-brown) 480px 600px);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 12V9h3V6h3V3h3V0h6v3h3v3h3v3h3v3z'/%3E%3C/svg%3E") repeat-x left center / 24px 12px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 12V9h3V6h3V3h3V0h6v3h3v3h3v3h3v3z'/%3E%3C/svg%3E") repeat-x left center / 24px 12px;
  opacity: .8;
}
.band.thin { height: 6px; -webkit-mask-size: 12px 6px; mask-size: 12px 6px; opacity: .65; }

/* Sections */
.section { padding: 88px 0; }
.section.alt { background: var(--surface-2); background: color-mix(in srgb, var(--surface-2) 60%, var(--bg)); }
.eyebrow { font: 600 .78rem var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--red); margin-bottom: 10px; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); }
.section-lede { font-size: 1.08rem; color: var(--muted); max-width: 44em; margin-bottom: 40px; }

/* Mapping */
.mapping { padding: 48px 0; }
.map-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
.map-grid svg { width: 64px; height: 24px; margin-bottom: 10px; }
.map-grid svg path { fill: none; stroke-linecap: round; }
.mg-main { stroke: var(--c-main); stroke-width: 4; }
.mg-red { stroke: var(--c-red); stroke-width: 2.6; }
.mg-ind { stroke: var(--c-indigo); stroke-width: 2.6; }
.mg-och { stroke: var(--c-ochre); stroke-width: 2.6; }
.mg-knot { fill: var(--c-red); }
.map-grid circle.mg-knot { fill: var(--c-indigo); }
.map-from { font: 500 .8rem var(--mono); color: var(--muted); margin: 0; }
.map-to { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; margin: 0 0 4px; }
.map-to::before { content: "→ "; color: var(--red); font-family: var(--sans); }
.map-desc { font-size: .9rem; color: var(--muted); margin: 0; }

/* Why */
.why-list { display: grid; gap: 14px; }
.why-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 48px minmax(0, 1.25fr); align-items: stretch;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.why-pain, .why-answer { padding: 20px 24px; }
.why-pain h3 { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--red) 60%, transparent); text-decoration-thickness: 1.5px; }
.why-pain p { color: var(--muted); margin: 0; font-size: .95rem; }
.why-answer { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.why-answer p { margin: 0; font-size: .95rem; }
.why-answer h3 { color: var(--text); }
.why-arrow { position: relative; }
.why-arrow::before { content: ""; position: absolute; left: 0; right: 10px; top: 50%; border-top: 2px dotted var(--line); }
.why-arrow::after { content: ""; position: absolute; right: 8px; top: calc(50% - 5px); width: 10px; height: 10px; border-radius: 50%; background: var(--c-red); }

/* Features */
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 22px 18px; }
.feature p { color: var(--muted); font-size: .94rem; margin: 0; }
.feature-mark { display: block; width: 28px; height: 8px; margin-bottom: 16px; border-radius: 2px;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='8'%3E%3Cpath d='M0 8V6h2V4h2V2h2V0h4v2h2v2h2v2h2V4h2V2h2V0h4v2h2v2h2v2h2v2z'/%3E%3C/svg%3E") no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='8'%3E%3Cpath d='M0 8V6h2V4h2V2h2V0h4v2h2v2h2v2h2V4h2V2h2V0h4v2h2v2h2v2h2v2z'/%3E%3C/svg%3E") no-repeat; }
.mk-red, .mk-red2 { background: var(--c-red); } .mk-indigo { background: var(--c-indigo); } .mk-ochre { background: var(--c-ochre); }
.mk-green { background: var(--c-green); } .mk-brown { background: var(--c-brown); }

.inject-demo { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.6fr); gap: 32px; align-items: center; margin-top: 48px; }
.inject-copy p { color: var(--muted); margin: 0; }
.code-block {
  margin: 0; padding: 16px 18px; border-radius: var(--radius);
  background: #1d1612; color: #efe6d8; border: 1px solid #3b3029;
  font: .85rem/1.65 var(--mono); overflow-x: auto; white-space: pre;
}
.c-tag { color: #e8836a; } .c-attr { color: #e2b457; } .c-str { color: #afc087; }

/* Quickstart */
.notice {
  display: flex; gap: 10px; flex-wrap: wrap; max-width: 46rem;
  padding: 14px 18px; margin-bottom: 36px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--ochre) 45%, transparent);
  background: color-mix(in srgb, var(--ochre) 9%, var(--bg));
}
.notice strong { color: var(--ochre); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 36px; }
.steps li { counter-increment: step; position: relative; padding-left: 52px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; font: 600 .9rem var(--mono);
  color: var(--red); border: 2px solid var(--c-red);
}
.steps p { color: var(--muted); font-size: .95rem; margin-bottom: 10px; }
.steps .code-block { font-size: .85rem; }
.steps .code-block + p { margin-top: 12px; }

/* History */
.history-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.history-copy p { max-width: 40em; }
.history-note { color: var(--muted); border-left: 3px solid var(--c-ochre); padding-left: 14px; font-size: .95rem; }
.number-figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; }
.number-figure svg { width: 100%; height: auto; }
.number-figure figcaption { font-size: .85rem; color: var(--muted); margin-top: 8px; }
.nf-main { fill: none; stroke: var(--c-main); stroke-width: 6; stroke-linecap: round; }
.nf-cord { fill: none; stroke-width: 3; stroke-linecap: round; }
.nf-red { stroke: var(--c-red); } .nf-ind { stroke: var(--c-indigo); }
.nf-zone path { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 4; }
.nf-label text { font: 500 11px var(--mono); fill: var(--muted); }
.nf-knot ellipse { stroke: var(--knot-shade); stroke-width: 1; }
.nf-k-red { fill: var(--c-red); } .nf-k-ind { fill: var(--c-indigo); }
.nf-eight { fill: none; stroke: var(--c-indigo); stroke-width: 3; }
.nf-value text { font: 600 14px var(--mono); fill: var(--text); text-anchor: middle; }
.nf-ann text { font: 500 11px var(--mono); fill: var(--muted); }

/* Roadmap */
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; position: relative; }
.roadmap::before { content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 5px; border-radius: 3px; background: var(--c-main); opacity: .85; }
.rm-item { position: relative; padding-top: 34px; }
.rm-knot { position: absolute; top: 2px; left: 0; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); border: 3px solid var(--c-main); }
.rm-item.is-current .rm-knot { background: var(--c-red); border-color: var(--c-red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-red) 25%, transparent); }
.rm-ver { font: 600 .85rem var(--mono); color: var(--red); margin: 0 0 4px; }
.rm-now { font: 600 .65rem/1.6 var(--sans); text-transform: uppercase; letter-spacing: .06em; background: var(--red); color: var(--on-accent); padding: 1px 6px; border-radius: 4px; margin-left: 6px; vertical-align: 1px; }
.rm-item p:last-child { color: var(--muted); font-size: .9rem; margin: 0; }

/* Open / CTA */
.open { text-align: center; }
.open-inner { max-width: 760px; }
.open p { color: var(--muted); font-size: 1.08rem; }
.open .cta-row { justify-content: center; }

/* Footer */
.site-footer { margin-top: 0; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; align-items: center; padding: 28px 24px 40px; font-size: .88rem; color: var(--muted); }
.footer-inner p { margin: 0; }
.brand-sm { font-family: var(--serif); font-weight: 700; color: var(--text); }
.footer-nav { display: flex; gap: 18px; }
.footer-nav a { color: var(--muted); }

/* Docs placeholder */
.doc-page { padding: 72px 0 96px; min-height: 60vh; }
.doc-page .wrap { max-width: 760px; }
.doc-page ul { padding-left: 1.2em; }
.doc-page li { margin-bottom: .4em; }

/* Motion */
@keyframes q-drop { from { stroke-dashoffset: var(--len, 400); } to { stroke-dashoffset: 0; } }
@keyframes q-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes q-sway { 0%, 100% { transform: rotate(-.5deg); } 50% { transform: rotate(.5deg); } }
@media (prefers-reduced-motion: no-preference) {
  .js-anim .q-cord, .js-anim .q-twist { stroke-dasharray: var(--len, 400); animation: q-drop 1.1s cubic-bezier(.3, .7, .3, 1) both; animation-delay: var(--d, 0s); }
  .js-anim .q-twist { stroke-dasharray: 1.2 4; animation: q-fade .6s ease both; animation-delay: calc(var(--d, 0s) + .9s); }
  .js-anim .knot, .js-anim .q-label { animation: q-fade .5s ease both; animation-delay: calc(var(--d, 0s) + .7s); }
  .q-sway { animation: q-sway 7s ease-in-out infinite; animation-delay: var(--sd, 0s); }
  .quipu-stage:hover .q-sway, .quipu-stage:focus-within .q-sway { animation-play-state: paused; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .hero-copy { padding-top: 0; }
  .map-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .inject-demo, .history-grid { grid-template-columns: 1fr; }
  .roadmap { grid-template-columns: 1fr; gap: 26px; }
  .roadmap::before { left: 8px; right: auto; top: 4px; bottom: 4px; width: 5px; height: auto; }
  .rm-item { padding: 0 0 0 40px; }
  .rm-knot { top: 0; }
}
@media (max-width: 760px) {
  .nav { display: none; }
  .hero { padding-top: 40px; }
  .section { padding: 64px 0; }
  .why-row { grid-template-columns: 1fr; }
  .why-arrow { height: 20px; }
  .why-arrow::before { left: 24px; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dotted var(--line); }
  .why-arrow::after { left: 20px; right: auto; top: auto; bottom: 0; }
  .steps { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }
  .map-grid, .feature-grid { grid-template-columns: 1fr; }
  .header-inner { gap: 12px; }
}
