/* The project site. Same tokens as mem ui, a larger type scale; light or dark follows the system. */

:root {
  color-scheme: light;
  --bg: #ffffff; --panel: #f7f7f8; --surface: #ffffff; --ink: #18181b; --ink-2: #52525b; --ink-3: #8b8b94;
  --line: #e5e5e9; --line-soft: #efeff2; --chip: #f1f1f4; --code-bg: #f6f6f8;
  --accent: #5b5bd6; --accent-ink: #ffffff; --accent-soft: rgb(91 91 214 / 0.1); --accent-2: #4747c2;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 12px 40px -12px rgb(24 24 27 / .18);
  --shadow-lg: 0 2px 4px rgb(0 0 0 / .04), 0 32px 80px -24px rgb(24 24 27 / .28);
  --max: 1120px;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f0f11; --panel: #151517; --surface: #1a1a1d; --ink: #ededf0; --ink-2: #b4b4bc; --ink-3: #7b7b85;
    --line: #2a2a2f; --line-soft: #222226; --chip: #26262b; --code-bg: #17171a;
    --accent: #8b8bf0; --accent-ink: #0d0d10; --accent-soft: rgb(139 139 240 / 0.14); --accent-2: #a5a5f5;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 12px 40px -12px rgb(0 0 0 / .6);
    --shadow-lg: 0 2px 4px rgb(0 0 0 / .3), 0 32px 80px -24px rgb(0 0 0 / .7);
  }
}

*, ::before, ::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
code, pre, kbd { font-family: var(--mono); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.wrap { width: min(var(--max), 100% - 32px); margin-inline: auto; }
.i { width: 1em; height: 1em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

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

.top { position: sticky; top: 0; z-index: 20; border-bottom: 1px solid transparent; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); transition: border-color .2s; }
.top.scrolled { border-color: var(--line); }
.top .wrap { display: flex; height: 60px; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 650; letter-spacing: -0.01em; white-space: nowrap; }
.brand svg { width: 26px; height: 26px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; font-size: 14.5px; }
.nav a { padding: 6px 12px; white-space: nowrap; border-radius: 8px; color: var(--ink-2); transition: color .15s, background-color .15s; }
.nav a:hover { color: var(--ink); background: var(--chip); }
.nav a[aria-current="page"] { color: var(--ink); }
.nav .gh { display: inline-flex; align-items: center; gap: 6px; }
.nav .gh svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 560px) { .nav .hide-sm { display: none; } .top .wrap { gap: 8px; } .nav a { padding: 6px 8px; } .cmd { font-size: 13px; } }

/* ------------------------------------------------------------------ buttons and code */

.btn { display: inline-flex; height: 44px; align-items: center; gap: 8px; padding: 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 15px; font-weight: 550; white-space: nowrap; transition: background-color .15s, border-color .15s, transform .15s; }
.btn:hover { border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); }
.btn.primary { border-color: transparent; background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 2px rgb(0 0 0 / .1), inset 0 1px 0 rgb(255 255 255 / .15); }
.btn.primary:hover { background: var(--accent-2); }
.btn .i { width: 17px; height: 17px; transition: transform .15s; }
.btn:hover .i.go { transform: translateX(2px); }

