/* Trade of Avaros — one stylesheet, no build step.
   Dark is the default (a terminal at night); light follows the system. */

:root {
  color-scheme: dark light;

  --bg: #08090b;
  --bg-soft: #0e1013;
  --surface: rgba(255, 255, 255, 0.045);
  --surface-solid: #14161a;
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --text-dim: #a3a3ab;
  --text-faint: #6e6e78;
  --accent: #5ac8fa;
  --accent-deep: #0a84ff;
  --up: #32d74b;
  --down: #ff453a;
  --warn: #ffd60a;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 18px 48px -28px rgba(0, 0, 0, 0.9);
  --blur: saturate(180%) blur(20px);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #fbfbfd;
    --bg-soft: #f2f2f5;
    --surface: #ffffff;
    --surface-solid: #ffffff;
    --hairline: rgba(0, 0, 0, 0.08);
    --hairline-strong: rgba(0, 0, 0, 0.14);
    --text: #1d1d1f;
    --text-dim: #5f5f66;
    --text-faint: #8e8e93;
    --accent: #0071e3;
    --accent-deep: #0062c4;
    --up: #0f8b34;
    --down: #d70015;
    --warn: #a86b00;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 14px 40px -26px rgba(0, 0, 0, 0.28);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100svh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(90, 200, 250, 0.10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
    "Segoe UI", Inter, Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol, ul, figure { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.shell {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 32px);
}

/* ─────────────────────────────────────────────── top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 76%, transparent);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--hairline);
}

.topbar__inner {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
}
.brand:hover { text-decoration: none; }
.brand__mark { width: 28px; height: 28px; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand__name { font-weight: 600; font-size: 15px; letter-spacing: -0.02em; white-space: nowrap; }
.brand__sub { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; }

.tabs {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs__item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease;
}
.tabs__item:hover { color: var(--text); }
.tabs__item.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 12%, transparent);
}

.topbar__right { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-dim);
  background: var(--surface);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}
.pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
  flex: none;
}
.pill[data-code="RUNNING"] .pill__dot,
.pill[data-code="IN_TRADE"] .pill__dot {
  background: var(--up);
  box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.55);
  animation: pulse 2.4s ease-out infinite;
}
.pill[data-code="RUNNING"],
.pill[data-code="IN_TRADE"] { color: var(--text); }
.pill[data-code="STANDBY"] .pill__dot { background: var(--warn); }
.pill[data-code="HALTED"] .pill__dot { background: var(--down); }

.mode {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: 7px;
  padding: 4px 7px;
}
.mode.is-live {
  color: var(--up);
  border-color: color-mix(in srgb, var(--up) 40%, transparent);
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(50, 215, 75, 0); }
  100% { box-shadow: 0 0 0 0 rgba(50, 215, 75, 0); }
}

/* ─────────────────────────────────────────────── views */

.view { display: none; padding: clamp(28px, 6vw, 56px) 0 8px; }
.view.is-active { display: block; }

.view.is-active > * {
  animation: rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.view.is-active > *:nth-child(2) { animation-delay: 0.04s; }
.view.is-active > *:nth-child(3) { animation-delay: 0.08s; }
.view.is-active > *:nth-child(4) { animation-delay: 0.12s; }
.view.is-active > *:nth-child(5) { animation-delay: 0.16s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
  html { scroll-behavior: auto; }
}

/* ─────────────────────────────────────────────── hero */

.hero { padding: 8px 0 clamp(24px, 5vw, 40px); }

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.hero__num {
  font-size: clamp(46px, 11vw, 92px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "ss01" 1;
}

.hero__row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 14px;
}

.delta {
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.delta.is-up { color: var(--up); }
.delta.is-down { color: var(--down); }
.delta.is-flat { color: var(--text-dim); }

.hero__meta { font-size: 13.5px; color: var(--text-dim); }

.spark {
  display: block;
  width: 100%;
  height: 88px;
  margin-top: 22px;
}

/* ─────────────────────────────────────────────── cards & grids */

.card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card--pad { padding: 20px 22px; }

.grid { display: grid; gap: 14px; margin-bottom: clamp(20px, 4vw, 28px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 760px) {
  .grid--2, .grid--3 { grid-template-columns: minmax(0, 1fr); }
}

.stat { padding: 18px 20px; }
.label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat__num {
  font-size: clamp(22px, 3.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}
.stat__sub { font-size: 12.5px; color: var(--text-dim); margin-top: 4px; }
.is-up { color: var(--up); }
.is-down { color: var(--down); }
.is-flat { color: var(--text-dim); }

.card__title { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-top: 8px; }
.card__sub { font-size: 13.5px; color: var(--text-dim); margin-top: 4px; }

.section-title {
  font-size: clamp(18px, 2.6vw, 21px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin: clamp(32px, 6vw, 48px) 0 6px;
}
.section-note { font-size: 13.5px; color: var(--text-dim); margin-bottom: 16px; max-width: 62ch; }

/* ─────────────────────────────────────────────── tuna */

.tuna { padding: 20px 22px; margin-bottom: clamp(20px, 4vw, 28px); }
.tuna__head { display: flex; align-items: flex-start; gap: 14px; }
.tuna__avatar {
  width: 44px; height: 44px; flex: none;
  border-radius: 13px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  padding: 7px;
}
.tuna__who {
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.tuna__role {
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
}
.tuna__headline { font-size: 16.5px; font-weight: 600; letter-spacing: -0.02em; margin-top: 3px; }
.tuna__ago { margin-left: auto; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.tuna__detail { font-size: 14.5px; color: var(--text-dim); margin-top: 12px; max-width: 68ch; }
.tuna[data-mood="pleased"] .tuna__avatar { border-color: color-mix(in srgb, var(--up) 45%, var(--hairline)); }
.tuna[data-mood="careful"] .tuna__avatar { border-color: color-mix(in srgb, var(--warn) 45%, var(--hairline)); }

/* ─────────────────────────────────────────────── position */

.position { padding: 20px 22px; margin-bottom: clamp(20px, 4vw, 28px); }
.position__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.position__sym { font-size: 24px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; }
.position__pnl { text-align: right; }
.position__pnlnum {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
}

.track { margin: 20px 0 4px; }
.track__bar {
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text) 9%, transparent);
  overflow: hidden;
  position: relative;
}
.track__fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--down), var(--warn) 42%, var(--up));
  transform-origin: left center;
  transform: scaleX(0);
  will-change: transform;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.track__marks {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; }
.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 999px;
  color: var(--text-dim);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid var(--hairline);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip--good { color: var(--up); border-color: color-mix(in srgb, var(--up) 32%, transparent); }
.chip--bad { color: var(--down); border-color: color-mix(in srgb, var(--down) 32%, transparent); }
.chip--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 32%, transparent); }

/* ─────────────────────────────────────────────── feed */

.feed { list-style: none; padding: 0; position: relative; }
.feed::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 12px;
  bottom: 16px;
  width: 1px;
  background: linear-gradient(180deg, var(--hairline-strong), transparent);
}
.feed__item { position: relative; padding: 12px 0 12px 42px; }
.feed__dot {
  position: absolute;
  left: 9px;
  top: 18px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--hairline-strong);
  display: grid;
  place-items: center;
}
.feed__dot::after {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-faint);
}
.feed__item[data-kind="trade"] .feed__dot::after { background: var(--accent); }
.feed__item[data-kind="entry"] .feed__dot::after { background: var(--up); }
.feed__item[data-kind="pass"] .feed__dot::after { background: var(--text-faint); }

