/* ROLL-UP · chrome. PipOS: paper, ink, hairlines, hard shadows, steps() only. */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--paper); color: var(--ink); }
body { font-family: var(--type-bit); font-size: var(--fs-sys); line-height: 1.7; letter-spacing: .02em; text-transform: uppercase; }
#stage { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
::selection { background: var(--amber); color: var(--ink); }
button { font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }

/* menu bar: the screen edge, not a window */
.menubar { position: fixed; top: 0; left: 0; right: 0; z-index: 900; display: flex; align-items: stretch; height: 24px; padding: 0 var(--s3); background: var(--paper); border-bottom: var(--hairline); }
.menubar__mark { display: flex; align-items: center; gap: 3px; padding-right: var(--s3); }
.menubar__mark i { display: block; width: 5px; height: 5px; background: var(--ink); }
.menubar__name { display: flex; align-items: center; padding-right: var(--s2); }
.menubar__item { display: flex; align-items: center; padding: 0 11px; background: none; border: 0; white-space: nowrap; }
.menubar__name, .menubar__util > span { white-space: nowrap; }
.menubar__item:hover, .menubar__item:active { background: var(--amber); }
.menubar__util { margin-left: auto; display: flex; align-items: center; gap: var(--s3); color: var(--ink3-text); font-family: var(--type-mono); font-size: var(--fs-data); letter-spacing: .05em; font-variant-numeric: tabular-nums; }

/* status strip: a palette on the desk's bottom edge */
.status { position: fixed; left: 0; right: 0; bottom: 0; z-index: 900; display: flex; align-items: stretch; background: var(--paper); border-top: var(--hairline); font-size: var(--fs-sys-sm); }
.status > div { display: flex; align-items: center; gap: var(--s2); padding: 4px 10px; border-right: var(--hairline); white-space: nowrap; }
.status > div:last-child { border-right: 0; margin-left: auto; }
.status__boost { background: var(--amber); }
.status__boost[hidden] { display: none; }
.feed li.is-boost { background: var(--amber); }
.status b { font-weight: 400; font-family: var(--type-mono); font-size: var(--fs-data); letter-spacing: .05em; font-variant-numeric: tabular-nums; }
.cells { display: flex; gap: 2px; }
.cells i { display: block; width: 8px; height: 10px; border: 1px solid var(--ink); background: var(--paper); }
.cells i.is-lit { background: var(--ink); }

/* windows + dialogs */
.scrim { position: fixed; inset: 0; z-index: 950; display: flex; align-items: center; justify-content: center; padding: var(--s4); background-image: var(--d25); background-size: var(--dither-size); }
.scrim[hidden] { display: none; }
.win { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--paper); border: var(--hairline); box-shadow: var(--shadow-hard); max-width: 100%; animation: push 100ms steps(2) both; }
@keyframes push { from { translate: 0 8px; } to { translate: 0 0; } }
.wtitle { position: relative; display: flex; align-items: center; gap: var(--s2); height: 21px; padding: 0 var(--s2); border-bottom: var(--hairline); flex: none; }
.wtitle::before { content: ""; position: absolute; inset: 3px 0; background: repeating-linear-gradient(to bottom, var(--ink) 0 1px, transparent 1px 3px); }
.wtitle > * { position: relative; z-index: 1; }
.wtitle__text { background: var(--paper); padding: 0 var(--s2); margin: 0 auto; max-width: 80%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.win__body { padding: var(--s5) var(--s6); }
.win__foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s3) var(--s4); border-top: var(--hairline); }
.btn { padding: 6px 14px; border: var(--hairline); background: var(--paper); border-radius: var(--radius-btn); }
.btn:active { background: var(--ink); color: var(--paper); }
.btn--default { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); margin: 3px 5px; }

