/* ---- reset / base ---- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }

/* ---- theme tokens ---- */
:root {
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ----- palettes ----- */
/* terracotta (default) */
html[data-palette="terracotta"] {
  --bg: #f5f1e8;
  --bg-2: #ede8db;
  --ink: #1d1b17;
  --ink-2: #3b3730;
  --ink-3: #736c5f;
  --ink-4: #a29a88;
  --rule: #d9d1bd;
  --accent: #c4542a;
  --accent-soft: #c4542a14;
  --selection: #f4d0ba;
  --dot: #1d1b1720;
}
html[data-palette="terracotta"][data-theme="dark"] {
  --bg: #171512;
  --bg-2: #1f1c17;
  --ink: #ece6d8;
  --ink-2: #c5bda9;
  --ink-3: #8a8270;
  --ink-4: #55504a;
  --rule: #2d2822;
  --accent: #e06b3a;
  --accent-soft: #e06b3a1a;
  --selection: #e06b3a33;
  --dot: #ece6d814;
}

/* mono + sand */
html[data-palette="sand"] {
  --bg: #f4f2ee;
  --bg-2: #ebe7df;
  --ink: #1a1917;
  --ink-2: #3a3733;
  --ink-3: #6e6a62;
  --ink-4: #9f9a8f;
  --rule: #d6d1c4;
  --accent: #7a6a52;
  --accent-soft: #7a6a5214;
  --selection: #d9cfb8;
  --dot: #1a191720;
}
html[data-palette="sand"][data-theme="dark"] {
  --bg: #121214;
  --bg-2: #1a1a1d;
  --ink: #ece8dd;
  --ink-2: #c3beae;
  --ink-3: #8a8476;
  --ink-4: #555147;
  --rule: #2a2a2e;
  --accent: #b9a582;
  --accent-soft: #b9a5821a;
  --selection: #b9a58233;
  --dot: #ece8dd14;
}

/* crimson */
html[data-palette="crimson"] {
  --bg: #f2f2ef;
  --bg-2: #e9e8e2;
  --ink: #141414;
  --ink-2: #363532;
  --ink-3: #696865;
  --ink-4: #9d9a94;
  --rule: #d3d0c7;
  --accent: #d33e3e;
  --accent-soft: #d33e3e14;
  --selection: #f5c9c9;
  --dot: #14141420;
}
html[data-palette="crimson"][data-theme="dark"] {
  --bg: #0f0f0f;
  --bg-2: #171717;
  --ink: #eae8e0;
  --ink-2: #c0bdb1;
  --ink-3: #868376;
  --ink-4: #52504a;
  --rule: #262525;
  --accent: #e55252;
  --accent-soft: #e552521a;
  --selection: #e5525233;
  --dot: #eae8e014;
}

/* forest sage */
html[data-palette="forest"] {
  --bg: #f3f4ef;
  --bg-2: #e9eae3;
  --ink: #131713;
  --ink-2: #343931;
  --ink-3: #676d60;
  --ink-4: #99a090;
  --rule: #d0d3c3;
  --accent: #3f7a5c;
  --accent-soft: #3f7a5c14;
  --selection: #c5e0d1;
  --dot: #13171320;
}
html[data-palette="forest"][data-theme="dark"] {
  --bg: #0f1412;
  --bg-2: #161c18;
  --ink: #e8ebdf;
  --ink-2: #bec2b1;
  --ink-3: #858b77;
  --ink-4: #51574a;
  --rule: #212924;
  --accent: #6fb08a;
  --accent-soft: #6fb08a1a;
  --selection: #6fb08a33;
  --dot: #e8ebdf14;
}

/* honey */
html[data-palette="honey"] {
  --bg: #faf7f0;
  --bg-2: #f0ece1;
  --ink: #1a1713;
  --ink-2: #3b362c;
  --ink-3: #756d5a;
  --ink-4: #a49b83;
  --rule: #ddd5bf;
  --accent: #b8860b;
  --accent-soft: #b8860b14;
  --selection: #f2deaa;
  --dot: #1a171320;
}
html[data-palette="honey"][data-theme="dark"] {
  --bg: #141210;
  --bg-2: #1d1a15;
  --ink: #eee7d6;
  --ink-2: #c6bda6;
  --ink-3: #8c836c;
  --ink-4: #555046;
  --rule: #2a271f;
  --accent: #e0b24a;
  --accent-soft: #e0b24a1a;
  --selection: #e0b24a33;
  --dot: #eee7d614;
}

/* violet */
html[data-palette="violet"] {
  --bg: #f2f1ee;
  --bg-2: #e8e7e2;
  --ink: #141317;
  --ink-2: #343237;
  --ink-3: #686672;
  --ink-4: #9a98a3;
  --rule: #d2d0d5;
  --accent: #6b4e9c;
  --accent-soft: #6b4e9c14;
  --selection: #d8c9f0;
  --dot: #14131720;
}
html[data-palette="violet"][data-theme="dark"] {
  --bg: #0e0e10;
  --bg-2: #16161a;
  --ink: #e8e6ec;
  --ink-2: #c0bdc5;
  --ink-3: #858291;
  --ink-4: #524f5a;
  --rule: #242327;
  --accent: #a387d0;
  --accent-soft: #a387d01a;
  --selection: #a387d033;
  --dot: #e8e6ec14;
}

/* mono */
html[data-palette="mono"] {
  --bg: #f4f2ec;
  --bg-2: #eae7df;
  --ink: #1a1a1a;
  --ink-2: #3a3a3a;
  --ink-3: #707070;
  --ink-4: #a0a0a0;
  --rule: #d5d1c6;
  --accent: #1a1a1a;
  --accent-soft: #1a1a1a0f;
  --selection: #e8e0c8;
  --dot: #1a1a1a20;
}
html[data-palette="mono"][data-theme="dark"] {
  --bg: #121110;
  --bg-2: #1a1916;
  --ink: #e9e6dc;
  --ink-2: #bfbcb2;
  --ink-3: #898679;
  --ink-4: #5a584f;
  --rule: #262521;
  --accent: #e9e6dc;
  --accent-soft: #e9e6dc14;
  --selection: #e9e6dc22;
  --dot: #e9e6dc14;
}
html[data-theme="dark"] {
  --bg: #0e1014;
  --bg-2: #151821;
  --ink: #e9e6dc;
  --ink-2: #bfbcb2;
  --ink-3: #898679;
  --ink-4: #5a584f;
  --rule: #262a35;
  --accent: #7ea4ff;
  --accent-soft: #7ea4ff1f;
  --selection: #7ea4ff33;
  --dot: #ffffff14;
  --glow: 126, 164, 255;
  --glow-strength: 0.14;
}

::selection { background: var(--selection); color: var(--ink); }

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.7;
  font-feature-settings: "calt", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* subtle phosphor glow on dark-mode text */
html[data-theme="dark"] .accent-glow,
html[data-theme="dark"] a.link:hover,
html[data-theme="dark"] .now li::before,
html[data-theme="dark"] .recs h4::before,
html[data-theme="dark"] .nav a[aria-current="page"]::before {
  text-shadow: 0 0 8px rgba(0, 255, 156, 0.55);
}

/* ---- backdrop: dot grid + cursor glow ---- */
body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 1px 1px, var(--dot) 1px, transparent 0);
  background-size: 22px 22px;
  background-attachment: fixed;
  background-position: 0 0;
}

