:root {
  color-scheme: dark;
  --page: #15191f;
  --panel: #1b2028;
  --raised: #232b36;
  --line: #343e4c;
  --text: #e3e9f2;
  --muted: #aeb9c8;
  --blue: #a2ceff;
  --teal: #99d6c3;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 74px; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.55 system-ui, sans-serif; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: white; text-decoration: underline; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button, input { background: var(--raised); border: 1px solid var(--line); border-radius: 5px; }
button:hover { background: #344356; border-color: #657c97; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 3vw, 35px); line-height: 1.2; letter-spacing: -.035em; font-weight: 650; }
h2 { font-size: 20px; font-weight: 600; }
h3 { font-size: 16px; font-weight: 650; }
.topbar { height: 57px; display: flex; align-items: center; gap: 13px; padding: 0 16px; background: #1a2028; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar nav { margin-left: auto; display: flex; gap: 20px; font-size: 13px; }
.brand { color: var(--text); font-weight: 650; white-space: nowrap; }
.brand span { color: var(--teal); font: 15px var(--mono); margin-right: 5px; }
.icon-button { width: 38px; height: 38px; flex: none; display: inline-grid; place-items: center; background: transparent; border-color: transparent; }
.icon-button[aria-expanded="true"] { background: #293544; border-color: var(--line); }
.robot-button { color: var(--blue); }
.workspace { display: flex; align-items: flex-start; min-height: calc(100vh - 92px); }
#explorer, #chat { background: var(--panel); width: 255px; flex: none; position: sticky; top: 57px; max-height: calc(100dvh - 57px); overflow: auto; }
#explorer { border-right: 1px solid var(--line); min-height: min(570px, calc(100dvh - 57px)); }
.panel-heading { min-height: 43px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.panel-heading span, .panel-heading h2 { font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.repo-name { color: var(--text); background: #222a34; padding: 8px 13px; font: 600 13px var(--mono); }
.repo-name span { color: var(--muted); }
#repo-tree { padding: 8px 9px 14px; font: 12px/1.45 var(--mono); }
#repo-tree details { min-width: 0; }
#repo-tree summary, .tree-link { min-height: 28px; display: flex; align-items: center; gap: 7px; padding: 3px 5px; border-radius: 4px; color: var(--text); overflow-wrap: anywhere; }
#repo-tree summary { list-style: none; cursor: pointer; }
#repo-tree summary::-webkit-details-marker { display: none; }
#repo-tree summary::before { content: '›'; color: var(--muted); font-size: 16px; line-height: 1; }
#repo-tree details[open] > summary::before { transform: rotate(90deg); }
#repo-tree summary:hover, .tree-link:hover { background: #2e4055; color: white; }
.tree-children { margin-left: 10px; border-left: 1px solid var(--line); padding-left: 5px; }
.tree-icon { color: var(--teal); flex: none; }
.tree-link .tree-icon { color: var(--blue); }
main { flex: 1; min-width: 0; }
.tabbar { display: flex; background: #1d242d; border-bottom: 1px solid var(--line); font: 13px var(--mono); }
.tabbar > * { padding: 12px 16px; border-right: 1px solid var(--line); }
.tabbar > span { background: var(--page); box-shadow: inset 0 2px var(--blue); }
.tabbar b { color: var(--teal); margin-right: 3px; }
.content { padding: 20px clamp(20px, 3.1vw, 48px) 44px; max-width: 1140px; margin: auto; }
.breadcrumb, .label { font: 12px/1.4 var(--mono); color: var(--muted); }
.breadcrumb span:first-child { color: var(--teal); }
.intro { position: relative; isolation: isolate; overflow: hidden; margin: 18px 0 28px; padding: 25px; background: #1b222c; border: 1px solid var(--line); border-radius: 8px; }
#code-field { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.profile { display: flex; gap: 18px; align-items: center; }
.profile img { border-radius: 7px; object-fit: cover; object-position: center 22%; border: 1px solid #566576; }
.profile .label { color: var(--teal); margin-bottom: 6px; }
.profile p:last-child, .bio { color: var(--muted); }
.profile p:last-child { margin-top: 5px; }
.bio { margin-top: 15px; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 13px; }
#motion-toggle { margin-top: 16px; padding: 3px 8px; font-size: 11px; }
.feature-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 12px; }
.feature { display: flex; flex-direction: column; overflow: hidden; color: var(--text); background: #222a35; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 3px 10px #0004; transition: border-color .16s, background .16s; }
.feature:hover { text-decoration: none; border-color: #84abd6; background: #2a3646; }
.art { min-height: 104px; display: grid; place-items: center; padding: 14px 8px; }
.tape-art { background: linear-gradient(125deg,#cbdffa,#e7eeff); }
.tape { display: flex; gap: 4px; color: #21354d; font: 600 clamp(13px, 1.6vw, 20px) var(--mono); }
.tape span { padding: .45em .55em; border: 1px solid #9db6da; background: #f7fbff; border-radius: 4px; }
.tape span:nth-child(3) { background: #335b9d; color: white; border-color: #335b9d; }
.formula-art { background: #303d57; color: #d9e7ff; font: 22px var(--mono); }
.feature-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 16px; }
.feature-body p { color: var(--muted); font-size: 14px; flex: 1; }
.feature-body > span { color: var(--blue); font-size: 13px; }
#projects { margin-top: 30px; }
.directory-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.directory-heading label { color: var(--muted); font-size: 12px; }
input { min-width: 0; padding: 7px 9px; }
.directory-heading input { width: min(170px, 100%); margin-left: 5px; }
.project-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 9px; border-top: 1px solid var(--line); }
.project-row:hover, .project-row:focus-within { background: var(--raised); }
.project-row p { color: var(--muted); font-size: 13px; }
.project-row > a { align-self: center; font: 12px var(--mono); }
#project-status { margin-top: 10px; }
#chat { width: 290px; border-left: 1px solid var(--line); }
.chat-body { padding: 12px; }
.chat-note { color: var(--muted); font-size: 12px; margin-bottom: 12px; }
#messages { max-height: min(47dvh, 460px); overflow: auto; display: grid; align-content: start; gap: 8px; }
.message { padding: 9px 10px; border-radius: 6px; background: #252e3a; font-size: 13px; overflow-wrap: anywhere; }
.message.user { background: #293e56; }
.message ul { margin: 6px 0 0; padding-left: 17px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin: 12px 0; }
.suggestions button, #chat-form button { padding: 5px 7px; font-size: 12px; }
#chat-form { display: flex; gap: 6px; }
#question { flex: 1; width: 0; font-size: 13px; }
footer { display: flex; gap: 15px; padding: 8px 16px; background: #1e2734; border-top: 1px solid var(--line); color: var(--muted); font: 11px var(--mono); }
footer span:last-child { margin-left: auto; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { position: fixed; z-index: 20; top: 8px; left: 8px; background: var(--page); padding: 8px 12px; }
@media (max-width: 1100px) {
  #chat { position: fixed; right: 0; z-index: 8; box-shadow: -5px 10px 24px #0007; }
}
@media (max-width: 740px) {
  #explorer { position: fixed; z-index: 8; left: 0; box-shadow: 5px 10px 24px #0007; }
  .topbar { padding: 0 9px; gap: 6px; }
  .topbar nav { gap: 10px; }
  .topbar nav a:nth-child(2), .brand span { display: none; }
}
@media (max-width: 490px) {
  .feature-grid { grid-template-columns: 1fr; }
  .intro { padding: 16px; }
  .profile { gap: 12px; }
  .profile img { width: 62px; height: 68px; }
  .profile p:last-child { font-size: 13px; }
  .directory-heading { align-items: flex-start; flex-direction: column; }
  #chat { width: min(100%, 320px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