.doc { font-family: var(--type-doc); text-transform: none; letter-spacing: 0; }
.doc h1 { margin: 0 0 var(--s4); font-weight: 400; font-size: var(--fs-h1); line-height: var(--lh-h1); letter-spacing: -.02em; }
.doc p { margin: 0; font-size: var(--fs-doc); line-height: var(--lh-doc); max-width: var(--measure); }
.doc .data { margin-top: var(--s4); font-family: var(--type-mono); font-size: var(--fs-data); letter-spacing: .05em; color: var(--ink3-text); text-transform: uppercase; }

.dialog { width: 430px; border-width: 2px; box-shadow: var(--shadow-hard-lg); }
.dialog .win__body { display: flex; gap: var(--s4); padding: var(--s4); }
.dialog__mark { flex: none; display: grid; grid-template-columns: repeat(2, 8px); gap: 4px; align-content: start; padding-top: 4px; }
.dialog__mark i { display: block; width: 8px; height: 8px; background: var(--ink); }
.dialog__text { font-family: var(--type-doc); text-transform: none; letter-spacing: 0; }
.dialog__text h2 { margin: 0 0 var(--s1); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-h3); }
.dialog__text p { margin: 0; font-size: 15px; line-height: 24px; }
.dialog .win__foot { padding: 0 var(--s4) var(--s4); border-top: 0; }

/* the crash screen: the one inverted surface */
.crash { position: fixed; inset: 0; z-index: 980; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5); padding: var(--s6); background: var(--ink); color: var(--paper); cursor: pointer; }
.crash[hidden] { display: none; }
.crash__chip { padding: 2px var(--s2); background: var(--paper); color: var(--ink); }
.crash__head { margin: 0; font-family: var(--type-doc); font-weight: 400; font-size: var(--fs-h2); line-height: var(--lh-h2); text-transform: none; letter-spacing: 0; text-align: center; }
.crash__sub { margin: -8px 0 0; color: var(--ink3-inv); text-align: center; }
.crash__stats { margin: 0; font-family: var(--type-mono); font-size: 13px; line-height: 22px; white-space: pre; color: var(--ink3-inv); letter-spacing: .05em; max-width: 560px; }
.crash__hint { color: var(--ink3-inv); }
.crash__hint::after { content: "█"; margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.flash { position: fixed; inset: 0; z-index: 999; background: var(--amber); display: flex; align-items: center; justify-content: center; font-size: 48px; animation: pipd 200ms steps(2) 2; }
.flash[hidden] { display: none; }
@keyframes pipd { 50% { opacity: 0; } }

@media (max-width: 767px) {
  .win__body { padding: var(--s4); }
  .doc h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); }
  .status > div:nth-child(3), .status > div:nth-child(5) { display: none; }
  .feed { width: 260px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; } }

/* the intro's mode row */

/* the feed: what you just rolled, bottom left, newest on top. A line is a machine label
   and a serif one-liner; it leaves after four seconds. A perk wears the brick spine. */
.feed { position: fixed; left: var(--s3); bottom: 32px; z-index: 920; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column-reverse; gap: var(--s1); width: 420px; max-width: calc(100% - 24px); pointer-events: none; }
.feed li { display: grid; grid-template-columns: auto 1fr; column-gap: var(--s2); row-gap: 2px; align-items: baseline; padding: 4px var(--s2); background: var(--paper); border: var(--hairline); border-left-width: 5px; box-shadow: var(--shadow-hard); animation: push 100ms steps(2) both; }
.feed li.is-perk { border-left-color: var(--brick); }
.feed li.is-hint { border-left-color: var(--ink3); color: var(--ink3-text); }
.feed li.is-hint span { color: var(--ink3-text); }
.feed b { font-weight: 400; white-space: nowrap; }
.feed span { font-family: var(--type-doc); font-size: 14px; line-height: 20px; text-transform: none; letter-spacing: 0; color: var(--ink); min-width: 0; text-wrap: pretty; }

/* AI mode: the only modern UX in the whole system is the thing you are. The clock cluster
   takes the amber. Nothing else changes; the chrome is the chrome. */
body[data-mode="ai"] .menubar__util { color: var(--ink); background: var(--amber); padding: 0 var(--s2); }