/* ---- radar ripple background ---- */
.bg-radar {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-radar svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.bg-radar .ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 0.6;
  opacity: 0;
  transform-origin: center;
  animation: radar-ring 9s linear infinite;
}
.bg-radar .ring.r2 { animation-delay: -3s; }
.bg-radar .ring.r3 { animation-delay: -6s; }
@keyframes radar-ring {
  0%   { r: 40px;  opacity: 0; }
  10%  { opacity: 0.22; }
  100% { r: 980px; opacity: 0; }
}
.bg-radar .hreact {
  fill: none;
  stroke: var(--accent);
  stroke-width: 0.6;
  opacity: 0;
  transition: opacity 380ms ease-out, r 380ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .bg-radar .ring { animation: none; opacity: 0.1; }
}
/* ---- layout ---- */
.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px 28px 160px;
  position: relative;
  z-index: 1;
}
@media (min-width: 820px) {
  .wrap { padding: 40px 48px 200px; }
}

/* ---- top nav ---- */
.chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 28px;
  border-bottom: 1px dashed var(--rule);
  margin-bottom: 48px;
}
.chrome .brand { color: var(--ink); text-decoration: none; font-weight: 500; letter-spacing: -0.01em; }
.chrome .brand::before { content: "~/"; color: var(--ink-4); }
.nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.nav a { color: var(--ink-3); text-decoration: none; padding: 2px 0; }
.nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"]::before { content: "•"; color: var(--accent); margin-right: 6px; }
.nav a:hover { color: var(--ink); }
.theme-toggle {
  color: var(--ink-3);
  border: 1px solid var(--rule);
  padding: 4px 8px;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1;
  transition: color 120ms, border-color 120ms;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--ink-3); }

