/* ux.md site — dark product style, few boxes: structure comes from space, type and hairlines. */

:root {
  color-scheme: dark;
  --bg: #08090b;
  --bg-1: #0e0f12;
  --bg-2: #141519;
  --bg-3: #1b1d22;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);
  --text: #eeeff1;
  --muted: #9ea3ad;
  --faint: #7c818c;
  --green: #3ddc97;
  --green-bg: rgba(61, 220, 151, 0.1);
  --red: #ff7b72;
  --red-bg: rgba(255, 123, 114, 0.1);
  --blue: #79a8ff;
  --blue-bg: rgba(121, 168, 255, 0.12);
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 14px;
  --r-xl: 20px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--text); }

:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }

code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--bg-3);
  padding: 0.1em 0.38em;
  border-radius: 5px;
}

h1, h2, h3 { margin: 0; line-height: 1.1; letter-spacing: -0.03em; font-weight: 600; }
p { margin: 0; }

.wrap { width: min(1120px, 100% - 48px); margin-inline: auto; }
.muted { color: var(--muted); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.skip {
  position: absolute; left: 12px; top: -60px; z-index: 20;
  background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--r-s);
}
.skip:focus { top: 12px; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(8, 9, 11, 0.72);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -0.01em; }
.logo { height: 20px; width: auto; flex-shrink: 0; color: var(--text); }

.site-header nav { display: flex; gap: 2px; margin-right: auto; }
.site-header nav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px;
  color: var(--muted); text-decoration: none; font-size: 14px; border-radius: var(--r-s);
}
.site-header nav a:hover { color: var(--text); }
.site-header nav a[aria-current="page"] { color: var(--text); }

/* ---------- buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 0 18px; border-radius: var(--r-m);
  font: 500 15px var(--sans); text-decoration: none; border: 1px solid transparent; white-space: nowrap;
  transition: background-color 0.15s, color 0.15s;
}
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: var(--r-s); }
.btn-primary { background: var(--text); color: #08090b; }
.btn-primary:hover { background: #ffffff; }
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-2); }

.text-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px;
  color: var(--text); font-weight: 500; text-decoration: none;
}
.text-link::after { content: ""; width: 7px; height: 7px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); transition: transform 0.15s; }
.text-link:hover::after { transform: translateX(3px) rotate(45deg); }

/* ---------- hero ---------- */

.hero { position: relative; overflow: hidden; padding: 104px 0 24px; }
.hero::before, .closing::before {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 20%, #000 30%, transparent 75%);
  pointer-events: none;
}
.hero-glow {
  position: absolute; left: 50%; top: 400px; width: 900px; height: 500px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(61, 220, 151, 0.16), transparent);
  filter: blur(20px); pointer-events: none;
}
.hero-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }

.pill {
  display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 4px 14px 4px 4px;
  border: 1px solid var(--line-2); border-radius: 999px; background: rgba(20, 21, 25, 0.8);
  color: var(--muted); font-size: 14px; text-decoration: none;
}
.pill:hover { color: var(--text); }
.pill-tag { background: var(--green-bg); color: var(--green); border-radius: 999px; padding: 3px 10px; font: 500 12px var(--mono); }

.hero h1 {
  margin-top: 28px;
  font-size: clamp(44px, 7.4vw, 88px);
  letter-spacing: -0.05em;
  line-height: 1;
  max-width: 13ch;
  background: linear-gradient(180deg, #ffffff 35%, #9da3ae 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin-top: 24px; font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 60ch; line-height: 1.55; }
.hero-lede { max-width: 62ch; line-height: 1.75; }
.file-badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px 1px 6px; margin: 0 1px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--bg-2);
  font: 500 0.82em var(--mono); color: var(--text); white-space: nowrap; vertical-align: 0.06em; line-height: 1.6;
}
.file-badge svg { width: 0.95em; height: 0.95em; color: var(--faint); }
.file-badge.is-ux { border-color: rgba(61, 220, 151, 0.35); background: rgba(61, 220, 151, 0.08); color: var(--green); }
.file-badge.is-ux svg { color: var(--green); }
a.file-badge { text-decoration: none; transition: background-color 0.15s, border-color 0.15s; }
a.file-badge.is-ux:hover { background: rgba(61, 220, 151, 0.16); border-color: rgba(61, 220, 151, 0.6); }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 32px; }

/* terminal: the one framed object on the page */

