:root {
  --bg0: #05070b;
  --bg1: #0b1220;
  --bg-elev: rgba(12, 18, 32, 0.72);
  --bg-card: rgba(14, 22, 38, 0.62);
  --mint: #00f5a0;
  --mint-bright: #3dffc8;
  --mint-dim: rgba(0, 245, 160, 0.12);
  --mint-glow: rgba(0, 245, 160, 0.38);
  --coral: #ff4d6d;
  --coral-dim: rgba(255, 77, 109, 0.16);
  --cyan: #5ad0ff;
  --text: #e8eef7;
  --muted: #8b9bb0;
  --line: rgba(255, 255, 255, 0.08);
  --line-glow: rgba(0, 245, 160, 0.28);
  --radius: 14px;
  --font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
  --mono: "SF Mono", "Cascadia Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 280ms;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--text);
  background: linear-gradient(165deg, var(--bg0) 0%, var(--bg1) 55%, #0a101c 100%);
  background-attachment: fixed;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono,
.stat .value,
.sys-value,
.hud-badge,
.trades-table td {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--mint);
  color: #04110c;
  padding: 0.5rem 0.9rem;
  z-index: 100;
  border-radius: 0 0 8px 0;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { left: 0; }

/* ——— Atmosphere ——— */
.fx-grid,
.fx-grain,
.fx-vignette,
.fx-glow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
}

.fx-grid {
  background-image:
    linear-gradient(rgba(0, 245, 160, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 245, 160, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  transform: perspective(600px) rotateX(58deg) scale(1.6) translateY(-18%);
  transform-origin: center top;
  opacity: 0.55;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 70%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent 70%);
}

.fx-grain {
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  mix-blend-mode: overlay;
}

.fx-vignette {
  background: radial-gradient(ellipse at center, transparent 40%, rgba(0, 0, 0, 0.55) 100%);
}

.fx-glow {
  background:
    radial-gradient(ellipse at 18% 0%, rgba(0, 245, 160, 0.1), transparent 50%),
    radial-gradient(ellipse at 82% 8%, rgba(90, 208, 255, 0.07), transparent 48%);
  height: 60vh;
  inset: 0 0 auto;
}

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* ——— Header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  background: rgba(5, 7, 11, 0.78);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px var(--mint-dim), 0 0 16px var(--mint-glow);
  /* static brand mark — weekly snapshot, not live */
  flex-shrink: 0;
}

@keyframes breathe {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 3px var(--mint-dim), 0 0 14px var(--mint-glow); }
  50% { opacity: 0.7; box-shadow: 0 0 0 5px rgba(0, 245, 160, 0.08), 0 0 22px var(--mint-glow); }
}

.brand strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.01em;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.nav-links {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--mint-bright);
  border-color: rgba(0, 245, 160, 0.25);
  background: var(--mint-dim);
  outline: none;
}


/* ——— Hero ——— */
.hero { padding: 2.5rem 0 1.35rem; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--mint-dim);
  color: var(--mint-bright);
  border: 1px solid rgba(0, 245, 160, 0.22);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  box-shadow: 0 0 20px rgba(0, 245, 160, 0.08);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint-glow);
  /* static brand mark — weekly snapshot, not live */
}

h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.85rem, 4vw, 2.55rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-shadow: 0 0 40px rgba(0, 245, 160, 0.08);
}

h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.4vw, 1.55rem);
  letter-spacing: -0.015em;
}

h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.lede {
  max-width: 46rem;
  margin: 0 0 1.6rem;
  color: var(--muted);
  font-size: 1.02rem;
}

/* ——— Stats / glass cards ——— */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.stat,
.hud-card,
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 24px rgba(0, 245, 160, 0.02),
    0 0 0 1px rgba(0, 245, 160, 0.04),
    0 18px 40px rgba(0, 0, 0, 0.28);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.stat {
  padding: 1rem 1.05rem;
  position: relative;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 245, 160, 0.45), transparent);
  opacity: 0.7;
}

.stat:hover,
.hud-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 245, 160, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 0 28px rgba(0, 245, 160, 0.035),
    0 0 0 1px rgba(0, 245, 160, 0.1),
    0 22px 48px rgba(0, 0, 0, 0.35);
}

