:root {
  color-scheme: dark;
  --bg: #050506;
  --panel: #0b0c0e;
  --line: #2b2d32;
  --chart-grid: #222428;
  --ink: #f2f3f5;
  --muted: #a1a5ad;
  --accent: #ff994d;
  --green: #62e8a0;
  --red: #ff9877;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--mono);
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 86px; scroll-behavior: smooth; }
body {
  margin: 0;
  background-image: linear-gradient(#ffffff07 1px, transparent 1px), linear-gradient(90deg, #ffffff07 1px, transparent 1px);
  background-size: 48px 48px;
}
header, main, footer { max-width: 1480px; margin: auto; padding-inline: clamp(16px, 4vw, 56px); }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
header {
  position: sticky; top: 0; z-index: 4; min-height: 64px;
  display: flex; align-items: center; gap: clamp(14px, 4vw, 52px);
  background: #050506f5; border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: -.04em; white-space: nowrap; }
.brand img { display: block; flex: none; }
nav { display: flex; gap: clamp(12px, 3vw, 36px); color: var(--muted); font-size: 11px; text-transform: uppercase; }
nav a:hover, .note a:hover { color: var(--accent); }
header > button { margin-left: auto; white-space: nowrap; }

button, input, select { font: inherit; }
button, .hero-actions a {
  cursor: pointer; min-height: 42px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 3px; font-size: 12px;
  transition: color .16s, border-color .16s, background .16s;
}
button:disabled { opacity: .45; cursor: not-allowed; }
.outline { background: #0d0e10; color: var(--ink); }
.outline:hover { background: var(--ink); color: var(--bg); }
.primary, .accent-outline {
  border-color: var(--accent); background: #ff994d17; color: var(--accent);
}
.primary { width: 100%; text-align: left; }
.primary:hover, .accent-outline:hover { background: var(--accent); color: #13100d; }
.danger { color: var(--red); border-color: var(--red); background: #ff987719; }
.danger:hover { background: var(--red); color: #15100e; }

.intro {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 472px; display: flex; align-items: center;
  margin-top: 20px; border: 1px solid var(--line); background: #030304;
}
.intro::before, .intro::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  width: 23px; height: 23px; border-color: var(--accent); border-style: solid;
}
.intro::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.intro::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
#rotation-field, .hero-scrim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-scrim {
  background: linear-gradient(90deg, #030304 0%, #030304e8 31%, #0303044d 75%, transparent),
    radial-gradient(ellipse at 20% 80%, #ff8b2912, transparent 60%);
}
.hero-copy { position: relative; z-index: 1; padding: clamp(24px, 5vw, 70px); max-width: 1050px; }
.terminal-label { letter-spacing: .16em; font-size: 10px; margin: 0 0 22px; }
.terminal-label span, h1 i { color: var(--accent); font-style: normal; }
h1 { font-size: clamp(27px, 5.3vw, 73px); line-height: 1.05; letter-spacing: -.075em; margin: 0; }
.scramble {
  background: linear-gradient(100deg, #fff0dc, var(--accent) 65%, #ffc089);
  background-clip: text; color: transparent; white-space: nowrap;
}
h1 + p { max-width: 49ch; margin: 19px 0; }
p { font-size: 13px; line-height: 1.65; color: var(--muted); }
.hero-actions, .hero-chips, .actions { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-chips { margin: 22px 0; }
.hero-chips span {
  color: var(--muted); font-size: 9px; letter-spacing: .08em; padding: 5px 8px;
  border: 1px solid var(--line); background: #0b0c0edb;
  animation: chip-in .45s ease both;
}
.hero-chips span:nth-child(2) { animation-delay: .12s; }
.hero-chips span:nth-child(3) { animation-delay: .24s; }
.hero-actions a { display: inline-flex; align-items: center; gap: 12px; text-transform: uppercase; }

.market-strip {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line); border-top: 0; background: #0b0c0e;
}
.market-strip > div { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 12px; padding: 13px 15px; }
.market-strip > div + div { border-left: 1px solid var(--line); }
.market-strip > p { grid-column: 1 / -1; padding-inline: 14px; }
.market-strip b { color: var(--accent); font-size: 11px; }
.market-strip strong { font-size: 12px; }
.market-strip small { color: var(--muted); font-size: 10px; }
.network-bar { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0 19px; font-size: 10px; color: var(--muted); }
.network-bar > span:first-child::before, .live-dot::before {
  content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px;
  border-radius: 50%; background: var(--green); animation: status-pulse 2.8s ease-out infinite;
}

.workspace { display: grid; grid-template-columns: 195px minmax(0, 1fr) 305px; gap: 10px; align-items: stretch; }
.instrument-panel, .chart-panel, .ticket, #positions, .fund, .explainer {
  min-width: 0; border: 1px solid var(--line); border-radius: 3px; background: var(--panel);
}
.instrument-panel, .chart-panel, .ticket { padding: 16px; }
.instrument-panel h2, .chart-heading h2 { font-size: 13px; margin: 0; }
.instrument-panel h2 { display: flex; justify-content: space-between; margin-bottom: 12px; }
.instrument-panel h2 span, .eyebrow, .section-title span { color: var(--accent); font-size: 10px; letter-spacing: .1em; }
.instrument-search { font-size: 10px; }
#instrument-list { max-height: 565px; overflow: auto; scrollbar-width: thin; }
.instrument-row {
  width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto;
  gap: 5px; text-align: left; background: transparent; color: var(--ink);
  padding: 9px 6px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
}
.instrument-row span { font-size: 11px; }
.instrument-row small { font-size: 9px; color: var(--muted); grid-column: 1 / -1; }
.instrument-row:hover, .instrument-row.selected { background: #ff994d12; }
.instrument-row.selected { box-shadow: inset 2px 0 var(--accent); }
.chart-panel { display: flex; flex-direction: column; }
.pair-composer { padding-bottom: 15px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.pair-select { display: grid; grid-template-columns: minmax(0, 1fr) 20px minmax(0, 1fr); align-items: end; gap: 8px; margin-top: 12px; }
.versus { color: var(--muted); font-size: 10px; text-align: center; align-self: center; }
.green { color: var(--green); }
.red { color: var(--red); }
label { display: grid; gap: 7px; color: var(--muted); font-size: 11px; min-width: 0; }
input, select {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px;
  color: var(--ink); background: #060709; border: 1px solid #41444b; border-radius: 3px;
}
input::placeholder { color: var(--muted); }
.chart-heading, .chart-bottom, .ticket-heading, .section-title.row { display: flex; justify-content: space-between; align-items: center; gap: 9px; }
.chart-heading p { font-size: 10px; margin: 5px 0; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 9px; font-size: 10px; }
.chart-area { flex: 1; min-height: 270px; display: grid; place-items: center; }
.chart-area svg { width: 100%; height: 100%; min-height: 270px; }
.chart-area p { padding-inline: 12px; text-align: center; }
.chart-bottom, .chart-disclaimer, .ticket-heading { color: var(--muted); font-size: 10px; }
.chart-bottom { flex-wrap: wrap; margin-top: auto; }
.range-controls { display: flex; gap: 3px; }
.range-controls button { min-height: 34px; padding: 5px 8px; color: var(--muted); background: #060709; }
.range-controls button.active { color: var(--accent); border-color: var(--accent); }
.ticket-heading { padding-bottom: 12px; border-bottom: 1px solid var(--line); letter-spacing: .09em; }
.ticket-heading .live-dot { white-space: nowrap; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.fields label:first-child { grid-column: 1 / -1; }
.account, #review-box { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 13px; }
.account h3 { font-size: 12px; }
.account small { color: var(--accent); font-size: 9px; }
.note, .market-details { font-size: 11px; line-height: 1.6; color: var(--muted); }
.note a, #positions > a, #fund-tx { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
summary { cursor: pointer; }
summary:hover { color: var(--accent); }

#positions, .fund, .explainer { margin-top: 12px; padding: 20px; }
.section-title h2 { margin: 5px 0; font-size: clamp(18px, 3vw, 26px); letter-spacing: -.04em; }
.section-title.row { padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.empty { padding: 20px 0; text-align: center; font-size: 13px; }
.empty-icon { display: block; color: var(--accent); font-size: 25px; padding-bottom: 6px; }
.metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-block: 15px; text-align: left; }
.metrics > div, .example { padding: 12px; border: 1px solid var(--line); background: var(--bg); }
.metrics small { color: var(--muted); display: block; margin-bottom: 6px; }
.position-leg { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); }
#positions > a, #fund-tx { font-size: 11px; }
.explainer > summary { display: flex; justify-content: space-between; font-size: 13px; }
.thesis { max-width: 690px; margin-top: 15px; }
.example { font-size: 12px; }
.example > div { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; }
.example > span { color: var(--muted); font-size: 10px; }
.example .total { border-top: 1px solid var(--line); padding-top: 10px; }
.fund { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.fund > div:last-child { display: grid; gap: 10px; align-content: start; min-width: 0; }
#fund-details { overflow-wrap: anywhere; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-block: 24px; color: var(--muted); font-size: 10px; }
footer a { color: var(--accent); }
footer a:hover { text-decoration: underline; }
#notice {
  position: fixed; right: 16px; bottom: 16px; z-index: 10; width: min(420px, calc(100vw - 32px));
  padding: 13px; border: 1px solid var(--accent); border-radius: 3px; background: #101113;
  color: var(--ink); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere;
  box-shadow: 0 12px 32px #000b;
}
.skip { position: absolute; z-index: 15; left: 10px; top: 8px; transform: translateY(-180%); padding: 10px; background: var(--bg); }
.skip:focus { transform: none; }
.arrived { animation: section-arrive .45s ease both; }

@keyframes chip-in { from { opacity: 0; transform: translateY(5px); } }
@keyframes status-pulse { 0% { box-shadow: 0 0 0 0 #62e8a077; } 80%, 100% { box-shadow: 0 0 0 6px #62e8a000; } }
@keyframes section-arrive { from { opacity: .6; transform: translateY(8px); } }

@media (max-width: 1080px) { .workspace { grid-template-columns: 148px minmax(0, 1fr) 255px; } }
@media (max-width: 870px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 235px; }
  .instrument-panel { grid-column: 1 / -1; }
  #instrument-list { max-height: 115px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 8px; }
}
@media (max-width: 650px) {
  html { scroll-padding-top: 108px; }
  header { min-height: 83px; padding-block: 8px; flex-wrap: wrap; gap: 7px; }
  .brand { font-size: 13px; gap: 6px; }
  header > button { min-height: 33px; font-size: 10px; padding: 6px 8px; }
  nav { order: 3; width: 100%; gap: 24px; padding-block: 6px; }
  .intro { min-height: 340px; margin-top: 12px; }
  .hero-scrim { background: linear-gradient(90deg, #030304f7, #03030466); }
  .hero-copy { padding: 20px; }
  .hero-actions a { font-size: 10px; min-height: 36px; padding: 7px 9px; }
  .market-strip > div { padding: 8px; }
  .market-strip small, .network-bar > span:last-child { display: none; }
  .market-strip strong { font-size: 10px; }
  .workspace, .fund { grid-template-columns: minmax(0, 1fr); }
  #instrument-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 107px; }
  .chart-area, .chart-area svg { min-height: 200px; }
  .metrics { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
