/* marea.systems — styled as a Dear ImGui application (the engine marea's own
   terminal is built on). Default dark theme colors, the signature #4296fa
   accent, title-barred windows, collapsing headers, a bottom status bar.
   No webfonts. Hand-built (no public ImGui CSS framework exists). */

:root {
  --imgui-blue: #4296fa;          /* (0.26,0.59,0.98) — the ImGui accent */
  --imgui-blue-active: #0f87fa;   /* (0.06,0.53,0.98) */
  --win-bg: #0f0f0f;              /* WindowBg */
  --child-bg: #141414;
  --frame-bg: #1a2740;           /* FrameBg-ish (dark blue) */
  --title-bg: #0a0a0a;           /* TitleBg */
  --title-active: #294a7a;       /* TitleBgActive */
  --border: rgba(110, 110, 128, 0.5);
  --text: #e8e8e8;
  --text-dim: #9a9a9a;
  --text-disabled: #6a6a6a;
  --green: #4ec9a0;
  --red: #f04a52;
  --sans: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "SF Mono", ui-monospace, monospace;
  --round: 4px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--text);
  background:
    radial-gradient(900px 500px at 50% -10%, #15233b 0%, transparent 60%),
    #07070a;
  line-height: 1.5;
  padding: 18px 16px 56px;        /* room for status bar */
}