.stat .label {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.stat .value {
  font-family: var(--mono);
  font-size: clamp(1.05rem, 2.1vw, 1.32rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  transition: color var(--dur) var(--ease);
}

.stat .value.pos { color: var(--mint); text-shadow: 0 0 18px rgba(0, 245, 160, 0.25); }
.stat .value.neg { color: var(--coral); text-shadow: 0 0 18px rgba(255, 77, 109, 0.22); }
.stat .value.flat { color: var(--text); }

.stat .value.tick {
  animation: numPulse 360ms var(--ease);
}

@keyframes numPulse {
  0% { opacity: 0.55; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ——— Sections ——— */
.section { padding: 1.4rem 0 1.9rem; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 0.3rem;
  color: var(--mint);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.muted { color: var(--muted); }

/* ——— HUD cards / charts ——— */
.hud-card { padding: 1rem 1.05rem 0.85rem; }

.hud-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.chart-title {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hud-badge {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 245, 160, 0.3);
  background: rgba(0, 245, 160, 0.08);
  color: var(--mint-bright);
  box-shadow: 0 0 12px rgba(0, 245, 160, 0.12);
}

.hud-badge.neg {
  border-color: rgba(255, 77, 109, 0.35);
  background: var(--coral-dim);
  color: var(--coral);
  box-shadow: 0 0 12px rgba(255, 77, 109, 0.12);
}

.chart-card-lg {
  margin-bottom: 1.1rem;
  padding: 1.1rem 1.15rem 0.95rem;
  background:
    linear-gradient(180deg, rgba(0, 245, 160, 0.055), transparent 42%),
    var(--bg-card);
}

.chart-stage {
  position: relative;
  height: 240px;
}

.chart-stage-lg { height: 380px; }

.chart-stage canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

/* ——— Systems panel ——— */
.systems-panel { display: flex; flex-direction: column; }

.sys-state {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(90, 208, 255, 0.3);
  color: var(--cyan);
  background: rgba(90, 208, 255, 0.08);
}

.sys-state.flat {
  border-color: rgba(139, 155, 176, 0.35);
  color: var(--muted);
  background: rgba(139, 155, 176, 0.08);
}
.sys-state.win,
.sys-state.open {
  border-color: rgba(0, 245, 160, 0.35);
  color: var(--mint);
  background: var(--mint-dim);
}
.sys-state.loss {
  border-color: rgba(255, 77, 109, 0.35);
  color: var(--coral);
  background: var(--coral-dim);
}

.systems-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.sys-cell {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
}

.sys-cell-wide { grid-column: 1 / -1; }

.sys-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.sys-value {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.sys-note {
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  line-height: 1.4;
}

.status-list {
  list-style: none;
  margin: 0.75rem 0 0.15rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
  max-height: 140px;
  overflow: auto;
}

.status-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}

.status-list .tag {
  color: var(--mint);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}

/* ——— Tables ——— */
.table-card {
  overflow: auto;
  padding: 0.2rem 0;
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.trades-table th,
.trades-table td {
  padding: 0.7rem 1rem;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.trades-table th {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.trades-table tbody tr {
  transition: background var(--dur) var(--ease);
}
.trades-table tbody tr:hover { background: rgba(0, 245, 160, 0.04); }
.trades-table tbody tr:last-child td { border-bottom: none; }

.trades-table td { font-family: var(--mono); font-size: 0.84rem; }
.trades-table .pos { color: var(--mint); }
.trades-table .neg { color: var(--coral); }
.trades-table .flat { color: var(--muted); }

.empty-note {
  margin: 1rem 1.1rem 1.15rem;
  color: var(--muted);
}

/* ——— About ——— */
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.about-card { padding: 1.15rem 1.2rem; }
.about-card p { margin: 0.35rem 0 0; color: var(--muted); }
.about-card h3 { color: var(--text); }

.disclaimer {
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
}

.btn-primary {
  background: var(--mint);
  color: #04110c;
  box-shadow: 0 0 24px rgba(0, 245, 160, 0.25);
}

.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding: 1.2rem 0 2rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.86rem;
}

/* ——— Responsive ——— */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .systems-panel { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .stat-grid,
  .info-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .stat-grid,
  .chart-grid,
  .info-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 1.75rem; }
  .chart-stage { height: 220px; }
  .chart-stage-lg { height: 280px; }
}

/* ——— Reduced motion ——— */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .brand-dot,
  .pill-dot { animation: none; }
  .stat,
  .hud-card,
  .nav-links a,
  .trades-table tbody tr,
  .stat .value {
    transition: none !important;
  }
  .stat:hover,
  .hud-card:hover { transform: none; }
  .stat .value.tick { animation: none; }
}



/* Paper backtest page + home link */
.about-backtest {
  margin-top: 0;
  width: 100%;
  max-width: none;
}
.about-backtest .hud-card-head { margin-bottom: 0.65rem; }
.backtest-figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(61, 255, 200, 0.18);
  background: #05070b;
}
.backtest-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1530 / 630;
  object-fit: contain;
  background: #05070b;
}
.backtest-figure figcaption {
  margin: 0;
  padding: 0.55rem 0.8rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  border-top: 1px solid rgba(61, 255, 200, 0.12);
}
.hero-compact { padding-bottom: 0.5rem; }
.hero-compact .lede { max-width: 40rem; }
.inline-link {
  color: var(--mint, #00f5a0);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 245, 160, 0.35);
}
.inline-link:hover { border-bottom-color: rgba(0, 245, 160, 0.85); }

.hero-compact { padding-bottom: 0.5rem; }
.hero-compact .lede { max-width: 40rem; }
.about-backtest { margin-top: 0; width: 100%; max-width: none; }
.about-backtest .hud-card-head { margin-bottom: 0.65rem; }
.backtest-figure {
  margin: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(61, 255, 200, 0.18);
  background: #05070b;
}
.backtest-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1530 / 630;
  object-fit: contain;
  background: #05070b;
}
.backtest-figure figcaption {
  margin: 0;
  padding: 0.55rem 0.8rem 0.65rem;
  font-size: 0.78rem;
  line-height: 1.35;
  border-top: 1px solid rgba(61, 255, 200, 0.12);
}
.inline-link {
  color: var(--mint, #00f5a0);
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 245, 160, 0.35);
}
.inline-link:hover { border-bottom-color: rgba(0, 245, 160, 0.85); }
.tweak-list {
  margin: 0.75rem 0 0;
  padding: 0 0 0 1.15rem;
  display: grid;
  gap: 0.95rem;
}
.tweak-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  align-items: baseline;
}
.tweak-flag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--mint, #00f5a0);
  border: 1px solid rgba(0, 245, 160, 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
}
.tweak-flag.muted {
  color: var(--muted);
  border-color: rgba(255,255,255,0.14);
}
.tweak-when { font-size: 0.78rem; margin-top: 0.2rem; }
.tweak-detail {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

/* All-time best / worst trade cards */
.extremes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
@media (max-width: 720px) {
  .extremes-grid { grid-template-columns: 1fr; }
}
.extreme-card {
  padding: 1.1rem 1.2rem 1.25rem;
}
.extreme-best {
  box-shadow: inset 0 0 0 1px rgba(0, 245, 160, 0.22), 0 0 28px rgba(0, 245, 160, 0.06);
}
.extreme-worst {
  box-shadow: inset 0 0 0 1px rgba(255, 92, 122, 0.28), 0 0 28px rgba(255, 92, 122, 0.06);
}
.extreme-pnl {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.35rem 0 1rem;
  line-height: 1.1;
}
.extreme-pnl.positive { color: #00f5a0; }
.extreme-pnl.negative { color: #ff5c7a; }
.extreme-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem 1rem;
  margin: 0;
}
.extreme-meta dt {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #8b98a8);
}
.extreme-meta dd {
  margin: 0.15rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  color: var(--text, #e8eef7);
}
.hud-badge.positive {
  color: #00f5a0;
  border-color: rgba(0, 245, 160, 0.35);
}
.hud-badge.negative {
  color: #ff5c7a;
  border-color: rgba(255, 92, 122, 0.35);
}

