:root {
  --paper: #f3efe6;
  --paper-2: #e9e3d5;
  --slip: #fbf9f3;
  --ink: #16140f;
  --ink-2: #57524a;
  --line: #16140f26;
  --ruby: #c9281a;
  --ruby-ink: #a81f13;
  --green: #1b5e4b;
  --gold: #d9a441;
  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --serif: "Newsreader", Georgia, serif;
  --mono: "Martian Mono", ui-monospace, Menlo, monospace;
  --gutter: clamp(16px, 4vw, 56px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: 64px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 clamp(17px, 1.25vw, 20px)/1.5 var(--serif); overflow-x: clip; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ruby-ink); }
:focus-visible { outline: 3px solid var(--ruby); outline-offset: 2px; }
h1, h2, h3, p, ul, ol, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
code { font: 400 .78em var(--mono); }
hr { border: 0; border-top: 1px dashed var(--ink); opacity: .5; margin: 14px 0; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 50; background: var(--ink); color: var(--paper); padding: 8px 12px; }

/* top bar */
.bar { position: fixed; inset: 0 0 auto; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 12px var(--gutter); pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar-name { font: 800 12px var(--mono); text-decoration: none; letter-spacing: -.02em; background: var(--paper); padding: 6px 8px; }
.accept { display: flex; align-items: center; font: 600 11px var(--mono); background: var(--ink); color: var(--paper); padding: 4px 4px 4px 10px; border-radius: 3px; }
.accept-label { opacity: .65; margin-right: 8px; }
.accept button { font: inherit; color: inherit; background: none; border: 0; padding: 7px 10px; min-height: 32px; cursor: pointer; border-radius: 2px; }
.accept button[aria-checked="true"] { background: var(--ruby); color: #fff; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; font: 600 clamp(11px, .9vw, 13px)/1.2 var(--mono); padding: 14px 18px; min-height: 46px; color: var(--ink); background: transparent; border: 1.5px solid var(--ink); text-decoration: none; cursor: pointer; transition: transform .12s, background .12s, color .12s; overflow-wrap: anywhere; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn:active { transform: translateY(2px); }
.btn[disabled] { opacity: .35; cursor: not-allowed; }
.btn[disabled]:hover { background: none; color: inherit; }
.btn-ruby { background: var(--ruby); border-color: var(--ruby); color: #fff; }
.btn-ruby:hover { background: var(--ruby-ink); border-color: var(--ruby-ink); color: #fff; }
.btn-small { padding: 8px 12px; min-height: 36px; font-size: 11px; }

/* receipts */
.receipt { background: var(--slip); font-family: var(--mono); font-size: 12px; line-height: 1.5; padding: 22px 20px 30px; position: relative;
  --zig: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% 100% / 14px 8px repeat-x;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 7px) no-repeat, var(--zig);
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 7px) no-repeat, var(--zig);
}
.r-total { display: flex; justify-content: space-between; gap: 12px; font-weight: 800; font-size: 14px; font-family: var(--mono); }

/* hero */
.hero { min-height: 100svh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: clamp(24px, 4vw, 72px); align-items: center; padding: 84px var(--gutter) 48px; position: relative; }
.kicker, .num { font: 600 clamp(10px, .85vw, 12px)/1.5 var(--mono); color: var(--ruby-ink); letter-spacing: -.01em; }
h1 { font: 900 clamp(52px, 10.4vw, 188px)/.86 var(--display); font-stretch: 75%; letter-spacing: -.025em; text-transform: uppercase; margin: 18px 0 28px; }
h1 em { font-style: normal; color: var(--ruby); }
.lede { font-size: clamp(19px, 1.75vw, 27px); line-height: 1.35; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-receipt { align-self: start; margin-top: -84px; overflow: hidden; padding: 0; filter: drop-shadow(0 12px 18px #16140f22); }
.receipt-roll { padding: 104px 20px 34px; animation: print 1.5s steps(26) .25s both; }
@keyframes print { from { transform: translateY(-100%); } to { transform: none; } }
.r-head { font-weight: 800; font-size: 17px; text-align: center; letter-spacing: -.03em; }
.r-sub, .r-foot { text-align: center; font-size: 10px; color: var(--ink-2); }
.r-lines a { display: grid; grid-template-columns: 58px 1fr; gap: 8px; padding: 6px 0; text-decoration: none; font-size: 11px; }
.r-lines a:hover { background: var(--ink); color: var(--slip); box-shadow: -6px 0 0 var(--ink), 6px 0 0 var(--ink); }
.r-lines b { text-align: right; }
.r-foot { margin-top: 10px; }
.barcode { height: 40px; margin-top: 14px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, #0000 2px 5px, var(--ink) 5px 6px, #0000 6px 8px, var(--ink) 8px 12px, #0000 12px 14px, var(--ink) 14px 15px, #0000 15px 19px); }

/* sections */
.sec { padding: clamp(64px, 9vw, 150px) var(--gutter); border-top: 1.5px solid var(--ink); }
.sec-head { margin-bottom: clamp(32px, 4vw, 64px); }
h2 { font: 900 clamp(38px, 6vw, 108px)/.92 var(--display); font-stretch: 75%; letter-spacing: -.02em; text-transform: uppercase; margin-top: 12px; }
.sec-lede { font-size: clamp(19px, 1.6vw, 25px); line-height: 1.36; max-width: 36em; margin-top: 18px; }
h3 { font: 800 clamp(19px, 1.7vw, 25px)/1.08 var(--display); font-stretch: 85%; }

/* demo */
.bug { background: var(--ink); color: var(--paper); }
.bug a:hover { color: var(--gold); }
.bug .num { color: #ff7a66; }
.bug .btn { color: var(--paper); border-color: var(--paper); }
.bug .btn:hover { background: var(--paper); color: var(--ink); }
.bug .btn-ruby { background: var(--ruby); border-color: var(--ruby); color: #fff; }
.bug .btn-ruby:hover { background: #e23a2b; border-color: #e23a2b; color: #fff; }
.bug .btn[disabled]:hover { background: none; color: var(--paper); }
.demo { max-width: 1120px; }
.demo-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; padding-bottom: 20px; }
.demo-call { font-size: clamp(11px, 1.05vw, 14px); overflow-wrap: anywhere; }
.demo-buttons { display: flex; gap: 8px; }
.demo-tickets { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); align-items: start; }
.ticket { color: var(--ink); min-height: 330px; display: flex; flex-direction: column; gap: 10px; }
.ticket a:hover { color: var(--ruby-ink); }
.ticket h3 { font-size: clamp(20px, 2vw, 28px); }
.t-note { font-size: 11px; color: var(--ink-2); font-family: var(--mono); line-height: 1.55; }
.t-note code { color: var(--ruby-ink); font-size: 1em; font-weight: 600; }
.t-rows { flex: 1; display: flex; flex-direction: column; gap: 4px; border-block: 1px dashed #16140f66; padding: 10px 0; min-height: 110px; font-size: 11px; max-height: 210px; overflow-y: auto; }
.t-rows li { display: flex; justify-content: space-between; gap: 10px; animation: land .22s ease-out; }
.t-rows .skip-row { color: var(--ink-2); }
.t-rows .fire { color: var(--ruby-ink); font-weight: 800; }
.t-rows .good { color: var(--green); font-weight: 800; }
@keyframes land { from { opacity: 0; transform: translateY(-6px); } }
.t-state { font: 500 11px/1.45 var(--mono); min-height: 3em; }
.t-state.bad { color: var(--ruby-ink); font-weight: 800; }
.t-state.good { color: var(--green); font-weight: 800; }
.approve { background: var(--ink); color: var(--paper); padding: 12px; font-size: 11px; }
.approve div { display: flex; gap: 8px; margin-top: 10px; }
.approve .btn { color: var(--paper); border-color: var(--paper); flex: 1; }
.approve .btn:hover { background: var(--paper); color: var(--ink); }
.approve .btn-ruby { border-color: var(--ruby); color: #fff; }
.approve .btn-ruby:hover { background: #e23a2b; color: #fff; border-color: #e23a2b; }
.stamp { position: absolute; right: 16px; top: 18px; font: 900 clamp(13px, 1.5vw, 20px)/1 var(--display); font-stretch: 80%; text-transform: uppercase; color: var(--green); border: 3px solid var(--green); padding: 7px 9px; transform: rotate(-9deg) scale(2.4); opacity: 0; pointer-events: none; }
.stamp.on { opacity: .92; transform: rotate(-9deg) scale(1); transition: transform .18s cubic-bezier(.5, 0, .9, .5), opacity .1s; }
.audit { margin-top: clamp(14px, 2vw, 24px); border: 1px solid #f3efe644; padding: 18px; }
.audit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.audit .t-note { color: #f3efe6b3; }
.chain { margin-top: 12px; font: 400 clamp(9px, .85vw, 11px)/1.5 var(--mono); display: grid; gap: 3px; }
.chain li { display: grid; grid-template-columns: 22px minmax(0, 1fr) 15ch; gap: 10px; padding: 3px 6px; background: #f3efe60f; animation: land .22s ease-out; }
.chain .ev { overflow-wrap: anywhere; }
.chain .h { color: #9ad2bd; text-align: right; }
.chain li.broken { background: #c9281a55; }
.chain li.broken .h { color: #ffb1a6; text-decoration: line-through; }
.chain li.forged .ev { color: var(--gold); font-weight: 800; }
.chain-status { font: 600 11px var(--mono); margin-top: 10px; }
.chain-status.bad { color: #ff9c8c; }
.chain-status.good { color: #9ad2bd; }
.demo-foot { margin-top: 20px; font-size: clamp(15px, 1.1vw, 18px); color: #f3efe6cc; max-width: 46em; }

/* tower */
.stack-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 72px); }
.tower-wrap { position: sticky; top: 0; height: 100svh; }
#tower { width: 100%; height: 100%; display: block; }
.chapters { display: flex; flex-direction: column; padding-block: 12vh 45vh; }
.chapter { min-height: 62vh; display: flex; flex-direction: column; justify-content: center; gap: 8px; max-width: 30em; opacity: .28; transition: opacity .25s; }
.chapter.on { opacity: 1; }
.chapter time { font: 600 11px var(--mono); color: var(--ruby-ink); }
.chapter h3 { font-size: clamp(30px, 3.5vw, 58px); font-weight: 900; line-height: .96; font-stretch: 75%; text-transform: uppercase; }

/* loop */
.loop { background: var(--paper-2); }
.rail { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 22px); padding-top: 24px; }
.rail::before { content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1) auto; height: 14px; background: linear-gradient(#b7b1a3, #8c867a 45%, #57524a); box-shadow: 0 3px 5px #0003; }
.slip { background: var(--slip); padding: 26px 18px 26px; font-size: clamp(16px, 1.15vw, 19px); line-height: 1.38; margin-top: -24px; padding-top: 44px; transform-origin: top center; transition: transform .25s; box-shadow: 0 8px 12px #16140f18; }
.slip:nth-child(odd) { transform: rotate(-.7deg); }
.slip:nth-child(even) { transform: rotate(.6deg); }
.slip:hover { transform: rotate(0) translateY(4px); }
.slip-no { font: 800 12px var(--mono); color: var(--ruby-ink); }
.slip h3 { margin: 4px 0 10px; font-size: clamp(24px, 2.3vw, 36px); font-weight: 900; text-transform: uppercase; font-stretch: 75%; }

/* studio */
.games { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(10px, 1.4vw, 20px) clamp(8px, 1.4vw, 20px); }
.games a, .games li.in-review { display: flex; flex-direction: column; gap: 3px; text-decoration: none; height: 100%; }
.games img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 19%; margin-bottom: 7px; transition: transform .18s; }
.games a:hover img { transform: translateY(-5px) rotate(-2deg); }
.games b { font: 800 clamp(14px, 1.25vw, 19px)/1.1 var(--display); font-stretch: 85%; }
.games span { font: 400 clamp(9px, .75vw, 11px)/1.4 var(--mono); color: var(--ink-2); }
.in-review span::after { content: " / in review"; color: var(--ruby-ink); }
.split { display: grid; grid-template-columns: 1fr 1fr; margin-top: clamp(32px, 4vw, 64px); border: 1.5px solid var(--ink); }
.split > div { padding: clamp(16px, 2vw, 28px); }
.split > div + div { border-left: 1.5px solid var(--ink); background: var(--ink); color: var(--paper); }
.split h3 { font-size: clamp(25px, 2.6vw, 40px); font-weight: 900; font-stretch: 75%; text-transform: uppercase; margin-bottom: 12px; }
.plain { display: grid; gap: 9px; font-size: clamp(16px, 1.15vw, 19px); line-height: 1.32; }
.war-story { margin-top: 24px; max-width: 46em; font-size: clamp(17px, 1.3vw, 21px); }
.war-story b { font-weight: 500; color: var(--ruby-ink); font-style: italic; }

/* bets */
.bets { counter-reset: b; border-top: 1.5px solid var(--ink); }
.bets li { counter-increment: b; display: grid; grid-template-columns: 56px minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(130px, .5fr); gap: clamp(10px, 2vw, 32px); align-items: baseline; padding: clamp(16px, 2vw, 28px) 0; border-bottom: 1.5px solid var(--ink); }
.bets li::before { content: "0" counter(b); font: 800 12px var(--mono); color: var(--ruby-ink); }
.bets h3 { font-size: clamp(24px, 2.6vw, 42px); font-weight: 900; font-stretch: 75%; text-transform: uppercase; line-height: .98; }
.bets a { font: 500 11px/1.45 var(--mono); }

/* proof */
.proof-grid { display: grid; grid-template-columns: minmax(150px, 240px) minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 3.4vw, 56px); align-items: start; }
.book { display: block; text-decoration: none; font: 600 11px var(--mono); }
.book img { box-shadow: 0 14px 28px #16140f40; margin-bottom: 12px; transition: transform .2s; }
.book:hover img { transform: translateY(-4px) rotate(-1deg); }
.quotes { display: grid; gap: 24px; }
blockquote p { font: 400 italic clamp(24px, 2.4vw, 38px)/1.1 var(--serif); }
blockquote footer { font: 400 10px/1.5 var(--mono); color: var(--ink-2); margin-top: 8px; }
.quote-more { font: 600 11px var(--mono); }
.links { border-top: 1.5px solid var(--ink); }
.links a { display: flex; flex-direction: column; gap: 2px; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.links b { font: 800 clamp(17px, 1.4vw, 22px)/1.1 var(--display); font-stretch: 85%; }
.links span { font: 400 10px/1.4 var(--mono); color: var(--ink-2); }

/* end */
.end { background: var(--ruby); color: #fff; }
.end .num { color: #fff; }
.end .btn { color: #fff; border-color: #fff; }
.end .btn:hover { background: #fff; color: var(--ruby-ink); }
.end .btn-ruby { background: var(--ink); border-color: var(--ink); }
.end .btn-ruby:hover { background: #000; border-color: #000; color: #fff; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; padding: 16px var(--gutter); background: var(--ink); color: var(--paper); font: 400 10px/1.5 var(--mono); }

/* agent mode */
.machine { min-height: 100svh; background: #0c0d0b; color: #d9e4d2; padding: 84px var(--gutter) 60px; font: 400 clamp(11px, 1vw, 14px)/1.65 var(--mono); }
.machine[hidden] { display: none; }
.machine-inner { max-width: 1000px; margin-inline: auto; }
.machine h2 { font: 800 clamp(25px, 3.6vw, 52px)/1.04 var(--mono); letter-spacing: -.05em; text-transform: none; margin: 28px 0 14px; color: #fff; }
.machine h3 { font: 800 12px var(--mono); margin-bottom: 8px; color: #fff; }
.machine a { color: #8fe3bf; }
.machine a:hover { color: #fff; }
.machine pre { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.machine code { font-size: 1em; }
.m-dim { color: #8b9686; }
.m-ok { color: #8fe3bf; font-weight: 800; }
.m-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 24px 0; }
.m-card { border: 1px solid #d9e4d233; padding: 14px; font-size: 11px; }
.m-card pre { background: #1a1c18; padding: 8px; font-size: 10px; }
.m-card p + p { margin-top: 8px; }
.json { background: #141512; padding: 18px; font-size: clamp(10px, .88vw, 12px); line-height: 1.55; max-height: 70vh; overflow: auto; margin-bottom: 18px !important; }
.json .k { color: #8fe3bf; } .json .s { color: #e9d9a6; } .json .n { color: #ff9c8c; }
.m-back { color: #d9e4d2; border-color: #d9e4d2; }
.m-back:hover { background: #d9e4d2; color: #0c0d0b; }
html[data-mode="agent"] { background: #0c0d0b; }
html[data-mode="agent"] main { display: none; }
html[data-mode="agent"] .bar-name { background: #0c0d0b; color: #d9e4d2; }
html[data-mode="agent"] .accept { background: #d9e4d2; color: #0c0d0b; }
.flash { animation: flash .36s steps(3); }
@keyframes flash { 0%, 100% { filter: none; } 50% { filter: invert(1); } }

/* The stamp starts scaled up, which would otherwise widen the page. */
.demo-tickets { overflow-x: clip; }

/* The shift */
.english { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 28px); }
.english article { background: var(--slip); padding: clamp(18px, 2.4vw, 34px); box-shadow: 0 8px 12px #16140f18; display: flex; flex-direction: column; gap: 16px; }
.english h3 { font: 800 12px/1.4 var(--mono); text-transform: uppercase; }
.eng-bad h3 { color: var(--ruby-ink); }
.eng-good h3 { color: var(--green); }
.eng-prompt { font-size: clamp(23px, 2.5vw, 38px); line-height: 1.16; flex: 1; }
.eng-out { border-top: 1.5px dashed var(--line); padding-top: 14px; font-size: clamp(16px, 1.2vw, 19px); }
.bugm { margin-top: clamp(48px, 7vw, 110px); }
.bugm-title { font-size: clamp(38px, 6vw, 92px); font-weight: 900; font-stretch: 75%; text-transform: uppercase; line-height: .95; margin-top: 10px; }
.bugm .rail { margin-top: clamp(28px, 4vw, 52px); }
.gates { background: var(--ink); color: var(--paper); margin-top: clamp(24px, 3vw, 40px); padding: clamp(16px, 2vw, 28px); font-size: clamp(19px, 1.7vw, 27px); line-height: 1.3; }
.gates b { font-weight: 500; font-style: italic; color: var(--gold); }

@media (max-width: 900px) {
  .english { grid-template-columns: 1fr; }
  .hero { grid-template-columns: 1fr; min-height: 0; padding-bottom: 56px; }
  .hero-receipt { margin-top: 12px; max-width: 360px; width: 100%; justify-self: center; }
  .receipt-roll { padding-top: 24px; }
  .demo-tickets { grid-template-columns: 1fr; }
  .ticket { min-height: 0; }
  .t-rows { min-height: 70px; }
  .rail { grid-template-columns: 1fr 1fr; row-gap: 34px; }
  .rail::before { display: none; }
  .slip { margin-top: 0; padding-top: 22px; }
  .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .split > div + div { border-left: 0; }
  .bets li { grid-template-columns: 30px minmax(0, 1fr); }
  .bets li > :not(:first-child) { grid-column: 2; }
  .bets li > h3 { grid-column: 2; }
  .proof-grid { grid-template-columns: 130px minmax(0, 1fr); }
  .links { grid-column: 1 / -1; }
  .m-cards { grid-template-columns: 1fr; }
}
/* Stacked tower: pinned above the text on upright phones and tablets. Keep the query in sync with stackedTower in app.js. */
@media (max-width: 900px) and (orientation: portrait) {
  .stack-grid { display: block; }
  .tower-wrap { top: 0; height: 42svh; z-index: 2; background: var(--paper); border-bottom: 1.5px solid var(--ink); }
  .chapters { padding-block: 0 8svh; }
  .chapter { min-height: 34svh; justify-content: flex-start; padding-top: 28px; }
}

@media (max-width: 480px) {
  .games { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { grid-template-columns: 1fr; row-gap: 12px; }
  .chain li { grid-template-columns: 16px minmax(0, 1fr) 9ch; gap: 6px; }
  .accept-label { display: none; }
  .accept { padding-left: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