/* ---- type ---- */
h1, h2, h3, h4 { font-weight: 500; margin: 0; letter-spacing: -0.01em; color: var(--ink); }
h1 { font-size: 20px; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); margin: 0 0 20px; }
h2::before { content: "## "; color: var(--ink-4); }
h3 { font-size: 15px; }
p { margin: 0 0 16px; color: var(--ink-2); }
p:last-child { margin-bottom: 0; }
small, .meta { color: var(--ink-3); font-size: 13px; }
em { font-style: normal; color: var(--ink); background: var(--accent-soft); padding: 0 2px; }

/* ---- links ---- */
a.link, .prose a, .item a.title {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 0% 1px;
  background-position: 0 100%;
  transition: background-size 220ms ease, color 120ms, text-shadow 120ms;
  padding-bottom: 1px;
}
a.link:hover, .prose a:hover, .item a.title:hover { color: var(--accent); background-size: 100% 1px; }

.arrow::before { content: "["; color: var(--ink-4); margin-right: 1px; }
.arrow::after  { content: "]"; color: var(--ink-4); margin-left: 1px; }

/* ---- sections ---- */
section { margin-bottom: 64px; scroll-margin-top: 40px; }
section:last-of-type { margin-bottom: 0; }

/* ---- ASCII ---- */
.ascii {
  color: var(--ink-3);
  white-space: pre;
  font-size: 12px;
  line-height: 1.25;
  margin: 0 0 24px;
  overflow-x: auto;
}
.ascii b { color: var(--accent); font-weight: inherit; }
/* ---- intro ---- */
.intro { font-size: 17px; line-height: 1.7; color: var(--ink); max-width: 58ch; }
.intro p { color: var(--ink-2); }
.intro .me { color: var(--ink); }
/* ---- items ---- */
ul.items { list-style: none; margin: 0; padding: 0; }
.items li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px dashed var(--rule);
}
.items li:last-child { border-bottom: 0; }
.items .title { font-weight: 500; color: var(--ink); }
.items .desc { grid-column: 1 / 2; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.items .aside {
  grid-row: 1 / span 2; grid-column: 2;
  color: var(--ink-3); font-size: 12px; text-align: right;
  white-space: nowrap; align-self: start; padding-top: 4px;
}
.items .links { grid-column: 1 / 2; display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin-top: 4px; }
.items .links a { color: var(--ink-3); text-decoration: none; }
.items .links a:hover { color: var(--accent); }
.items .links a::before { content: "["; color: var(--ink-4); }
.items .links a::after  { content: "]"; color: var(--ink-4); }

/* ---- now card ---- */
.now {
  border: 1px dashed var(--rule);
  padding: 18px 20px;
  background: color-mix(in oklab, var(--bg-2) 55%, transparent);
  position: relative;
}
.now::before {
  content: "// now";
  position: absolute; top: -10px; left: 14px;
  background: var(--bg); padding: 0 8px;
  color: var(--ink-3); font-size: 12px;
}
.now ul { list-style: none; margin: 0; padding: 0; }
.now li { color: var(--ink-2); padding: 4px 0; }
.now li::before { content: "· "; color: var(--accent); }

/* ---- timeline ---- */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 100px 1fr; gap: 24px; padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.timeline li:last-child { border-bottom: 0; }
.timeline .when { color: var(--ink-3); font-size: 12px; padding-top: 3px; font-variant-numeric: tabular-nums; }
.timeline .what .role { color: var(--ink); font-weight: 500; }
.timeline .what .org  { color: var(--ink-3); }
.timeline .what p { font-size: 13.5px; margin: 4px 0 0; color: var(--ink-2); }
.timeline .stack { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.timeline .stack span { font-size: 11px; color: var(--ink-3); border: 1px solid var(--rule); padding: 1px 6px; border-radius: 2px; }

/* ---- recs ---- */
.recs { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 640px) { .recs { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.recs h4 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ink-3); margin: 0 0 10px; font-weight: 500; }
.recs h4::before { content: "› "; color: var(--accent); }
.recs ul { list-style: none; margin: 0; padding: 0; }
.recs li { font-size: 13px; color: var(--ink-2); padding: 3px 0; }
.recs li .by { color: var(--ink-4); }

/* ---- sign-off ---- */
.signoff {
  margin-top: 120px;
  padding-top: 32px;
  border-top: 1px dashed var(--rule);
  color: var(--ink-3);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 6px;
}
.signoff .sig { color: var(--ink); font-style: italic; margin-top: 10px; }
.socials { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.socials a { color: var(--ink-3); text-decoration: none; }
.socials a:hover { color: var(--accent); }

/* ---- prose ---- */
.prose { max-width: 68ch; font-size: 15px; line-height: 1.75; color: var(--ink-2); }
.prose h1 { font-size: 22px; color: var(--ink); margin-bottom: 6px; }
.prose h2 { text-transform: none; letter-spacing: -0.01em; font-size: 16px; color: var(--ink); margin: 40px 0 12px; }
.prose h2::before { content: "§ "; color: var(--ink-4); }
.prose h3 { margin: 28px 0 8px; }
.prose p { color: var(--ink-2); }
.prose hr { border: 0; border-top: 1px dashed var(--rule); margin: 36px 0; }
.prose blockquote { margin: 20px 0; padding: 2px 0 2px 18px; border-left: 2px solid var(--accent); color: var(--ink); }
.prose code { font-size: 13px; background: var(--bg-2); padding: 1px 5px; border-radius: 2px; color: var(--ink); }
.prose pre { background: var(--bg-2); border: 1px solid var(--rule); padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; border-radius: 2px; }
.prose pre code { background: none; padding: 0; font-size: 12.5px; }
.prose ul { padding-left: 20px; }
.prose li { margin: 4px 0; }
.prose .caption { font-size: 12px; color: var(--ink-3); margin: 0 0 24px; text-align: center; }
.prose .footnote { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 28px; border-top: 1px dashed var(--rule); padding-top: 14px; }

.ph {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(135deg, var(--bg-2) 0 10px, transparent 10px 20px), var(--bg);
  border: 1px solid var(--rule);
  color: var(--ink-3); font-size: 11px;
  display: grid; place-items: center; letter-spacing: 0.05em;
}

.tag {
  display: inline-block; color: var(--ink-3);
  font-size: 11px; padding: 0 6px;
  border: 1px solid var(--rule); border-radius: 2px; margin-right: 4px;
}
.tag::before { content: "#"; color: var(--ink-4); }

.cursor { display: inline-block; width: 8px; height: 1em; background: var(--accent); vertical-align: -2px; margin-left: 2px; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.fade-in { animation: fadeIn 500ms ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.kprefix {
  position: fixed;
  left: 16px; bottom: 52px;
  z-index: 70;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent);
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 4px 8px;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 100ms ease, transform 100ms ease;
}
.kprefix.on { opacity: 1; transform: translateY(0); }
.kprefix .cur { display: inline-block; width: 6px; height: 12px; vertical-align: -1px; background: var(--accent); margin-left: 2px; animation: kblink 1s steps(2,end) infinite; }

/* ---- terminal prompt header ---- */
.prompt {
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0 0 28px;
  padding: 0 0 10px;
  border-bottom: 1px dashed var(--rule);
  white-space: pre-wrap;
  word-break: break-word;
}
.prompt .user { color: var(--accent); }
.prompt .at   { color: var(--ink-4); }
.prompt .host { color: var(--ink-2); }
.prompt .path { color: var(--ink-3); }
.prompt .sep  { color: var(--ink-4); margin: 0 4px; }
.prompt .dollar { color: var(--ink-4); }
.prompt .cmd  { color: var(--ink); }
.prompt .cur {
  display: inline-block;
  width: 7px; height: 13px;
  vertical-align: -1px;
  background: var(--ink);
  margin-left: 4px;
  animation: pblink 1s steps(2, end) infinite;
}
.prompt .cur.off { animation: none; opacity: 0; }
@keyframes pblink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }

/* ---- perf toast ---- */
.perf {
  position: fixed;
  right: 16px; bottom: 16px;
  z-index: 75;
  min-width: 200px;
  padding: 10px 14px 12px;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 180ms ease, transform 220ms ease;
  pointer-events: none;
  user-select: none;
}
.perf.on { opacity: 1; transform: translateY(0); }
.perf .cmd { color: var(--ink-3); margin-bottom: 4px; }
.perf .cmd::before { content: "$ "; color: var(--accent); }
.perf .row { display: grid; grid-template-columns: 52px 1fr auto; column-gap: 10px; line-height: 1.6; }
.perf .row .lbl { color: var(--ink-3); }
.perf .row .bar {
  align-self: center;
  height: 2px;
  background: var(--rule);
  position: relative;
  overflow: hidden;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform 500ms ease;
}
.perf .row .bar::after {
  content: "";
  position: absolute; inset: 0;
  background: var(--accent);
  opacity: 0.7;
}
.perf.on .row .bar { transform: scaleX(var(--w, 0)); }
.perf .row .val { color: var(--ink); font-variant-numeric: tabular-nums; }
.perf .row .val.slow { color: var(--accent); }
.perf .foot { margin-top: 6px; color: var(--ink-3); font-size: 11px; }
.perf .foot .ok { color: var(--accent); }
@media (max-width: 640px) { .perf { display: none; } }
@media (prefers-reduced-motion: reduce) { .perf { transition: opacity 120ms ease; transform: none !important; } }

/* ---- keyboard nav focus ring ---- */
.k-focus {
  position: relative;
  color: var(--ink) !important;
  background-color: var(--accent-soft);
  box-shadow:
    -6px 0 0 var(--accent-soft),
    6px 0 0 var(--accent-soft);
  border-radius: 1px;
  transition: background-color 100ms ease;
}
.k-focus::before {
  content: "›";
  position: absolute;
  left: -14px; top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-weight: 600;
  animation: kblink 1.1s steps(2, end) infinite;
  pointer-events: none;
}
/* nav-style items (inline, small): tighter arrow + pill-style bg */
.nav .k-focus,
.hintbar .k-focus {
  box-shadow: none;
  background: var(--accent-soft);
  padding: 2px 6px;
  margin: 0 -2px;
  color: var(--accent) !important;
}
.nav .k-focus::before,
.hintbar .k-focus::before {
  left: -8px;
}
@keyframes kblink { 0%, 49% { opacity: 1 } 50%, 100% { opacity: 0 } }

/* ---- hint bar ---- */
.hintbar {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: color-mix(in oklab, var(--bg) 82%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  user-select: none;
}
.hintbar kbd {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--bg-2);
  color: var(--ink-2);
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 2px;
  padding: 0 5px;
  line-height: 1.55;
  min-width: 16px;
  text-align: center;
  display: inline-block;
}
.hintbar .sep { color: var(--ink-4); }
.hintbar button.help {
  color: var(--ink-3);
  border: 1px solid var(--rule);
  border-radius: 2px;
  padding: 1px 6px;
  font-family: var(--mono);
  font-size: 11px;
  cursor: pointer;
  transition: color 120ms, border-color 120ms;
}
.hintbar button.help:hover { color: var(--accent); border-color: var(--accent); }
@media (max-width: 640px) { .hintbar { display: none; } }

/* ---- cheatsheet overlay ---- */
.sheet-bg {
  position: fixed; inset: 0; z-index: 80;
  background: color-mix(in oklab, var(--bg) 72%, transparent);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none;
  transition: opacity 140ms ease;
}
.sheet-bg.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.98);
  z-index: 81;
  width: min(560px, calc(100vw - 32px));
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 22px 26px 20px;
  font-family: var(--mono);
  color: var(--ink-2);
  opacity: 0;
  transition: opacity 140ms ease, transform 180ms ease;
  box-shadow: 0 30px 80px rgba(0,0,0,0.4);
}
.sheet.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sheet header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 14px;
}
.sheet h5 {
  margin: 0;
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 500;
}
.sheet .esc { color: var(--ink-4); font-size: 11px; }
.sheet .esc kbd {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--bg-2); color: var(--ink-2);
  border: 1px solid var(--rule); border-bottom-width: 2px;
  border-radius: 2px; padding: 0 5px;
}
.sheet .grid {
  display: grid; grid-template-columns: auto 1fr; column-gap: 18px; row-gap: 6px;
  font-size: 13px;
}
.sheet .grid .k { color: var(--ink); font-variant-ligatures: none; }
.sheet .grid .k kbd {
  font-family: var(--mono); font-size: 11px;
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--rule); border-bottom-width: 2px;
  border-radius: 2px; padding: 1px 6px; margin-right: 2px;
}
.sheet .grid .d { color: var(--ink-3); }
.sheet .sect {
  grid-column: 1 / -1;
  margin: 12px 0 4px;
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-4);
}
.sheet .sect:first-child { margin-top: 0; }

