/* CommitPad: one amber phosphor terminal (his Cyberspace reference: sidebar OS, a solid amber profile card,
   posts in thin glowing frames, keys in brackets). Every frame is a nine-sliced PNG from art/tools/ui.py. */
@font-face { font-family: "Commit Mono"; src: url("/fonts/commitmono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Commit Mono"; src: url("/fonts/commitmono-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #170900;
  --bg-deep: #100600;
  --amber: #fb9b10;
  --text: #f6a432;
  --soft: #d98a24;
  --dim: #a4661c;
  --faint: #6b3d0c;
  --rule: #3a1c03;
  --ink: #170900;
  --c0: #2a1303; --c1: #5a2c05; --c2: #93500a; --c3: #c9770d; --c4: #fb9b10;
  --glow: 0 0 6px rgba(251, 155, 16, .55);
  --glow-soft: 0 0 4px rgba(251, 155, 16, .3);
  --side: 232px;
  --pad: 28px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text);
  font: 400 15px/1.6 "Commit Mono", ui-monospace, Consolas, monospace; text-shadow: var(--glow-soft);
  -webkit-font-smoothing: antialiased;
}
/* the tube: faint scanlines and a vignette, never over the pointer */
body::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.10) 2px 3px),
    radial-gradient(ellipse at 50% 45%, rgba(0,0,0,0) 60%, rgba(0,0,0,.45) 100%);
}
a { color: inherit; }
button, input { font: inherit; color: inherit; }
kbd { font: inherit; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 60; background: var(--amber); color: var(--ink); padding: 6px 10px; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
::selection { background: var(--amber); color: var(--ink); text-shadow: none; }

/* ---------- frames (nine-slice rasters) ---------- */
.fr { border: 5px solid transparent; border-image: url("/px/frame.png") 9 / 9px / 4px stretch; }
.fr-lit { border: 5px solid transparent; border-image: url("/px/frame_lit.png") 11 / 11px / 6px stretch; }
.card { border: 5px solid transparent; border-image: url("/px/card.png") 12 fill / 12px / 7px stretch; color: var(--ink); text-shadow: none; }
.field { border: 4px solid transparent; border-image: url("/px/field.png") 7 fill / 7px / 3px stretch; }

/* ---------- the OS ---------- */
.os { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: 6px;
  padding: 26px 18px 18px 26px; border-right: 1px solid var(--rule); background: var(--bg);
}
.brand { display: block; width: max-content; margin-left: -8px; text-decoration: none; }
.brand img { display: block; width: 196px; height: auto; }
.ticker { color: var(--dim); font-size: 13px; margin: 2px 0 18px; }
.menu { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.menu a {
  display: flex; justify-content: space-between; align-items: baseline; padding: 7px 10px 7px 0; text-decoration: none;
  color: var(--soft); font-size: 15px; transition: color .15s, text-shadow .15s;
}
.menu a:hover { color: var(--amber); text-shadow: var(--glow); }
.menu a[aria-current="page"] { color: var(--amber); text-shadow: 0 0 8px rgba(251,155,16,.9), 0 0 2px rgba(251,155,16,.9); font-weight: 700; }
.count { font-size: 13px; color: var(--amber); }
.side-foot { margin-top: auto; display: grid; gap: 14px; }
.find { background: none; border: 0; padding: 6px 0; text-align: left; color: var(--dim); cursor: pointer; font-size: 13px; }
.find:hover { color: var(--amber); }
.find kbd, .hint kbd { color: var(--amber); }
.who { font-size: 13px; color: var(--dim); display: flex; align-items: center; gap: 10px; min-height: 40px; }
.who canvas, .who img { width: 32px; height: 32px; image-rendering: pixelated; flex: none; }
.who a { color: var(--soft); }

main { padding: 26px var(--pad) 40px; min-width: 0; outline: none; }
.page-title { font-size: 13px; font-weight: 700; letter-spacing: .08em; color: var(--amber); text-shadow: var(--glow); margin: 0 0 18px; }
.note, .muted { color: var(--dim); }
.stack { display: grid; gap: 22px; max-width: 1560px; }

/* ---------- keys: [B] Buy ---------- */
.key {
  display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 2px 12px; cursor: pointer;
  border: 4px solid transparent; border-image: url("/px/key.png") 7 / 7px / 3px stretch; background: none;
  color: var(--soft); text-decoration: none; white-space: nowrap; transition: transform .08s, color .15s;
}
.key:hover:not(:disabled), .key:focus-visible { border-image: url("/px/key_lit.png") 8 / 8px / 4px stretch; color: var(--amber); text-shadow: var(--glow); }
.key:active:not(:disabled) { transform: translateY(1px); }
.key:disabled, .key[aria-disabled="true"] { opacity: .45; cursor: not-allowed; }
.key b { color: var(--amber); font-weight: 700; }
.key img { width: 18px; height: 18px; display: block; }
.card .key { border-image: url("/px/key_ink.png") 5 / 5px / 1px stretch; color: var(--ink); }
.card .key b { color: var(--ink); }
.card .key:hover:not(:disabled), .card .key:focus-visible { background: rgba(23,9,0,.12); color: var(--ink); text-shadow: none; border-image: url("/px/key_ink.png") 5 / 5px / 1px stretch; }
.keys { display: flex; flex-wrap: wrap; gap: 10px; }

/* ---------- the graph ---------- */
.graph { padding: 22px 24px 20px; }
.graph-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--dim); margin-bottom: 14px; }
.graph-head b { color: var(--amber); font-weight: 400; }
.graph canvas { display: block; width: 100%; height: auto; cursor: default; touch-action: pan-y; }
.graph-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 16px; font-size: 13px; color: var(--dim); }
.legend { display: inline-flex; gap: 4px; align-items: center; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.cell-tip { min-height: 1.6em; color: var(--soft); }
.search { display: flex; align-items: center; gap: 10px; padding: 6px 12px; margin-top: 18px; }
.search span { color: var(--amber); font-weight: 700; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 8px 0; font-size: 17px; color: var(--amber); caret-color: var(--amber); text-shadow: var(--glow); }
.search input::placeholder { color: var(--faint); text-shadow: none; }
.search .msg { font-size: 13px; }

/* ---------- the profile card ---------- */
.profile { padding: 18px 20px 16px; }
.profile-top { display: grid; grid-template-columns: 116px minmax(0, 1fr) auto; gap: 18px 20px; align-items: start; }
.dither { width: 116px; height: 116px; image-rendering: pixelated; display: block; background: rgba(23,9,0,.15); }
.logo-tile { display: grid; place-items: center; border: 2px solid var(--ink); background: none; }
.logo-tile img { width: 46%; height: auto; }
.graph .status:empty { display: none; }
.profile h2 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.profile p { margin: 0; }
.profile .since { font-size: 13px; white-space: nowrap; }
.profile-mid { border-top: 2px solid var(--ink); margin-top: 18px; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.stats { display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; }
.stats b { font-weight: 700; }
.ca-row { margin-top: 14px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 13px; }
.ca-row code { font: inherit; font-size: 14px; overflow-wrap: anywhere; user-select: all; }
.ca-row .status { grid-column: 1 / -1; min-height: 1.3em; }

/* digit wheels */
.wheel { display: inline-flex; overflow: hidden; height: 1.5em; line-height: 1.5em; vertical-align: bottom; }
.wheel .d { display: inline-block; width: 1ch; position: relative; }
.wheel .d > span { display: block; transition: transform 1.2s cubic-bezier(.2,.9,.2,1); }
.wheel .d > span > i { display: block; font-style: normal; height: 1.5em; }

/* ---------- tabs + posts ---------- */
.tabs { display: flex; gap: 10px; flex-wrap: wrap; }
.tabs [role="tab"][aria-selected="true"] { border-image: url("/px/key_lit.png") 8 / 8px / 4px stretch; color: var(--amber); text-shadow: var(--glow); }
.post { padding: 16px 20px 16px; }
.post-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--dim); margin-bottom: 12px; }
.post-head b { color: var(--text); font-weight: 400; }
.post h3 { margin: 0 0 10px; font-size: 15px; text-decoration: underline; text-underline-offset: 4px; font-weight: 700; color: var(--amber); }
.post ul { margin: 0; padding: 0 0 0 1.2em; list-style: "\25B8  "; }
.post li { margin: 4px 0; }
.post-foot { border-top: 1px solid var(--rule); margin-top: 14px; padding-top: 12px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; font-size: 13px; color: var(--dim); }
.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag { padding: 0 10px; min-height: 28px; display: inline-flex; align-items: center; border: 4px solid transparent; border-image: url("/px/key.png") 7 / 7px / 3px stretch; font-size: 13px; color: var(--soft); text-decoration: none; }
a.tag:hover { color: var(--amber); }