.terminal {
  margin: 72px 0 0; width: min(900px, 100%); text-align: left;
  background: linear-gradient(180deg, rgba(24, 26, 31, 0.96), rgba(12, 13, 16, 0.96));
  border: 1px solid var(--line-2); border-radius: var(--r-xl);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 50px 100px -30px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.term-bar { display: flex; align-items: center; gap: 14px; height: 44px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 7px; }
.dots i { width: 11px; height: 11px; border-radius: 50%; background: var(--bg-3); }
.term-title { font: 400 13px var(--mono); color: var(--faint); }
.t-replay { margin-left: auto; min-height: 30px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: none; color: var(--muted); font: 500 12px var(--sans); cursor: pointer; }
.t-replay:hover { color: var(--text); background: var(--bg-3); }
.term-body {
  padding: 24px 26px 28px; font: 400 14px/1.7 var(--mono);
  max-height: calc(80vh - 46px); max-height: calc(80svh - 46px); overflow: hidden;
  display: flex; flex-direction: column;
}
.term-body > * { flex-shrink: 0; }
/* when the output is taller than the window, keep the newest lines in view and fade the oldest */
.term-body.is-overflow {
  justify-content: flex-end;
  mask-image: linear-gradient(180deg, transparent 0, #000 96px);
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 96px);
}
.term-body p + p, .term-body .t-list { margin-top: 10px; }
.t-caret { color: var(--green); margin-right: 6px; }
.t-dim { color: var(--faint); }
.t-head { color: var(--red); margin-top: 18px !important; }
.t-list { list-style: none; padding: 0; margin: 0; }
.t-list li { display: grid; grid-template-columns: 92px 1fr auto 1.2em; gap: 16px; padding: 7px 0; }
.t-state { text-align: right; }
.t-id { color: var(--red); }
.t-msg { font-family: var(--sans); font-size: 15px; }
.t-loc { color: var(--faint); }
.t-ok { color: var(--green); margin-top: 18px !important; }

/* works with */

.agents { padding: 128px 0 0; }
.agents-head { text-align: center; margin: 0 auto 48px; max-width: 960px; }
.agents-head h2 { text-wrap: balance; }
.agents-head h2 { font-size: clamp(30px, 3.6vw, 44px); letter-spacing: -0.045em; line-height: 1.08; }
.agents-head p { margin-top: 14px; color: var(--muted); font-size: 17px; }
.agent-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(6, 1fr); border-block: 1px solid var(--line); }
.agent-list li + li { border-left: 1px solid var(--line); }
.agent-list a {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 12px 28px;
  text-decoration: none; text-align: center; transition: background-color 0.2s;
}
.agent-list a:hover { background: linear-gradient(180deg, transparent, rgba(61, 220, 151, 0.06)); }
.a-icon { width: 26px; height: 26px; margin-bottom: 8px; color: var(--faint); transition: color 0.2s, transform 0.2s; }
.a-logo { width: 26px; height: 26px; margin-bottom: 8px; object-fit: contain; filter: grayscale(1) brightness(1.6); opacity: 0.55; transition: opacity 0.2s, filter 0.2s, transform 0.2s; }
.agent-list a:hover .a-logo { opacity: 1; filter: none; transform: translateY(-2px); }
.agent-list a:hover .a-icon { color: var(--green); transform: translateY(-2px); }
.a-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; color: var(--muted); transition: color 0.2s; }
.agent-list a:hover .a-name { color: var(--text); }
.a-file { font: 400 12px var(--mono); color: var(--faint); overflow-wrap: anywhere; }

/* ---------- sections ---------- */

.section { padding: 144px 0 0; }

.section-intro { max-width: 720px; margin-bottom: 56px; }
.section-intro h2, .anatomy-copy h2, .closing h2 { font-size: clamp(32px, 4vw, 52px); letter-spacing: -0.045em; line-height: 1.05; }
.section-intro p { margin-top: 16px; color: var(--muted); font-size: 18px; max-width: 58ch; }
.section-intro-row { max-width: none; display: flex; justify-content: space-between; align-items: end; gap: 24px; flex-wrap: wrap; }

/* without / with comparison */

.cmp-head, .cmp li { display: grid; grid-template-columns: 1fr 1fr 6rem; gap: 32px; align-items: baseline; }
.cmp-head { padding-bottom: 14px; font: 500 13px var(--mono); color: var(--faint); }
.cmp { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.cmp li { padding: 22px 0; border-bottom: 1px solid var(--line); }
.cmp p { display: flex; gap: 12px; font-size: 17px; }
.cmp-bad { color: var(--muted); }
.cmp-good { color: var(--text); }
.cmp-mark { flex-shrink: 0; font-family: var(--mono); }
.cmp-bad .cmp-mark { color: var(--red); }
.cmp-good .cmp-mark { color: var(--green); }
.cmp-id { justify-self: end; font: 400 13px var(--mono); color: var(--faint); text-decoration: none; }
.cmp-id:hover { color: var(--text); }

/* rule anatomy */

.anatomy { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 72px; align-items: start; }
.anatomy-copy { position: sticky; top: 120px; }
.anatomy-copy p { margin: 18px 0 12px; color: var(--muted); font-size: 18px; max-width: 46ch; }
.anatomy-rule { margin: 0; border-left: 1px solid var(--line-2); }
.anatomy-rule > div { display: grid; grid-template-columns: 7.5rem 1fr; gap: 24px; padding: 18px 0 18px 28px; position: relative; }
.anatomy-rule > div::before { content: ""; position: absolute; left: -4px; top: 27px; width: 7px; height: 7px; border-radius: 50%; background: var(--bg); border: 1px solid var(--line-2); }
.anatomy-rule dt { font: 400 13px/1.9 var(--mono); color: var(--faint); }
.anatomy-rule dd { margin: 0; color: var(--muted); }
.anatomy-rule .a-title { color: var(--text); font-size: 24px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.25; }
.anatomy-rule .a-do { color: var(--text); box-shadow: inset 2px 0 0 var(--green); padding-left: 14px; }
.anatomy-rule .a-dont { color: var(--text); box-shadow: inset 2px 0 0 var(--red); padding-left: 14px; }

/* features: open grid, no boxes */

.features { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 56px 48px; }
.f-icon { width: 22px; height: 22px; color: var(--green); }
.features h3 { margin-top: 18px; font-size: 18px; letter-spacing: -0.02em; }
.features p { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 40ch; }

/* steps */

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 48px; position: relative; }
.steps::before { content: ""; position: absolute; left: 14px; right: 0; top: 14px; height: 1px; background: linear-gradient(90deg, var(--line-2), transparent); }
.steps li { position: relative; }
.steps::before, .steps::after { z-index: 0; }
.step-n { z-index: 1; }
.step-n {
  position: relative; display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--line-2); font: 500 13px var(--mono); color: var(--text);
}
.steps h3 { margin-top: 22px; font-size: 18px; letter-spacing: -0.02em; }
.steps p { margin-top: 8px; color: var(--muted); font-size: 15px; max-width: 38ch; }

