:root {
  --bg: #050505;
  --panel: #0b0b0b;
  --panel-2: #101010;
  --ink: #f2f2f0;
  --muted: rgba(242, 242, 240, 0.48);
  --line: rgba(255, 159, 26, 0.22);
  --line-strong: rgba(255, 159, 26, 0.45);
  --amber: #ff9f1a;
  --amber-dim: #c47812;
  --gold: #ff9f1a;
  --gold-soft: #ffb347;
  --pos: #3ddc84;
  --neg: #ff5c5c;
  --brand: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", "Menlo", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.4;
  font-weight: 400;
  font-size: 14px;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(255, 159, 26, 0.07), transparent 55%),
    linear-gradient(180deg, #080808 0%, #050505 40%, #030303 100%);
}
.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  pointer-events: none;
  opacity: 0.35;
}

/* —— Terminal chrome —— */
.term-bar {
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.term-bar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.term-left {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
}
.term-mark {
  font-family: var(--brand);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--amber);
  text-transform: uppercase;
}
.term-mark span { color: var(--ink); font-weight: 500; }
.term-session {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.term-session .live-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pos);
  margin-right: 6px;
  box-shadow: 0 0 8px var(--pos);
  animation: pulse 1.6s ease infinite;
}
.term-session.closed .live-dot {
  background: var(--amber-dim);
  box-shadow: none;
  animation: none;
}

.topnav { display: contents; }
.btn-contact {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-contact:hover {
  background: var(--amber);
  color: #000;
  border-color: var(--amber);
}

.hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 18px;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px 24px;
  align-items: end;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  animation: rise 0.7s ease both;
}
.brand-name {
  font-family: var(--brand);
  font-weight: 700;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
}
.brand-line {
  display: block;
  width: 48px;
  height: 2px;
  background: var(--amber);
}
.brand-sub {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--amber);
}

.meta {
  font-family: var(--mono);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 400;
  margin: 0;
  text-align: right;
  max-width: 420px;
  justify-self: end;
  animation: rise 0.7s ease 0.08s both;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 18px 20px 56px;
  display: grid;
  gap: 18px;
}

/* —— Panels —— */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 159, 26, 0.06);
  animation: rise 0.65s ease both;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 159, 26, 0.1), transparent 55%);
}
.panel-head h2,
.sec-head h2 {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.72rem;
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}
.sec-sub,
.panel-sub {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(255, 159, 26, 0.1), transparent 55%);
}

.perf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  animation: rise 0.65s ease 0.05s both;
}
.perf-card {
  text-align: left;
  padding: 16px 16px 18px;
  border-right: 1px solid var(--line);
  position: relative;
}
.perf-card:last-child { border-right: 0; }
.perf-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--amber);
  opacity: 0.55;
}
.perf-label {
  margin: 0 0 4px;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 500;
}
.perf-date {
  margin: 0 0 10px;
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.perf-value {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(1.55rem, 3.5vw, 2rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}
.perf-value.pos { color: var(--pos); }
.perf-value.neg { color: var(--neg); }

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .meta { text-align: left; justify-self: start; max-width: none; }
  .perf-grid { grid-template-columns: 1fr; }
  .perf-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .perf-card:last-child { border-bottom: 0; }
}

.table-wrap {
  overflow: auto;
  max-height: min(52vh, 520px);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
th, td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-dim);
  font-weight: 600;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
td:last-child, th:last-child { text-align: right; }
/* numeric columns lean right */
td:nth-child(n+3), th:nth-child(n+3) { text-align: right; }
#watchlist_body td:nth-child(1),
#watchlist_body td:nth-child(2),
#trades_body td:nth-child(2),
#signals_body td:nth-child(1),
#signals_body td:nth-child(2) {
  text-align: left;
}
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.12s ease; }
tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
tbody tr:hover { background: rgba(255, 159, 26, 0.07); }

.sym {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--amber);
}
.entry-time {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.72rem;
  color: rgba(242, 242, 240, 0.72);
}
.muted { color: var(--muted); }
.pos { color: var(--pos); font-weight: 500; }
.neg { color: var(--neg); font-weight: 500; }
.act {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.act.entry { color: var(--pos); }
.act.exit { color: var(--neg); }

footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 20px 36px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  border-top: 1px solid var(--line);
}
.footer-brand { color: var(--amber); letter-spacing: 0.08em; text-transform: uppercase; }

/* —— Modal —— */
.modal[hidden] { display: none; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}
.modal-panel {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line-strong);
  padding: 24px 22px 20px;
  animation: rise 0.3s ease both;
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.modal-close:hover { color: var(--amber); }
.modal-panel h2 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.modal-lead {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.85rem;
}
#contact_form { display: grid; gap: 12px; }
#contact_form label { display: grid; gap: 5px; }
#contact_form label span {
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber);
  font-weight: 500;
}
#contact_form input,
#contact_form textarea {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
  background: #050505;
  border: 1px solid var(--line);
  padding: 10px 11px;
  outline: none;
  width: 100%;
  resize: vertical;
}
#contact_form input:focus,
#contact_form textarea:focus { border-color: var(--amber); }
#contact_form .hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  overflow: hidden;
}
.form-status {
  margin: 0;
  min-height: 1.2em;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}
.form-status.ok { color: var(--pos); }
.form-status.err { color: var(--neg); }
.btn-submit {
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #000;
  background: var(--amber);
  border: 1px solid var(--amber);
  padding: 11px 16px;
  cursor: pointer;
}
.btn-submit:hover { filter: brightness(1.06); }
.btn-submit:disabled { opacity: 0.5; cursor: wait; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}