/* how it works: four scenes on one 12 s loop */
.scenes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.scene { padding: 14px 14px 12px; min-height: 176px; position: relative; overflow: hidden; }
.scene .n { font-size: 12px; color: var(--dim); }
.scene .say { font-size: 13px; color: var(--soft); margin-top: 8px; }
.sc-type { margin-top: 12px; font-size: 16px; color: var(--amber); white-space: nowrap; overflow: hidden; width: 0; animation: type 12s steps(14) infinite; text-shadow: var(--glow); }
.sc-type::after { content: "_"; animation: blink 1s steps(1) infinite; }
@keyframes type { 0% { width: 0 } 16%, 92% { width: 15ch } 100% { width: 0 } }
@keyframes blink { 50% { opacity: 0 } }
.sc-repo { margin-top: 12px; padding: 10px 12px; opacity: 0; animation: repo 12s infinite; font-size: 13px; }
.sc-repo b { display: block; font-size: 14px; }
@keyframes repo { 0%, 20% { opacity: 0; transform: translateY(6px) } 26%, 92% { opacity: 1; transform: none } 100% { opacity: 0 } }
.sc-fees { margin-top: 12px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; width: 100%; max-width: 150px; }
.sc-fees i { aspect-ratio: 1; border-radius: 2px; background: var(--c0); animation: fee 12s infinite; }
@keyframes fee { 0%, 40% { background: var(--c0) } 46% { background: var(--c4); box-shadow: 0 0 6px rgba(251,155,16,.8) } 60%, 92% { background: var(--c2) } 100% { background: var(--c0) } }
.sc-wait { margin-top: 10px; font-size: 14px; color: var(--amber); }
.sc-claim { margin-top: 12px; opacity: 0; animation: claim 12s infinite; font-size: 14px; color: var(--amber); text-shadow: var(--glow); }
@keyframes claim { 0%, 70% { opacity: 0 } 74%, 94% { opacity: 1 } 100% { opacity: 0 } }