/* ---- dynamic bg blobs ---- */
.bg-blobs .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.25; mix-blend-mode: normal; }
.bg-blobs .b1 { width: 45vw; height: 45vw; left: -10vw; top: -10vw; background: var(--accent); animation: float1 22s ease-in-out infinite; }
.bg-blobs .b2 { width: 40vw; height: 40vw; right: -10vw; bottom: -10vw; background: var(--ink-3); animation: float2 26s ease-in-out infinite; }
@keyframes float1 { 50% { transform: translate(15vw, 10vh); } }
@keyframes float2 { 50% { transform: translate(-12vw, -8vh); } }

/* ---- tweaks panel ---- */
#__tweaks-panel {
  position: fixed; right: 16px; bottom: 16px; z-index: 9999;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--rule); border-radius: 4px;
  padding: 14px 16px 12px; font-family: var(--mono); font-size: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  min-width: 240px;
}
#__tweaks-panel h5 { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); font-weight: 500;}
#__tweaks-panel .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0; }
#__tweaks-panel .row > span:first-child { color: var(--ink-3); }
#__tweaks-panel .opts { display: flex; flex-wrap: wrap; gap: 4px; }
#__tweaks-panel button {
  border: 1px solid var(--rule); padding: 2px 7px; color: var(--ink-3);
  font-family: var(--mono); font-size: 11px; border-radius: 2px;
}
#__tweaks-panel button.on { border-color: var(--accent); color: var(--accent); }

/* ensure focusable targets scroll nicely */
[data-k-item]:focus-visible { outline: none; }
