/* Xermu site. One idea runs through it: green is the guest, amber is the host. */

:root {
  --bg: #0a0d0b;
  --bg-2: #0f1411;
  --panel: #131916;
  --line: #24302a;
  --line-2: #31413a;
  --text: #dfe7e1;
  --muted: #8d9c93;
  --guest: #86e36a;
  --guest-bg: #14241a;
  --host: #f2b155;
  --host-bg: #2a2114;
  --on-accent: #08130a;
  --mono: "JetBrains Mono", "IBM Plex Mono", "Cascadia Code", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}

:root[data-theme="light"] {
  --bg: #f5f6f1;
  --bg-2: #eceee7;
  --panel: #ffffff;
  --line: #d6dbd0;
  --line-2: #bcc4b6;
  --text: #17201a;
  --muted: #56645b;
  --guest: #1f7a2a;
  --guest-bg: #e3f1e0;
  --host: #9a5600;
  --host-bg: #f8ead2;
  --on-accent: #ffffff;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6f1;
    --bg-2: #eceee7;
    --panel: #ffffff;
    --line: #d6dbd0;
    --line-2: #bcc4b6;
    --text: #17201a;
    --muted: #56645b;
    --guest: #1f7a2a;
    --guest-bg: #e3f1e0;
    --host: #9a5600;
    --host-bg: #f8ead2;
    --on-accent: #ffffff;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--guest); outline-offset: 2px; border-radius: 3px; }
code, kbd, pre { font-family: var(--mono); font-size: .9em; }
p code, td code { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: .05em .35em; }
h1, h2, h3 { margin: 0; line-height: 1.15; text-wrap: balance; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 12px; z-index: 20; background: var(--panel); padding: 8px 12px; }

/* ── Top bar ── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-in { display: flex; align-items: center; gap: 24px; height: 56px; }
.mark { display: flex; align-items: center; gap: 8px; font: 700 17px var(--mono); letter-spacing: -.01em; text-decoration: none; }
.mark svg path { fill: none; stroke-width: 2.6; stroke-linecap: square; }
.mk-g { stroke: var(--guest); }
.mk-h { stroke: var(--host); }
.nav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; padding: 4px 0; border-bottom: 1px solid transparent; }
.nav a:hover, .nav a.on { color: var(--text); border-bottom-color: var(--guest); }
.top-act { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--muted); cursor: pointer; }
.icon-btn:hover { color: var(--text); border-color: var(--line); }

.btn {
  display: inline-block; padding: 9px 16px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  font: 500 14px var(--sans); text-decoration: none; white-space: nowrap;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--text); }
.btn-primary { background: var(--guest); border-color: var(--guest); color: var(--on-accent); font-weight: 600; }
.btn-primary:hover { border-color: var(--guest); filter: brightness(1.08); }
.btn-ghost { padding: 6px 12px; }

/* ── Hero ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 56px; align-items: center; padding-top: 72px; padding-bottom: 40px; }
.chip { display: inline-flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px; margin-bottom: 24px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--host); }
h1 { font: 700 clamp(36px, 5.4vw, 62px)/1.04 var(--sans); letter-spacing: -.035em; margin-bottom: 24px; }
h1 em { font-style: normal; color: var(--guest); }
.lede { font-size: 18px; color: var(--muted); max-width: 34em; margin-bottom: 28px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.legend { font: 12px var(--mono); color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.k { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 4px; }
.k-g { color: var(--guest); background: var(--guest-bg); }
.k-h { color: var(--host); background: var(--host-bg); }
.legend .k-h { margin-left: 12px; }

.shot { margin: 0; }
.shot-frame { position: relative; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px; background: var(--panel); box-shadow: 0 30px 80px -40px rgba(0, 0, 0, .7); }
.shot-frame img { display: block; width: 100%; height: auto; border-radius: 4px; image-rendering: auto; }
.tag { position: absolute; font: 11px var(--mono); padding: 3px 8px; border-radius: 4px; background: rgba(8, 12, 10, .78); color: #dfe7e1; }
.tag.tl { top: 16px; left: 16px; }
.tag.br { bottom: 16px; right: 16px; }
.shot figcaption { font-size: 13px; color: var(--muted); margin-top: 10px; }
[data-cycle] .shot-frame img { opacity: 0; transition: opacity .7s ease; }
[data-cycle] .shot-frame img + img { position: absolute; top: 8px; left: 8px; width: calc(100% - 16px); }
[data-cycle] .shot-frame img.is-on { opacity: 1; }
[data-cycle] figcaption { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cycle-dots { display: flex; gap: 6px; flex: none; }
.cycle-dots button { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.cycle-dots button::before { content: ""; width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--muted); }
.cycle-dots button[aria-current="true"]::before { background: var(--guest); border-color: var(--guest); }
.cycle-dots button:focus-visible { outline: 2px solid var(--guest); outline-offset: 1px; border-radius: 4px; }

/* ── Facts ── */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: 24px; padding-top: 0; padding-bottom: 0; }
.fact { display: flex; gap: 14px; align-items: baseline; padding: 22px 20px 22px 0; }
.fact + .fact { border-left: 1px solid var(--line); padding-left: 20px; }
.fact b { font: 700 34px/1 var(--mono); color: var(--guest); font-variant-numeric: tabular-nums; }
.fact:nth-child(even) b { color: var(--host); }
.fact span { font-size: 13.5px; line-height: 1.45; color: var(--muted); }

