:root {
  --bg: #000;
  --fg: #f2f1ee;
  --dim: #7d7b76;
  --faint: #3a3936;
  --line: rgba(242, 241, 238, .13);
  --accent: #ff5b1f;
  --grot: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --serif: "Newsreader", Georgia, serif;
  --colw: clamp(380px, 34vw, 520px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; }
html, body { background: var(--bg); }
body { color: var(--fg); font-family: var(--mono); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: var(--mono); }
[hidden] { display: none !important; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
.fb { position: fixed; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; }
.veil { display: none; }

.cap { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }

/* The chrome waits for the OODA countdown, then fades in on ACT. */
.mark, .scene, .mk .cat, .mk .p, .act > * { transition: opacity .9s ease; }
html.intro .mark, html.intro .scene, html.intro .mk .cat, html.intro .mk .p, html.intro .act > * { opacity: 0; pointer-events: none; }

/* Brand */
.mark {
  position: fixed; z-index: 5; top: calc(18px + var(--safe-t)); left: max(24px, env(safe-area-inset-left, 0px));
  font-family: var(--grot); font-stretch: 125%; font-size: 20px; letter-spacing: -.01em; pointer-events: none;
}
.scene {
  position: fixed; z-index: 5; top: calc(46px + var(--safe-t)); left: max(24px, env(safe-area-inset-left, 0px));
  max-width: 340px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim);
  pointer-events: none; text-shadow: 0 0 4px #000, 0 0 10px #000;
}
.scene .tag { display: block; }
.sc { margin-top: 26px; transition: opacity .4s ease, transform .4s ease; }
.sc.sw { opacity: 0; transform: translateY(4px); }
.sc b { display: block; margin: 8px 0 6px; color: var(--fg); font-weight: 400; font-family: var(--grot); font-stretch: 125%; font-size: clamp(16px, 1.7vw, 24px); letter-spacing: .02em; }
.sc p { max-width: 230px; font-family: var(--serif); font-style: italic; font-weight: 300; font-size: 16px; line-height: 1.3; letter-spacing: 0; text-transform: none; color: #b9b7b1; }

/* Market column */
.tabs { display: flex; align-items: center; gap: 2px; }
.tabs button { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); padding: 6px 8px; border: 1px solid transparent; transition: color .15s; }
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: var(--fg); border-color: var(--line); }
.tabs.box { gap: 0; border: 1px solid var(--line); }
.tabs.box button { padding: 7px 11px; border: 0; }
.tabs.box button.on { background: var(--fg); color: #000; }

.mk {
  position: fixed; z-index: 4; top: 0; right: 0; bottom: 0; width: var(--colw);
  padding: 20px 22px 22px 64px;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .9) 52px);
  display: flex; flex-direction: column; overflow-y: auto; scrollbar-width: none;
}
.mk::-webkit-scrollbar { display: none; }
.cat { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-bottom: 14px; }
.cat code { font-size: 13px; letter-spacing: .04em; }
.cbtn { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; padding: 6px 9px; border: 1px solid var(--line); transition: border-color .15s, color .15s; }
.cbtn:hover:not(:disabled) { border-color: var(--fg); }
.cbtn:disabled { color: var(--faint); cursor: default; }
.cbtn.ok { color: var(--accent); border-color: var(--accent); }

.p-chart { flex: 1 1 auto; min-height: 210px; display: flex; flex-direction: column; }
.hd { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cw { position: relative; flex: 1; min-height: 140px; }
.tcv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: pan-y; }
.sim { position: absolute; top: 8px; left: 8px; font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); background: rgba(0, 0, 0, .7); padding: 3px 5px; border: 1px solid rgba(255, 91, 31, .35); pointer-events: none; }