.snippet { margin-top: 0; border: 1px solid var(--line-2); border-radius: var(--r-l); background: var(--bg-1); overflow: hidden; }
.snippet-bar { padding: 6px 8px; border-bottom: 1px solid var(--line); }
.agent-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.agent-tabs::-webkit-scrollbar { display: none; }
.agent-tabs button {
  min-height: 36px; padding: 0 12px; border: 0; border-radius: var(--r-s); background: none; cursor: pointer;
  color: var(--faint); font: 500 13px var(--sans); white-space: nowrap; transition: color 0.15s, background-color 0.15s;
}
.agent-tabs button:hover { color: var(--text); }
.agent-tabs button[aria-selected="true"] { color: var(--text); background: var(--bg-3); }
.snippet-file { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 10px 0 18px; font-size: 14px; color: var(--muted); }
.snippet .snippet-file code { color: var(--green); background: var(--green-bg); padding: 0.1em 0.4em; font-size: 13px; }
.snippet pre { margin: 0; padding: 14px 18px 22px; white-space: pre-wrap; max-width: 78ch; }
.snippet code { background: none; padding: 0; font-size: 14px; line-height: 1.75; color: var(--text); }

/* get started: tabs */
.start-tabs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-m); background: var(--bg-1); }
.start-tabs button {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border: 0; border-radius: 7px;
  background: none; color: var(--muted); font: 500 14px var(--sans); cursor: pointer; transition: color 0.15s, background-color 0.15s;
}
.start-tabs button svg { width: 15px; height: 15px; }
.start-tabs button:hover { color: var(--text); }
.start-tabs button[aria-selected="true"] { background: var(--bg-3); color: var(--text); }
.start-tabs button[aria-selected="true"] svg { color: var(--green); }
.start-panel { max-width: 760px; margin-top: 28px; }
.start-panel:focus-visible { outline-offset: 8px; }
.start-panel + .start-panel { margin-top: 48px; }
.js .start-panel + .start-panel { margin-top: 28px; }
.start-panel > p { color: var(--muted); font-size: 16px; max-width: 60ch; }
.start-tag { color: var(--green); font-weight: 500; }
.start-panel .snippet { margin-top: 20px; }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 10px 12px 18px; border-bottom: 1px solid var(--line); }
.dl-file { display: flex; align-items: center; gap: 12px; min-width: 0; }
.dl-file .file-badge { font-size: 14px; }
.dl-file small { color: var(--muted); font-size: 14px; }
.start-dl { gap: 8px; flex-shrink: 0; }
.start-dl svg { width: 15px; height: 15px; }
.start-panel .snippet-file { padding-top: 10px; }
.agent-note { margin-top: 32px; color: var(--faint); font-size: 14px; }
.agent-note a { color: var(--muted); }

/* category list on the landing page */

.cat-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 48px; }
.cat-list a { display: block; padding: 22px 0 26px; border-top: 1px solid var(--line); text-decoration: none; height: 100%; }
.cat-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cat-name { font-weight: 600; font-size: 17px; letter-spacing: -0.015em; transition: color 0.15s; }
.cat-list a:hover .cat-name { color: var(--green); }
.cat-count { font: 400 13px var(--mono); color: var(--faint); }
.cat-sum { display: block; margin-top: 6px; color: var(--muted); font-size: 14px; }

/* closing */

.closing { position: relative; overflow: hidden; margin-top: 144px; padding: 128px 0 136px; border-top: 1px solid var(--line); }
.closing::before { mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 20%, transparent 70%); -webkit-mask-image: radial-gradient(ellipse 60% 70% at 50% 0%, #000 20%, transparent 70%); }
.closing-glow { top: -260px; }
.closing-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.closing h2 { max-width: 18ch; }
.closing p { margin-top: 18px; color: var(--muted); font-size: 18px; max-width: 56ch; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 14px; color: var(--muted); }
.footer-inner { display: grid; grid-template-columns: auto 1fr auto; gap: 24px 40px; align-items: center; }
.footer-inner p { max-width: 56ch; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.foot-links a { color: var(--muted); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.foot-links a:hover { color: var(--text); }

/* ---------- inner pages ---------- */

.page-head { padding: 88px 0 48px; }
.page-head h1 { font-size: clamp(44px, 5.6vw, 68px); letter-spacing: -0.05em; }
.page-head .lede { margin-top: 16px; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }

.level {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font: 500 11px var(--mono); letter-spacing: 0.04em; vertical-align: middle; white-space: nowrap;
}
.level-must { background: var(--green-bg); color: var(--green); }
.level-should { background: var(--bg-3); color: var(--muted); }

.head-meta { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin-top: 24px; }
.head-meta .text-link { margin-left: 12px; font-size: 14px; }

.search { position: relative; display: block; margin-top: 36px; max-width: 560px; }
.search::before {
  content: ""; position: absolute; left: 16px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%);
  background: no-repeat center/16px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ea3ad' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
}
.search input {
  width: 100%; min-height: 48px; padding: 0 16px 0 44px;
  font: 400 16px var(--sans); color: var(--text);
  background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--r-m);
}
.search input::placeholder { color: var(--faint); }
.search input:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.search-status { margin-top: 12px; color: var(--muted); font-size: 14px; min-height: 1.5em; }

.rid { font: 400 13px var(--mono); color: var(--muted); text-decoration: none; }

.empty { padding: 48px 0; }
.empty p + p { margin-top: 6px; color: var(--muted); }

/* ---------- category page ---------- */

/* ---------- library page ---------- */

html:has(.lib-tabs) { scroll-padding-top: 136px; }
.lib-head { padding-bottom: 32px; }
.lib-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 36px; }
.lib-controls .search { margin-top: 0; flex: 1 1 320px; max-width: 520px; }