/* ── Sections ── */
.sec { padding-top: 96px; }
.eyebrow { font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--guest); margin-bottom: 12px; }
h2 { font: 700 clamp(26px, 3.4vw, 38px)/1.12 var(--sans); letter-spacing: -.025em; margin-bottom: 14px; max-width: 22em; }
.sub { color: var(--muted); font-size: 17px; max-width: 44em; margin-bottom: 32px; }
h3 { font: 600 16px/1.3 var(--sans); margin-bottom: 6px; }
.more { display: inline-block; margin: 20px 20px 0 0; font: 13px var(--mono); color: var(--guest); text-decoration: none; }
.more::after { content: " →"; }
.more:hover { text-decoration: underline; }
.note { font-size: 13px; color: var(--muted); margin: 14px 0 0; }

/* ── Map ── */
.map { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.map-head, .map-row { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: center; }
.map-head { padding: 12px 20px; border-bottom: 1px solid var(--line); }
.map-head .k { justify-self: start; }
.map-row { padding: 16px 20px; text-decoration: none; border-bottom: 1px solid var(--line); transition: background .15s; }
.map-row:last-child { border-bottom: 0; }
.map-row:hover { background: var(--bg-2); }
.map-row b { display: block; font: 600 15.5px var(--sans); }
.map-row i { display: block; font: normal 12.5px/1.45 var(--mono); color: var(--muted); margin-top: 3px; }
.map-row .g b { color: var(--guest); }
.map-row .h b { color: var(--host); }
.arrow { height: 1px; margin: 0 12px; background: linear-gradient(90deg, var(--guest), var(--host)); position: relative; }
.arrow::after { content: ""; position: absolute; right: -1px; top: -3px; border: solid var(--host); border-width: 1px 1px 0 0; width: 6px; height: 6px; transform: rotate(45deg); }

/* ── Tabs and code ── */
.demo { border: 1px solid var(--line); border-radius: 10px; background: var(--panel); padding: 16px 20px 18px; margin-bottom: 32px; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 500 14px var(--sans); padding: 8px 12px; margin-bottom: -1px; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--guest); }
.pane > p { max-width: 54em; margin: 16px 0 0; color: var(--muted); }
.xl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.code { position: relative; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); overflow: hidden; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 13.5px; line-height: 1.7; tab-size: 4; }
.code .lab { display: block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 7px 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.code.g { border-color: color-mix(in srgb, var(--guest) 35%, var(--line)); }
.code.g .lab { color: var(--guest); background: var(--guest-bg); }
.code.h { border-color: color-mix(in srgb, var(--host) 35%, var(--line)); }
.code.h .lab { color: var(--host); background: var(--host-bg); }
.by { color: var(--muted); display: inline-block; min-width: 5.5em; }
.copy { position: absolute; top: 8px; right: 8px; background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 4px; font: 12px var(--mono); padding: 3px 10px; cursor: pointer; }
.copy:hover { color: var(--text); border-color: var(--line-2); }

/* ── Feature grid ── */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px 32px; }
.grid3 li { border-top: 1px solid var(--line); padding-top: 16px; }
.grid3 p { color: var(--muted); font-size: 14.5px; margin: 0; }