a { color: var(--imgui-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.dim { color: var(--text-dim); }
.up { color: var(--green); }
.down { color: var(--red); }
.center { text-align: center; }

/* ── Menu bar (ImGui BeginMainMenuBar) ───────────────────────────────── */
.menubar {
  max-width: 1040px; margin: 0 auto 14px; background: #141414;
  border: 1px solid var(--border); border-radius: var(--round);
  display: flex; align-items: center; gap: 2px; padding: 3px 6px; font-size: 13px;
}
.menubar .brand { font-weight: 700; color: #fff; padding: 3px 10px 3px 4px; display: flex; align-items: center; gap: 7px; }
.menubar .brand svg { color: var(--imgui-blue); }
.menubar a { color: var(--text); padding: 4px 9px; border-radius: 3px; }
.menubar a:hover { background: rgba(66,150,250,0.31); text-decoration: none; }
.menubar .spacer { flex: 1; }

/* ── Window (ImGui Begin) ────────────────────────────────────────────── */
.win {
  max-width: 1040px; margin: 0 auto 18px; background: var(--win-bg);
  border: 1px solid var(--border); border-radius: var(--round); overflow: hidden;
  box-shadow: 0 18px 50px -24px #000;
}
.win.narrow { max-width: 760px; }
.titlebar {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: var(--title-active); color: #fff; font-weight: 600; font-size: 13px;
}
.titlebar .dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; opacity: 0.5; }
.titlebar .ttl { flex: 1; }
.titlebar .x { display: none; } /* close button removed */
.win-body { padding: 18px 20px; }

/* ── Typography ──────────────────────────────────────────────────────── */
h1 { font-size: 34px; line-height: 1.08; letter-spacing: -0.5px; margin-bottom: 10px; font-weight: 800; }
h1 .accent { color: var(--imgui-blue); }
h2 { font-size: 20px; margin-bottom: 8px; font-weight: 700; }
h3 { font-size: 15px; margin-bottom: 5px; font-weight: 600; }
p { margin-bottom: 10px; }
.lead { color: var(--text-dim); max-width: 62ch; }

/* ── Buttons (ImGui Button: translucent blue, full on hover) ─────────── */
.btn {
  display: inline-block; font-family: var(--sans); font-size: 14px; cursor: pointer; border: 0;
  background: rgba(66,150,250,0.40); color: #fff; padding: 8px 18px; border-radius: var(--round);
  text-decoration: none; transition: background 0.08s;
}
.btn:hover { background: var(--imgui-blue); text-decoration: none; }
.btn:active { background: var(--imgui-blue-active); }
.btn.ghost { background: rgba(110,110,128,0.22); }
.btn.ghost:hover { background: rgba(110,110,128,0.40); }
.btn:focus-visible { outline: 1px solid var(--imgui-blue); outline-offset: 2px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn.full { display: block; text-align: center; }

/* ── Separator ───────────────────────────────────────────────────────── */
.sep { height: 1px; background: var(--border); margin: 16px 0; border: 0; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 22px; align-items: start; }
.pill { display: inline-block; font-size: 12px; font-family: var(--mono); color: var(--imgui-blue);
  background: rgba(66,150,250,0.14); border: 1px solid rgba(66,150,250,0.4); padding: 3px 9px;
  border-radius: 999px; margin-bottom: 14px; }
.meta-line { font-family: var(--mono); font-size: 12px; color: var(--text-dim); margin-top: 14px; }

/* ── Child window / frame (sunken panel) ─────────────────────────────── */
.child {
  background: var(--child-bg); border: 1px solid var(--border); border-radius: var(--round); padding: 4px;
}
.child-head { font-family: var(--mono); font-size: 12px; color: var(--text-dim);
  padding: 5px 8px; border-bottom: 1px solid var(--border); }

/* ── Tables (watchlist) ──────────────────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 13px; }
.tbl th { text-align: right; color: var(--text-dim); font-weight: 600; padding: 5px 8px;
  border-bottom: 1px solid var(--border); }
.tbl th:first-child { text-align: left; }
.tbl td { padding: 4px 8px; text-align: right; border-bottom: 1px solid rgba(110,110,128,0.18); }
.tbl td:first-child { text-align: left; font-weight: 700; color: #fff; }
.tbl tr:hover td { background: rgba(66,150,250,0.10); }
#ticks li { display: contents; }

/* ── Ticker (status-bar feed) ────────────────────────────────────────── */
.ticker { overflow: hidden; }
.ticker-track { display: inline-block; white-space: nowrap; animation: ticker 34s linear infinite;
  font-family: var(--mono); }
.ticker-item { padding: 0 18px; }
@keyframes ticker { from { transform: translateX(0); } to { transform: translateX(-25%); } }

/* ── Features ────────────────────────────────────────────────────────── */
.feat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.feat { background: var(--child-bg); border: 1px solid var(--border); border-radius: var(--round); padding: 14px 16px; }
.feat h3 { color: #fff; }
.feat p { color: var(--text-dim); margin: 0; }

/* Tier coding: Tape = gray, Desk = blue */
.tier-legend { display: flex; gap: 18px; align-items: center; margin: 4px 0 16px; font-size: 13px; color: var(--text-dim); }
.tier-tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.tier-tag.tape { background: rgba(154,154,162,0.18); color: #c8c8d0; border: 1px solid rgba(154,154,162,0.45); }
.tier-tag.desk { background: rgba(66,150,250,0.18); color: #7fb6ff; border: 1px solid rgba(66,150,250,0.5); }
.feat-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feat-col { background: var(--child-bg); border: 1px solid var(--border); border-radius: var(--round); padding: 14px 16px; }
.tier-head { font-size: 13px; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 8px; }
.tier-head.tape { color: #c8c8d0; }
.tier-head.desk { color: #7fb6ff; }
.feat-tags { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.feat-tags li { font-size: 13px; color: var(--text-dim); padding-left: 18px; position: relative; }
.feat-tags li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 2px; }
.feat-tags li.tape::before { background: #9a9aa2; }
.feat-tags li.desk::before { background: var(--imgui-blue); }
.tabs-tier { margin-left: auto; align-self: center; }
@media (max-width: 760px) { .feat-cols { grid-template-columns: 1fr; } }

/* ── Collapsing headers (FAQ + sections) ─────────────────────────────── */
.collapse { margin-bottom: 6px; }
.collapse > summary {
  cursor: pointer; list-style: none; padding: 9px 12px; font-weight: 600;
  background: rgba(66,150,250,0.31); border-radius: var(--round); color: var(--text);
}
.collapse > summary:hover { background: rgba(66,150,250,0.55); }
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary::before { content: "+  "; font-family: var(--mono); color: var(--imgui-blue); }
.collapse[open] > summary::before { content: "\2212  "; }
.collapse > div { padding: 10px 14px 14px; color: var(--text-dim); }

/* ── Tabs (ImGui tab bar) ────────────────────────────────────────────── */
.tabs { display: flex; flex-wrap: wrap; gap: 3px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.tab { font-family: var(--sans); font-size: 13px; cursor: pointer; border: 0; color: var(--text-dim);
  background: rgba(110,110,128,0.14); padding: 7px 14px; border-radius: var(--round) var(--round) 0 0; }
.tab:hover { background: rgba(66,150,250,0.28); color: var(--text); }
.tab.active { background: var(--title-active); color: #fff; }
.tab:focus-visible { outline: 1px solid var(--imgui-blue); outline-offset: -2px; }
/* per-tab tier dot: Tape gray, Desk blue */
.tab::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 7px; vertical-align: middle; }
.tab.tape::before { background: #9a9aa2; }
.tab.desk::before { background: var(--imgui-blue); }
.tabs-key { margin-left: auto; align-self: center; font-size: 11px; color: var(--text-dim); }
.tabs-key .d { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin: 0 5px 0 12px; vertical-align: middle; }
.tabs-key .d.tape { background: #9a9aa2; }
.tabs-key .d.desk { background: var(--imgui-blue); }

/* Trades tape (HTML, animated) */
.trades-pane { }
.trades-wrap { background: #06070a; border: 1px solid var(--border); border-radius: var(--round); height: 360px; display: flex; flex-direction: column; overflow: hidden; }
.trades-tbl { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 12px; flex: 1; }
.trades-tbl th { text-align: right; color: var(--text-dim); font-weight: 600; padding: 6px 12px; border-bottom: 1px solid var(--border); }
.trades-tbl th:first-child { text-align: left; }
.trades-tbl td { padding: 3px 12px; text-align: right; border-bottom: 1px solid rgba(110,110,128,0.10); }
.trades-tbl td.time { text-align: left; color: var(--text-dim); }
.trades-tbl td.side { font-weight: 700; }
.tr-buy td.side { color: #3fb96b; } .tr-sell td.side { color: #e0555a; }
.tr-buy { background: rgba(63,185,107,0.06); } .tr-sell { background: rgba(224,85,90,0.06); }
.trades-foot { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 11px; color: var(--text-dim); }
.tf-tf { padding: 1px 7px; border-radius: 3px; }
.tf-tf.on { color: #fff; background: rgba(66,150,250,0.32); }
.ratio-bar { flex: 1; height: 12px; border-radius: 3px; overflow: hidden; display: flex; border: 1px solid var(--border); }
.ratio-bar .b { background: #2e7d4f; } .ratio-bar .s { background: #9e3a3f; }

/* ── GEX-by-strike distribution (animated canvas) ────────────────────── */
.gex-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.gex-ctl { font-size: 11px; color: var(--text-dim); background: rgba(66,150,250,0.10);
  border: 1px solid var(--border); border-radius: 3px; padding: 3px 9px; }
.gex-canvas { display: block; width: 100%; height: 360px; background: #06070a;
  border: 1px solid var(--border); border-radius: var(--round); }
.gex-legend { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.gex-legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px;
  vertical-align: middle; margin-right: 6px; }
.lg.put { background: #e0555a; }
.lg.call { background: #3fb96b; }
.lg.net { background: #5a86c8; }
.lg.spot { background: #f2c14e; width: 3px; height: 13px; border-radius: 0; }
.gex-status { margin-top: 8px; font-size: 12px; color: var(--text-dim); }

/* NetGEX lattice tab (strike x expiry heatmap) */
.lat-pane { padding: 6px; overflow-x: auto; }
.lat-grid { display: grid; gap: 2px; font-family: var(--mono); font-size: 11px; min-height: 360px;
  grid-auto-rows: 1fr; }
.lat { padding: 0 5px; display: flex; align-items: center; justify-content: flex-end; white-space: nowrap;
  color: #f0f0f4; border-radius: 2px; text-shadow: 0 1px 2px rgba(0,0,0,0.85); }
.lat-h { color: var(--text-dim); text-shadow: none; justify-content: flex-end; }
.lat-k { color: var(--text-dim); justify-content: flex-start; text-shadow: none; }
.lat-spot { outline: 2px solid #30cdf2; outline-offset: -2px; }
.lat.p3{background:#ff6a12}.lat.p2{background:#b9701d}.lat.p1{background:#4a371c}
.lat.z{background:#16161d}
.lat.n1{background:#392747}.lat.n2{background:#7a3fb0}.lat.n3{background:#c24de0}

/* ── Screenshots gallery ─────────────────────────────────────────────── */
.shot-stage { position: relative; background: #06070a; border: 1px solid var(--border); border-radius: var(--round); overflow: hidden; }
.shot-img { display: block; width: 100%; height: auto; max-width: 100%; background: #06070a; cursor: zoom-in; }

/* Screenshot lightbox (click a shot to zoom) */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 48px); background: rgba(5,6,10,0.94); cursor: zoom-out;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.lightbox.open { display: flex; }
.lightbox img { max-width: 96vw; max-height: 90vh; width: auto; height: auto; border: 1px solid var(--border);
  border-radius: var(--round); box-shadow: 0 30px 90px rgba(0,0,0,0.6); cursor: default; }
.lb-close { position: absolute; top: 16px; right: 20px; background: none; border: 0; color: var(--text-dim);
  font-size: 26px; line-height: 1; cursor: pointer; padding: 6px; }
.lb-close:hover { color: var(--text); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text); font-size: 26px; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb-nav:hover { background: rgba(66,150,250,0.2); border-color: var(--imgui-blue); }
.lb-prev { left: 18px; } .lb-next { right: 18px; }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: var(--text-dim);
  font-size: 13px; pointer-events: none; }
@media (max-width: 640px) { .lb-nav { width: 38px; height: 38px; font-size: 22px; } }
.shot-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 38px; height: 48px; border: 0; cursor: pointer;
  background: rgba(10,10,10,0.6); color: #fff; font-size: 24px; line-height: 1; border-radius: var(--round); }
.shot-nav:hover { background: rgba(66,150,250,0.7); }
.shot-nav.prev { left: 10px; } .shot-nav.next { right: 10px; }
.shot-cap { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.shot-name { font-weight: 600; }
.shot-counter { margin-left: auto; color: var(--text-dim); font-size: 12px; }
.shot-thumbs { display: flex; gap: 8px; margin-top: 12px; overflow-x: auto; padding-bottom: 4px; }
.shot-thumb { flex: 0 0 auto; width: 104px; aspect-ratio: 1690 / 1075; border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; cursor: pointer; opacity: 0.55; transition: opacity 0.12s, border-color 0.12s; padding: 0; background: #06070a; }
.shot-thumb:hover { opacity: 0.85; }
.shot-thumb.active { opacity: 1; border-color: var(--imgui-blue); }
.shot-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Pricing (three child windows) ───────────────────────────────────── */
.price-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch;
  max-width: 1040px; margin: 0 auto 44px; }
.price-win { display: flex; flex-direction: column; margin: 0; max-width: none; width: 100%; }
.price-win .win-body { display: flex; flex-direction: column; flex: 1; }
.price-amt { font-size: 32px; font-weight: 800; margin: 8px 0 2px; }
.price-amt small { font-size: 13px; font-weight: 400; color: var(--text-dim); }
.price-desc { color: var(--text-dim); min-height: 40px; }
.price-feats { list-style: none; margin: 10px 0 16px; }
.price-feats li { position: relative; padding: 4px 0 4px 20px; color: var(--text-dim); }
.price-feats li::before { content: "\2713"; position: absolute; left: 0; color: var(--imgui-blue); font-weight: 700; }
.price-win .btn { margin-top: auto; }
.founder .titlebar { background: linear-gradient(90deg,#7a3d00,#d07f10); }
.founder-note { font-size: 12px; color: #ffb060; text-align: center; margin-top: 8px; }

/* ── Status bar (bottom, ImGui app footer) ───────────────────────────── */
.statusbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 50;
  background: #0a0a0a; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 14px; padding: 0 12px; font-family: var(--mono); font-size: 12px;
  color: var(--text-dim);
}
.statusbar .live { color: var(--green); }
.statusbar .feed { flex: 1; overflow: hidden; }
.statusbar .right { color: var(--text-dim); }
.statusbar .status-link { color: var(--accent); }
.statusbar .status-link:hover { text-decoration: underline; }

/* ── Footer / disclaimer ─────────────────────────────────────────────── */
.disclaimer { max-width: 1040px; margin: 0 auto; color: var(--text-disabled); font-size: 11px;
  line-height: 1.6; padding: 4px 6px 10px; }

@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; }
  .feat-grid { grid-template-columns: 1fr; }
  .price-row { grid-template-columns: 1fr; }
  h1 { font-size: 26px; }
  .menubar .hide-sm { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  html { scroll-behavior: auto; }
}
