@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url("assets/fonts/archivo-latin.woff2") format("woff2");
}
@font-face {
  font-family: "VT323";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/vt323-400-latin.woff2") format("woff2");
}

:root {
  --void: #050a07;
  --glass: #09120d;
  --glass-2: #0e1a13;
  --line: #1d3326;
  --plastic: #e7e0cc;
  --plastic-hi: #f7f2e4;
  --plastic-lo: #a69e88;
  --ink: #f1ecdf;
  --dim: #a3b8a9;
  --cash: #6dff9a;
  --cash-ink: #062611;
  --pink: #ff5ad1;
  --orange: #ff8c2a;
  --blue: #6b95ff;
  --wall: #148a33;
  --display: "Archivo", system-ui, sans-serif;
  --term: "VT323", ui-monospace, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scrollbar-color: var(--wall) var(--void); }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--display);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--cash); color: var(--cash-ink); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--wall); border: 3px solid var(--void); border-radius: 8px; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--cash); outline-offset: 3px; border-radius: 4px; }
h1, h2, p { margin: 0; text-wrap: balance; }
p { text-wrap: pretty; }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--cash); color: var(--cash-ink); padding: .6rem 1rem; border-radius: 8px; font-weight: 700; }
.skip:focus { top: 1rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 44px; padding: 0 1.15rem;
  border-radius: 10px; border: 1px solid transparent;
  font: 700 .95rem/1 var(--display); font-stretch: 112%; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: transform .2s var(--ease-out), background-color .2s, box-shadow .2s, border-color .2s;
}
.btn-cash { background: var(--cash); color: var(--cash-ink); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .7); }
.btn-cash:hover { background: #8dffb1; transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .8); }
.btn-cash:active { transform: translateY(1px); }
.btn-ghost { background: rgba(5, 10, 7, .55); color: var(--ink); border-color: rgba(241, 236, 223, .28); backdrop-filter: blur(6px); }
.btn-ghost:hover { border-color: var(--ink); background: rgba(5, 10, 7, .8); }
.btn-lg { min-height: 54px; padding: 0 1.6rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn:disabled { cursor: not-allowed; background: var(--glass-2); color: var(--dim); box-shadow: none; border-color: var(--line); transform: none; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

.ca-chip {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 44px; padding: 0 .9rem 0 .4rem;
  background: rgba(5, 10, 7, .7); color: var(--ink);
  border: 1px solid rgba(241, 236, 223, .22); border-radius: 10px;
  font: 400 1.2rem/1 var(--term); cursor: pointer;
  transition: border-color .2s;
}
.ca-chip:hover { border-color: var(--cash); }
.ca-label { background: var(--plastic); color: #1b1a14; padding: .3rem .45rem; border-radius: 6px; font: 800 .72rem/1 var(--display); letter-spacing: .06em; }
.ca-val { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-chip.is-empty { cursor: default; }
.ca-chip.is-empty .ca-val { color: var(--dim); }

/* ---------- cover: the desk ---------- */
.cover { position: relative; height: 520vh; background: #000; }
.cover-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.stage {
  position: absolute; left: 0; top: 0;
  width: 1024px; height: 577px;
  transform-origin: 0 0;
}
.stage img { width: 1024px; height: 577px; max-width: none; user-select: none; -webkit-user-drag: none; }
.room {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 45%, rgba(0, 0, 0, .55) 100%),
    linear-gradient(to top, rgba(3, 6, 4, .92) 0%, rgba(3, 6, 4, .55) 26%, transparent 52%);
}

.screen {
  position: absolute; left: 0; top: 0;
  container-type: size;
  background: radial-gradient(90% 80% at 50% 45%, #0e2116 0%, #050b07 70%);
  border-radius: 7% / 9%;
  overflow: hidden;
  opacity: 0;
  box-shadow: inset 0 0 1.5cqw rgba(0, 0, 0, .9);
}
.screen::before {
  /* scanlines */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: repeating-linear-gradient(to bottom, rgba(0, 0, 0, .28) 0 1px, transparent 1px 3px);
}
.screen::after {
  /* glass glare */
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(60% 40% at 30% 18%, rgba(255, 255, 255, .09), transparent 70%);
}
.screen-in {
  position: absolute; inset: 0;
  display: grid; place-content: center; justify-items: center; gap: 4cqh;
  color: var(--cash);
  text-shadow: 0 0 .8cqw rgba(109, 255, 154, .55);
}
.boot-logo { display: flex; align-items: center; gap: 2.4cqw; }
.boot-logo img { width: min(11cqw, 16cqh); height: auto; filter: drop-shadow(0 0 1cqw rgba(109, 255, 154, .4)); }
.boot-logo span { font: 900 min(8.5cqw, 13cqh)/1 var(--display); font-stretch: 125%; letter-spacing: -.02em; color: var(--ink); text-shadow: 0 0 1.4cqw rgba(241, 236, 223, .35); }
.boot-lines { list-style: none; margin: 0; padding: 0; font: 400 min(3.6cqw, 5.4cqh)/1.25 var(--term); min-width: min(52cqw, 78cqh); }
.boot-lines li { opacity: 0; transition: opacity .12s; white-space: pre; }
.boot-lines li.on { opacity: 1; }
.boot-go { color: var(--ink); }
.caret { display: inline-block; width: .55em; height: .9em; margin-left: .2em; vertical-align: -.1em; background: currentColor; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.topbar {
  position: absolute; z-index: 5; left: 0; right: 0; top: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(.9rem, 2vw, 1.5rem) clamp(1rem, 3vw, 2.5rem);
}
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.brand img { border-radius: 8px; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
.brand span { font: 900 1.25rem/1 var(--display); font-stretch: 118%; letter-spacing: -.01em; color: #08130c; }
.brand b { font: 400 1.35rem/1 var(--term); color: #08130c; background: rgba(241, 236, 223, .7); padding: .1rem .4rem; border-radius: 5px; }
.topbar-act { display: flex; gap: .6rem; }

.cover-copy {
  position: absolute; z-index: 4;
  left: clamp(1rem, 3vw, 2.5rem); bottom: clamp(1.5rem, 6vh, 4rem);
  max-width: min(46rem, calc(100% - 2rem));
}
.cover-copy h1 {
  font: 900 clamp(2.4rem, 5.6vw, 5.4rem)/.94 var(--display);
  font-stretch: 118%; letter-spacing: -.035em;
  color: var(--ink);
  text-shadow: 0 2px 30px rgba(0, 0, 0, .65);
}
.cover-copy p { margin-top: 1.1rem; max-width: 40rem; font-size: clamp(1rem, 1.3vw, 1.18rem); color: #e2ddcf; text-shadow: 0 1px 14px rgba(0, 0, 0, .8); }
.cover-copy p b { color: var(--cash); font-weight: 700; }
.cover-cta { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem; margin-top: 1.6rem; }

.scroll-cue {
  position: absolute; z-index: 4; right: clamp(1rem, 3vw, 2.5rem); bottom: clamp(1.5rem, 6vh, 4rem);
  display: flex; align-items: center; gap: .7rem;
  font: 400 1.3rem/1 var(--term); color: var(--plastic);
}
.scroll-cue .wheel { animation: wheel 1.8s var(--ease-out) infinite; }
@keyframes wheel { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(7px); opacity: 0; } 100% { opacity: 0; } }

/* ---------- on the computer ---------- */
.desktop {
  position: relative;
  padding: clamp(2rem, 6vh, 4rem) clamp(.75rem, 3vw, 2.5rem) 7rem;
  display: grid; gap: clamp(1.25rem, 3vw, 2.25rem);
  max-width: 1320px; margin: 0 auto;
}
body::after {
  /* the whole desktop sits behind CRT glass */
  content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, .16) 0 1px, transparent 1px 3px),
    radial-gradient(130% 100% at 50% 50%, transparent 60%, rgba(0, 0, 0, .55) 100%);
  opacity: var(--glass-on, 0);
  transition: opacity .3s;
}

.win {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(0, 0, 0, .6);
  overflow: hidden;
  scroll-margin-top: 1.5rem;
}
.win-bar {
  display: flex; align-items: center; gap: .55rem;
  padding: .55rem .6rem .55rem .9rem;
  background: linear-gradient(to bottom, var(--plastic-hi), var(--plastic));
  color: #22201a;
  border-bottom: 1px solid var(--plastic-lo);
  font: 400 1.25rem/1 var(--term); letter-spacing: .04em;
}
.win-bar img { border-radius: 3px; }
.win-ctl { margin-left: auto; display: flex; gap: .3rem; }
.win-ctl s {
  width: 1.15rem; height: 1.05rem; border-radius: 4px;
  background: var(--plastic-hi);
  border: 1px solid var(--plastic-lo);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
  position: relative;
}
.win-ctl s::after { content: ""; position: absolute; left: 25%; right: 25%; bottom: 28%; height: 2px; background: #3a372d; }
.win-ctl s:nth-child(2)::after { top: 26%; bottom: 26%; height: auto; background: none; border: 2px solid #3a372d; border-top-width: 3px; }
.win-ctl s:nth-child(3)::after { left: 50%; right: auto; top: 18%; bottom: 18%; width: 2px; height: auto; transform: rotate(45deg); box-shadow: 0 0 0 0 #3a372d; }
.win-ctl s:nth-child(3)::before { content: ""; position: absolute; left: 50%; top: 18%; bottom: 18%; width: 2px; background: #3a372d; transform: rotate(-45deg); }
.win-body { padding: clamp(1.25rem, 3vw, 2.5rem); }

.win h2 {
  font: 900 clamp(1.7rem, 3.2vw, 2.9rem)/1 var(--display);
  font-stretch: 115%; letter-spacing: -.03em;
}
.sub { margin-top: .75rem; color: var(--dim); max-width: 60ch; }
.fine { margin-top: 1rem; font-size: .85rem; color: var(--dim); }

/* desk.exe */
.desk-body { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.desk-copy h2 { font-size: clamp(2rem, 4.4vw, 4rem); line-height: .95; }
.desk-copy p { margin-top: 1.1rem; color: #d6d9cd; max-width: 58ch; }
.desk-copy p + p { color: var(--ink); }
.versus { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.vs-panel { background: #050b07; border: 1px solid var(--line); border-radius: 10px; padding: .9rem .9rem .6rem; }
.vs-panel figcaption { font: 400 1.25rem/1 var(--term); margin-bottom: .6rem; }
.vs-bad figcaption { color: var(--pink); }
.vs-good figcaption { color: var(--cash); }
.vs-panel svg { width: 100%; height: clamp(110px, 14vw, 170px); }
.vs-note { grid-column: 1 / -1; font-size: .8rem; color: var(--dim); }

/* rows */
.row { display: grid; gap: clamp(1.25rem, 3vw, 2.25rem); align-items: start; }
.row-a { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
.row-b { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }

/* ticket */
.ticket { display: grid; gap: 1rem; }
.ticket .sub { margin-top: -.4rem; }
.field { display: grid; gap: .4rem; }
.field > span { font: 400 1.15rem/1 var(--term); color: var(--dim); letter-spacing: .03em; }
.field input {
  width: 100%; min-height: 48px; padding: .7rem .85rem;
  background: #040906; color: var(--ink); caret-color: var(--cash);
  border: 1px solid var(--line); border-radius: 9px;
  font: 400 1.45rem/1 var(--term);
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: #6f8a78; }
.field input:hover { border-color: #2c4a37; }
.field input:focus { outline: none; border-color: var(--cash); box-shadow: 0 0 0 3px rgba(109, 255, 154, .18); }
.field input[aria-invalid="true"] { border-color: var(--pink); }
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.field-err { min-height: 1.2em; margin-top: -.5rem; font-size: .88rem; color: var(--pink); }
.receipt {
  margin: 0; padding: 1rem 1.1rem;
  background: var(--plastic); color: #1f1d17;
  border-radius: 10px;
  font: 400 1.35rem/1.15 var(--term);
  background-image: repeating-linear-gradient(to bottom, transparent 0 27px, rgba(0, 0, 0, .06) 27px 28px);
}
.receipt div { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; }
.receipt dt { color: #4b473b; }
.receipt dd { margin: 0; font-variant-numeric: tabular-nums; text-align: right; }
.r-total { border-top: 2px dashed #8f8874; margin-top: .3rem; padding-top: .5rem !important; font-size: 1.7rem; }
.r-total dt { color: #1f1d17; }
.r-burn { font-size: 1.1rem; }
.r-burn dd { color: #953a05; }

/* book */
.book-scroll { margin-top: 1.2rem; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.book { width: 100%; border-collapse: collapse; font: 400 1.3rem/1.2 var(--term); font-variant-numeric: tabular-nums; }
.book th { text-align: left; padding: .7rem .9rem; color: var(--dim); font-weight: 400; background: var(--glass-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.book-empty td { padding: clamp(2.5rem, 7vw, 5rem) 1.5rem; text-align: center; color: var(--dim); font-family: var(--display); font-size: 1rem; }
.book-empty svg { margin: 0 auto .9rem; color: var(--wall); }
.book-empty strong { display: block; color: var(--ink); font-size: 1.15rem; margin-bottom: .35rem; }
.book-empty span { display: block; max-width: 36ch; margin: 0 auto; }

/* settle */
.settle-body { display: grid; gap: 1.8rem; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: s; padding: 1.3rem 1.4rem 0 0; display: grid; gap: .45rem; align-content: start; }
.steps li + li { padding-left: 1.4rem; border-left: 1px solid var(--line); }
.steps li::before { content: counter(s); font: 400 2.2rem/1 var(--term); color: var(--cash); }
.steps b { font: 800 1.25rem/1.15 var(--display); font-stretch: 110%; }
.steps span { color: var(--dim); }
.tx { margin: 0; background: #040906; border: 1px solid var(--line); border-radius: 12px; padding: clamp(.75rem, 2vw, 1.5rem); }
.tx svg { width: 100%; height: auto; overflow: visible; }
.tx text { font: 400 22px var(--term); fill: var(--ink); text-anchor: middle; letter-spacing: .04em; }
.tx .tx-sm { font-size: 18px; fill: var(--dim); }
.tx .tx-title { font-size: 30px; fill: var(--cash); }
.tx .tx-orange { fill: var(--orange); text-anchor: start; }
.tx-party rect { fill: var(--glass-2); stroke: var(--line); stroke-width: 1.5; }
.tx-box { fill: rgba(109, 255, 154, .06); stroke: var(--cash); stroke-width: 2; stroke-dasharray: 6 6; }
.tx path { fill: none; stroke-width: 3; }
.tx .tx-g { stroke: var(--cash); }
.tx .tx-p { stroke: var(--pink); }
.tx .tx-o { stroke: var(--orange); stroke-dasharray: 3 4; }

/* burn */
.burned { margin-top: 1.6rem; display: flex; align-items: baseline; flex-wrap: wrap; gap: .4rem 1rem; padding: 1.2rem 1.3rem; background: #040906; border: 1px solid var(--line); border-radius: 12px; }
.burned-n { font: 400 clamp(3.2rem, 7vw, 5.5rem)/.85 var(--term); color: var(--orange); text-shadow: 0 0 22px rgba(255, 140, 42, .35); font-variant-numeric: tabular-nums; }
.burned-l { color: var(--dim); max-width: 30ch; }
.stats { margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.stats div { padding: .9rem 1rem; }
.stats div + div { border-left: 1px solid var(--line); }
.stats dt { font-size: .82rem; color: var(--dim); }
.stats dd { margin: .2rem 0 0; font: 400 1.6rem/1 var(--term); font-variant-numeric: tabular-nums; }

/* readme */
.readme { display: grid; gap: 0; }
.readme h2 { margin-bottom: 1rem; }
.readme details { border-top: 1px solid var(--line); }
.readme details:last-child { border-bottom: 1px solid var(--line); }
.readme summary {
  list-style: none; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 0; font-weight: 700; font-size: 1.05rem;
}
.readme summary::-webkit-details-marker { display: none; }
.readme summary::after { content: "+"; font: 400 1.7rem/1 var(--term); color: var(--cash); transition: transform .25s var(--ease-out); }
.readme details[open] summary::after { transform: rotate(45deg); }
.readme summary:hover { color: var(--cash); }
.readme details p { padding: 0 0 1.1rem; color: var(--dim); max-width: 62ch; }

/* footer */
.foot { display: grid; gap: 1.4rem; }
.foot-big { font: 900 clamp(2.2rem, 6vw, 5rem)/.92 var(--display); font-stretch: 120%; letter-spacing: -.035em; }
.foot-act { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.ca-chip-lg { min-height: 48px; font-size: 1.35rem; }

/* taskbar */
.taskbar {
  position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: .5rem;
  padding: .35rem .5rem calc(.35rem + env(safe-area-inset-bottom));
  background: linear-gradient(to bottom, var(--plastic-hi), var(--plastic));
  border-top: 1px solid var(--plastic-lo);
  color: #22201a;
  transform: translateY(110%);
  transition: transform .45s var(--ease-out);
}
.taskbar.on { transform: none; }
.taskbar a { text-decoration: none; }
.start {
  display: flex; align-items: center; gap: .45rem; min-height: 36px; padding: 0 .8rem 0 .45rem;
  background: #07110b; color: var(--cash); border-radius: 8px;
  font: 900 .9rem/1 var(--display); font-stretch: 118%; letter-spacing: .02em;
}
.start img { border-radius: 4px; }
.tasks { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; }
.tasks a {
  display: flex; align-items: center; min-height: 36px; padding: 0 .85rem;
  border: 1px solid var(--plastic-lo); border-radius: 8px; background: var(--plastic-hi);
  font: 400 1.2rem/1 var(--term); white-space: nowrap;
  transition: background-color .15s;
}
.tasks a:hover { background: #fff; }
.tasks a.cur { background: #07110b; color: var(--cash); border-color: #07110b; }
.clock { margin-left: auto; padding: 0 .6rem; font: 400 1.3rem/1 var(--term); white-space: nowrap; }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: 4.5rem;
  transform: translate(-50%, 1rem); opacity: 0; pointer-events: none;
  background: var(--cash); color: var(--cash-ink); padding: .6rem 1rem; border-radius: 10px;
  font: 700 .95rem/1 var(--display);
  transition: opacity .25s, transform .35s var(--ease-out);
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .desk-body, .row-a, .row-b { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .steps li, .steps li + li { padding: 1.1rem 0; border-left: 0; }
  .steps li + li { border-top: 1px solid var(--line); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats div:nth-child(3) { border-left: 0; }
  .stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  .topbar .js-x { display: none; }
  .brand b { display: none; }
  .scroll-cue { display: none; }
  .field-pair { grid-template-columns: 1fr; }
  .tasks { display: none; }
  .tx text { font-size: 26px; }
  .tx .tx-sm { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cover { height: 100vh; height: 100svh; }
  .screen { display: none; }
  .scroll-cue .wheel, .caret { animation: none; }
  * { transition-duration: .01ms !important; }
}

/* settlement diagram: vertical on phones */
.tx-tall { display: none; }
.tx .tx-mid { text-anchor: middle; }
@media (max-width: 600px) {
  .tx-wide { display: none; }
  .tx-tall { display: block; max-width: 360px; margin: 0 auto; }
  .tx .tx-tall text { font-size: 22px; }
  .tx .tx-tall .tx-sm { font-size: 18px; }
  .tx .tx-tall .tx-title { font-size: 28px; }
}