.lib { display: grid; grid-template-columns: 1fr 1.1fr; gap: 32px; align-items: start; margin-top: 48px; padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.lib h3 { font-size: 20px; margin-bottom: 10px; }
.lib p { color: var(--muted); }
.lib .more { margin-top: 4px; }

/* ── Pipeline ── */
.pipe { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-bottom: 40px; counter-reset: s; }
.pipe li { position: relative; padding: 16px 16px 18px; border: 1px solid var(--line); border-left-width: 0; background: var(--panel); }
.pipe li:first-child { border-left-width: 1px; border-radius: 10px 0 0 10px; }
.pipe li:last-child { border-radius: 0 10px 10px 0; }
.pipe li::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; }
.pipe li.g::before { background: var(--guest); }
.pipe li.h::before { background: var(--host); }
.pipe .n { display: block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.pipe .g .n { color: var(--guest); }
.pipe .h .n { color: var(--host); }
.pipe b { display: block; font: 600 15px var(--sans); margin-bottom: 4px; }
.pipe i { display: block; font-style: normal; font-size: 13px; line-height: 1.45; color: var(--muted); }

.tbl-wrap { overflow-x: auto; margin-top: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; }
.tbl caption { text-align: left; padding: 14px 18px; font: 600 15px var(--sans); border-bottom: 1px solid var(--line); }
.tbl th, .tbl td { text-align: left; padding: 10px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td { color: var(--muted); }
.tbl td:first-child { color: var(--text); white-space: nowrap; }

/* ── Audio chain ── */
.chain { display: flex; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 40px; }
.chain li { position: relative; flex: 1 1 150px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.chain li + li::before { content: "→"; position: absolute; left: -21px; top: 50%; transform: translateY(-50%); color: var(--muted); font-family: var(--mono); }
.chain li.j { border-color: color-mix(in srgb, var(--host) 45%, var(--line)); background: var(--host-bg); }
.chain b { display: block; font: 600 14.5px var(--sans); }
.chain i { display: block; font-style: normal; font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* ── Kernels ── */
.kern { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.kcard { grid-column: span 2; display: flex; flex-direction: column; padding: 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.kcard:nth-child(-n+2) { grid-column: span 3; }
.kcard header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.lvl { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.def { font: 600 11px var(--mono); padding: 2px 8px; border-radius: 4px; color: var(--host); background: var(--host-bg); }
.def.open { color: var(--guest); background: var(--guest-bg); }
.kcard h3 { font-size: 17px; }
.kcard p { color: var(--muted); font-size: 14.5px; flex: 1; }
.cmd { display: block; font-size: 12.5px; padding: 8px 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; overflow-wrap: anywhere; }
.cmd::before { content: "$ "; color: var(--muted); }

/* ── Accuracy ── */
.acc { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: start; }
.gold { padding: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.gold h3 { font-size: 20px; margin-bottom: 10px; }
.gold > p { color: var(--muted); }
.bars li { display: grid; grid-template-columns: 11em 1fr 3.6em; gap: 12px; align-items: center; padding: 7px 0; font-size: 14px; }
.bars b { font: 600 13px var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
meter { width: 100%; height: 8px; border: 0; border-radius: 4px; background: var(--bg-2); -webkit-appearance: none; appearance: none; }
meter::-webkit-meter-bar { background: var(--bg-2); border: 0; border-radius: 4px; height: 8px; }
meter::-webkit-meter-optimum-value { background: var(--guest); border-radius: 4px; }
meter::-moz-meter-bar { background: var(--guest); border-radius: 4px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 28px; }
.checks li { border-top: 1px solid var(--line); padding-top: 14px; }
.checks p { color: var(--muted); font-size: 14.5px; margin: 0; }

/* ── Run ── */
.run { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.run p { color: var(--muted); }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 16px; margin: 0; }
.keys div { display: flex; align-items: center; gap: 10px; }
.keys dd { margin: 0; font-size: 14px; color: var(--muted); }
kbd { display: inline-block; min-width: 2.9em; text-align: center; padding: 2px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--panel); font-size: 12px; }

/* ── Status ── */
.status { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.status > p { font-size: 17px; color: var(--muted); }
.docs li + li { border-top: 1px solid var(--line); }
.docs a { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; text-decoration: none; }
.docs a:hover b { color: var(--guest); }
.docs i { font: normal 12.5px var(--mono); color: var(--muted); }

/* ── Footer ── */
.foot { margin-top: 112px; border-top: 1px solid var(--line); background: var(--bg-2); }
.foot-in { padding-top: 32px; padding-bottom: 40px; font-size: 13.5px; color: var(--muted); }
.foot p { max-width: 60em; margin-bottom: .6em; }
.foot b { color: var(--text); }

/* ── Narrow screens ── */
@media (max-width: 960px) {
  .nav { display: none; }
  .top-act { margin-left: auto; }
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 48px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3) { border-left: 0; padding-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--line); }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .pipe { grid-template-columns: 1fr; }
  .pipe li, .pipe li:first-child, .pipe li:last-child { border-left-width: 1px; border-top-width: 0; border-radius: 0; padding-left: 20px; }
  .pipe li:first-child { border-top-width: 1px; border-radius: 10px 10px 0 0; }
  .pipe li:last-child { border-radius: 0 0 10px 10px; }
  .pipe li::before { top: 0; bottom: 0; right: auto; width: 3px; height: auto; }
  .lib, .acc, .run, .status { grid-template-columns: 1fr; }
  .kcard, .kcard:nth-child(-n+2) { grid-column: span 3; }
  .kcard:last-child { grid-column: span 6; }
}
@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .sec { padding-top: 72px; }
  .facts { grid-template-columns: 1fr; }
  .fact, .fact + .fact { border-left: 0; padding-left: 0; }
  .fact + .fact { border-top: 1px solid var(--line); }
  .grid3, .checks, .xl { grid-template-columns: 1fr; }
  .kcard, .kcard:nth-child(-n+2), .kcard:last-child { grid-column: span 6; }
  .map-head, .map-row { grid-template-columns: 1fr; gap: 8px; }
  .map-head span:nth-child(n+2), .arrow { display: none; }
  .map-row .h { padding-left: 14px; border-left: 2px solid var(--host); }
  .bars li { grid-template-columns: 1fr 3.6em; }
  .bars li span { grid-column: 1 / -1; }
  .chain li + li::before { display: none; }
  .demo { padding: 12px 14px 16px; }
}

/* ── About page ── */
.about-hero { padding-top: 72px; padding-bottom: 32px; }
.h1-s { font-size: clamp(32px, 4.6vw, 52px); max-width: 17em; }
.lede.wide { max-width: 44em; }
.lede b { color: var(--text); }
.tl { border-left: 1px solid var(--line-2); margin-left: 6px; }
.tl > li { position: relative; display: grid; grid-template-columns: 150px 1fr; gap: 24px; padding: 0 0 48px 28px; }
.tl > li:last-child { padding-bottom: 0; }
.tl > li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--bg); border: 2px solid var(--guest); }
.tl > li:last-child::before { border-color: var(--host); background: var(--host); }
.when { font: 600 14px var(--mono); color: var(--guest); padding-top: 2px; white-space: nowrap; }
.what h3 { font-size: 21px; margin-bottom: 10px; }
.role { font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; margin-left: 8px; vertical-align: 3px; white-space: nowrap; }
.what p { color: var(--muted); max-width: 46em; }
.pts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 32px; margin: 16px 0; max-width: 60em; }
.pts li { font-size: 14.5px; color: var(--muted); padding-left: 14px; border-left: 2px solid var(--line); }
.pts b { color: var(--text); }
.prose { max-width: 44em; font-size: 17px; color: var(--muted); }
@media (max-width: 960px) {
  .tl > li { grid-template-columns: 1fr; gap: 6px; }
  .pts { grid-template-columns: 1fr; }
}
.tl { margin-top: 32px; }