.feed__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.feed__title { font-size: 14.5px; font-weight: 600; letter-spacing: -0.015em; }
.feed__hash {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border-radius: 5px;
  padding: 1px 5px;
}
.feed__ago { font-size: 12px; color: var(--text-faint); }
.feed__msg { font-size: 13.5px; color: var(--text-dim); margin-top: 3px; }
.feed__amt { font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; margin-left: auto; }
.feed__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }

/* ─────────────────────────────────────────────── tables */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 4px 8px;
}
.table { width: 100%; border-collapse: collapse; min-width: 620px; }
.table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}
.table td {
  padding: 13px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid color-mix(in srgb, var(--hairline) 60%, transparent);
  vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--text) 3%, transparent); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .sym { font-weight: 600; letter-spacing: -0.01em; }
.table .muted { color: var(--text-dim); }
.table .mono { font-family: var(--mono); font-size: 12px; color: var(--text-faint); }
.table .rank { font-variant-numeric: tabular-nums; color: var(--text-faint); font-size: 12px; }
.table .win { color: var(--up); font-weight: 600; }

/* ─────────────────────────────────────────────── blocked */

.blocked { list-style: none; padding: 0; display: grid; gap: 8px; }
.blocked__item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 13.5px;
  flex-wrap: wrap;
}
.blocked__sym { font-weight: 600; min-width: 84px; }
.blocked__reason { color: var(--text-dim); flex: 1 1 240px; }
.blocked__ago { color: var(--text-faint); font-size: 12px; margin-left: auto; }