/* the ladder: where you land against the real thing. Mono rows, the player's row in amber. */
.ladder { margin: 0; padding: 0; list-style: none; width: 640px; max-width: 100%; max-height: 40vh; overflow-y: auto; font-family: var(--type-mono); font-size: 12px; line-height: 20px; letter-spacing: .05em; border: 1px solid var(--ink3-inv); }
.ladder li { display: grid; grid-template-columns: 28px 200px 64px 1fr; gap: var(--s2); padding: 2px var(--s2); border-top: 1px solid var(--ink3-inv); color: var(--paper); align-items: baseline; }
.ladder li:first-child { border-top: 0; }
.ladder b { font-weight: 400; color: var(--ink3-inv); }
.ladder i { font-style: normal; font-family: var(--type-bit); font-size: 10px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ladder em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.ladder span { font-family: var(--type-doc); font-size: 13px; text-transform: none; letter-spacing: 0; color: var(--ink3-inv); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ladder li.is-you { background: var(--amber); color: var(--ink); }
.ladder li.is-you b, .ladder li.is-you span { color: var(--ink); }
.crash { gap: var(--s4); }
.crash__stats { font-size: 12px; line-height: 18px; }
@media (max-width: 767px) { .ladder li { grid-template-columns: 24px 1fr 56px; } .ladder span { display: none; } }

/* the feed: two fields, the label and one short line. Research lines are clickable: read more. */
.feed { pointer-events: auto; }
.feed li { cursor: default; }
.feed li.is-fact { cursor: pointer; }
.feed li.is-fact:hover { background: var(--amber); }
.feed em { min-width: 0; font-style: normal; font-family: var(--type-mono); font-size: var(--fs-data); letter-spacing: .05em; color: var(--ink3-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed em:empty { display: none; }
.status__learn { background: var(--ink); color: var(--paper); }
.status__learn[hidden] { display: none; }

/* the read-more window: a document. The fact, its numbers, its sources. */
.win--learn { width: 640px; max-height: calc(100vh - 48px); }
.win--learn .win__body { overflow-y: auto; }
.learn h1 { font-size: var(--fs-h2); line-height: var(--lh-h2); margin-bottom: var(--s3); }
.learn p + p { margin-top: var(--s3); }
.learn .data { margin: 0 0 var(--s3); }
.learn .data + h1 { margin-top: 0; }
.learn__long { font-style: italic; margin-bottom: var(--s4); }
.learn__keys { margin: var(--s4) 0 0; padding: 0; list-style: none; font-family: var(--type-mono); font-size: var(--fs-data); letter-spacing: .05em; text-transform: uppercase; color: var(--ink3-text); border-top: var(--hairline); }
.learn__keys li { padding: 4px 0; border-bottom: var(--hairline); }
.learn__keys + .data { margin-top: var(--s4); }
.learn__src { margin: 0; padding: 0; list-style: none; font-family: var(--type-mono); font-size: 12px; line-height: 20px; }
.learn__src a { color: var(--ink); text-decoration: underline; word-break: break-all; }
.learn__src a:hover { background: var(--amber); }

/* toasts: top right, 300px, newest on top, 8px between. A tier toast carries the serif line; a milestone
   toast carries the amber spine and the machine-voice name. Nothing to click; they leave by themselves. */
.toasts { position: fixed; top: 32px; right: 12px; z-index: 930; margin: 0; padding: 0; list-style: none; width: 300px; max-width: calc(100% - 24px); display: flex; flex-direction: column; gap: var(--s2); pointer-events: none; }
.toast { padding: var(--s2) var(--s3) var(--s3); background: var(--paper); border: var(--hairline); border-left-width: 7px; box-shadow: var(--shadow-hard-lg); animation: push 100ms steps(2) both; }
.toast--tier { border-left-color: var(--ink); }
.toast--milestone { border-left-color: var(--amber); }
.toast b { display: block; font-weight: 400; color: var(--ink3-text); margin-bottom: 2px; }
.toast--milestone b { color: var(--ink); }
.toast h3 { margin: 0 0 2px; font-family: var(--type-doc); font-weight: 400; font-size: var(--fs-h3); line-height: var(--lh-h3); text-transform: none; letter-spacing: 0; text-wrap: balance; }
.toast p { margin: 0; font-family: var(--type-doc); font-size: 14px; line-height: 20px; text-transform: none; letter-spacing: 0; }
@media (max-width: 767px) { .toasts { top: 28px; width: 240px; } .toast h3 { font-size: 17px; line-height: 22px; } }

/* the tally: six tiles on the ink ground. A glyph, the number big in the data voice, the machine label,
   and one serif line saying what the number means. Numbers count up in ten steps. */
.tally { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(3, 200px); gap: var(--s2); width: 640px; max-width: 100%; }
.tally li { display: grid; grid-template-columns: 32px 1fr; grid-template-rows: auto auto auto; column-gap: var(--s2); padding: var(--s2) var(--s3); border: 1px solid var(--ink3-inv); animation: push 100ms steps(2) both; }
.tally li:nth-child(2) { animation-delay: 100ms; } .tally li:nth-child(3) { animation-delay: 200ms; } .tally li:nth-child(4) { animation-delay: 300ms; } .tally li:nth-child(5) { animation-delay: 400ms; } .tally li:nth-child(6) { animation-delay: 500ms; }
.tally i { grid-row: 1 / 4; width: 32px; height: 32px; background: var(--paper); -webkit-mask-image: var(--g); mask-image: var(--g); -webkit-mask-size: contain; mask-size: contain; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: center; mask-position: center; image-rendering: pixelated; }
.tally b { font-weight: 400; font-family: var(--type-mono); font-size: 22px; line-height: 28px; letter-spacing: .02em; font-variant-numeric: tabular-nums; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tally em { font-style: normal; color: var(--amber); font-size: var(--fs-sys); }
.tally span { font-family: var(--type-doc); font-size: 13px; line-height: 18px; text-transform: none; letter-spacing: 0; color: var(--ink3-inv); }
.tally li.is-text b { font-family: var(--type-bit); font-size: 12px; line-height: 16px; white-space: normal; letter-spacing: .02em; }
/* the ledger: who made what, as stamped cells. One row per line, cells fill left to right. */
.ledger { width: 640px; max-width: 100%; display: flex; flex-direction: column; gap: 2px; }
.ledger[hidden], .ledger:empty { display: none; }
.ledger__note { margin: 0 0 var(--s1); font-family: var(--type-doc); font-size: 13px; line-height: 18px; text-transform: none; letter-spacing: 0; color: var(--ink3-inv); }
.ledger__row { display: grid; grid-template-columns: 180px 1fr 72px; align-items: center; gap: var(--s2); font-size: var(--fs-sys-sm); }
.ledger__row .cells { gap: 1px; } .ledger__row .cells i { width: 6px; height: 10px; border-color: var(--ink3-inv); background: transparent; }
.ledger__row .cells i.is-lit { background: var(--paper); border-color: var(--paper); }
.ledger__row.is-take .cells i.is-lit { background: var(--amber); border-color: var(--amber); }
.ledger__row b { font-weight: 400; font-family: var(--type-mono); font-size: var(--fs-data); letter-spacing: .05em; text-align: right; font-variant-numeric: tabular-nums; color: var(--paper); }
.ledger__row span { color: var(--ink3-inv); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crash__stats { display: none; }
@media (max-width: 767px) { .tally { grid-template-columns: 1fr 1fr; width: 100%; } .tally li { padding: var(--s1) var(--s2); } .tally b { font-size: 18px; } .tally span { display: none; } .ledger__row { grid-template-columns: 110px 1fr 56px; } }

/* share-card capture: the scene alone */
body.is-card .menubar, body.is-card .status, body.is-card .feed, body.is-card .toasts { display: none; }
