@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("fonts/plus-jakarta-sans-latin.woff2") format("woff2");
}

:root {
  --bg: oklch(0.982 0.006 85);
  --surface: oklch(0.997 0.002 85);
  --sunk: oklch(0.955 0.008 85);
  --ink: oklch(0.23 0.03 245);
  --ink-2: oklch(0.43 0.025 245);
  --ink-3: oklch(0.52 0.02 245);
  --line: oklch(0.89 0.012 85);
  --line-2: oklch(0.82 0.015 85);
  --accent: oklch(0.43 0.09 190);
  --accent-ink: oklch(0.36 0.08 190);
  --accent-soft: oklch(0.94 0.03 190);
  --ok: oklch(0.52 0.12 152);
  --ok-soft: oklch(0.95 0.035 152);
  --draft: oklch(0.47 0.09 65);
  --draft-dot: oklch(0.72 0.13 72);
  --draft-soft: oklch(0.96 0.035 80);
  --shadow: 0 1px 2px oklch(0.3 0.03 245 / 0.06), 0 8px 24px oklch(0.3 0.03 245 / 0.08);
  --radius: 10px;
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.6 var(--font);
  font-feature-settings: "ss01";
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
::selection { background: var(--accent); color: var(--surface); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--sunk);
  border: 1px solid var(--line);
  padding: 0.05em 0.35em;
  border-radius: 5px;
  overflow-wrap: anywhere;
}
kbd {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-3);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 0 6px;
  line-height: 18px;
}
.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-3); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 16px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }

/* ---------- header */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklch, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; white-space: nowrap; font-size: 15px; }
.brand b { font-weight: 800; }
.brand em { font-style: normal; color: var(--ink-3); border-left: 1px solid var(--line-2); padding-left: 10px; }
.mark { width: 28px; height: 28px; flex: none; }
.mark rect { fill: var(--accent); }
.mark path { stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; fill: none; }

.hsearch { position: relative; flex: 1; max-width: 480px; margin-left: auto; display: flex; align-items: center; }
.hsearch > .i { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.hsearch input {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 8px 44px 8px 38px;
}
.hsearch input::placeholder { color: var(--ink-3); }
.hsearch kbd { position: absolute; right: 12px; }
.navbtn { display: none; }

/* ---------- search results */
.results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius);
  box-shadow: var(--shadow); max-height: min(70vh, 560px); overflow: auto; z-index: 30;
  padding: 6px; text-align: left;
}
.results[hidden] { display: none; }
.results a {
  display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink);
}
.results a:hover, .results a[aria-selected="true"] { background: var(--accent-soft); }
.results .rt { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.results .rh { display: block; color: var(--accent-ink); font-size: 14px; margin-top: 1px; }
.results .rm { display: block; color: var(--ink-3); font-size: 13px; }
.results mark { background: none; color: inherit; font-weight: 750; text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.results .empty { padding: 14px 12px; color: var(--ink-2); }
.results .more { padding: 8px 12px 6px; font-size: 13px; color: var(--ink-3); border-top: 1px solid var(--line); margin-top: 4px; }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; vertical-align: middle; }
.dot.ok { background: var(--ok); }
.dot.draft { background: transparent; box-shadow: inset 0 0 0 2px var(--draft-dot); }

/* ---------- home */
.home { flex: 1; }
.hero {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, oklch(1 0 0) 0%, oklch(0.975 0.025 158) 55%, oklch(0.93 0.06 158) 100%);
}
.hero-in { max-width: 860px; margin: 0 auto; padding: 88px 24px 72px; }
.hero h1 {
  font-size: clamp(2rem, 1.2rem + 3.2vw, 3.4rem); line-height: 1.08; letter-spacing: -0.03em;
  font-weight: 780; margin: 0 0 18px; text-wrap: balance; max-width: 18ch;
}
.lede { font-size: 1.125rem; color: var(--ink-2); max-width: 62ch; margin: 0 0 28px; text-wrap: pretty; }
.bigsearch { position: relative; display: flex; align-items: center; }
.bigsearch > .i { position: absolute; left: 20px; width: 22px; height: 22px; color: var(--accent); pointer-events: none; }
.bigsearch input {
  width: 100%; font: inherit; font-size: 1.15rem; color: var(--ink);
  background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 14px;
  padding: 18px 20px 18px 54px; box-shadow: var(--shadow);
  transition: border-color .2s cubic-bezier(.16,1,.3,1), box-shadow .2s cubic-bezier(.16,1,.3,1);
}
.bigsearch input:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft); }
.bigsearch input::placeholder { color: var(--ink-3); }
.tries { margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--ink-3); }
.tries button {
  font: inherit; font-size: 14px; color: var(--ink-2); background: var(--surface);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; cursor: pointer;
}
.tries button:hover { border-color: var(--accent); color: var(--accent-ink); }