.lib-tabs {
  position: fixed; left: 0; right: 0; top: 64px; z-index: 9;
  background: rgba(8, 9, 11, 0.82);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  opacity: 0; visibility: hidden; transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.3s;
}
.lib-tabs.is-visible { opacity: 1; visibility: visible; transform: none; transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s; }
@media (prefers-reduced-motion: reduce) { .lib-tabs, .lib-tabs.is-visible { transition: none; transform: none; } }

/* category grid at the top of the library */
.lib-grid { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-l); overflow: hidden; }
.lib-grid a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; height: 100%; padding: 30px 24px 28px; background: var(--bg); text-decoration: none; transition: background-color 0.15s, opacity 0.2s; }
.lib-grid a:hover { background: var(--bg-1); }
.lg-icon { display: grid; place-items: center; margin-bottom: 10px; color: var(--muted); transition: color 0.15s, transform 0.2s; }
.lg-icon svg { width: 26px; height: 26px; }
.lib-grid a:hover .lg-icon { color: var(--green); transform: translateY(-2px); }
.lg-top { display: flex; align-items: center; justify-content: center; gap: 8px; }
.lg-name { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.lg-sum { color: var(--muted); font-size: 14px; max-width: 32ch; text-wrap: balance; }
.lib-grid a.is-empty { opacity: 0.35; pointer-events: none; }
.lib-tabs-scroll {
  display: flex; gap: 4px; padding: 8px 0; overflow-x: auto; scrollbar-width: none;
  mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 40px), transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 40px), transparent);
  padding-inline: 8px 40px; margin-inline: -8px;
}
.lib-tabs-scroll::-webkit-scrollbar { display: none; }
.lib-tab {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 10px;
  border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: color 0.2s, background-color 0.2s, opacity 0.2s;
}
.lib-tab:hover { color: var(--text); background: var(--bg-2); }
.lib-tab-i { width: 16px; height: 16px; flex-shrink: 0; }
.lib-tab-n { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--bg-3); font: 400 11px var(--mono); color: var(--faint); text-align: center; transition: background-color 0.2s, color 0.2s; }
.lib-tab.is-active { color: var(--text); background: var(--bg-3); }
.lib-tab.is-active .lib-tab-i { color: var(--green); }
.lib-tab.is-active .lib-tab-n { background: rgba(61, 220, 151, 0.14); color: var(--green); }
.lib-tab.is-empty { opacity: 0.35; pointer-events: none; }

.lib-main { padding-bottom: 144px; }
.lib-cat, .lib-main > .empty { max-width: 960px; }
.lib-cat { padding-top: 72px; }
.lib-main > .lib-cat:first-child { padding-top: 40px; }
.lib-cat-head { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; padding-bottom: 28px; }
.lib-cat-icon { flex-shrink: 0; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(180deg, var(--bg-3), var(--bg-1)); border: 1px solid var(--line-2); color: var(--green); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05); }
.lib-cat-icon svg { width: 24px; height: 24px; }
.lib-cat-text h2 { font-size: clamp(32px, 4vw, 44px); letter-spacing: -0.045em; }
.lib-cat-text p { margin-top: 8px; color: var(--muted); font-size: 17px; max-width: 60ch; }
.lib-cat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 16px; }
.lib-cat-meta .text-link { margin-left: 8px; font-size: 14px; min-height: 32px; }
.lib-cat .intro { font-size: 16px; padding-bottom: 32px; }
.lib-cat .rule:first-of-type { border-top-color: var(--line-2); }

.rules { min-width: 0; }
.intro { font-size: 18px; color: var(--muted); max-width: 62ch; padding-bottom: 40px; }

.rule { padding: 56px 0 64px; border-top: 1px solid var(--line); }
.rule:target .rid { color: var(--green); }
.rule[hidden], .lib-cat[hidden] { display: none; }
.rule-head { display: flex; align-items: center; gap: 10px; }
.rule-head .rid:hover { color: var(--text); }
.rule h3 { margin: 16px 0 0; font-size: clamp(26px, 2.8vw, 34px); letter-spacing: -0.04em; line-height: 1.12; max-width: 26ch; text-wrap: balance; }
.why { margin-top: 14px; max-width: 64ch; color: var(--muted); font-size: 17px; }

.copy-sm { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-color: transparent; }
.copy-sm svg { width: 14px; height: 14px; }

/* Don't / Do panels */
.ex-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 32px; }
.ex-panel { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-l); background: var(--bg-1); overflow: hidden; }
.ex-panel-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 500 12px var(--mono); }
.ex-panel-dont .ex-panel-h { color: var(--red); box-shadow: inset 0 2px 0 rgba(255, 123, 114, 0.7); }
.ex-panel-do .ex-panel-h { color: var(--green); box-shadow: inset 0 2px 0 rgba(61, 220, 151, 0.7); }
.ex-stage {
  flex: 1; min-height: 220px; padding: 28px 22px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px) 0 0 / 14px 14px, #09090b;
}
.ex-cap { padding: 14px 16px 16px; border-top: 1px solid var(--line); font-size: 14.5px; color: var(--text); line-height: 1.55; }
.ex-pair-text .ex-cap { border-top: 0; }

.check { flex-shrink: 0; display: inline-block; padding: 2px 10px; border-radius: 999px; color: var(--text); font: 400 12px var(--mono); background: var(--bg-3); white-space: nowrap; }

/* ---------- example components (shadcn-like, dark) ---------- */