.p-price { margin-top: 22px; }
.un { display: flex; align-items: center; justify-content: space-between; }
.chain { display: flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.chain i { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.big { font-family: var(--grot); font-stretch: 125%; font-weight: 300; letter-spacing: -.02em; font-variant-numeric: tabular-nums; font-size: clamp(46px, 4.6vw, 76px); line-height: 1; margin-top: 12px; transition: color .5s; }
.big.f-up { color: var(--accent); transition: none; }
.big.f-dn { color: var(--dim); transition: none; }
.chg { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.chg div { display: flex; flex-direction: column; gap: 8px; padding: 11px 0 12px 12px; border-left: 1px solid var(--line); min-width: 0; }
.chg div:first-child { border-left: 0; padding-left: 0; }
.chg b { font-family: var(--grot); font-stretch: 112%; font-weight: 300; font-size: clamp(14px, 1.25vw, 19px); font-variant-numeric: tabular-nums; color: #b9b7b1; white-space: nowrap; }
.chg b.up { color: var(--accent); }

.g { display: grid; grid-template-columns: 1fr 1fr; }
.g div { display: flex; flex-direction: column; gap: 6px; padding: 11px 0 11px 18px; border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 0; }
.g div:nth-child(odd) { padding-left: 0; border-left: 0; }
.g div:nth-last-child(-n+2) { border-bottom: 0; }
.g b { font-family: var(--grot); font-stretch: 112%; font-weight: 300; font-size: clamp(16px, 1.45vw, 22px); font-variant-numeric: tabular-nums; }
.g small { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 13px; }
.g small em { font-style: normal; color: var(--accent); }

/* Left actions */
.act {
  position: fixed; z-index: 5; left: max(24px, env(safe-area-inset-left, 0px)); bottom: calc(24px + var(--safe-b));
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: calc(100% - var(--colw) - 70px);
}
.act::before { content: ""; position: absolute; inset: -30px -90px -40px -70px; z-index: -1; pointer-events: none; background: radial-gradient(closest-side, rgba(0, 0, 0, .92) 55%, rgba(0, 0, 0, 0)); }
.lk { display: flex; flex-direction: column; gap: 8px; }
.lk a { display: grid; place-items: center; width: 56px; height: 56px; border: 1px solid var(--line); background: rgba(0, 0, 0, .55); transition: border-color .15s, color .15s; }
.lk a[href]:hover { border-color: var(--accent); color: var(--accent); }
.lk a:not([href]) { color: var(--faint); }
.lk svg { width: 20px; height: 20px; fill: currentColor; }
.ca { display: flex; align-items: center; gap: 10px; text-shadow: 0 0 4px #000, 0 0 12px #000; max-width: 100%; }
.ca code { font-size: 13px; letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp { display: grid; place-items: center; width: 29px; height: 29px; color: var(--dim); transition: color .15s; }
.cp:hover:not(:disabled) { color: var(--fg); }
.cp:disabled { color: var(--faint); cursor: default; }
.cp.ok { color: var(--accent); }
.cp svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.go {
  display: inline-flex; align-items: baseline; gap: 18px; color: var(--accent);
  font-family: var(--grot); font-stretch: 125%; font-weight: 400; font-size: clamp(36px, 3.8vw, 58px); line-height: 1;
  white-space: nowrap; text-shadow: 0 0 10px #000, 0 0 26px #000;
}
.go .ar { font-family: var(--mono); font-size: .62em; transition: transform .2s ease; }
.go[href]:hover .ar { transform: translateX(8px); }
.go.off { cursor: default; }
.go.off .ar { font-size: .32em; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.btns { display: flex; gap: 8px; }
.pfb { display: inline-flex; align-items: center; gap: 12px; height: 42px; padding: 0 16px; border: 1px solid var(--line); background: rgba(0, 0, 0, .88); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; transition: border-color .15s; white-space: nowrap; }
.pfb:hover { border-color: rgba(242, 241, 238, .4); }
.pfb i { width: 8px; height: 8px; border-radius: 50%; background: #ffd2b0; box-shadow: 0 0 8px 2px rgba(255, 91, 31, .7); }

/* Modals */
.md { position: fixed; inset: 0; z-index: 20; display: flex; padding: 18px; background: rgba(0, 0, 0, .86); overflow-y: auto; }
.mw { margin: auto; width: min(480px, 100%); background: #0b0b0a; border: 1px solid var(--line); padding: 18px; }
.mw-doc { width: min(620px, 100%); }
.mh { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.mh b { font-weight: 400; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.mx { width: 30px; height: 30px; font-size: 20px; color: var(--dim); }
.mx:hover { color: var(--fg); }

.doc h2 { font-family: var(--grot); font-stretch: 125%; font-weight: 300; font-size: clamp(28px, 5vw, 42px); letter-spacing: -.01em; line-height: 1.05; }
.lede { font-family: var(--serif); font-weight: 300; font-size: 21px; line-height: 1.3; margin-top: 14px; color: #d9d7d1; }
.doc ol { list-style: none; padding: 0; margin-top: 22px; counter-reset: t; }
.doc li { counter-increment: t; position: relative; padding: 12px 0 13px 42px; border-top: 1px solid var(--line); }
.doc li::before { content: counter(t, decimal-leading-zero); position: absolute; left: 0; top: 14px; font-size: 11px; letter-spacing: .1em; color: var(--accent); }
.doc li b { font-weight: 400; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }
.doc li p { font-family: var(--serif); font-weight: 300; font-size: 17px; line-height: 1.32; color: #b9b7b1; margin-top: 5px; }
.fine { font-size: 10px; line-height: 1.5; color: var(--dim); border-top: 1px solid var(--line); padding-top: 14px; }

.pfs { position: relative; aspect-ratio: 1; background: #050505; border: 1px solid var(--line); }
.pfd { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font-size: 12px; line-height: 1.7; letter-spacing: .06em; color: var(--dim); cursor: pointer; transition: color .15s, background .15s; }
.pfd:hover, .pfd.over { color: var(--fg); background: #0d0c0b; }
.pfd input { position: absolute; width: 1px; height: 1px; opacity: 0; }
#pfc { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.mn { font-size: 10px; letter-spacing: .08em; color: var(--dim); margin-top: 12px; }
.mn.err { color: var(--accent); }
.mc { display: flex; gap: 8px; margin-top: 12px; }
.mc button { flex: 1; height: 42px; border: 1px solid var(--line); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.mc button:hover { border-color: rgba(242, 241, 238, .4); }
.mc .pri { background: var(--accent); border-color: var(--accent); color: #000; }

/* Phones and narrow tablets: the art stays fixed, panels scroll over it and it fades to black. */
@media (max-width: 899px) {
  .veil { display: block; position: fixed; inset: 0; z-index: 3; background: #000; opacity: var(--k, 0); pointer-events: none; }
  .flow { position: relative; z-index: 4; display: flex; flex-direction: column; padding: 0 16px 24px; }
  .spacer { height: calc(100svh - 216px - var(--safe-b)); order: 0; }
  .mk { display: contents; }
  .mk .cat { display: none; }
  .scene { z-index: 2; }
  .mark, .scene { position: absolute; }
  .mark { z-index: 5; }
  .sc { margin-top: 8px; }
  .sc span, .sc p { display: none; }
  .sc b { margin: 0; font-size: 13px; color: var(--accent); }

  .p, .act { background: rgba(11, 11, 10, calc(.42 + .58 * var(--k, 0))); border: 1px solid var(--line); padding: 16px; }
  .p { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .p-price { order: 1; margin-top: 0; }
  .act { order: 2; position: static; margin-top: 10px; max-width: none; align-items: stretch; gap: 14px; }
  .act::before { display: none; }
  .p-chart { order: 3; margin-top: 10px; min-height: 0; }
  .p-stats { order: 4; margin-top: 10px; padding-top: 4px; padding-bottom: 4px; }

  .big { font-size: 48px; }
  .chg { margin-top: 14px; border-bottom: 0; }
  .chg div { padding-bottom: 2px; }
  .cw { flex: none; height: 230px; }

  .lk { position: absolute; top: calc(14px + var(--safe-t)); right: 16px; flex-direction: row; z-index: 6; }
  .lk a { width: 42px; height: 42px; }
  .ca { justify-content: space-between; text-shadow: none; }
  .ca code { font-size: 12px; flex: 1; }
  .go { justify-content: center; background: var(--accent); color: #000; font-size: 24px; padding: 17px 16px; gap: 12px; text-shadow: none; }
  .go .ar { font-size: .8em; }
  .go.off .ar { font-size: .42em; color: rgba(0, 0, 0, .65); }
  .btns { flex-direction: column; }
  .pfb { justify-content: center; height: 46px; background: none; }
}

@media (min-width: 900px) and (max-height: 760px) {
  .p-price { margin-top: 12px; }
  .big { font-size: clamp(38px, 3.6vw, 56px); margin-top: 8px; }
  .chg { margin-top: 10px; }
  .chg div { padding-top: 7px; padding-bottom: 8px; gap: 5px; }
  .g div { padding-top: 6px; padding-bottom: 6px; gap: 3px; }
  .g small { font-size: 10px; }
  .lk { flex-direction: row; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