.cmd { position: relative; display: flex; align-items: center; gap: 12px; max-width: 100%; padding: 10px 10px 10px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--code-bg); font-family: var(--mono); font-size: 14px; color: var(--ink-2); }
.cmd code { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.cmd code::before { content: "$ "; color: var(--ink-3); }
.copy { display: inline-grid; width: 30px; height: 30px; flex-shrink: 0; place-items: center; border-radius: 7px; color: var(--ink-3); transition: color .15s, background-color .15s; }
.copy:hover { background: var(--chip); color: var(--ink); }
.copy .i { width: 15px; height: 15px; }
.copy.done { color: var(--accent); }

pre.code { position: relative; overflow-x: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
pre.code .copy { position: absolute; top: 10px; right: 10px; opacity: 0; }
pre.code:hover .copy, pre.code .copy:focus-visible { opacity: 1; }
pre.code .c { color: var(--ink-3); }

/* ------------------------------------------------------------------ landing */

.hero { position: relative; padding: 88px 0 0; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -240px 0 auto; height: 720px; z-index: -1; background: radial-gradient(60% 50% at 50% 40%, var(--accent-soft), transparent 70%); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--ink-2); }
.pill b { padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12px; }
.hero h1 { max-width: 18ch; text-wrap: balance; margin: 24px auto 0; font-size: clamp(40px, 6.4vw, 68px); font-weight: 680; line-height: 1.04; letter-spacing: -0.04em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { max-width: 640px; margin: 22px auto 0; font-size: clamp(17px, 2vw, 19px); line-height: 1.6; color: var(--ink-2); }
.ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 34px; }
.hero .cmd { width: fit-content; margin: 22px auto 0; }

.window { position: relative; display: block; margin: 64px auto 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; text-align: left; }
.window-bar { display: flex; height: 38px; align-items: center; gap: 7px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--line); }
.window-bar span { margin: 0 auto; padding: 2px 14px; border-radius: 6px; background: var(--chip); font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.window-bar + * { display: block; }
.window img { width: 100%; height: auto; }
.window .play { position: absolute; right: 18px; bottom: 18px; }
.hero .window { width: min(1160px, 100% - 32px); margin-bottom: -1px; border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hero .window img { aspect-ratio: 1440 / 860; object-fit: cover; object-position: top; }

section.band { padding: 104px 0; border-top: 1px solid var(--line); }
section.band.alt { background: var(--panel); }
.kicker { font-size: 14px; font-weight: 600; color: var(--accent); }
.band h2 { max-width: 24ch; text-wrap: balance; margin-top: 10px; font-size: clamp(30px, 4vw, 42px); font-weight: 660; line-height: 1.12; letter-spacing: -0.03em; }
.band .sub { max-width: 620px; margin-top: 16px; font-size: 17.5px; color: var(--ink-2); }

.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 48px; counter-reset: step; }
.step { padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.step::before { counter-increment: step; content: counter(step); display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 14px; font-weight: 700; }
.step h3 { margin-top: 16px; font-size: 17px; font-weight: 620; letter-spacing: -0.01em; }
.step p { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
/* how it works: both tools read from and commit to one git repository; a remote, if any, reaches other machines.
   Wide windows lay it out left to right; narrow ones top to bottom, the wires turning with them. */
.loop { --wire: var(--accent); --wire-2: color-mix(in srgb, var(--ink) 55%, transparent);
  display: grid; grid-template-columns: minmax(0, 210px) minmax(104px, 1fr) minmax(0, 340px) minmax(72px, 0.6fr) minmax(0, 180px);
  align-items: center; margin-top: 28px; padding: 44px 36px; border: 1px solid var(--line); border-radius: 16px;
  background: radial-gradient(70% 90% at 50% 50%, var(--accent-soft), transparent 70%), var(--panel); }
.agents { display: grid; gap: 14px; }
.agent { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .04); }
.agent > div { display: grid; min-width: 0; line-height: 1.35; }
.agent b, .remote b { font-size: 14.5px; font-weight: 620; }
.agent span:not(.agent-icon), .remote > span:not(.agent-icon) { font-size: 12px; color: var(--ink-3); }
.agent-icon { display: grid; width: 34px; height: 34px; flex-shrink: 0; place-items: center; border-radius: 9px; background: var(--ink); color: var(--bg); }
.agent-icon .i { width: 17px; height: 17px; }
.agent-icon.soft { background: var(--chip); color: var(--ink-2); }

.wire { display: grid; gap: 22px; padding: 0 10px; }
.lane { display: grid; gap: 5px; justify-items: center; font-size: 12px; color: var(--ink-2); text-align: center; line-height: 1.3; text-wrap: balance; }
.lane.both span { white-space: nowrap; }
.lane i { position: relative; width: 100%; height: 2px; background: var(--wire); }
.lane.save i { background: repeating-linear-gradient(to right, var(--wire-2) 0 6px, transparent 6px 10px); }
.lane i::before, .lane i::after { content: ""; position: absolute; top: 50%; translate: 0 -50%; border: 6px solid transparent; }
.lane.recall i::before { left: -2px; border-right: 8px solid var(--wire); border-left: 0; }
.lane.save i::after { right: -2px; border-left: 8px solid var(--wire-2); border-right: 0; }
.lane.both i { background: repeating-linear-gradient(to right, var(--wire-2) 0 6px, transparent 6px 10px); }
.lane.both i::before { left: -2px; border-right: 8px solid var(--wire-2); border-left: 0; }
.lane.both i::after { right: -2px; border-left: 8px solid var(--wire-2); border-right: 0; }

.repo { border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow); overflow: hidden; }
.repo-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; white-space: nowrap; }
.repo-head .i { width: 17px; height: 17px; color: var(--accent); }
.repo-head b { font-weight: 640; }
.repo-head em { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 11.5px; font-style: normal; font-weight: 600; }
.tree { padding: 10px 16px 8px; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.tree-dir { display: flex; align-items: center; gap: 7px; color: var(--ink-3); }
.tree-dir .i { width: 14px; height: 14px; }
.tree ul { list-style: none; margin: 4px 0 0 7px; padding-left: 14px; border-left: 1px solid var(--line); }
.tree li { display: flex; align-items: center; gap: 8px; padding: 2px 0; }
.tree li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .dot { width: 7px; height: 7px; flex-shrink: 0; border-radius: 50%; }
.dot.t-feedback { background: #2a78d6; } .dot.t-reference { background: #eb6834; } .dot.t-project { background: #1baf7a; } .dot.t-user { background: #eda100; }
@media (prefers-color-scheme: dark) { .dot.t-feedback { background: #3987e5; } .dot.t-reference { background: #d95926; } .dot.t-project { background: #199e70; } .dot.t-user { background: #c98500; } }
.log { margin: 4px 16px 0; padding: 9px 0 10px; border-top: 1px dashed var(--line); font-family: var(--mono); font-size: 11.5px; line-height: 1.75; color: var(--ink-3); }
.log p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log code { color: var(--accent); }
.repo-foot { padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel); font-size: 12.5px; color: var(--ink-2); }
.repo-foot code { font-size: 12px; }

.remote { display: grid; justify-items: center; gap: 4px; padding: 18px 14px; border: 1.5px dashed color-mix(in srgb, var(--ink) 22%, transparent); border-radius: 14px; text-align: center; line-height: 1.35; }
.remote .agent-icon { margin-bottom: 4px; }

@media (max-width: 900px) {
  .loop { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 28px 18px; }
  .agents { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 520px); }
  .repo, .remote { width: min(100%, 420px); }
  .wire { display: flex; justify-content: center; gap: 36px; padding: 6px 0; }
  .lane { display: flex; align-items: center; gap: 10px; text-align: left; }
  .lane i { width: 2px; height: 56px; }
  .lane.save i { background: repeating-linear-gradient(to bottom, var(--wire-2) 0 6px, transparent 6px 10px); }
  .lane.both i { background: repeating-linear-gradient(to bottom, var(--wire-2) 0 6px, transparent 6px 10px); }
  .lane i::before, .lane i::after { left: 50% !important; right: auto !important; top: auto; translate: -50% 0; border: 6px solid transparent; }
  .lane.recall i::before { top: -2px; border-bottom: 8px solid var(--wire); border-top: 0; }
  .lane.save i::after { bottom: -2px; border-top: 8px solid var(--wire-2); border-bottom: 0; }
  .lane.both i::before { top: -2px; border-bottom: 8px solid var(--wire-2); border-top: 0; }
  .lane.both i::after { bottom: -2px; border-top: 8px solid var(--wire-2); border-bottom: 0; }
  .lane.recall { flex-direction: row-reverse; }
  .lane.recall i::before, .lane.save i::after, .lane.both i::before, .lane.both i::after { border-left: 6px solid transparent; border-right: 6px solid transparent; }
}
@media (max-width: 480px) { .agent { padding: 10px; gap: 9px; } .agent-icon { width: 30px; height: 30px; } .agent span:not(.agent-icon) { font-size: 11px; } }

.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 48px; border: 1px solid var(--line); border-radius: 16px; background: var(--line); overflow: hidden; }
.feature { padding: 28px; background: var(--surface); }
.feature .i { width: 22px; height: 22px; color: var(--accent); }
.feature h3 { margin-top: 18px; font-size: 16.5px; font-weight: 620; letter-spacing: -0.01em; }
.feature p { margin-top: 6px; font-size: 15px; color: var(--ink-2); }
.feature p a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; gap: 56px; }
.ticks { margin-top: 28px; display: grid; gap: 14px; list-style: none; }
.ticks li { display: flex; gap: 12px; font-size: 15.5px; color: var(--ink-2); }
.ticks li b { color: var(--ink); font-weight: 600; }
.ticks .i { width: 20px; height: 20px; margin-top: 2px; color: var(--accent); }
.split .window { margin: 0; }
.split .ctas { justify-content: flex-start; margin-top: 32px; }

