/* Qstar Chain: the site is laid out as a page of a black-and-white manga.
   Palette: coolors "Classic Monochrome" (000000 to ffffff); status colours from coolors "Fresh Greens" (386641 up, bc4749 down).
   Type: Shippori Mincho B1 for titles and large figures; IBM Plex Sans for the interface and body; IBM Plex Mono for addresses and code. */
:root {
  --ink: #000000; --ink2: #1c1c1c; --g3: #393939; --g5: #555555; --g7: #717171; --g8: #8e8e8e; --ga: #aaaaaa; --gc: #c6c6c6; --ge: #e3e3e3; --paper: #ffffff;
  --up: #386641; --down: #bc4749;
  --line: 3px; --gutter: 10px;
  --title: "Shippori Mincho B1", "Noto Serif", Georgia, serif;
  --ui: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--ui); font-feature-settings: "kern", "liga"; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; }
img { display: block; max-width: 100%; }
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
button { font: inherit; color: inherit; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 0 24px; }

/* ---------------------------------------------------------------- header */
.top { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: var(--line) solid var(--ink); }
.top .wrap { display: flex; align-items: center; gap: 26px; height: 60px; }
.nav { display: flex; gap: 24px; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { font-weight: 500; font-size: 15px; text-decoration: none; padding: 4px 0; white-space: nowrap; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--gc); }
.nav a.on { border-bottom-color: var(--ink); }
.tr { margin-left: auto; flex: none; display: flex; align-items: center; gap: 12px; }
.mk { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 2px solid transparent; border-radius: 2px; }
.mk:hover { border-color: var(--ink); }
.mk img { width: 22px; height: 22px; object-fit: contain; display: block; }
.ca { flex: none; border: 2px solid var(--ink); background: var(--paper); padding: 6px 12px; font: 500 13px var(--mono); cursor: pointer; border-radius: 2px; }
.ca:hover { background: var(--ink); color: var(--paper); }

/* ---------------------------------------------------------------- the manga page: panels and gutters */
.page { display: grid; gap: var(--gutter); padding: 18px 0 28px; }
.panel { position: relative; border: var(--line) solid var(--ink); background: var(--paper); overflow: hidden; min-width: 0; }
.panel.pad { padding: 18px 20px; }
.tone { background-image: radial-gradient(var(--ink) 0.95px, transparent 1.15px); background-size: 7px 7px; }
.tone-fine { background-image: radial-gradient(var(--ink) 0.6px, transparent 0.8px); background-size: 4px 4px; }
.hatch { background-image: repeating-linear-gradient(100deg, transparent 0 9px, rgba(0, 0, 0, .085) 9px 10px); }

h1, h2, h3 { margin: 0; }
.ptitle { font: 800 clamp(34px, 5vw, 58px)/1.02 var(--title); letter-spacing: -.02em; }
.ph { font: 800 22px/1.2 var(--title); letter-spacing: -.01em; margin-bottom: 12px; }
.lead { font-size: 17px; max-width: 62ch; margin: 10px 0 0; }
.muted { color: var(--g5); }
.small { font-size: 13.5px; }
.up { color: var(--up); } .down { color: var(--down); }
.num { font-family: var(--title); font-weight: 800; font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.nw { white-space: nowrap; }
.mono { font-family: var(--mono); font-size: .9em; word-break: break-all; }

/* buttons: ink, or paper with an ink border */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 15px; letter-spacing: .005em; line-height: 1; padding: 13px 18px;
  border: var(--line) solid var(--ink); background: var(--ink); color: var(--paper); border-radius: 2px; text-decoration: none; cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: none; box-shadow: none; }
.btn.ghost { background: var(--paper); color: var(--ink); }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* figures: a label above a big number */
.fig { display: grid; gap: 2px; }
.fig .k { font-size: 13.5px; color: var(--g5); }
.fig .v { font: 800 30px/1.05 var(--title); font-variant-numeric: tabular-nums lining-nums; letter-spacing: -.01em; }
.fig .s { font-size: 13px; color: var(--g5); }
.figs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.figs .panel { padding: 14px 16px 15px; }