/* ─────────────────────────────────────────────── lifecycle */

.lifecycle { list-style: none; padding: 0; display: grid; gap: 8px; }
.lifecycle__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-size: 13.5px;
  flex-wrap: wrap;
}
.stage {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--hairline-strong);
  color: var(--text-dim);
  white-space: nowrap;
}
.stage[data-stage="LIVE_SNIPER"] {
  color: var(--up);
  border-color: color-mix(in srgb, var(--up) 40%, transparent);
  background: color-mix(in srgb, var(--up) 10%, transparent);
}
.stage[data-stage="SHADOW_INCUBATOR"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
.stage[data-stage="RETIRED"] { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.lifecycle__name { font-weight: 600; flex: 1 1 180px; }
.lifecycle__meta { color: var(--text-dim); font-variant-numeric: tabular-nums; }

/* ─────────────────────────────────────────────── reports */

.reports { list-style: none; padding: 0; display: grid; gap: 10px; }
.report {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.report:hover { border-color: var(--hairline-strong); transform: translateY(-1px); }
.report__title { font-weight: 600; font-size: 14.5px; }
.report__meta { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.report__chev { margin-left: auto; color: var(--text-faint); font-size: 18px; }

/* ─────────────────────────────────────────────── prose */

.prose { font-size: 14.5px; line-height: 1.65; color: var(--text-dim); }
.prose > * + * { margin-top: 0.85em; }
.prose h1, .prose h2, .prose h3 {
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 1.6em;
}
.prose h1 { font-size: 22px; }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 15.5px; }
.prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 0.35em; }
.prose code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  padding: 1px 5px;
  border-radius: 5px;
}
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 1.6em 0; }
.prose blockquote {
  border-left: 2px solid var(--hairline-strong);
  padding-left: 14px;
  color: var(--text-dim);
  font-style: italic;
}
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; }
.prose th, .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hairline); }

/* ─────────────────────────────────────────────── modal */

.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal__body {
  position: relative;
  width: min(760px, 100%);
  max-height: min(84svh, 900px);
  overflow: auto;
  padding: 22px 26px 30px;
  background: var(--surface-solid);
  animation: rise 0.28s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal__head {
  position: sticky;
  top: -22px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 14px;
  margin-bottom: 6px;
  background: var(--surface-solid);
  border-bottom: 1px solid var(--hairline);
}
.modal__head h2 { font-size: 17px; letter-spacing: -0.02em; margin: 0; }
.modal__close {
  margin-left: auto;
  appearance: none;
  border: 0;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

/* ─────────────────────────────────────────────── footer & empty */

.foot {
  margin-top: clamp(48px, 10vw, 90px);
  padding: 24px 0 40px;
  border-top: 1px solid var(--hairline);
  display: grid;
  gap: 8px;
  justify-items: start;
  font-size: 12.5px;
  color: var(--text-faint);
  max-width: 70ch;
}
.foot img { opacity: 0.75; }
.foot__meta { font-family: var(--mono); font-size: 11.5px; }

.empty { font-size: 13.5px; color: var(--text-faint); padding: 18px 0; }

.loading { opacity: 0.5; }

/* number roll-in */
.flash { animation: flash 0.7s ease; }
@keyframes flash {
  0% { background: color-mix(in srgb, var(--accent) 22%, transparent); }
  100% { background: transparent; }
}