.start { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: start; gap: 56px; }
.start pre.code { font-size: 13.5px; }
.start .note { margin-top: 16px; font-size: 14.5px; color: var(--ink-3); }
.start .note a, .sub a { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }

@media (max-width: 900px) {
  .steps, .start { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  section.band { padding: 80px 0; }
}
@media (max-width: 600px) {
  .features { grid-template-columns: minmax(0, 1fr); }
  .hero { padding-top: 56px; }
  .window-bar span { display: none; }
}

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

.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; font-size: 14px; color: var(--ink-3); }
.foot .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.foot .brand { color: var(--ink); font-size: 15px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 20px; margin-left: auto; }
.foot a:hover { color: var(--ink); }

/* ------------------------------------------------------------------ docs */

.docs { max-width: 820px; padding: 56px 0 96px; font-size: 16.5px; line-height: 1.7; }
.docs-head h1 { font-size: clamp(34px, 4.6vw, 46px); font-weight: 680; line-height: 1.1; letter-spacing: -0.035em; }
.docs-head > p { margin-top: 12px; font-size: 18px; color: var(--ink-2); }
.docs a:not(.jump a) { color: var(--accent); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--accent) 35%, transparent); text-underline-offset: 3px; }
.jump { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.jump a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; color: var(--ink-2); transition: color .15s, border-color .15s; }
.jump a:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--ink); }
.docs section { margin-top: 56px; padding-top: 40px; border-top: 1px solid var(--line); }
.docs h2 { font-size: 26px; font-weight: 650; line-height: 1.2; letter-spacing: -0.025em; }
.docs p, .docs pre, .docs table, .docs figure { margin-top: 16px; }
.docs b { font-weight: 620; }
.docs :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: var(--chip); font-size: 0.86em; overflow-wrap: anywhere; }
.docs pre { position: relative; overflow-x: auto; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--code-bg); font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
.docs pre .copy { position: absolute; top: 10px; right: 10px; opacity: 0; }
.docs pre:hover .copy, .docs pre .copy:focus-visible { opacity: 1; }
.docs table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.docs th { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; white-space: nowrap; }
.docs td { padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; color: var(--ink-2); }
.docs td:first-child { white-space: nowrap; }