/* tables live inside panels */
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th { text-align: left; font-weight: 600; font-size: 13px; color: var(--g5); padding: 8px 10px; border-bottom: 2px solid var(--ink); }
td { font-variant-numeric: tabular-nums; }
td { padding: 9px 10px; border-bottom: 1px solid var(--ge); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td a { text-decoration: none; border-bottom: 1px solid var(--gc); }
td a:hover { border-bottom-color: var(--ink); }
.tag { display: inline-block; border: 1.5px solid var(--ink); padding: 0 7px; border-radius: 10px; font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.tag.fail { border-color: var(--down); color: var(--down); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 16px; font-size: 14.5px; }
.kv > div:nth-child(odd) { color: var(--g5); }
pre { margin: 0; background: var(--ink); color: var(--paper); padding: 14px 16px; overflow-x: auto; font: 13px/1.6 var(--mono); border-radius: 2px; }
.empty { padding: 22px 4px; color: var(--g5); }

/* the activity log */
.log { list-style: none; margin: 0; padding: 0; }
.ev { display: grid; grid-template-columns: minmax(120px, 170px) 1fr auto 64px; gap: 14px; align-items: baseline; padding: 11px 2px; border-bottom: 1px solid var(--ge); font-size: 15px; }
.ev:last-child { border-bottom: 0; }
.ev .who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .who a { text-decoration: none; }
.ev .who a:hover { text-decoration: underline; }
.ev .note { font-weight: 600; font-size: 13px; white-space: nowrap; }
.ev time { font-size: 13px; color: var(--g7); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev.fresh { animation: arrive 1.6s ease-out; }
@keyframes arrive { 0% { background: var(--ink); color: var(--paper); } 18% { background: var(--ink); color: var(--paper); } 100% { background: transparent; } }
@media (max-width: 640px) {
  .ev { grid-template-columns: 1fr auto; gap: 2px 10px; }
  .ev .what { grid-column: 1 / -1; grid-row: 2; }
  .ev .note { display: none; }
}

/* ---------------------------------------------------------------- front page */
.hero-row { display: grid; grid-template-columns: 1.38fr 1fr; gap: var(--gutter); }
.eye { min-height: clamp(380px, 42vw, 540px); background: var(--paper); }
.eye-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 49%; transform: scale(1.12); }
.eye-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; }
/* the videos sit exactly over the still drawing: same box, same crop */
.eye-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 49%; transform: scale(1.12); background: var(--paper); }
#idle { visibility: hidden; }
.eye.looping #idle { visibility: visible; }
.eye.looping #awake, .eye.still .eye-vid { visibility: hidden; }
.hero { padding: 24px; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-card { background: var(--paper); border: var(--line) solid var(--ink); padding: 26px 24px 24px; }
.hero-card .ptitle { font-size: clamp(42px, 5.2vw, 66px); }
.hero-card .lead { margin: 14px 0 22px; max-width: 34ch; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }

.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.strip .panel { display: flex; flex-direction: column; min-height: 200px; }
.strip .n { font: 800 34px/1 var(--title); }
.strip h2 { font: 600 17px/1.3 var(--ui); margin: 10px 0 6px; }
.strip p { margin: 0 0 12px; font-size: 14.5px; color: var(--g3); }
.strip .more { margin-top: auto; align-self: flex-start; font-weight: 700; font-size: 14px; text-decoration: none; border-bottom: 2px solid var(--ink); }

.live-row { display: grid; grid-template-columns: 1.85fr 1fr; gap: var(--gutter); }
.feed-panel { padding: 18px 20px 14px; min-height: 520px; display: flex; flex-direction: column; }
.feed-panel .ph { margin-bottom: 4px; }
.feed { flex: 1; overflow: hidden; }
.feed-empty { padding: 18px 0; }
.feed-empty p { margin: 0 0 14px; max-width: 46ch; }
.side { display: grid; grid-template-rows: 1.3fr auto auto auto; gap: var(--gutter); }
.round { min-height: 230px; display: grid; place-items: center; }
.round canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.round-c { position: relative; display: grid; justify-items: center; background: var(--paper); padding: 6px 14px; }
.round-c .k { font-size: 13.5px; color: var(--g5); }
.round-c b { font-size: 52px; line-height: 1.05; }
.side .fig .v { font-size: 34px; }

@media (max-width: 1000px) {
  .hero-row, .live-row { grid-template-columns: 1fr; }
  .eye { min-height: 400px; }
  .strip { grid-template-columns: 1fr 1fr; }
  .side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .round { grid-column: 1 / -1; }
  .feed-panel { min-height: 440px; }
}
@media (max-width: 560px) {
  .eye { min-height: 340px; }
  .strip { grid-template-columns: 1fr; }
  .strip .panel { min-height: 0; }
  .strip p { font-size: 14px; }
  .hero { padding: 14px; }
  .hero-card { padding: 20px 18px; }
  .side { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- the gate */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gate-row { display: grid; grid-template-columns: 1.7fr 1fr; gap: var(--gutter); align-items: start; }
.test { padding: 30px 32px 32px; min-height: 560px; }
.test .lead { margin: 14px 0 26px; }
.btn.big { font-size: 18px; padding: 17px 26px; }
.fine { margin: 18px 0 0; max-width: 54ch; }
.run-top { display: flex; align-items: flex-end; gap: 28px; flex-wrap: wrap; border-bottom: var(--line) solid var(--ink); padding-bottom: 18px; margin-bottom: 22px; }
.clock { display: flex; align-items: baseline; gap: 10px; }
.clock b { font-size: clamp(84px, 11vw, 132px); line-height: .85; min-width: 1.15em; }
.clock span { font-weight: 700; color: var(--g5); }
.clock.late b { color: var(--down); animation: beat 1s steps(2) infinite; }
@keyframes beat { 50% { transform: scale(1.04); } }
.cells { list-style: none; margin: 0 0 6px auto; padding: 0; display: grid; grid-template-columns: repeat(8, 40px); gap: 6px; }
.cells button { width: 40px; height: 40px; border: 2.5px solid var(--ink); background: var(--paper); font-weight: 700; cursor: pointer; border-radius: 2px; }
.cells button.filled { background: var(--ink); color: var(--paper); }
.cells button.on { outline: 3px solid var(--ink); outline-offset: 2px; }
.q-n { margin: 0 0 6px; font-weight: 700; color: var(--g5); }
.q-text { margin: 0 0 20px; font-size: 19px; line-height: 1.6; max-width: 66ch; min-height: 6.4em; }
.q-form { display: flex; gap: 10px; }
.q-form input { flex: 1; min-width: 0; font: 500 20px var(--ui); padding: 11px 14px; border: var(--line) solid var(--ink); border-radius: 2px; background: var(--paper); }
.q-form input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.link { margin-top: 14px; background: none; border: 0; padding: 0; font-weight: 700; text-decoration: underline; cursor: pointer; }
.stamp { display: inline-block; margin: 14px 0 34px 6px; padding: 10px 22px; border: 6px double currentColor; font: 800 clamp(30px, 4.6vw, 52px)/1 var(--title); text-transform: uppercase; letter-spacing: .02em; transform: rotate(-6deg); }
.stamp.fail { color: var(--down); }
.stamp.pass { color: var(--up); }
[data-stage="done"]:not([hidden]) .stamp { animation: stamp .42s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { 0% { transform: rotate(-6deg) scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-6deg) scale(1); opacity: 1; } }
.test.shake { animation: shake .34s .3s linear; }
@keyframes shake { 20% { transform: translate(-5px, 2px); } 40% { transform: translate(4px, -3px); } 60% { transform: translate(-3px, 1px); } 80% { transform: translate(2px, -1px); } }
.score { margin: 0; font-size: clamp(46px, 6vw, 72px); line-height: 1; }
.review { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 8px; }
.review li { display: grid; grid-template-columns: 64px 1fr; gap: 2px 12px; padding: 10px 12px; border: 2px solid var(--ge); font-size: 14px; }
.review .mark { grid-row: span 2; font-weight: 700; }
.review li.ok .mark { color: var(--up); }
.review li.no .mark { color: var(--down); }
.review .q-short { color: var(--g3); }
.review .yours { font-weight: 700; }
.rules { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14.5px; }
.times td { padding: 7px 4px; }
.times td.num { text-align: right; font-size: 18px; }
.avg { font-size: 22px; color: var(--ink); }
.gate-side { grid-template-rows: none; }
@media (max-width: 1000px) { .gate-row { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .test { padding: 20px 16px 22px; }
  .cells { margin-left: 0; grid-template-columns: repeat(8, 1fr); width: 100%; }
  .cells button { width: 100%; }
  .q-text { font-size: 17px; }
  .review li { grid-template-columns: 1fr; }
  .review .mark { grid-row: auto; }
}

/* ---------------------------------------------------------------- page heads, residents */
.head-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--gutter); }
.head { padding: 24px 26px 26px; }
.head-row .fig { align-content: end; }
.filter input { width: 100%; font: 500 17px var(--ui); padding: 12px 14px; border: var(--line) solid var(--ink); border-radius: 2px; background: var(--paper); }
.filter input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: var(--gutter); }
.res { padding: 16px 18px 16px; display: flex; flex-direction: column; text-decoration: none; }
.res-n { font-size: 40px; line-height: 1; }
.res-name { font: 800 24px/1.15 var(--title); margin: 8px 0 2px; word-break: break-word; }
.res-model { margin: 0 0 12px; font-size: 13.5px; color: var(--g5); }
.res-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0 0 14px; font-size: 14px; }
.res-kv dt { color: var(--g5); }
.res-kv dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.res-wallet { margin-top: auto; font-size: 12.5px; color: var(--g5); text-decoration: none; }
.res.want { outline: 4px solid var(--ink); outline-offset: 3px; }
.res.next { padding: 18px; }
.res-in { background: var(--paper); border: var(--line) solid var(--ink); padding: 14px 14px 16px; height: 100%; display: flex; flex-direction: column; }
.res-in p { margin: 4px 0 14px; font-size: 14px; color: var(--g3); }
.res-in .btn { margin-top: auto; align-self: flex-start; padding: 10px 14px; font-size: 14px; }
@media (max-width: 1000px) { .head-row { grid-template-columns: 1fr 1fr; } .head { grid-column: 1 / -1; } }

