/* HEDGE. The INDEX tower look (ledtower): black, LED red, Khand numbers, JetBrains Mono dots. */
:root {
  --bg: #000; --panel: #0b0404; --line: #262626; --rule: #5c100d;
  --text: #fff; --text-2: #c2c2c2; --text-3: #808080;
  --brand: #fb0201; --brand-2: #ff2f24; --up: #1fd46b; --down: #ff3b5c; --amber: #ffb000;
  --f-mark: "Panchang", "Arial Black", sans-serif;
  --f-num: "Khand", "Arial Narrow", sans-serif;
  --f-ui: "Switzer", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 2.2vw, 44px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--text); overflow-x: clip; scrollbar-color: #3a0b09 #000; scrollbar-width: thin; scroll-behavior: smooth; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: #3a0b09; border: 2px solid #000; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand); }
body { margin: 0; background: var(--bg); font-family: var(--f-ui); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
img { display: block; }
h1, h2, p { margin: 0; }
::selection { background: var(--brand); color: #fff; }
.wrap { max-width: 1680px; margin: 0 auto; padding: 0 var(--gutter); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); }

/* nav */
nav { height: 64px; display: flex; align-items: center; gap: 34px; border-bottom: 1px solid #120404; }
.mark { display: flex; align-items: center; gap: 10px; font-family: var(--f-mark); font-weight: 800; font-size: 22px; letter-spacing: .02em; }
.mark img { width: 40px; height: 40px; }
.links { display: flex; gap: 26px; font-weight: 600; font-size: 14.5px; color: var(--text-2); }
.links a { position: relative; padding: 6px 0; transition: color .15s; }
.links a:hover { color: #fff; }
.nav-r { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.live { display: inline-flex; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--text-3); text-transform: uppercase; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #333; }
.live.on i { background: var(--brand); box-shadow: 0 0 0 0 rgba(251, 2, 1, .6); animation: ping 1.8s ease-out infinite; }
@keyframes ping { 0% { box-shadow: 0 0 0 0 rgba(251, 2, 1, .6); } 100% { box-shadow: 0 0 0 9px rgba(251, 2, 1, 0); } }
.ca { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 5px; border: 1px solid var(--brand); background: transparent; cursor: pointer; font-family: var(--f-mono); font-size: 12px; }
.ca[hidden] { display: none; }
.ca .k { color: var(--brand-2); font-weight: 700; }

/* tower */
.tower { position: relative; height: clamp(240px, 31vw, 460px); background: #070101; overflow: hidden; }
.tower canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.tower::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40px; background: linear-gradient(transparent, #000); pointer-events: none; }

/* sections */
section { padding: clamp(56px, 7vw, 110px) 0 0; }
.kicker { display: flex; align-items: center; gap: 14px; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--brand-2); text-transform: uppercase; }
.kicker::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.dothead { display: block; width: 100%; margin: 14px 0 18px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lede { max-width: 640px; color: var(--text-2); font-size: 15.5px; }
.lede b { color: #fff; }
.lede .mono { font-size: 12.5px; }

/* what is this */
.what { padding-top: clamp(44px, 5vw, 80px); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 30px; }
.card { border: 1px solid #1f0b0b; background: #050101; border-radius: 4px; padding: 22px 22px 24px; position: relative; }
.card .n { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 3px; background: var(--brand); color: #fff; font-family: var(--f-num); font-weight: 600; font-size: 22px; line-height: 1; margin-bottom: 16px; }
.card b { display: block; font-size: 19px; margin-bottom: 8px; }
.card p { color: var(--text-2); font-size: 15px; line-height: 1.5; }
.card em { font-style: normal; color: var(--brand-2); font-weight: 700; }
.what .fine { margin-top: 18px; font-family: var(--f-mono); font-size: 12px; color: var(--text-3); line-height: 1.7; }
.bwhat { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* the numbers */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-top: 10px; }
.stat { border: 1px solid #1f0b0b; background: #050101; border-radius: 4px; padding: 16px 18px 14px; }
.stat .k { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--brand-2); text-transform: uppercase; }
.stat .v { font-family: var(--f-num); font-weight: 600; font-size: 38px; line-height: 1; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .v.up { color: var(--up); }
.stat .v.down { color: var(--down); }
.stat .s { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* the board */
.board { border: 1px solid #1f0b0b; background: #050101; border-radius: 4px; overflow: hidden; margin-top: 18px; }
.bhead { display: flex; justify-content: space-between; align-items: flex-start; padding: 16px 18px 10px; gap: 16px; }
.bhead canvas { height: 34px; display: block; }
.bhead .px { text-align: right; }
.bhead .px .v { font-family: var(--f-num); font-weight: 600; font-size: 30px; line-height: 1; }
.bhead .px .c { font-family: var(--f-mono); font-size: 11.5px; margin-top: 4px; }
.bsub { display: flex; justify-content: space-between; padding: 0 18px 12px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; color: var(--brand-2); text-transform: uppercase; border-bottom: 1px solid #1f0b0b; gap: 14px; flex-wrap: wrap; }
.bsub span:last-child { color: var(--text-3); }
.bsub span:last-child.open { color: var(--up); }
.tblw { overflow: auto; }
.book { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 900px; }
.book th { font-family: var(--f-mono); font-weight: 400; font-size: 10.5px; letter-spacing: .08em; color: var(--brand-2); text-align: left; padding: 14px 18px 10px; text-transform: uppercase; white-space: nowrap; }
.book td { padding: 14px 18px; border-top: 1px solid #1a0707; white-space: nowrap; vertical-align: middle; }
.book .r { text-align: right; }
.book .id { color: var(--text-3); font-family: var(--f-mono); font-size: 12px; }
.book .num { font-family: var(--f-num); font-weight: 600; font-size: 19px; line-height: 1; }
.book .sub { display: block; font-family: var(--f-mono); font-size: 10.5px; color: var(--text-3); margin-top: 4px; }
.book .lev { color: var(--brand-2); }
.book .pnl.up { color: var(--up); }
.book .pnl.down { color: var(--down); }
.book tr.dead td { color: var(--text-3); }
.book tr.dead .num { color: var(--text-3); }
.book tr.flash td { background: #150303; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 9px; border-radius: 2px; font-family: var(--f-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; }
.chip.open { background: var(--brand); color: #fff; }
.chip.open::after { content: "running"; }
.chip.liquidated::after { content: "lost"; }
.chip.closed::after { content: "cashed out"; }
.chip.pending::after { content: "waits for open"; }
.chip.cancelled::after { content: "cancelled"; }
.chip.open::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: ping 1.8s ease-out infinite; }
.chip.pending { border: 1px dashed #444; color: #aaa; }
.chip.liquidated { background: #fff; color: #000; }
.chip.closed { border: 1px solid #444; color: #aaa; }
.chip.cancelled { border: 1px solid #333; color: var(--text-3); }
.empty { display: none; padding: 48px 18px; text-align: center; font-family: var(--f-mono); font-size: 12.5px; color: var(--text-3); line-height: 1.8; }
.empty b { display: block; color: #fff; font-family: var(--f-num); font-weight: 600; font-size: 26px; letter-spacing: .02em; }
.board.is-empty .tblw { display: none; }
.board.is-empty .empty { display: block; }
.note { font-family: var(--f-mono); font-size: 11px; color: var(--text-3); margin-top: 14px; line-height: 1.7; }


footer { margin-top: clamp(70px, 8vw, 120px); border-top: 1px solid #1a0505; padding: 26px 0 40px; color: var(--text-3); font-size: 12.5px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* welcome: mascot rises from the bottom, then the bubble (same moves as Project SpaceX) */
.hello { position: fixed; inset: 0; z-index: 90; cursor: pointer; background: rgba(0, 0, 0, 0); transition: background .5s ease; }
.hello.on { background: rgba(0, 0, 0, .62); }
.hello-char { position: absolute; bottom: 0; left: 24%; transform: translate(-50%, 78%); opacity: 0; pointer-events: none;
  transition: transform .75s cubic-bezier(.16, 1, .3, 1), opacity .5s ease; }
.hello.on .hello-char { transform: translate(-50%, 0); opacity: 1; }
.hello-char img { display: block; height: min(64vh, 640px); width: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .6)); user-select: none; }
.hello-char img + img { position: absolute; left: 0; top: 0; }
.hello-char img { opacity: 0; transition: opacity .22s ease; }
.hello-char img.show { opacity: 1; }
.hello-bubble { position: absolute; left: calc(24% + min(17vh, 170px)); bottom: min(50vh, 500px); width: min(440px, 46vw);
  background: #fff; color: #0b0b0b; border-radius: 18px; padding: 20px 24px 16px;
  box-shadow: 0 0 0 3px #000, 0 24px 60px rgba(0, 0, 0, .55);
  opacity: 0; transform: translateY(14px) scale(.94); transform-origin: 0% 100%;
  transition: transform .55s cubic-bezier(.16, 1, .3, 1), opacity .35s ease; }
.hello-bubble::after { content: ""; position: absolute; left: 30px; bottom: -15px; width: 26px; height: 26px; background: #fff;
  transform: rotate(45deg) skew(12deg, 12deg); box-shadow: 3px 3px 0 0 #000; border-radius: 0 0 5px 0; }
.hello-bubble.in { opacity: 1; transform: none; }
.hello-name { font-family: var(--f-mono); font-weight: 800; font-size: 12px; letter-spacing: .14em; color: #000; margin-bottom: 6px; }
.hello-text { font-family: var(--f-ui); font-weight: 600; font-size: clamp(17px, 1.45vw, 21px); line-height: 1.38; min-height: 2.8em; }
.hello-hint { font-family: var(--f-mono); font-size: 11px; color: #777; text-align: right; margin-top: 10px; letter-spacing: .04em; }
.hello.leaving .hello-char { transition: transform .5s cubic-bezier(.5, 0, .75, 0), opacity .45s ease; }

@media (max-width: 1000px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .cards { grid-template-columns: 1fr; }
  .links { display: none; }
}
@media (max-width: 600px) {
  .stats { grid-template-columns: 1fr; }
  .stat .v { font-size: 32px; }
  .hello-char { left: 50%; }
  .hello-char img { height: 44vh; }
  .hello-bubble { left: 50%; bottom: calc(44vh + 26px); width: calc(100vw - 32px); transform: translate(-50%, 14px) scale(.94); transform-origin: 50% 100%; }
  .hello-bubble.in { transform: translate(-50%, 0); }
  .hello-bubble::after { left: 50%; margin-left: -13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