/* a memory file, its parts marked and numbered */
.anatomy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.anatomy pre.file { margin: 0; padding: 14px 0; font-size: 12.5px; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.anatomy pre.file code { display: block; padding: 0 18px; }
.anatomy mark { position: relative; display: block; margin: 2px -18px; padding: 2px 44px 2px 15px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 9%, transparent); color: inherit; }
.anatomy mark::after { content: attr(data-n); position: absolute; top: 4px; right: 12px; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-family: var(--sans); font-size: 11.5px; font-weight: 700; }
.anatomy [data-n="1"], .callouts li:nth-child(1) { --c: #2a78d6; }
.anatomy [data-n="2"], .callouts li:nth-child(2) { --c: #eb6834; }
.anatomy [data-n="3"], .callouts li:nth-child(3) { --c: #1baf7a; }
.anatomy [data-n="4"], .callouts li:nth-child(4) { --c: #b07e00; }
.callouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; list-style: none; counter-reset: n; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); }
.callouts li { position: relative; padding-left: 32px; counter-increment: n; }
.callouts li::before { content: counter(n); position: absolute; top: 1px; left: 0; display: grid; width: 20px; height: 20px; place-items: center; border-radius: 50%; background: var(--c); color: #fff; font-size: 11.5px; font-weight: 700; }
.callouts b { color: var(--ink); }
@media (max-width: 640px) { .callouts { grid-template-columns: minmax(0, 1fr); } }

/* how a here memory matches a session: one bar per rule, as long as its score */
.ladder { display: grid; gap: 10px; padding: 20px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rung { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr) 36px; align-items: center; gap: 14px; font-size: 14.5px; }
.rung span { color: var(--ink-2); }
.rung i { height: 8px; width: var(--w); border-radius: 4px; background: color-mix(in srgb, var(--accent) calc(var(--w) * 0.9 + 10%), var(--chip)); }
.rung b { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .rung { grid-template-columns: minmax(0, 1fr) 36px; } .rung i { grid-column: 1 / -1; grid-row: 2; } .rung b { grid-row: 1; grid-column: 2; } }

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