/* GEMAX — www.gemax.dev */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("fonts/instrument-serif-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #09090d;
  --bg-alt: #0c0c12;
  --card: #121219;
  --card-2: #17171f;
  --line: #22222c;
  --line-2: #2e2e3b;
  --text: #ecebf3;
  --text-2: #b8b6c8;
  --muted: #8d8ba1;
  --dim: #63617a;

  --accent: #b388ff;
  --accent-strong: #8e45ce;
  --accent-soft: rgba(179, 136, 255, 0.12);
  --accent-line: rgba(179, 136, 255, 0.35);

  --blue: #82aaff;
  --green: #8fd6a4;
  --amber: #f2c46d;
  --red: #ff7d8b;
  --cyan: #7fd7e4;
  --orange: #f7a072;

  /* NICOS faces, as the editor ships them */
  --desktop: #05070d;
  --pane: #0e1016;
  --pane-border: #333337;
  --pane-border-active: #4a70a8;
  --pane-rule: #1b1e26;

  --radius: 14px;
  --font: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, kbd, pre { font-family: var(--mono); }
code { font-size: 0.88em; color: var(--text); background: var(--accent-soft); padding: 0.08em 0.38em; border-radius: 5px; }
kbd {
  font-size: 0.8em;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.05em 0.42em;
  white-space: nowrap;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: rgba(179, 136, 255, 0.35); color: #fff; }

/* language switch: no JS → English */
html[data-lang="es"] .en { display: none !important; }
html:not([data-lang="es"]) .es { display: none !important; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap-wide { max-width: 1320px; }

.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--accent); color: #000; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }

.ic { width: 1em; height: 1em; display: inline-block; vertical-align: -0.12em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------ nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(9, 9, 13, 0.72);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s;
}
.nav.scrolled { border-bottom-color: var(--line); }
.nav-in { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 760; letter-spacing: 0.06em; font-size: 17px; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 24px; margin-right: auto; }
.nav-links a { color: var(--muted); font-family: var(--mono); font-size: 12.5px; letter-spacing: 0.08em; text-transform: uppercase; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-tools { display: flex; align-items: center; gap: 10px; }
.mx-btn { background: none; border: 0; padding: 0; }
.mx-btn kbd { font-size: 12px; padding: 4px 8px; }
.mx-btn:hover kbd { border-color: var(--accent-line); color: var(--accent); }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.lang button { background: none; border: 0; padding: 5px 9px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.08em; color: var(--dim); }
.lang button[aria-pressed="true"] { background: var(--card-2); color: var(--text); }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--text); color: #0b0b10;
  border: 0; border-radius: 10px;
  padding: 12px 18px;
  font-family: var(--mono); font-size: 13.5px; font-weight: 600;
  transition: transform 0.15s, background 0.15s;
}
.btn:hover { text-decoration: none; background: #fff; transform: translateY(-1px); }
.btn-sm { padding: 8px 13px; font-size: 12px; border-radius: 8px; }

/* ------------------------------------------------------------ shared */
.eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 22px;
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 36px; height: 1px; background: var(--accent-line); }
.title {
  margin: 0 0 22px;
  font-size: clamp(34px, 4.6vw, 60px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 720;
  max-width: 980px;
  text-wrap: balance;
}
.title em, .hero-title em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.title-xl { font-size: clamp(44px, 7vw, 96px); }
.intro { max-width: 760px; color: var(--text-2); font-size: 18.5px; margin: 0 0 44px; text-wrap: pretty; }
.section { padding: 112px 0; border-top: 1px solid var(--line); }
.section-alt { background: var(--bg-alt); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { opacity: 1; transform: none; }

/* ------------------------------------------------------------ hero */
.hero { position: relative; padding: 84px 0 64px; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 900px; z-index: -1;
  background:
    radial-gradient(600px 380px at 78% 18%, rgba(142, 69, 206, 0.28), transparent 70%),
    radial-gradient(520px 320px at 12% 0%, rgba(74, 112, 168, 0.16), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 62%);
}
.hero-title {
  margin: 0 0 28px;
  font-size: clamp(44px, 7.6vw, 108px);
  line-height: 0.96;
  letter-spacing: -0.042em;
  font-weight: 780;
  max-width: 1060px;
  text-wrap: balance;
}
.hero-title em { font-size: 1.06em; letter-spacing: -0.02em; }
.lede { max-width: 780px; font-size: clamp(17px, 1.6vw, 20px); line-height: 1.6; color: var(--text-2); margin: 0 0 34px; text-wrap: pretty; }

.install { max-width: 820px; border: 1px solid var(--line-2); border-radius: 12px; background: rgba(18, 18, 25, 0.85); }
.install-tabs { display: flex; gap: 2px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); }
.install-tabs button, .ct-tabs button, .g-tabs button {
  background: none; border: 0; border-bottom: 2px solid transparent;
  padding: 7px 12px 8px; margin-bottom: -1px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--dim);
}
.install-tabs button[aria-selected="true"], .ct-tabs button[aria-selected="true"], .g-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.install-row { display: flex; align-items: center; gap: 12px; padding: 14px 10px 14px 18px; }
.install-row code {
  flex: 1; min-width: 0; background: none; padding: 0;
  font-size: 13.5px; color: var(--text); white-space: nowrap; overflow-x: auto; scrollbar-width: none;
}
.install-row code::-webkit-scrollbar { display: none; }
.c-prompt { color: var(--accent); margin-right: 6px; user-select: none; }
.copy {
  flex: none; width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: 8px; color: var(--muted);
  transition: color 0.15s, border-color 0.15s;
}
.copy svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.copy:hover { color: var(--text); border-color: var(--accent-line); }
.copy.done { color: var(--green); border-color: rgba(143, 214, 164, 0.5); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; font-family: var(--mono); font-size: 12.5px; color: var(--dim); }
.meta a { color: var(--accent); }

/* ------------------------------------------------------------ the editor illustration */
.editor {
  --ed-font: 12.5px;
  position: relative;
  margin-top: 64px;
  border-radius: 16px;
  background: var(--desktop);
  border: 1px solid #1d2030;
  box-shadow: 0 40px 120px -30px rgba(142, 69, 206, 0.35), 0 24px 60px -20px rgba(0, 0, 0, 0.8);
  font-family: var(--mono);
  font-size: var(--ed-font);
  line-height: 1.62;
  color: #d6d7e3;
  overflow: hidden;
  user-select: none;
}
.ed-bar { display: flex; justify-content: space-between; align-items: center; height: 34px; padding: 0 12px; }
.pills { display: flex; gap: 6px; }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #141725; color: #8d90a8; }
.pill.on { background: #2a1f45; color: #d9c6ff; }
.pill.dim { background: transparent; }
.ed-desk {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 10px;
  height: 500px;
  padding: 0 10px 10px;
}
.pane {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  background: var(--pane);
  border: 1px solid var(--pane-border);
  border-radius: 11px;
  overflow: hidden;
  transition: border-color 0.6s ease, box-shadow 0.6s ease;
}
.pane.is-active { border-color: var(--pane-border-active); }
.editor.purple .pane.is-active { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(179, 136, 255, 0.25), 0 0 28px -6px rgba(179, 136, 255, 0.35); }
.pane-head { padding: 8px 16px 0; font-size: 11px; color: #6d7088; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pane-head i { font-style: normal; color: #4b4e63; margin: 0 4px; }
.pane-body { flex: 1; min-height: 0; padding: 8px 16px 6px; overflow: hidden; white-space: pre; }
.modeline {
  display: flex; gap: 14px; align-items: center;
  margin: 0 16px; padding: 5px 0 7px;
  border-top: 1px solid var(--pane-rule);
  font-size: 11px; color: #9a9db3; white-space: nowrap; overflow: hidden;
}
.ml-name { color: #e6e7f0; font-weight: 600; }
.ml-ok { color: var(--green); }
.ml-pos { margin-left: auto; color: #75788f; }
.ml-mode { color: #8a8da5; }

.code .ln { display: inline-block; width: 2.4em; color: #3f4257; text-align: right; margin-right: 1.2em; }
.code .row { display: block; height: 1.62em; }
.code .row.cur { background: rgba(130, 170, 255, 0.05); }
.t-c { color: #676b85; font-style: italic; }
.t-p { color: #8f93a8; }
.t-k { color: #c792ea; }
.t-f { color: #82aaff; }
.t-s { color: #c3e88d; }
.t-w { color: #f7a072; }
.t-n { color: #f2c46d; }
.cursor {
  display: inline-block; width: 0.62em; height: 1.25em; vertical-align: -0.22em;
  background: #b388ff; border-radius: 1px;
  animation: breathe 1s ease-in-out infinite;
}
@keyframes breathe { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.9; } }

.ed-col { display: grid; grid-template-rows: 0fr 1fr; min-height: 0; transition: grid-template-rows 0.55s cubic-bezier(.2, .8, .2, 1); }
.ed-col.split { grid-template-rows: 1fr 1fr; }
.pane-top { opacity: 0; transform: scale(0.97); margin-bottom: 0; transition: opacity 0.45s ease 0.1s, transform 0.55s cubic-bezier(.2, .8, .2, 1), margin 0.55s; }
.ed-col.split .pane-top { opacity: 1; transform: none; margin-bottom: 10px; }
.ed-col:not(.split) .pane-top { border-width: 0; }

.magit p { margin: 0; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.m-key { color: #82aaff; font-weight: 600; }
.m-sec { color: #c792ea; }
.m-dim { color: #75788f; }
.m-ref { color: var(--green); }
.m-mod { color: var(--amber); }
.m-hash { color: #6d7088; }

.term { color: #c9cbd8; display: flex; flex-direction: column; }
.cc-box { margin-top: auto; border: 1px solid #3a3d52; border-radius: 6px; padding: 3px 10px; }
.cc-cur { display: inline-block; width: 0.6em; height: 1.15em; vertical-align: -0.2em; background: #6d7088; }
.cc-foot { margin-top: 3px !important; font-size: 0.9em; }
.term p { margin: 0; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.term .tp { color: var(--accent); }
.term .tdim { color: #6d7088; }
.term .tok { color: var(--green); }
.term .tbul { color: var(--orange); }
.term .tamber { color: var(--amber); }
.term p.in { animation: line-in 0.35s ease both; }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.agent-chip { margin-left: auto; color: #c8cadb; }
.agent-chip b { color: var(--amber); font-weight: 400; }
.agent-chip .c-model { color: var(--cyan); }
.agent-chip .c-ctx { color: var(--amber); }
.agent-chip.idle b { color: var(--green); }

.ed-mini { height: 30px; padding: 4px 22px 0; font-size: 12px; color: #b9bbcc; white-space: nowrap; overflow: hidden; }
.ed-mini .kc-key { color: var(--amber); margin-right: 1.2em; }
.ed-mini .kc-cmd { color: var(--blue); }
.ed-mini .mx-p { color: var(--accent); margin-right: 0.6em; }
.ed-mini .echo { color: #d7d9e6; }
.ed-mini .echo-ok { color: var(--green); }
.ed-popup {
  position: absolute; left: 10px; bottom: 36px; width: min(420px, 60%);
  background: #10121a; border: 1px solid var(--accent); border-radius: 11px;
  padding: 6px; box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.8);
  animation: pop-in 0.22s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.ed-popup p { margin: 0; padding: 2px 10px; border-radius: 6px; display: flex; justify-content: space-between; gap: 16px; white-space: nowrap; }
.ed-popup p.sel { background: #2a1f45; color: #fff; }
.ed-popup .doc { color: #6d7088; overflow: hidden; text-overflow: ellipsis; }
.ed-popup .hl { color: var(--accent); }
.editor-note { margin: 14px 4px 0; font-size: 13px; color: var(--dim); font-family: var(--mono); }

/* ------------------------------------------------------------ stats */
.stats { border-top: 1px solid var(--line); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 36px 26px 36px 0; border-right: 1px solid var(--line); }
.stat + .stat { padding-left: 26px; }
.stat:last-child { border-right: 0; }
.stat b { display: block; font-size: clamp(38px, 4.4vw, 58px); line-height: 1; font-weight: 780; letter-spacing: -0.04em; margin-bottom: 12px; }
.stat > span { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------ philosophy */
.principles { display: grid; gap: 0; border-top: 1px solid var(--line); }
.principle {
  display: grid; grid-template-columns: 96px 1fr 1.05fr; gap: 32px; align-items: start;
  padding: 40px 0; border-bottom: 1px solid var(--line);
}
.principle .num { font-size: 56px; line-height: 0.9; font-weight: 780; color: #26263a; letter-spacing: -0.04em; }
.principle h3 { margin: 4px 0 12px; font-size: 26px; letter-spacing: -0.02em; font-weight: 700; }
.principle p { margin: 0; color: var(--text-2); }
.p-proof { padding: 18px 20px; overflow: hidden; }
.code-block { margin: 0; font-size: 13px; line-height: 1.7; color: #d4d6e3; white-space: pre; overflow-x: auto; scrollbar-width: thin; }
.code-block .k { color: #c792ea; }
.code-block .f { color: #82aaff; }
.code-block .s { color: #c3e88d; }
.code-block .c { color: #676b85; font-style: italic; }
.code-block .a-call { color: var(--accent); }
.tree { font-family: var(--mono); font-size: 13px; line-height: 1.75; }
.tree p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #d4d6e3; }
.t-dir { color: var(--blue) !important; }
.t-dim { color: var(--dim); margin-left: 8px; }
.t-acc { color: var(--accent); }

/* ------------------------------------------------------------ lineage */
.kept { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px 18px; margin: 8px 0 40px; }
.kept-label { font-family: var(--mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--green); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  font-family: var(--mono); font-size: 12.5px; color: var(--text-2);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 12px; background: var(--card);
}
.chips li code { background: none; padding: 0; }
.chips li kbd { font-size: 11px; }
.lineage { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.l-row { display: grid; grid-template-columns: 200px 1fr 1.5fr; border-top: 1px solid var(--line); }
.l-row:first-child { border-top: 0; }
.l-row > span { padding: 18px 22px; }
.l-head > span { padding: 12px 22px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.l-head > span:last-child { color: var(--accent); }
.l-row > span:first-child { font-weight: 650; color: var(--text); }
.l-row > span:nth-child(2) { color: var(--muted); }
.l-row > span:nth-child(3) { color: var(--text); background: linear-gradient(90deg, rgba(179, 136, 255, 0.06), transparent 70%); border-left: 1px solid var(--line); }
.l-row:not(.l-head) > span:nth-child(2) { font-size: 15.5px; }
.l-row:not(.l-head) > span:nth-child(3) { font-size: 15.5px; }

/* ------------------------------------------------------------ architecture */
.arch { display: grid; grid-template-columns: 1.25fr 1fr; gap: 28px; align-items: start; }
.arch-stack { display: grid; gap: 10px; }
.arch-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.arch-row:has(.blk-wide) { grid-template-columns: 1fr; }
.blk {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  min-height: 72px; padding: 14px 16px;
  text-align: left;
  background: var(--card); border: 1px solid var(--line-2); border-radius: 12px;
  font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.blk small { font-weight: 400; font-size: 11.5px; color: var(--dim); }
.blk:hover { border-color: var(--accent-line); transform: translateY(-1px); }
.blk.is-on { border-color: var(--accent); background: linear-gradient(180deg, rgba(179, 136, 255, 0.12), rgba(179, 136, 255, 0.03)); box-shadow: 0 0 30px -10px rgba(179, 136, 255, 0.5); }
.blk-wide { flex-direction: row; align-items: baseline; gap: 14px; min-height: 64px; }
.blk-api { border-style: dashed; }
.blk-core { min-height: 84px; background: linear-gradient(180deg, #17151f, var(--card)); }
.arch-flow {
  position: relative; text-align: center; padding: 6px 0;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim);
}
.arch-flow::before, .arch-flow::after { content: "↓"; color: var(--accent); margin: 0 12px; }
.arch-info { position: sticky; top: 96px; padding: 26px 28px; min-height: 260px; }
.arch-info > div { display: none; }
.arch-info > div.is-on { display: block; animation: line-in 0.3s ease both; }
.arch-info h3 { margin: 0 0 12px; font-family: var(--mono); font-size: 16px; color: var(--accent); }
.arch-info p { margin: 0; color: var(--text-2); }

/* ------------------------------------------------------------ features */
.features {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.feat { background: var(--bg-alt); padding: 30px 28px 32px; transition: background 0.25s; }
.feat:hover { background: #111019; }
.ic-lg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 18px; }
.feat h3 { margin: 0 0 8px; font-size: 21px; letter-spacing: -0.015em; font-weight: 700; }
.feat p { margin: 0; color: var(--muted); font-size: 15.5px; }
.chips-more { margin-top: 28px; }
.chips-more .chips-label { border: 0; background: none; padding-left: 0; color: var(--dim); letter-spacing: 0.14em; text-transform: uppercase; font-size: 11.5px; }

/* ------------------------------------------------------------ agents */
.agents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.agent-card { display: flex; flex-direction: column; }
.agent-card h3 { margin: 22px 0 8px; font-size: 22px; letter-spacing: -0.015em; font-weight: 700; }
.agent-card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.mock {
  min-height: 196px; padding: 16px 18px;
  background: var(--pane); border: 1px solid var(--pane-border); border-radius: 12px;
  font-family: var(--mono); font-size: 12px; line-height: 1.75; color: #cfd1de;
}
.mock p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: inherit; font-size: inherit; }
.a-call { color: var(--accent); margin-right: 6px; }
.a-arg { color: #9fa3ba; }
.a-ret { color: var(--green) !important; }
.b-title { color: #e6e7f0 !important; font-weight: 600; margin-bottom: 6px !important; }
.b-dim { color: var(--dim); font-weight: 400; }
.b-row b { font-weight: 400; display: inline-block; width: 1.4em; }
.b-tool { color: var(--cyan); margin: 0 8px; }
.b-why { color: var(--dim); }
.b-red { color: var(--red); }
.b-amber { color: var(--amber); }
.b-green { color: var(--green); }
.b-dorm { color: var(--dim) !important; }
.mock-board .b-row:nth-child(2) { background: rgba(255, 125, 139, 0.07); border-radius: 6px; margin: 0 -8px !important; padding: 0 8px; }
.d-head { color: #e6e7f0 !important; margin-bottom: 8px !important; }
.d-dim { color: var(--dim); }
.d-del { color: #ff9aa5 !important; background: rgba(255, 125, 139, 0.09); margin: 0 -18px !important; padding: 0 18px; }
.d-add { color: #a6e3b8 !important; background: rgba(143, 214, 164, 0.09); margin: 0 -18px !important; padding: 0 18px; }
.d-ctx { color: #7d8098 !important; }
.d-keys { margin-top: 12px !important; color: var(--dim) !important; }
.d-keys kbd { font-size: 10.5px; margin-right: 3px; }

/* ------------------------------------------------------------ extend */
.extend { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; align-items: start; }
.tiers { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--card); }
.t-row { display: grid; grid-template-columns: 1.15fr 1fr 1.1fr; border-top: 1px solid var(--line); }
.t-row:first-child { border-top: 0; }
.t-row > span { padding: 16px 18px; font-size: 15px; color: var(--text-2); }
.t-row > span:first-child b { display: block; font-family: var(--mono); font-size: 13.5px; color: var(--text); font-weight: 600; }
.t-row > span:first-child small { font-family: var(--mono); font-size: 11.5px; color: var(--dim); }
.t-head > span { padding: 11px 18px; font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.t-row:not(.t-head) > span:last-child { color: var(--muted); }
.code-tabs { overflow: hidden; }
.ct-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); }
.code-tabs .code-block { padding: 20px 22px 22px; font-size: 13px; }

/* ------------------------------------------------------------ gallery */
.g-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.shot { margin: 0; border-radius: 14px; overflow: hidden; border: 1px solid #1d2030; background: var(--desktop); box-shadow: 0 30px 90px -30px rgba(142, 69, 206, 0.3); }
.shot img { width: 100%; height: auto; }

/* ------------------------------------------------------------ install */
.section-cta { position: relative; overflow: hidden; }
.section-cta::before {
  content: ""; position: absolute; inset: auto -10% -40% 30%; height: 700px; z-index: -1; pointer-events: none;
  background: radial-gradient(520px 340px at 60% 50%, rgba(142, 69, 206, 0.22), transparent 70%);
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 48px 0 0; padding: 0; list-style: none; }
.step { position: relative; padding: 28px 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; gap: 12px; }
.step .num { font-family: var(--mono); font-size: 12px; color: var(--accent); border: 1px solid var(--accent-line); border-radius: 999px; width: 26px; height: 26px; display: grid; place-items: center; }
.step h3 { margin: 4px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.015em; }
.step p { margin: 0; color: var(--muted); font-size: 15.5px; }
.step .btn { margin-top: auto; align-self: flex-start; font-size: 12.5px; max-width: 100%; }
.step .btn svg { flex: none; }
.soon {
  margin-top: auto; align-self: flex-start;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); border: 1px dashed var(--accent-line); border-radius: 999px; padding: 6px 12px;
}
.install-row-sm { margin-top: auto; padding: 8px 8px 8px 14px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg); }
.cta-foot { margin: 34px 0 0; max-width: 780px; color: var(--dim); font-size: 15px; }

/* ------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--line); padding: 44px 0 56px; }
.footer-in { display: flex; justify-content: space-between; gap: 32px; align-items: flex-start; }
.f-brand { display: flex; gap: 16px; align-items: flex-start; max-width: 520px; }
.f-brand b { letter-spacing: 0.08em; }
.f-brand p { margin: 4px 0 0; color: var(--muted); font-size: 15px; }
.f-side { text-align: right; }
.f-hint { margin: 0; color: var(--muted); font-size: 14px; }
.f-small { margin: 8px 0 0; color: var(--dim); font-family: var(--mono); font-size: 12px; }

/* ------------------------------------------------------------ M-x on the page */
.mx { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; pointer-events: none; }
.mx[hidden] { display: none; }
.mx-pop {
  pointer-events: auto;
  width: min(640px, calc(100% - 24px)); margin: 0 auto 8px;
  max-height: 46vh; overflow-y: auto;
  background: #10121a; border: 1px solid var(--accent); border-radius: 12px;
  padding: 6px; box-shadow: 0 24px 60px -16px rgba(0, 0, 0, 0.9);
  animation: pop-in 0.18s cubic-bezier(.2, .8, .2, 1) both;
}
.mx-pop:empty { display: none; }
.mx-item {
  display: flex; justify-content: space-between; gap: 18px; padding: 6px 12px; border-radius: 7px;
  font-family: var(--mono); font-size: 13px; color: var(--text-2); cursor: pointer;
}
.mx-item .doc { color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mx-item.sel { background: #2a1f45; color: #fff; }
.mx-item mark { background: none; color: var(--accent); }
.mx-line {
  pointer-events: auto;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px 12px;
  background: rgba(5, 7, 13, 0.96); border-top: 1px solid var(--line-2);
  font-family: var(--mono); font-size: 14px;
}
.mx-line label { color: var(--accent); }
.mx-line input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: inherit; caret-color: var(--accent); }
.mx-hint { color: var(--dim); font-size: 11px; display: flex; gap: 6px; }
.mx-echo { color: var(--green); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1040px) {
  .nav-links { display: none; }
  .nav-tools { margin-left: auto; }
  .principle { grid-template-columns: 64px 1fr; }
  .principle .p-proof { grid-column: 2; }
  .principle .num { font-size: 40px; }
  .arch, .extend { grid-template-columns: 1fr; }
  .arch-info { position: static; min-height: 0; }
  .agents { grid-template-columns: 1fr; max-width: 640px; }
  .features { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; max-width: 640px; }
  .ed-desk { height: 440px; }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }
  .hero { padding-top: 52px; }
  .section { padding: 80px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat { padding: 26px 16px 26px 0; }
  .stat + .stat { padding-left: 16px; }
  .stat:nth-child(2) { border-right: 0; }
  .stat:nth-child(3) { padding-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .principle { grid-template-columns: 1fr; gap: 14px; padding: 30px 0; }
  .principle .p-proof { grid-column: 1; }
  .l-row { grid-template-columns: 1fr; }
  .l-head { display: none; }
  .l-row > span { padding: 6px 18px; }
  .l-row > span:first-child { padding-top: 16px; font-size: 13px; font-family: var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); font-weight: 500; }
  .l-row > span:nth-child(2)::before { content: "Emacs · "; color: var(--dim); }
  .l-row > span:nth-child(3) { border-left: 0; padding-bottom: 16px; }
  .l-row > span:nth-child(3)::before { content: "GEMAX · "; color: var(--accent); }
  .arch-row { grid-template-columns: repeat(2, 1fr); }
  .blk-wide { flex-direction: column; gap: 3px; }
  .features { grid-template-columns: 1fr; }
  .feat { padding: 24px 20px 26px; }
  .ic-lg { margin-bottom: 12px; }
  .mock { min-height: 0; }
  .t-row { grid-template-columns: 1fr 1fr; }
  .t-row > span:last-child { grid-column: 1 / -1; padding-top: 0; }
  .t-head { display: none; }
  .editor { --ed-font: 11px; margin-top: 44px; }
  .ed-desk { grid-template-columns: 1fr; height: 380px; }
  .ed-col { display: none; }
  .pills .pill:not(.on):not([data-clock]) { display: none; }
  .footer-in { flex-direction: column; }
  .f-side { text-align: left; }
  .mx-btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}