/* git log */
.gitlog { display: grid; gap: 0; }
.commit { padding: 12px 0; border-bottom: 1px solid var(--rule); font-size: 14px; display: grid; gap: 2px; }
.commit:last-child { border-bottom: 0; }
.commit .h { color: var(--amber); }
.commit .h a { color: var(--amber); }
.commit .meta { color: var(--dim); font-size: 13px; }
.commit .msg { padding-left: 4ch; color: var(--text); overflow-wrap: anywhere; }

/* tables of repos */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.row:hover .row-name { color: var(--amber); text-shadow: var(--glow); }
.row canvas, .row img.av { width: 44px; height: 44px; image-rendering: pixelated; display: block; }
.row-name { font-weight: 700; overflow-wrap: anywhere; }
.row-sub { color: var(--dim); font-size: 13px; }
.row-amt { text-align: right; white-space: nowrap; }
.row-amt b { color: var(--amber); font-weight: 400; display: block; }
.row-amt span { font-size: 12px; color: var(--dim); }

/* forms */
.form { display: grid; gap: 16px; padding: 18px 20px 20px; max-width: 760px; }
.form label { display: grid; gap: 6px; font-size: 13px; color: var(--dim); }
.form .in { display: flex; align-items: center; gap: 8px; padding: 0 10px; min-height: 44px; }
.form .in span { color: var(--amber); }
.form input[type="text"], .form input[type="number"] { flex: 1; min-width: 0; background: none; border: 0; outline: none; padding: 8px 0; font-size: 16px; color: var(--amber); caret-color: var(--amber); }
.form input::placeholder { color: var(--faint); }
.form .in:focus-within { border-image: url("/px/frame_lit.png") 11 fill / 11px / 6px stretch; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split-line { font-size: 13px; color: var(--soft); border-left: 2px solid var(--c2); padding-left: 12px; }
.status { font-size: 13px; min-height: 1.5em; color: var(--soft); }
.status.bad { color: #ff7a3d; }
.status.good { color: var(--amber); text-shadow: var(--glow); }
.pic-choice { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.pic-choice canvas, .pic-choice img { width: 72px; height: 72px; image-rendering: pixelated; }

.launch-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; max-width: 1560px; }
.launch-grid .form { max-width: none; }
.preview { position: sticky; top: 26px; }
.preview .profile-top { grid-template-columns: 96px minmax(0, 1fr) auto; }
.preview .dither { width: 96px; height: 96px; }
.pic-choice .key { font-size: 13px; color: var(--soft); display: inline-flex; }
@media (max-width: 1100px) { .launch-grid { grid-template-columns: 1fr; } .preview { position: static; } }

/* repo page */
.readme { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; color: var(--soft); max-height: 420px; overflow: auto; margin: 0; }
.snippet { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.snippet code { font: inherit; font-size: 13px; overflow-wrap: anywhere; color: var(--amber); }
.badge-img { display: block; margin-top: 12px; image-rendering: pixelated; }
.coin { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.coin:last-child { border-bottom: 0; }
.coin img { width: 44px; height: 44px; object-fit: cover; filter: sepia(1) saturate(2.2) hue-rotate(-12deg) brightness(.9); }
.coin code { font: inherit; font-size: 12px; color: var(--dim); overflow-wrap: anywhere; }

/* dialogs */
dialog { background: transparent; border: 0; padding: 0; color: var(--text); max-width: min(640px, calc(100vw - 32px)); width: 100%; }
dialog::backdrop { background: rgba(10, 4, 0, .78); }
.find-form { background: var(--bg); padding: 18px 20px; display: grid; gap: 10px; }
.find-form label { font-size: 13px; color: var(--amber); font-weight: 700; letter-spacing: .06em; }
.prompt { display: flex; gap: 10px; align-items: center; font-size: 18px; }
.prompt span { color: var(--amber); }
.prompt input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--amber); padding: 6px 0; caret-color: var(--amber); }
.hint, .find-form .msg { margin: 0; font-size: 13px; color: var(--dim); }
.wallets { display: grid; gap: 8px; }

/* ---------- small screens ---------- */
@media (max-width: 1020px) {
  .scenes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-top { grid-template-columns: 96px minmax(0, 1fr); }
  .profile-top .since { grid-column: 2; }
  .dither { width: 96px; height: 96px; }
}
@media (max-width: 760px) {
  :root { --pad: 16px; }
  .os { grid-template-columns: 1fr; }
  .side { position: sticky; top: 0; z-index: 10; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 16px 8px; border-right: 0; border-bottom: 1px solid var(--rule); }
  .brand img { width: 150px; }
  .ticker { margin: 0; }
  .menu { order: 3; width: 100%; display: flex; gap: 16px; overflow-x: auto; scrollbar-width: none; }
  .menu a { padding: 6px 0; white-space: nowrap; gap: 6px; }
  .side-foot { margin: 0 0 0 auto; display: flex; gap: 10px; }
  .find { display: none; }
  .who { min-height: 0; }
  .who span { display: none; }
  .graph { padding: 14px 12px; }
  .two { grid-template-columns: 1fr; }
  .scenes { grid-template-columns: 1fr; }
  .scene { min-height: 0; }
  .profile-top { grid-template-columns: 72px minmax(0, 1fr); gap: 12px 14px; }
  .dither { width: 72px; height: 72px; }
  .ca-row { grid-template-columns: 1fr; }
  .snippet { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .sc-type { width: 15ch; } .sc-repo, .sc-claim { opacity: 1; } .sc-fees i { background: var(--c2); }
}

/* grid and flex children never grow past the screen */
.stack > *, .launch-grid > *, .os > * { min-width: 0; }
.graph canvas { max-width: 100%; }
@media (max-width: 760px) {
  .side { max-width: 100vw; }
  .menu { flex: 1 1 100%; min-width: 0; max-width: 100%; }
  .search .key b + * { display: none; }
  .search .key { padding: 2px 8px; }
}
.form > *, .form label, .form .in, .row > * { min-width: 0; }
@media (max-width: 760px) {
  .key { white-space: normal; text-align: left; }
  .in .key b + * { display: none; }
}
@media (max-width: 760px) {
  .profile .since { white-space: normal; }
  .row { grid-template-columns: 44px minmax(0, 1fr); }
  .row-amt { grid-column: 2; text-align: left; }
  .coin { grid-template-columns: 44px minmax(0, 1fr); }
  .coin .key { grid-column: 1 / -1; justify-self: start; }
}

/* docs */
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; align-items: start; max-width: 1560px; }
.doc-toc { position: sticky; top: 26px; }
.doc-toc ol { margin: 0; padding-left: 2.2em; display: grid; gap: 6px; font-size: 14px; }
.doc-toc a { color: var(--soft); text-decoration: none; }
.doc-toc a:hover { color: var(--amber); text-shadow: var(--glow); }
.doc-body { display: grid; gap: 18px; min-width: 0; }
.doc { scroll-margin-top: 20px; max-width: 980px; }
.doc h2 { margin: 0 0 12px; font-size: 16px; color: var(--amber); text-shadow: var(--glow); }
.doc p, .doc li, .doc dd { color: var(--text); line-height: 1.7; }
.doc p { margin: 0 0 10px; }
.doc ol, .doc ul { margin: 0 0 10px; padding-left: 1.6em; display: grid; gap: 6px; }
.doc code { color: var(--amber); font: inherit; }
.doc b { color: var(--amber); }
.doc-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc-table td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.doc-table td:first-child { color: var(--dim); width: 34%; }
.faq dt { color: var(--amber); margin-top: 12px; }
.faq dd { margin: 4px 0 0; }
@media (max-width: 900px) { .docs { grid-template-columns: 1fr; } .doc-toc { position: static; } }