.mods-in { max-width: 1080px; margin: 0 auto; padding: 64px 24px 80px; }
.mods h2 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 6px; }
.mods-in > .muted { margin: 0 0 28px; max-width: 70ch; }
.modlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 48px; border-top: 1px solid var(--line); }
.modlist li { border-bottom: 1px solid var(--line); }
.modlist a { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 18px 4px; text-decoration: none; color: var(--ink); }
.modlist a:hover .mn { color: var(--accent-ink); }
.mn { font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; }
.mc { color: var(--ink-3); font-size: 14px; font-variant-numeric: tabular-nums; align-self: center; }
.mt { grid-column: 1 / -1; color: var(--ink-2); font-size: 14px; }

/* ---------- layout with sidebar */
.wrap { max-width: 1280px; width: 100%; margin: 0 auto; padding: 0 24px; flex: 1; }
.with-side { display: grid; grid-template-columns: 272px minmax(0, 1fr); gap: 56px; }
.side {
  position: sticky; top: 65px; align-self: start; max-height: calc(100vh - 65px); overflow: auto;
  padding: 28px 8px 40px 0; font-size: 14px;
}
.side-mod { display: block; font-weight: 750; color: var(--ink); text-decoration: none; font-size: 15px; margin-bottom: 14px; }
.side-g { margin: 18px 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.side ul { list-style: none; margin: 0; padding: 0; }
.side li a {
  display: block; padding: 5px 10px; margin-left: -10px; border-radius: 6px;
  color: var(--ink-2); text-decoration: none; line-height: 1.35;
}
.side li a:hover { background: var(--sunk); color: var(--ink); }
.side li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }

/* ---------- doc page */
.doc { padding: 32px 0 80px; max-width: 76ch; min-width: 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-ink); text-decoration: underline; }
.crumbs .i { width: 14px; height: 14px; color: var(--line-2); }
.doc h1, .modpage h1 {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem); line-height: 1.15; letter-spacing: -0.025em;
  font-weight: 780; margin: 0 0 14px; text-wrap: balance;
}
.meta { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 28px; font-size: 14px; }
.where { color: var(--ink-2); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; padding: 4px 10px 4px 8px; border-radius: 999px; }
.status .i { width: 15px; height: 15px; }
.status.ok { background: var(--ok-soft); color: var(--ok); }
.status.ok .muted { color: inherit; font-weight: 500; opacity: .85; }
.status.draft { background: var(--draft-soft); color: var(--draft); }
p.status { margin: 0 0 28px; }

.asks { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 8px; }
.asks-h { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--ink-3); }
.asks ul { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 15px; }
.asks li::marker { color: var(--accent); }

.doc section { margin-top: 44px; }
.doc h2 { font-size: 1.3rem; letter-spacing: -0.015em; margin: 0 0 12px; font-weight: 720; }
.doc h3 { font-size: 1.02rem; margin: 28px 0 8px; }
.doc p, .doc li { text-wrap: pretty; }
.doc section > p:first-of-type { font-size: 1.05rem; }

.tbl { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 12px 0 8px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--sunk); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td code { white-space: nowrap; overflow-wrap: normal; }
td strong { font-weight: 700; letter-spacing: 0.01em; }