.ex-stage { --z-bg: #09090b; --z-card: #0c0c0e; --z-b: #27272a; --z-fg: #fafafa; --z-mut: #a1a1aa; --z-ph: #71717a; --z-red: #ef4444; --z-redt: #f87171; font: 400 13px/1.45 var(--sans); color: var(--z-fg); }
.ex-stage p { margin: 0; }
.ex-stage b { font-weight: 600; }
.ex-i { width: 14px; height: 14px; flex-shrink: 0; }
.ex-i-lg { width: 22px; height: 22px; }
.ex-stack { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 270px; }
.ex-tight { gap: 6px; }
.ex-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ex-center { align-items: center; justify-content: center; text-align: center; }
.ex-end { justify-content: flex-end; }
.ex-rel { position: relative; }
.ex-w { width: 100%; max-width: 280px; }
.ex-pad { padding: 18px 0; }
.ex-muted { color: var(--z-mut); font-size: 12px; }
.ex-strong { font-weight: 600; font-size: 13.5px; }
.ex-h { font-size: 15px; }
.ex-mono { font-family: var(--mono); font-size: 12px; }
.ex-d { color: var(--z-redt); display: inline-flex; }
.ex-up { color: #4ade80; }
.ex-big { font-size: 26px; font-weight: 600; letter-spacing: -0.03em; }
.ex-sep { border: 0; border-top: 1px solid var(--z-b); margin: 2px 0; width: 100%; }

.ex-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.ex-label { font-size: 12px; font-weight: 500; }
.ex-input { display: flex; align-items: center; height: 34px; padding: 0 11px; border: 1px solid var(--z-b); border-radius: 6px; background: transparent; color: var(--z-fg); white-space: nowrap; overflow: hidden; }
.ex-input-sm { height: 30px; font-size: 12px; }
.ex-ph { color: var(--z-ph); }
.ex-input.is-focus { box-shadow: 0 0 0 2px var(--z-bg), 0 0 0 4px #52525b; }
.ex-input.is-error { border-color: var(--z-red); }
.ex-input.is-error.is-focus { box-shadow: 0 0 0 2px var(--z-bg), 0 0 0 4px rgba(239, 68, 68, 0.45); }
.ex-caret { display: inline-block; width: 1px; height: 15px; margin-left: 1px; background: var(--z-fg); animation: blink 1s steps(1) infinite; }
.ex-help { font-size: 11.5px; color: var(--z-mut); }
.ex-err { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--z-redt); }
.ex-err .ex-i { width: 12px; height: 12px; }

.ex-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 6px; font-weight: 500; font-size: 12.5px; white-space: nowrap; border: 1px solid transparent; }
.ex-btn-primary { background: var(--z-fg); color: #18181b; }
.ex-btn-outline { border-color: var(--z-b); color: var(--z-fg); background: var(--z-bg); }
.ex-btn-ghost { color: var(--z-fg); }
.ex-btn-destructive { background: #dc2626; color: #fff; }
.ex-btn.ex-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.ex-btn.ex-full { width: 100%; }
.ex-btn.ex-icon { width: 32px; padding: 0; }
.ex-btn.is-pending { opacity: 0.8; }
.ex-btn.is-disabled { opacity: 0.45; }
.ex-btn.is-ring, .ex-btn.ex-icon.is-ring { box-shadow: 0 0 0 2px var(--z-bg), 0 0 0 4px #d4d4d8; }
.ex-btn-primary .ex-spin { border-color: rgba(0, 0, 0, 0.2); border-top-color: #18181b; }
.ex-spin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); border-top-color: var(--z-fg); animation: spin 0.8s linear infinite; }

.ex-card { width: 100%; padding: 14px; border: 1px solid var(--z-b); border-radius: 10px; background: var(--z-card); text-align: left; }
.ex-card.ex-bare { padding: 0; border: 0; background: none; }
.ex-nest { padding: 10px; margin-top: 8px; }
.ex-li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex-av { flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #27272a; font-size: 11px; font-weight: 600; }
.ex-overflow { white-space: nowrap; overflow: visible; position: relative; z-index: 1; }
.ex-trunc { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-clip-off { overflow: visible; }
.ex-dup { color: var(--z-redt); }

.ex-alert { display: flex; align-items: center; gap: 8px; padding: 9px 11px; border: 1px solid var(--z-b); border-radius: 8px; font-size: 12px; text-align: left; }
.ex-alert > span { flex: 1; }
.ex-alert-d { border-color: rgba(239, 68, 68, 0.45); color: var(--z-redt); }
.ex-toast { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; max-width: 290px; padding: 12px 14px; border: 1px solid var(--z-b); border-radius: 10px; background: var(--z-card); box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.8); text-align: left; }
.ex-toast-t { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.ex-toast .ex-muted { margin-top: 2px; }

.ex-dialog { width: 100%; max-width: 280px; padding: 16px; border: 1px solid var(--z-b); border-radius: 10px; background: var(--z-bg); box-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.9); text-align: left; display: flex; flex-direction: column; gap: 8px; position: relative; z-index: 1; }
.ex-dialog-t { font-weight: 600; font-size: 14px; }
.ex-dialog-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
.ex-overlay { position: relative; width: 100%; max-width: 290px; padding: 34px 10px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; }
.ex-behind { position: absolute; top: 8px; left: 10px; opacity: 0.6; }
.ex-esc { position: absolute; bottom: -24px; right: 4px; font-size: 11px; color: var(--z-mut); }

.ex-code { width: 100%; max-width: 300px; margin: 0; padding: 12px 14px; border: 1px solid var(--z-b); border-radius: 8px; background: var(--z-card); font: 400 11.5px/1.6 var(--mono); color: #d4d4d8; white-space: pre-wrap; text-align: left; }
.tk-tag { color: #7dd3fc; }
.tk-attr { color: #c4b5fd; }
.tk-str { color: #86efac; }

.ex-kb { display: grid; gap: 4px; width: 100%; padding: 6px; border-radius: 8px; background: #18181b; }
.ex-kb span { display: grid; place-items: center; height: 22px; border-radius: 4px; background: #3f3f46; font-size: 11px; }
.ex-kb-alpha { grid-template-columns: repeat(10, 1fr); }
.ex-kb-num { grid-template-columns: repeat(3, 1fr); }
.ex-kb-num span { height: 20px; }
.ex-kb-num span:empty { background: none; }
.ex-suggest { align-self: center; padding: 3px 10px; border-radius: 999px; background: #27272a; font-size: 11px; color: var(--z-fg); }

.ex-states { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 260px; }
.ex-state { display: flex; flex-direction: column; gap: 4px; align-items: center; justify-content: center; height: 64px; border-radius: 8px; font-size: 12px; font-weight: 500; }
.ex-state small { font-size: 10.5px; font-weight: 400; color: var(--z-mut); display: inline-flex; }
.ex-ok { border: 1px solid var(--z-b); background: var(--z-card); }
.ex-ok small { color: #4ade80; }
.ex-missing { border: 1px dashed #3f3f46; color: var(--z-ph); }
.ex-table-h { display: flex; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid var(--z-b); font-size: 11.5px; color: var(--z-mut); }
.ex-empty-i { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: #18181b; border: 1px solid var(--z-b); color: var(--z-mut); }
.ex-empty-i.ex-d { color: var(--z-redt); }
.ex-shift { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--z-redt); }
.ex-shift .ex-i { transform: rotate(90deg); }
.ex-skel-row { display: flex; gap: 10px; align-items: center; }
.ex-skel { display: block; height: 9px; border-radius: 4px; background: #27272a; animation: pulse 1.6s ease-in-out infinite; }
.ex-skel-av { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; }
.ex-skel-lines { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.ex-progress { height: 6px; border-radius: 999px; background: #27272a; overflow: hidden; }
.ex-progress span { display: block; height: 100%; border-radius: inherit; background: var(--z-fg); }
.ex-press { position: relative; display: inline-flex; }
.ex-pointer { position: absolute; right: -10px; bottom: -12px; width: 18px; height: 18px; fill: #fafafa; stroke: #09090b; stroke-width: 1.5; }

.ex-side { display: flex; flex-direction: column; gap: 2px; width: 100%; max-width: 190px; padding: 8px; border: 1px solid var(--z-b); border-radius: 10px; background: var(--z-card); }
.ex-nav { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 6px; color: var(--z-mut); font-size: 12.5px; }
.ex-nav.is-active { background: #27272a; color: var(--z-fg); font-weight: 500; }
.ex-topnav { display: flex; gap: 2px; padding: 3px; border-radius: 8px; background: #18181b; width: fit-content; }
.ex-topnav span { padding: 4px 10px; border-radius: 6px; font-size: 12px; color: var(--z-mut); }
.ex-topnav .is-active { background: var(--z-bg); color: var(--z-fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.ex-url { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 8px; background: #18181b; color: var(--z-mut); font: 400 11px var(--mono); white-space: nowrap; overflow: hidden; }
.ex-url span { overflow: hidden; text-overflow: ellipsis; color: var(--z-fg); }
.ex-url b { color: #86efac; font-weight: 400; }
.ex-chip { display: inline-flex; padding: 3px 9px; border: 1px solid var(--z-b); border-radius: 999px; font-size: 11px; color: var(--z-fg); }
.ex-kbd { display: inline-block; padding: 1px 6px; margin-right: 4px; border: 1px solid var(--z-b); border-bottom-width: 2px; border-radius: 4px; font: 500 10.5px var(--mono); color: var(--z-fg); }
.ex-tip { position: absolute; top: -32px; right: -24px; padding: 4px 8px; border-radius: 6px; background: var(--z-fg); color: #18181b; font-size: 11px; font-weight: 500; white-space: nowrap; }
.ex-ratio { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font: 500 11px var(--mono); }
.ex-ratio-bad { background: rgba(239, 68, 68, 0.12); color: var(--z-redt); }
.ex-ratio-ok { background: rgba(74, 222, 128, 0.12); color: #4ade80; }
.ex-motion { position: relative; width: 100%; max-width: 280px; }
.ex-whoosh { transform: rotate(-6deg) translateX(14px) scale(0.94); filter: blur(0.6px); box-shadow: -18px 0 0 -6px rgba(255, 255, 255, 0.05), -36px 0 0 -12px rgba(255, 255, 255, 0.03); }

.ex-danger { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid rgba(239, 68, 68, 0.4); border-radius: 8px; }
.ex-danger span { display: flex; flex-direction: column; }
.ex-danger small { font-size: 11px; color: var(--z-mut); }

.ex-cramped { gap: 0; }
.ex-tiny { display: grid; place-items: center; width: 18px; height: 18px; color: var(--z-fg); }
.ex-tiny .ex-i { width: 12px; height: 12px; }
.ex-hit { padding: 6px; border: 1px dashed rgba(74, 222, 128, 0.5); border-radius: 8px; }

.ex-phone { position: relative; width: 132px; height: 200px; padding: 22px 10px 10px; border: 1px solid #3f3f46; border-radius: 20px; background: var(--z-bg); overflow: hidden; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.ex-notch { position: absolute; top: 7px; left: 50%; width: 36px; height: 6px; transform: translateX(-50%); border-radius: 999px; background: #27272a; }
.ex-phone .ex-stack { gap: 6px; }
.ex-phone-overflow { overflow: visible; }
.ex-wide-table { display: grid; grid-template-columns: repeat(4, 62px); gap: 8px 10px; width: max-content; font-size: 11px; }
.ex-wide-table span:nth-child(-n+4) { color: var(--z-mut); }
.ex-phone-overflow::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 1px #3f3f46; pointer-events: none; }
.ex-mcard { display: flex; flex-direction: column; padding: 7px 8px; border: 1px solid var(--z-b); border-radius: 8px; font-size: 11px; }
.ex-mcard small { color: var(--z-mut); font-size: 10px; }
.ex-mbar { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 600; }
.ex-mbar b { color: #60a5fa; font-weight: 500; }
.ex-mfoot { margin-top: auto; }
.ex-reach { position: absolute; }

.ex-emoji { font-size: 22px; }
.ex-aiglow { background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(59, 130, 246, 0.25)), var(--z-card); border-color: rgba(167, 139, 250, 0.4); }
.ex-grad { background: linear-gradient(90deg, #c4b5fd, #93c5fd); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ex-gradbtn { background: linear-gradient(90deg, #8b5cf6, #3b82f6); color: #fff; }

.ex-dot { width: 10px; height: 10px; border-radius: 50%; }
.ex-dot-g { background: #22c55e; } .ex-dot-r { background: #ef4444; } .ex-dot-a { background: #f59e0b; }
.ex-status { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500; }
.ex-status .ex-i { width: 12px; height: 12px; }
.ex-st-g { background: rgba(34, 197, 94, 0.12); color: #4ade80; }
.ex-st-r { background: rgba(239, 68, 68, 0.12); color: #f87171; }
.ex-st-a { background: rgba(245, 158, 11, 0.12); color: #fbbf24; }
.ex-input-xs { height: 22px; font-size: 10.5px; padding: 0 8px; border-radius: 4px; }
.ex-xtight { gap: 3px; }
.ex-steps { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--z-mut); }
.ex-steps span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.ex-steps .is-done { color: #4ade80; }
.ex-steps .is-done .ex-i { width: 12px; height: 12px; }
.ex-steps .is-on { color: var(--z-fg); font-weight: 600; }
.ex-steps i { flex: 1; height: 1px; min-width: 10px; background: var(--z-b); }
.ex-sheet { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1px; background: var(--z-b); border: 1px solid var(--z-b); border-radius: 4px; overflow: hidden; font-size: 8.5px; }
.ex-sheet span { padding: 3px 4px; background: var(--z-card); white-space: nowrap; overflow: hidden; min-height: 14px; }
.ex-sheet-tiny { grid-template-columns: repeat(4, 1fr); font-size: 6.5px; }
.ex-sheet-tiny span { padding: 2px; }
.ex-devices { display: flex; align-items: flex-end; gap: 12px; }
.ex-laptop { width: 200px; padding: 10px; border: 1px solid #3f3f46; border-radius: 10px 10px 4px 4px; background: var(--z-bg); box-shadow: 0 8px 0 -4px #27272a; }
.ex-phone-sm { width: 74px; height: 120px; padding: 18px 6px 6px; border-radius: 14px; }
.ex-phone-sm .ex-mcard { font-size: 9px; padding: 5px; }
.ex-shiftdemo { position: relative; height: 54px; border: 1px solid var(--z-b); border-radius: 8px; background: var(--z-card); overflow: hidden; }
.ex-page { position: absolute; left: 12px; right: 30px; top: 10px; bottom: 10px; border-radius: 4px; background: repeating-linear-gradient(180deg, #3f3f46 0 6px, transparent 6px 12px); }
.ex-page-ghost { left: 22px; right: 20px; opacity: 0.35; background: repeating-linear-gradient(180deg, #f87171 0 6px, transparent 6px 12px); }
.tk-c { color: #71717a; }
.ex-sw { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--z-b); }
.ex-endcursor { align-self: flex-start; height: 14px; }
.ex-endcursor .ex-pointer { position: static; }
.ex-gridbox { position: relative; width: 100%; max-width: 260px; padding: 14px; border: 1px solid var(--z-b); border-radius: 10px; background: var(--z-card); }
.ex-gridlines::before { content: ""; position: absolute; inset: 0 14px; background: repeating-linear-gradient(90deg, rgba(74, 222, 128, 0.12) 0 1px, transparent 1px calc(100% / 4)); pointer-events: none; }
.ex-gridbox .ex-stack { max-width: none; position: relative; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: 0.5; } }

.copy {
  flex-shrink: 0; min-height: 36px; padding: 0 12px; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font: 500 13px var(--sans); cursor: pointer; transition: color 0.15s, background-color 0.15s;
}
.copy:hover { color: var(--text); background: var(--bg-2); }
.copy[data-state="done"] { color: var(--green); border-color: rgba(61, 220, 151, 0.4); }

/* ---------- motion ---------- */

@media (prefers-reduced-motion: no-preference) {
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }

  /* hero terminal: agent at work */
  .motion .terminal .is-pending { display: none; }
  .t-cursor { display: inline-block; width: 0.6em; height: 1.15em; margin-left: 2px; vertical-align: text-bottom; background: var(--text); animation: blink 1s steps(1) infinite; }
  .t-status { display: flex; gap: 10px; color: var(--muted); margin-top: 14px !important; }
  .t-spin { color: var(--green); width: 1ch; }
  .t-shimmer {
    background: linear-gradient(90deg, var(--faint) 0%, var(--faint) 35%, #ffffff 50%, var(--faint) 65%, var(--faint) 100%) 0 0 / 250% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 1.6s linear infinite;
  }
  .motion .t-list li.is-new { animation: appear 0.3s ease-out both; }
  .motion .t-list li.is-fixed .t-id { color: var(--green); }
  .motion .t-list li.is-fixed .t-msg { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(255, 255, 255, 0.25); }
  .motion .t-list li.is-fixed .t-state::before { content: "✓"; color: var(--green); font-size: 15px; display: inline-block; animation: pop 0.3s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
  .motion .t-ok.is-new { animation: appear 0.35s ease-out both; }

  /* word-by-word headings */
  .motion [data-words] .w { transition: opacity 0.15s linear; }

  /* comparison strike-through */
  .motion .cmp li { --p: 0; }
  .motion .cmp-bad .s {
    background: linear-gradient(rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35)) no-repeat 0 58% / calc(var(--p) * 100%) 1px;
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
  }
  .motion .cmp-bad { opacity: calc(1 - var(--p) * 0.4); }
  .motion .cmp-good { opacity: calc(0.25 + var(--p) * 0.75); transform: translateX(calc((1 - var(--p)) * -10px)); }
  .motion .cmp-good .cmp-mark { display: inline-block; transform: scale(calc(0.4 + var(--p) * 0.6)); }
  .motion .cmp-id { opacity: calc(0.3 + var(--p) * 0.7); }

  /* anatomy progress */
  .motion .anatomy-rule { position: relative; }
  .motion .anatomy-rule::after {
    content: ""; position: absolute; left: -1px; top: 0; width: 1px;
    height: calc(var(--fill, 0) * 100%); background: linear-gradient(180deg, transparent, var(--green));
  }
  .motion .anatomy-rule > div { opacity: 0.3; transition: opacity 0.45s ease; }
  .motion .anatomy-rule > div.is-on { opacity: 1; }
  .motion .anatomy-rule > div::before { transition: background-color 0.3s, border-color 0.3s, box-shadow 0.3s; }
  .motion .anatomy-rule > div.is-on::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.15); }

  /* steps progress */
  .motion .steps::after {
    content: ""; position: absolute; left: 14px; top: 14px; height: 1px;
    width: calc(var(--fill, 0) * var(--len, 0px)); background: var(--green);
  }
  .motion .step-n { transition: color 0.3s, border-color 0.3s, background-color 0.3s, box-shadow 0.3s; }
  .motion .step-n.is-on { color: var(--green); border-color: var(--green); background: #0b1a14; box-shadow: 0 0 0 5px rgba(61, 220, 151, 0.1); }

  /* list entrances and icon drawing */
  .motion .rv { opacity: 0; transform: translateY(14px); transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--d, 0ms); }
  .motion .rv.in { opacity: 1; transform: none; }
  .motion .f-icon * { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(0.4, 0, 0.2, 1); transition-delay: calc(var(--d, 0ms) + 150ms); }
  .motion .features li.in .f-icon * { stroke-dashoffset: 0; }
}
@keyframes blink { 50% { opacity: 0; } }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes appear { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .lib-grid { grid-template-columns: 1fr 1fr; }
  .lib-grid li:last-child:nth-child(odd) { grid-column: span 2; }
  .agent-list { grid-template-columns: repeat(3, 1fr); }
  .agent-list li:nth-child(4) { border-left: 0; }
  .agent-list li:nth-child(n+4) { border-top: 1px solid var(--line); }
  .anatomy { grid-template-columns: 1fr; gap: 48px; }
  .anatomy-copy { position: static; }
  .features { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr; gap: 36px; }
  .steps::before { left: 14px; right: auto; top: 14px; bottom: 14px; width: 1px; height: auto; background: linear-gradient(180deg, var(--line-2), transparent); }
  .motion .steps::after { width: 1px; height: calc(var(--fill, 0) * var(--len, 0px)); }
  .steps li { padding-left: 52px; }
  .step-n { position: absolute; left: 0; top: 0; }
  .steps h3 { margin-top: 2px; }
  .cat-list { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .dl-file small { display: none; }
  .hero-lede { max-width: none; font-size: 17px; line-height: 1.7; text-wrap: wrap; }
  .start-tabs { display: flex; width: 100%; }
  .start-tabs button { flex: 1; justify-content: center; padding: 0 10px; }
  .lib-grid a { padding: 22px 12px 20px; gap: 4px; }
  .lg-icon { margin-bottom: 6px; }
  .lg-top { flex-direction: column; gap: 6px; }
  .lg-icon svg { width: 24px; height: 24px; }
  .lg-name { font-size: 15px; }
  .lg-sum { display: none; }
  html:has(.lib-tabs) { scroll-padding-top: 128px; }
  .lib-cat { padding-top: 56px; }
  .lib-cat-head { gap: 14px; }
  .lib-cat-icon { width: 44px; height: 44px; border-radius: 12px; }
  .lib-tab { padding: 0 10px 0 8px; font-size: 13.5px; }
      .agent-tabs { mask-image: linear-gradient(90deg, #000 85%, transparent); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); padding-right: 24px; }
  .snippet code { font-size: 13px; }
  .agents { padding-top: 72px; }
  .agent-list { grid-template-columns: 1fr 1fr; }
  .agent-list li:nth-child(n) { border-left: 0; border-top: 0; }
  .agent-list li:nth-child(even) { border-left: 1px solid var(--line); }
  .agent-list li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .agent-list a { padding: 20px 8px; }
  .wrap { width: calc(100% - 32px); }
  .header-inner { gap: 8px; }
  .header-cta { display: none; }
  .site-header nav { margin-left: auto; margin-right: 0; }
  .site-header nav a { padding: 0 10px; }
  .hero { padding-top: 64px; }
  .terminal { margin-top: 48px; }
  .term-body { padding: 18px 16px 20px; font-size: 13px; }
  .t-list li { grid-template-columns: auto 1fr; gap: 2px 12px; }
  .t-list .t-msg, .t-list .t-loc { grid-column: 1 / -1; }
  .t-state { grid-row: 1; grid-column: 2; }
  .section { padding-top: 96px; }
  .cmp-head { display: none; }
  .cmp li { grid-template-columns: 1fr; gap: 8px; }
  .cmp-id { justify-self: start; }
  .anatomy-rule > div { grid-template-columns: 1fr; gap: 4px; padding-left: 20px; }
  .features, .cat-list { grid-template-columns: 1fr; }
  .rule { padding: 36px 0 40px; }
  .ex-pair { grid-template-columns: 1fr; }
  .ex-stage { min-height: 200px; padding: 24px 16px; }
    .closing { margin-top: 96px; padding: 96px 0; }
}
