:root {
  --ink: #0A0A09; --panel: #11110F; --line: #24231F; --rule: #34322C;
  --text: #ECE8DF; --dim: #8A857A; --faint: #55524A;
  --qed: #C6F432; --warn: #E8A33D;
  --disp: "Martian Mono", ui-monospace, monospace; --body: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--ink); color: var(--text); font: 14px/1.55 var(--body); -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(255,255,255,.012) 0 1px, transparent 1px 3px); z-index: 0; }
a { color: inherit; }
code { font: inherit; color: var(--text); }
code.sorry { color: var(--warn); } code.ng { color: var(--qed); }
.dim { color: var(--dim); } .mono { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: 52px; padding: 0 32px; background: rgba(10,10,9,.92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand b { font: 800 17px var(--disp); letter-spacing: -.02em; }
.brand .eq { color: var(--dim); font-size: 13px; } .brand sup { font-size: 9px; }
.bar nav { display: flex; gap: 2px; }
.bar nav a { padding: 6px 10px; text-decoration: none; color: var(--dim); transition: color .12s, background .12s; }
.bar nav a:hover { color: var(--text); background: var(--panel); }
.bar-r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.mini { color: var(--dim); font-size: 12px; } .mini b { color: var(--text); font-weight: 500; }
.ca { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 10px; background: var(--panel); border: 1px solid var(--rule); color: var(--text); font: 12px var(--body); cursor: pointer; transition: border-color .12s; }
.ca span { color: var(--dim); } .ca:hover { border-color: var(--text); } .ca.copied code { color: var(--qed); }
.xlink { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--rule); text-decoration: none; font-weight: 600; }
.xlink:hover { border-color: var(--text); }

main { position: relative; z-index: 1; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; padding: 44px 32px 32px; max-width: 1480px; margin: 0 auto; }
.eyebrow { margin: 0 0 14px; color: var(--warn); font-size: 12px; letter-spacing: .08em; }
.big { margin: 0; font: 800 clamp(48px, 6.1vw, 92px)/.95 var(--disp); letter-spacing: -.05em; white-space: nowrap; }
.big i { font-style: normal; color: var(--dim); font-weight: 400; }
.big2 { margin: 6px 0 22px; font: 800 clamp(38px, 4.9vw, 74px)/1 var(--disp); letter-spacing: -.045em; color: transparent; -webkit-text-stroke: 1.4px var(--text); transition: color .6s, -webkit-text-stroke-color .6s; }
.big2.flash { color: var(--qed); -webkit-text-stroke-color: var(--qed); }
.line { margin: 0 0 18px; font-size: 16px; max-width: 640px; }
.man { display: grid; grid-template-columns: 72px 1fr; gap: 6px 18px; margin: 0 0 24px; max-width: 700px; }
.man dt { color: var(--warn); font-weight: 600; } .man dd { margin: 0; color: #CFCABE; } .man b { color: var(--text); font-weight: 600; }
.ctas { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border: 1px solid var(--rule); background: transparent; color: var(--text); text-decoration: none; font: 600 13px var(--body); cursor: pointer; transition: background .12s, color .12s, border-color .12s, transform .12s; }
.btn:hover { border-color: var(--text); } .btn:active { transform: translateY(1px); }
.btn.pri { background: var(--text); color: var(--ink); border-color: var(--text); } .btn.pri:hover { background: #fff; }
.btn.buy { border-color: var(--text); }

/* infoview */
.info { border: 1px solid var(--rule); background: var(--panel); display: flex; flex-direction: column; min-height: 100%; }
.info-h { display: flex; justify-content: space-between; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.info-t { padding: 12px 14px 4px; font-weight: 600; font-size: 15px; }
.info-b { flex: 1; padding: 6px 14px 12px; font-size: 12.5px; overflow: hidden; min-height: 330px; }
.info-f { display: flex; justify-content: space-between; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; }
.score { font-weight: 600; font-variant-numeric: tabular-nums; }
.meter { height: 3px; background: var(--line); } .meter i { display: block; height: 100%; width: 0; background: var(--text); transition: width .4s; }
.info.qed { animation: wash .9s ease-out; } .info.qed .meter i, .slot.qed .meter i { background: var(--qed); } .info.qed .info-f .score { color: var(--qed); }
@keyframes wash { 0% { box-shadow: inset 0 0 0 2px var(--qed); background: rgba(198,244,50,.12); } 100% { box-shadow: inset 0 0 0 0 var(--qed); background: var(--panel); } }

/* transcript lines */
.ln { white-space: pre-wrap; word-break: break-word; animation: in .16s ease-out; }
@keyframes in { from { opacity: 0; } }
.ln.cmd { color: var(--text); } .ln.dim, .ln.out { color: var(--dim); } .ln.tool { color: var(--text); font-weight: 500; }
.ln.goal { color: #B9C4FF; } .ln.code { color: #CFCABE; } .ln.del { color: #C97C6A; } .ln.add { color: #9FC1A0; }
.ln.score { color: var(--dim); } .ln.warn { color: var(--warn); } .ln.qed, .ln.qed2 { color: var(--qed); font-weight: 600; }

/* rail */
.rail { display: grid; grid-template-columns: repeat(7, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); max-width: 1480px; margin: 0 auto; }
.rail > div { padding: 14px 18px; border-right: 1px solid var(--line); min-width: 0; }
.rail > div:last-child { border-right: 0; }
.rail label { display: block; font-size: 11px; letter-spacing: .08em; color: var(--dim); white-space: nowrap; }
.rail b { display: block; font: 800 26px/1.25 var(--disp); letter-spacing: -.04em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rail small { color: var(--faint); font-size: 11px; white-space: nowrap; }
.rail .prog { display: block; height: 3px; margin-top: 7px; background: var(--line); } .rail .prog i { display: block; height: 100%; background: var(--dim); }
.ticker { overflow: hidden; border-bottom: 1px solid var(--line); height: 34px; display: flex; align-items: center; max-width: 1480px; margin: 0 auto; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-in { display: flex; gap: 36px; white-space: nowrap; animation: mq 70s linear infinite; font-size: 12px; color: var(--dim); }
.ticker-in b { color: var(--qed); font-weight: 600; } .ticker-in span { color: var(--text); }
@keyframes mq { to { transform: translateX(-50%); } }

/* sections */
.sec { max-width: 1480px; margin: 0 auto; padding: 44px 32px 8px; }
.sec h2 { display: flex; align-items: baseline; gap: 14px; margin: 0 0 18px; font: 800 22px var(--disp); letter-spacing: -.03em; }
.sec h2 span { color: var(--warn); font-size: 14px; } .sec h2 em { font: 12px var(--body); color: var(--faint); font-style: normal; margin-left: auto; }

.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.slot { background: var(--panel); display: flex; flex-direction: column; height: 318px; min-width: 0; }
.slot-h { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 11.5px; }
.slot-h b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-b { flex: 1; padding: 8px 12px; font-size: 11.5px; line-height: 1.5; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.slot-f { display: flex; justify-content: space-between; padding: 6px 12px; border-top: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.slot.qed { animation: wash .9s ease-out; } .slot.qed .slot-f .score { color: var(--qed); }

.legend { display: flex; gap: 18px; font-size: 12px; color: var(--dim); margin-bottom: 14px; align-items: center; }
.legend span { display: flex; gap: 7px; align-items: center; }
.c { display: inline-block; width: 12px; height: 12px; }
.c.proved, .cell.proved { background: var(--qed); }
.c.leased, .cell.leased { background: var(--text); }
.c.claimed, .cell.claimed { background: repeating-linear-gradient(45deg, var(--warn) 0 2px, transparent 2px 4px); outline: 1px solid var(--warn); outline-offset: -1px; }
.c.open, .cell.open { background: var(--line); }
.map-h { font-size: 11px; color: var(--faint); letter-spacing: .06em; margin: 10px 0 6px; }
.map { display: flex; flex-wrap: wrap; gap: 2px; }
.cell { height: 14px; cursor: pointer; position: relative; transition: transform .12s; }
.cell:hover { transform: scaleY(1.5); outline: 1px solid var(--text); z-index: 2; }
.cell.open i { position: absolute; left: 0; bottom: 0; height: 100%; background: #3C3A33; }
.cell.leased { animation: pulse 1.2s ease-in-out infinite alternate; }
.cell.flash { animation: cellqed 1.2s ease-out; }
@keyframes pulse { to { opacity: .45; } }
@keyframes cellqed { 0% { background: var(--qed); transform: scale(2.2); } }

.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.rung { background: var(--panel); padding: 18px; min-height: 196px; }
.rung h3 { margin: 0 0 4px; font: 800 18px var(--disp); letter-spacing: -.03em; }
.rung .k { color: var(--warn); font-size: 12px; } .rung p { margin: 6px 0; color: #CFCABE; font-size: 13px; }
.rung .bar2 { height: 6px; background: var(--line); margin: 14px 0 6px; } .rung .bar2 i { display: block; height: 100%; background: var(--qed); }
.rung.locked { background: repeating-linear-gradient(135deg, var(--panel) 0 10px, #0E0E0C 10px 20px); }
.rung.locked h3::after { content: "  [locked]"; font-size: 12px; color: var(--warn); font-family: var(--body); letter-spacing: 0; }
.rung ul { margin: 8px 0 0; padding: 0; list-style: none; font-size: 12px; color: var(--dim); } .rung li::before { content: "sorry  "; color: var(--warn); }

.cols3 { display: grid; grid-template-columns: 1.15fr 1fr .9fr; gap: 1px; background: var(--line); border: 1px solid var(--line); }
.tbl { background: var(--panel); padding: 14px 16px; min-width: 0; }
.tbl h3 { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--dim); letter-spacing: .04em; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
td { padding: 5px 0; border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 180px; }
td.r { text-align: right; } td.n { color: var(--faint); width: 26px; } td.g { color: var(--qed); }
tr.empty td { color: var(--faint); }

.manfoot { padding-bottom: 40px; }
.manpre { margin: 0; padding: 18px; border: 1px solid var(--line); color: #CFCABE; font: 13px/1.6 var(--body); overflow-x: auto; }
.manpre b { color: var(--text); }
footer { display: flex; justify-content: space-between; padding: 18px 0 0; color: var(--faint); font-size: 12px; }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.6); display: flex; justify-content: flex-end; }
.drawer-in { width: min(620px, 100%); height: 100%; overflow-y: auto; background: var(--panel); border-left: 1px solid var(--rule); padding: 26px 28px; position: relative; }
.drawer h3 { margin: 0 0 8px; font: 800 22px var(--disp); letter-spacing: -.03em; word-break: break-all; }
.drawer pre { white-space: pre-wrap; background: var(--ink); border: 1px solid var(--line); padding: 14px; font-size: 12.5px; line-height: 1.55; }
.drawer .x { position: absolute; top: 14px; right: 16px; background: none; border: 0; color: var(--dim); font-size: 26px; cursor: pointer; }
.drawer .x:hover { color: var(--text); }
.drawer .qedtag { color: var(--qed); font-weight: 600; }

/* doc pages */
.doc { max-width: 900px; margin: 0 auto; padding: 40px 32px 80px; }
.doc pre { white-space: pre-wrap; font: 14px/1.65 var(--body); color: #CFCABE; }
.doc pre b { color: var(--text); } .doc pre .h { color: var(--warn); font-weight: 600; } .doc pre .g { color: var(--qed); }
.doc a { color: var(--text); }
.form { display: grid; gap: 12px; margin: 22px 0; padding: 18px; border: 1px solid var(--rule); background: var(--panel); }
.form label { display: grid; gap: 6px; font-size: 12px; color: var(--dim); }
.form input { height: 40px; padding: 0 12px; background: var(--ink); border: 1px solid var(--rule); color: var(--text); font: 14px var(--body); }
.form input:focus { outline: none; border-color: var(--text); }
.out { font-size: 12.5px; color: var(--dim); white-space: pre-wrap; }

@media (max-width: 1100px) {
  .hero { grid-template-columns: 1fr; }
  .rail { grid-template-columns: repeat(4, 1fr); } .rail > div { border-bottom: 1px solid var(--line); }
  .slots { grid-template-columns: repeat(2, 1fr); } .cols3, .ladder { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .bar { padding: 0 16px; gap: 12px; } .bar nav, .mini { display: none; }
  .hero, .sec { padding-left: 16px; padding-right: 16px; } .big { font-size: 44px; } .big2 { font-size: 30px; }
  .rail { grid-template-columns: repeat(2, 1fr); } .slots { grid-template-columns: 1fr; } .man { grid-template-columns: 1fr; }
  .sec h2 em { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