.shot { margin: 12px 0 0; }
.shot a { display: block; border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { font-size: 13px; color: var(--ink-3); margin-top: 8px; }

.tech { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 18px; }
.tech summary { cursor: pointer; font-weight: 700; font-size: 1.02rem; padding: 6px 0; }
.tech summary .muted { font-weight: 500; font-size: 14px; }
.tech[open] summary { margin-bottom: 12px; }
.k { font-size: 13px; font-weight: 700; color: var(--ink-3); margin-right: 6px; }

/* ---------- module page */
.modpage { padding: 32px 0 80px; max-width: 1080px; }
.legend { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-3); margin: -8px 0 8px; }
.legend .dot:last-of-type { margin-left: 12px; }
.grp { margin-top: 40px; }
.grp h2 { font-size: 1.15rem; margin: 0 0 4px; display: flex; align-items: baseline; gap: 10px; letter-spacing: -0.01em; }
.grp .n { font-size: 13px; color: var(--ink-3); font-weight: 600; font-variant-numeric: tabular-nums; }
.flist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); column-gap: 40px; border-top: 1px solid var(--line); }
.flist li { border-bottom: 1px solid var(--line); }
.flist a { display: block; padding: 12px 2px; text-decoration: none; color: var(--ink); }
.ft { display: flex; align-items: center; gap: 9px; font-weight: 650; }
.flist a:hover .ft { color: var(--accent-ink); }
.fx { display: block; color: var(--ink-3); font-size: 13.5px; line-height: 1.45; margin: 2px 0 0 17px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }


/* ---------- article (plain-language guide) */
.upd { margin: -4px 0 18px; font-size: 13.5px; color: var(--ink-3); }
.doc .lede { font-size: 1.15rem; color: var(--ink); margin-bottom: 20px; }
.doc .lede b { font-weight: 700; }
.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--draft-soft); color: var(--ink); border-radius: var(--radius);
  padding: 12px 16px; margin: 0 0 8px; font-size: 14.5px;
}
.note .i { color: var(--draft); margin-top: 3px; }
.note p { margin: 0; }
.steps { list-style: none; counter-reset: st; margin: 8px 0 0; padding: 0; }
.steps li {
  counter-increment: st; position: relative; padding: 0 0 18px 48px; min-height: 32px;
  font-size: 1.05rem; line-height: 1.6;
}
.steps li::before {
  content: counter(st); position: absolute; left: 0; top: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink);
  font-weight: 750; font-size: 15px; font-variant-numeric: tabular-nums;
}
.steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 15.5px; top: 34px; bottom: 2px; width: 1px; background: var(--line-2);
}
.steps b { font-weight: 700; }
.flow { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.flow li { display: flex; align-items: center; gap: 8px; }
.flow li + li::before {
  content: ""; width: 14px; height: 1px; background: var(--line-2); flex: none;
}
.fl {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 14px; border-radius: var(--radius);
  border: 1px solid var(--line-2); background: var(--surface); text-decoration: none; color: var(--ink);
}
a.fl:hover { border-color: var(--accent); }
.flow li[aria-current] .fl { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.fs { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.flow li[aria-current] .fs { color: inherit; opacity: .85; }
.fn { font-weight: 650; font-size: 14.5px; }
.more ul { margin: 0; padding-left: 20px; }
.more li { margin: 4px 0; }
.modflow { margin: 4px 0 8px; }
.modflow p { margin: 0 0 8px; font-size: 13.5px; font-weight: 700; }
.modflow ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: mf; }
.modflow li {
  counter-increment: mf; display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 999px;
  padding: 5px 14px 5px 6px; font-size: 14px; font-weight: 600;
}
.modflow li::before {
  content: counter(mf); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 750;
}
.flist .fx { margin-left: 0; -webkit-line-clamp: 1; }

/* ---------- footer */
.foot { border-top: 1px solid var(--line); background: var(--sunk); }
.foot-in { max-width: 1280px; margin: 0 auto; padding: 24px; font-size: 13.5px; color: var(--ink-2); }
.foot p { margin: 0 0 4px; max-width: 90ch; }

/* ---------- responsive */
@media (max-width: 1000px) {
  .with-side { grid-template-columns: 1fr; gap: 0; }
  .side {
    display: none; position: static; max-height: none; padding: 16px 0;
    border-bottom: 1px solid var(--line);
  }
  .side.open { display: block; }
  .navbtn {
    display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 14px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line-2);
    border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
  }
}
@media (max-width: 760px) {
  .top-in { flex-wrap: wrap; padding: 10px 16px; gap: 10px 12px; }
  .brand em { display: none; }
  .hsearch { order: 3; flex-basis: 100%; max-width: none; }
  .hsearch kbd { display: none; }
  .wrap { padding: 0 16px; }
  .hero-in { padding: 48px 16px 44px; }
  .mods-in { padding: 40px 16px 56px; }
  .modlist, .flist { grid-template-columns: 1fr; }
  .navbtn span { display: none; }
  .flow { flex-direction: column; align-items: stretch; }
  .flow li + li::before { display: none; }
  .flow .fl { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
