/* Wisp Study's page. The tokens are the app's own (src/theme.rs): the warm
   window surface, the working plane, the violet of the icon, the four status
   colours of a screening decision. No web fonts: the page loads nothing from
   anywhere else. */

:root {
  --paper: #F5F4F1;
  --surface: #FFFFFF;
  --sunken: #ECEBE6;
  --ink: #1F2329;
  --ink-2: #5C636E;
  --ink-3: #8A9099;
  --line: #E0DFD9;
  --line-strong: #CBCAC4;
  --accent: #6A4CC6;
  --accent-soft: #EBE6FA;
  --on-accent: #FFFFFF;
  --marker: rgba(232, 178, 30, 0.38);
  --ok: #23764A; --ok-bg: #E0F1E7;
  --info: #2A5FC4; --info-bg: #E3ECFD;
  --warn: #8F5C0C; --warn-bg: #F8ECD2;
  --bad: #B23B30; --bad-bg: #FBE6E3;
  --term-bg: #1E1F23; --term-ink: #E6E7EA; --term-dim: #8B909A;
  --shadow: 0 1px 2px rgba(31, 35, 41, .05), 0 12px 32px -8px rgba(31, 35, 41, .16), 0 40px 80px -32px rgba(59, 58, 143, .22);

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Source Han Serif CN", STSong, SimSun, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --rail: 132px;
  --top: 56px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1B1D;
    --surface: #222326;
    --sunken: #2A2B2F;
    --ink: #E6E7EA;
    --ink-2: #ABAFB7;
    --ink-3: #80858E;
    --line: #333539;
    --line-strong: #47494F;
    --accent: #A592EE;
    --accent-soft: rgba(159, 138, 234, .18);
    --on-accent: #141518;
    --marker: rgba(232, 185, 46, .34);
    --ok: #63C48F; --ok-bg: rgba(99, 196, 143, .16);
    --info: #7CA8F5; --info-bg: rgba(124, 168, 245, .16);
    --warn: #E0B25A; --warn-bg: rgba(224, 178, 90, .16);
    --bad: #EE877C; --bad-bg: rgba(238, 135, 124, .16);
    --term-bg: #121315;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 16px 40px -8px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 24px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.8 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--line-strong); text-underline-offset: .22em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--accent); color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
code { font: .88em var(--mono); background: var(--sunken); padding: .12em .38em; border-radius: 4px; }
h1, h2, h3, h4, p, ol, ul, figure, blockquote { margin: 0; }
ol, ul { padding: 0; list-style: none; }
strong, b { font-weight: 650; }

.wrap { max-width: 1220px; margin: 0 auto; padding-inline: clamp(18px, 4.2vw, 48px); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 6px 12px; border-radius: 6px; z-index: 20; }
.skip:focus { left: 12px; }

/* ---------- top bar ---------- */
.top {
  position: sticky; top: 0; z-index: 10; height: var(--top);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-in { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 1.08rem/1 var(--serif); letter-spacing: .01em; }
.brand:hover { color: inherit; }
.top nav { display: flex; gap: 4px; margin-left: auto; }
.top nav a, .gh { font-size: .9rem; text-decoration: none; padding: 6px 12px; border-radius: 7px; color: var(--ink-2); white-space: nowrap; }
.top nav a:hover, .gh:hover { background: var(--sunken); color: var(--ink); }
.gh { border: 1px solid var(--line-strong); color: var(--ink); }
/* The same page in the other language: after the sections, before GitHub. */
.lang { font-size: .9rem; text-decoration: none; padding: 6px 4px; color: var(--ink-3); white-space: nowrap; margin-inline: -14px -12px; }
.lang:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero { position: relative; isolation: isolate; padding-top: clamp(56px, 9vw, 124px); padding-bottom: clamp(64px, 9vw, 120px); }
.wisp {
  position: absolute; z-index: -1; pointer-events: none;
  top: clamp(8px, 3vw, 44px); right: clamp(-40px, -2vw, 0px);
  width: min(47%, 560px); overflow: visible;
}
.wisp path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.wisp-thick { stroke: url(#wisp-ink); stroke-width: 15; animation: draw 1.7s cubic-bezier(.6, 0, .2, 1) .15s backwards; }
.wisp-thin { stroke: #B9A8F5; stroke-width: 6.5; opacity: .6; animation: draw 1.4s cubic-bezier(.6, 0, .2, 1) .7s backwards; }
@keyframes draw { from { stroke-dashoffset: 1; } }

.kicker { font: 600 .82rem/1 var(--mono); letter-spacing: .14em; color: var(--accent); margin-bottom: clamp(20px, 3vw, 34px); display: flex; flex-wrap: wrap; gap: .4em 1.4em; }
.kicker-version { color: var(--ink-3); letter-spacing: .06em; }
h1 {
  font: 900 clamp(2.5rem, 7.6vw, 6.4rem)/1.1 var(--serif);
  letter-spacing: .01em;
  margin-left: -.03em;
}
.hero-cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); margin-top: clamp(32px, 5vw, 64px); align-items: start; }
.lead { font-size: clamp(1.06rem, 1.5vw, 1.24rem); line-height: 1.85; max-width: 31em; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.fine { margin-top: 18px; font-size: .84rem; color: var(--ink-3); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .72em 1.35em; border-radius: 9px; border: 1px solid var(--line-strong);
  font: 600 .96rem/1.3 var(--sans); text-decoration: none; color: var(--ink); background: transparent;
  transition: transform .15s ease, background-color .15s ease, border-color .15s ease;
}
.btn:hover { color: var(--ink); border-color: var(--ink-3); background: var(--surface); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { color: var(--on-accent); background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: transparent; }

.abstract { border-top: 2px solid var(--ink); padding-top: 16px; font-size: .9rem; line-height: 1.95; color: var(--ink-2); }
.abstract b { font-family: var(--serif); color: var(--ink); font-weight: 700; }
.keywords { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: .84rem; }

/* A citation: of a figure on this page, or of a sentence in the demo. */
.cite {
  appearance: none; border: 0; cursor: pointer; display: inline;
  font: 600 .8em/1.4 var(--mono); letter-spacing: 0;
  color: var(--accent); background: var(--accent-soft);
  padding: .18em .5em; border-radius: 5px; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.cite:hover, .cite[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ---------- figures ---------- */
.shot img { border-radius: 10px; border: 1px solid var(--line-strong); box-shadow: var(--shadow); background: var(--surface); }
figcaption { margin-top: 14px; font-size: .86rem; line-height: 1.7; color: var(--ink-2); max-width: 56em; }
figcaption b { font-family: var(--serif); color: var(--ink); font-weight: 700; }
figcaption, .verdict span { background: linear-gradient(var(--marker), var(--marker)) no-repeat 0 100% / 0% 100%; width: fit-content; }
.lit figcaption, figcaption.lit { animation: sweep 2.8s ease-out; }
@keyframes sweep { 0% { background-size: 0% 100%; } 22%, 70% { background-size: 100% 100%; } 100% { background-size: 100% 0%; } }
.hero .shot { margin-top: clamp(48px, 7vw, 96px); }

/* ---------- sections ---------- */
.sec { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); padding-block: clamp(72px, 10vw, 136px); position: relative; }
.sec::before { content: ""; position: absolute; top: 0; left: clamp(18px, 4.2vw, 48px); right: clamp(18px, 4.2vw, 48px); border-top: 1px solid var(--line-strong); }
.rail { position: sticky; top: calc(var(--top) + 36px); align-self: start; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.rail .no { font: 600 .8rem/1 var(--mono); color: var(--accent); letter-spacing: .08em; }
.rail .v { writing-mode: vertical-rl; font: 700 1.6rem/1 var(--serif); letter-spacing: .42em; }
/* Latin letters lie on their side here and want less air between them than characters do. */
:lang(en) .rail .v { letter-spacing: .1em; }
.rail::after { content: ""; width: 1px; height: 72px; background: var(--line-strong); margin-left: .78rem; }

h2 { font: 900 clamp(1.8rem, 4.1vw, 3.15rem)/1.22 var(--serif); letter-spacing: .01em; max-width: 18em; }
.sec-lead { margin-top: 22px; max-width: 41em; color: var(--ink-2); }
.sec-main h3 { font: 900 1.38rem/1.35 var(--serif); }
.nb { display: inline-block; }
.more { margin-top: 44px; font-weight: 600; }
.more a { text-decoration-color: var(--accent); }

/* ---------- §1: where 355 papers went ---------- */
.flow { margin-top: clamp(40px, 6vw, 72px); }
.ledger { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--line-strong); }
.ledger li { padding: 18px 16px 20px 0; position: relative; }
.ledger li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.ledger b { display: block; font: 900 clamp(2rem, 4.4vw, 3.5rem)/1.05 var(--serif); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.01em; }
.ledger span { display: block; margin-top: 8px; font-weight: 600; font-size: .95rem; line-height: 1.5; }
.ledger small { display: block; font-weight: 400; font-size: .8rem; color: var(--ink-3); margin-top: 2px; }
.ledger .sum b { color: var(--accent); }

.bar { display: flex; gap: 3px; height: 58px; margin-top: 6px; }
.seg { flex: 1 1 0; min-width: 9px; display: flex; align-items: center; justify-content: center; gap: .5em; border-radius: 5px; font-size: .9rem; white-space: nowrap; overflow: hidden; }
.seg:first-child { border-radius: 9px 5px 5px 9px; }
.seg:last-child { border-radius: 5px 9px 9px 5px; }
.seg b { font: 700 1.12rem/1 var(--serif); font-variant-numeric: lining-nums; }
.seg i { font-style: normal; }
.ok { color: var(--ok); background: var(--ok-bg); }
.info { color: var(--info); background: var(--info-bg); }
.warn { color: var(--warn); background: var(--warn-bg); }
.bad { color: var(--bad); background: var(--bad-bg); }

.chip { display: inline-block; font-size: .8rem; line-height: 1.5; font-weight: 600; padding: .12em .7em; border-radius: 999px; white-space: nowrap; }
.legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 32px; margin-top: 20px; font-size: .88rem; color: var(--ink-2); }
.legend .chip { margin-right: .8em; }
.after { margin-top: 22px; max-width: 44em; }
.after b { font-family: var(--serif); font-size: 1.15em; }

/* ---------- §1: the eight steps ---------- */
.steps { margin-top: clamp(56px, 8vw, 104px); display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.steps-list { display: flex; flex-direction: column; border-top: 1px solid var(--line-strong); position: sticky; top: calc(var(--top) + 28px); }
.steps-list button {
  appearance: none; background: none; border: 0; border-bottom: 1px solid var(--line); border-left: 3px solid transparent;
  font: inherit; color: var(--ink-2); text-align: left; cursor: pointer;
  display: grid; grid-template-columns: 1.3em minmax(0, 1fr) auto; align-items: baseline; gap: 8px;
  padding: 12px 10px 12px 9px; font-size: .95rem; line-height: 1.5;
  transition: background-color .15s ease, color .15s ease;
}
.steps-list button:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.steps-list button[aria-selected="true"] { color: var(--ink); background: var(--surface); border-left-color: var(--accent); font-weight: 650; }
.steps i, .try i { font: italic 700 1.1em/1 var(--serif); color: var(--accent); }
.steps-list time { font: .72rem/1 var(--mono); color: var(--ink-3); font-weight: 400; }
.steps-panels h3 { display: flex; align-items: baseline; gap: .6em; }
.steps-panels p { margin-top: 12px; max-width: 43em; }
.steps-panels .shot { margin-top: 26px; }
.steps-panels article + article { margin-top: 64px; }
.js .steps-panels article + article { margin-top: 0; }
.js .steps-panels article:not([hidden]) { animation: rise .35s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
html:not(.js) .steps { grid-template-columns: minmax(0, 1fr); }
html:not(.js) .steps-list { display: none; }

/* ---------- demos: a card drawn like the app's ---------- */
.try { margin-top: clamp(64px, 9vw, 112px); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.try-text p { margin-top: 14px; color: var(--ink-2); }
.try-text strong { color: var(--ink); }
.card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 20px 22px 18px; box-shadow: var(--shadow); font-size: .9rem; line-height: 1.7; }
.card-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.card-head strong { display: block; font-size: .98rem; line-height: 1.45; }
.byline { display: block; font-size: .8rem; color: var(--ink-3); margin-top: 3px; }
.reason { margin-top: 14px; }
.card blockquote { margin-top: 12px; padding: 9px 14px; border-left: 3px solid var(--accent); background: var(--sunken); border-radius: 0 7px 7px 0; font-size: .86rem; color: var(--ink-2); display: flex; gap: 12px; justify-content: space-between; }
.card blockquote cite { font-style: normal; font-size: .76rem; color: var(--ink-3); white-space: nowrap; }
.card-meta { margin-top: 10px; font-size: .76rem; color: var(--ink-3); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.choices button {
  appearance: none; font: 600 .86rem/1.3 var(--sans); color: var(--ink); cursor: pointer;
  padding: .55em 1em; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface);
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.choices button:hover { border-color: var(--ink-3); }
.choices button:active { transform: translateY(1px); }
.choices .suggested { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.choices button[aria-pressed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; }
.verdict { margin-top: 14px; font-size: .86rem; color: var(--ink-2); min-height: 3.4em; }
.verdict span { -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.verdict span.lit { animation: sweep 2.8s ease-out; }

/* ---------- §1: the door to the tutorials (site/tutorials/) ---------- */
.guides-head { margin-top: clamp(64px, 9vw, 112px); }
.guides-head p { margin-top: 12px; max-width: 41em; color: var(--ink-2); }
.guides { margin-top: 26px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 40px); border-top: 1px solid var(--line-strong); }
.guides a { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); column-gap: 10px; padding: 18px 0 20px; border-bottom: 1px solid var(--line); text-decoration: none; }
.guides a:hover { color: inherit; }
.guides .num { font-size: 1.5rem; line-height: 1.25; }
.guides > a > span:last-child { display: block; }
.guides strong { font: 900 1.06rem/1.45 var(--serif); transition: color .15s ease; }
.guides a:hover strong { color: var(--accent); }
.guides span span { display: block; margin-top: 4px; font-size: .86rem; line-height: 1.65; color: var(--ink-2); }

/* ---------- §2: the theses ---------- */
.theses { margin-top: clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line-strong); }
.thesis { display: grid; grid-template-columns: 5.4rem minmax(0, 1fr) minmax(0, 19rem); column-gap: clamp(20px, 3.5vw, 52px); padding-block: clamp(28px, 4vw, 44px); border-top: 1px solid var(--line-strong); align-items: start; }
.num { font: 400 clamp(2.2rem, 4vw, 3.2rem)/1 var(--serif); color: var(--accent); font-variant-numeric: lining-nums tabular-nums; letter-spacing: -.02em; }
.thesis h3 { font-size: clamp(1.3rem, 2.3vw, 1.72rem); font-weight: 900; }
.thesis h3 + p { margin-top: 12px; max-width: 35em; }
.proof { font-size: .86rem; line-height: 1.75; color: var(--ink-2); padding-top: .5rem; }
.proof b { display: block; font: 600 .72rem/1 var(--mono); letter-spacing: .14em; color: var(--accent); margin-bottom: 9px; }

.cite-demo { grid-column: 2 / -1; margin-top: 30px; }
.cite-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 2.5vw, 28px); align-items: stretch; }
.chat { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 20px 22px; font-size: .92rem; line-height: 1.85; box-shadow: var(--shadow); }
.chat .q { width: fit-content; max-width: 92%; margin-left: auto; background: var(--accent-soft); padding: 8px 14px; border-radius: 12px 12px 3px 12px; line-height: 1.6; }
.chat .a { margin-top: 16px; }
.chat .cite { white-space: normal; }
.sources { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.sources span { display: inline-block; font-size: .8rem; padding: .2em .8em; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--ink-2); }
.sheet {
  position: relative; background: #FDFCF9; color: #26282C; border: 1px solid var(--line-strong); border-radius: 3px;
  padding: 26px 30px 44px; font: .84rem/1.9 var(--serif); box-shadow: var(--shadow);
}
.sheet h4 { font: 700 1.05rem/1.4 var(--serif); text-align: center; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid #DDD9CF; }
.sheet p { text-indent: 2em; }
.sheet p + p { margin-top: 6px; }
.sheet mark { color: inherit; background: linear-gradient(rgba(232, 178, 30, .5), rgba(232, 178, 30, .5)) no-repeat 0 60% / 0% 78%; padding: .1em 0; transition: background-size .6s cubic-bezier(.4, 0, .2, 1); }
.sheet mark.on { background-size: 100% 78%; }
.pageno { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: .74rem; color: #8A8D93; }

.limits { margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: 5.4rem minmax(0, 1fr); column-gap: clamp(20px, 3.5vw, 52px); }
.limits h3 { grid-column: 2; }
.limits ul { grid-column: 2; margin-top: 16px; columns: 2; column-gap: 48px; font-size: .92rem; color: var(--ink-2); max-width: 60em; }
.limits li { break-inside: avoid; padding: 7px 0 7px 1.3em; position: relative; }
.limits li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }

/* ---------- §3: tools ---------- */
.code-cols { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.code { background: var(--term-bg); color: var(--term-ink); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; }
.code figcaption { margin: 0; padding: 10px 18px; font: .74rem/1.5 var(--sans); letter-spacing: .04em; color: var(--term-dim); border-bottom: 1px solid rgba(255, 255, 255, .08); background: none; width: auto; max-width: none; }
.code pre { margin: 0; padding: 16px 18px 18px; overflow-x: auto; font: .82rem/1.85 var(--mono); flex: 1; }
.code code { background: none; padding: 0; font: inherit; color: inherit; }
.code .p, .code .c { color: var(--term-dim); }
.code .p { user-select: none; }

.tool-table { margin-top: clamp(36px, 5vw, 56px); width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.6; }
.tool-table caption { caption-side: top; text-align: left; font-size: .86rem; color: var(--ink-2); padding-bottom: 12px; }
.tool-table caption b { font-family: var(--serif); color: var(--ink); }
.tool-table tr { border-top: 1px solid var(--line); }
.tool-table tr:first-child { border-top-color: var(--line-strong); }
.tool-table tr:last-child { border-bottom: 1px solid var(--line-strong); }
.tool-table th { text-align: left; font-weight: 400; padding: 9px 20px 9px 0; white-space: nowrap; vertical-align: baseline; width: 1%; }
.tool-table th code { background: none; padding: 0; font-size: .86rem; font-weight: 600; }
.tool-table td { padding: 9px 0; color: var(--ink-2); }
.w { display: inline-block; font: 600 .68rem/1 var(--sans); color: var(--warn); background: var(--warn-bg); padding: .28em .45em; border-radius: 4px; margin: 0 .5em; vertical-align: .12em; }

/* ---------- §4: download ---------- */
.dl-grid { margin-top: clamp(32px, 5vw, 52px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.dl { position: relative; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 14px; padding: 26px 24px 24px; display: flex; flex-direction: column; }
.dl.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.dl.mine::after { content: "你的系统"; position: absolute; top: 18px; right: 18px; font-size: .72rem; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: .2em .7em; border-radius: 999px; }
:lang(en) .dl.mine::after { content: "Your system"; }
.dl h3 { font-size: 1.7rem; font-weight: 900; }
.dl-req { font-size: .86rem; color: var(--ink-3); margin-top: 2px; }
.dl .btn { margin-top: 22px; align-self: flex-start; }
.dl:not(.mine) .btn.primary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.dl:not(.mine) .btn.primary:hover { background: var(--sunken); border-color: var(--ink-3); }
.dl-grid:not(:has(.mine)) .btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.dl-file { margin-top: 12px; font: .74rem/1.6 var(--mono); color: var(--ink-3); overflow-wrap: anywhere; }
.dl-file i { font-style: normal; }
.dl-file + .dl-file { margin-top: 2px; }
.dl-pick { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 10px; }
.dl .dl-pick .btn { margin-top: 0; }
.dl-note { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); font-size: .86rem; line-height: 1.7; color: var(--ink-2); }
.dl-foot { margin-top: clamp(36px, 5vw, 56px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.dl-foot ul { margin-top: 12px; font-size: .92rem; color: var(--ink-2); }
.dl-foot li { padding: 7px 0 7px 1.3em; position: relative; }
.dl-foot li::before { content: "–"; position: absolute; left: 0; color: var(--ink-3); }

/* ---------- footer ---------- */
.foot { border-top: 1px solid var(--line-strong); background: var(--sunken); padding-block: clamp(48px, 7vw, 88px); font-size: .9rem; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.foot h2 { font-size: 1.3rem; }
.refs ol { margin-top: 16px; counter-reset: ref; }
.refs li { counter-increment: ref; padding: 5px 0 5px 2.6em; position: relative; }
.refs li::before { content: "[" counter(ref) "]"; position: absolute; left: 0; font: .82rem/2 var(--mono); color: var(--ink-3); }
.colophon { color: var(--ink-2); }
.colophon p + p { margin-top: 12px; }
.colophon b { font-family: var(--serif); color: var(--ink); }

/* ---------- narrower ---------- */
@media (max-width: 1040px) {
  .guides { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .thesis { grid-template-columns: 4rem minmax(0, 1fr); }
  .proof { grid-column: 2; padding-top: 14px; }
  .limits { grid-template-columns: 4rem minmax(0, 1fr); }
  .try { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  body { font-size: 16px; }
  .sec { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; flex-direction: row; align-items: baseline; gap: 12px; margin-bottom: 18px; }
  .rail .v { writing-mode: horizontal-tb; font-size: 1rem; letter-spacing: .3em; }
  .rail::after { display: none; }
  .hero-cols { grid-template-columns: minmax(0, 1fr); }
  .wisp { width: 62%; opacity: .5; top: 4px; right: -8%; }
  .ledger { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ledger li:nth-child(4) { padding-left: 0; border-left: 0; }
  .ledger li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .steps-list { position: static; flex-direction: row; overflow-x: auto; border-top: 0; border-bottom: 1px solid var(--line-strong); margin-inline: calc(-1 * clamp(18px, 4.2vw, 48px)); padding-inline: clamp(18px, 4.2vw, 48px); scrollbar-width: none; }
  .steps-list::-webkit-scrollbar { display: none; }
  .steps-list button { flex: none; display: flex; border: 0; border-bottom: 3px solid transparent; padding: 10px 12px; }
  .steps-list button[aria-selected="true"] { border-bottom-color: var(--accent); background: none; }
  .steps-list time { display: none; }
  .cite-cols, .code-cols, .dl-foot, .foot-in { grid-template-columns: minmax(0, 1fr); }
  .dl-grid { grid-template-columns: minmax(0, 1fr); }
  .limits ul { columns: 1; }
}
@media (max-width: 600px) {
  .guides { grid-template-columns: minmax(0, 1fr); }
  .top nav a { padding: 6px 8px; }
  .gh { display: none; }
  .lang { margin-inline: 0; }
  :lang(en) .top nav { gap: 0; }
  :lang(en) .top nav a { padding: 6px 5px; font-size: .82rem; }
  .brand span { display: none; }
  .top-in { gap: 8px; }
  .ledger { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ledger li, .ledger li + li { padding: 14px 12px 16px 0; border-left: 0; border-top: 1px solid var(--line); }
  .ledger li:nth-child(-n+2) { border-top: 0; }
  .ledger .sum { grid-column: 1 / -1; }
  .seg i { display: none; }
  .bar { height: 46px; }
  .legend { grid-template-columns: minmax(0, 1fr); }
  .legend .chip { display: table; margin: 0 0 4px; }
  .thesis, .limits { grid-template-columns: minmax(0, 1fr); }
  .proof, .cite-demo, .limits h3, .limits ul { grid-column: 1; }
  .num { margin-bottom: 10px; }
  .card { padding: 16px; }
  .card-head { flex-direction: column; gap: 10px; }
  .sheet { padding: 20px 20px 40px; }
  .tool-table th, .tool-table td { display: block; width: auto; padding: 0; white-space: normal; }
  .tool-table th { padding-top: 10px; }
  .tool-table td { padding-bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