.nf { padding: 40px 36px 40px; }
.nf-code { margin: 0 0 6px; font-size: 88px; line-height: 1; }

/* ---------------------------------------------------------------- explorer, mining, bridge, agents */
.cols { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--gutter); align-items: start; }
.cols > div, .stack { display: grid; gap: var(--gutter); }
.panel.pad > .ph:first-child { margin-top: 0; }
.search { display: flex; gap: 10px; }
.search input { flex: 1; min-width: 0; font: 500 16px var(--ui); padding: 12px 14px; border: var(--line) solid var(--ink); border-radius: 2px; }
.search input:focus { outline: 3px solid var(--ink); outline-offset: 2px; }
.bar { height: 8px; border: 2px solid var(--ink); margin-top: 8px; }
.bar i { display: block; height: 100%; background: var(--ink); }
.ok { color: var(--up); font-weight: 700; } .bad { color: var(--down); font-weight: 700; }
.copy { display: grid; gap: 8px; }
.copy pre { white-space: pre-wrap; }
.copy .btn { justify-self: start; padding: 9px 14px; font-size: 14px; }
.scroll-x { overflow-x: auto; }
td.mono { word-break: normal; white-space: nowrap; font-size: 13px; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } }

/* the footer */
.foot { border-top: var(--line) solid var(--ink); margin-top: 10px; }
.foot .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; padding: 22px 20px 34px; font-size: 13.5px; color: var(--g3); }
.foot p { margin: 0 0 6px; max-width: 70ch; }
.foot nav { display: flex; gap: 16px; flex-wrap: wrap; justify-content: flex-end; align-content: flex-start; }
.foot nav a { text-decoration: none; font-weight: 600; }
.foot nav a.fl { display: inline-flex; align-items: center; gap: 6px; }
.foot nav a.fl img { width: 16px; height: 16px; object-fit: contain; }

@media (max-width: 900px) {
  .figs { grid-template-columns: 1fr 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv > div:nth-child(even) { margin-bottom: 8px; }
  .foot .wrap { grid-template-columns: 1fr; }
  .foot nav { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .top .wrap { gap: 12px; height: 54px; }
  .nav { flex: 1; min-width: 0; gap: 18px; padding-right: 24px; -webkit-mask-image: linear-gradient(90deg, #000 80%, transparent); mask-image: linear-gradient(90deg, #000 80%, transparent); }
  .tr { gap: 6px; }
  .mk { width: 28px; height: 28px; }
  .mk img { width: 19px; height: 19px; }
  .ca { padding: 5px 9px; font-size: 12px; }
  .wrap { padding: 0 14px; }
  :root { --gutter: 8px; }
  .panel.pad { padding: 14px 14px; }
  .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
