/* ── Inter font (self-hosted) ───────────────────────────────── */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('../fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ── Reset & base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue:     #3b82f6;
  --blue-h:   #2563eb;
  --green:    #22c55e;
  --red:      #f87171;
  --text:     #f1f5f9;
  --muted:    #94a3b8;
  --border:   #334155;
  --bg:       #0f172a;
  --surface:  #1e293b;
  --bg-alt:   #162032;
  --radius:   8px;
  --shadow:   0 1px 3px rgba(0,0,0,.4), 0 1px 2px rgba(0,0,0,.3);
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
}

/* ── Container ─────────────────────────────────────────────── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s, color .15s, border-color .15s;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}
.btn-primary:hover { background: var(--blue-h); border-color: var(--blue-h); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
}
.btn-ghost:hover { color: var(--text); }

.btn-outline {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.btn-lg  { padding: 14px 28px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

/* ── Navigation ────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, .92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.3px;
}
.logo-dot { color: var(--blue); }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  padding: 96px 0 80px;
  text-align: center;
}

.hero-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 20px;
}

.hero-subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Sections ──────────────────────────────────────────────── */
.section { padding: 64px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  text-align: center;
}

.section-subtitle {
  color: var(--muted);
  text-align: center;
  margin-bottom: 32px;
  font-size: 15px;
}

/* ── How it works ──────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 36px;
  margin-top: 48px;
}

.step-num {
  font-size: 40px;
  font-weight: 800;
  color: var(--blue);
  opacity: 0.25;
  margin-bottom: 12px;
  line-height: 1;
}

.step h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.step p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}

/* ── Tiers ─────────────────────────────────────────────────── */
.tiers-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 680px;
  margin: 38px auto 0;
}

.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  box-shadow: var(--shadow);
}

.tier-card-premium {
  position: relative;
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue), var(--shadow);
  padding-top: 44px;
}

.tier-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}

.tier-badge-free    { background: var(--bg); color: var(--muted); }
.tier-badge-premium { background: rgba(59,130,246,.15); color: var(--blue); }

.tier-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
}

.tier-features {
  list-style: none;
  margin-bottom: 28px;
}

.tier-features li {
  padding: 9px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}
.tier-features li:last-child { border-bottom: none; }

.feature-yes::before  { content: '✓'; color: #4ADE80; font-weight: 700; flex-shrink: 0; }
.feature-no::before   { content: '✕'; color: #DE5050; font-weight: 700; flex-shrink: 0; }
.feature-no  { color: var(--muted); }

/* ── Dashboard ─────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 8px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  margin-bottom: 10px;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--text);
}

.stat-value-green { color: var(--green); }
.stat-value-red   { color: var(--red); }

.stats-period {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 38px;
  margin-top: 4px;
}

.subsection-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.trades-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.trades-table th {
  background: var(--bg-alt);
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.trades-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.trades-table tr:last-child td { border-bottom: none; }
.trades-table tbody tr:hover   { background: rgba(255,255,255,.03); }

.badge-win  { color: var(--green); font-weight: 600; }
.badge-loss { color: var(--red);   font-weight: 600; }
.pnl-pos    { color: var(--green); font-weight: 600; }
.pnl-neg    { color: var(--red);   font-weight: 600; }
.dir-long   { color: var(--blue);  font-weight: 500; }
.dir-short  { color: #a78bfa;      font-weight: 500; }

.loading { text-align: center; color: var(--muted); padding: 40px !important; }

.data-updated {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  margin-top: 8px;
}

/* ── Join CTA ──────────────────────────────────────────────── */
.cta-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 72px 40px;
  text-align: center;
}

.cta-box h2 {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.cta-box p {
  color: var(--muted);
  font-size: 16px;
  margin-bottom: 32px;
}

/* ── Footer ────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 0;
  text-align: center;
}

.footer-logo {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.disclaimer {
  font-size: 12px;
  color: var(--muted);
  max-width: 620px;
  margin: 0 auto 16px;
  line-height: 1.65;
}

.footer-links {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }

/* ── Backtest: Stats Panel ──────────────────────────────────── */
.stats-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

/* Row 1 – Big Three */
.stats-panel-hero {
  display: flex;
  justify-content: space-evenly;
  text-align: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 12px;
}
.stats-hero-item { min-width: 90px; }
.stats-hero-item .stat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 6px; }
.stats-hero-item .stat-val   { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.stat-val-gold { color: #f59e0b; }

/* Row 2 – Trust Row (4-col with group labels) */
.stats-trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 0 10px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.trust-group-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  padding-bottom: 6px;
  opacity: 0.7;
}
.trust-group-label-robustness {
  grid-column: 1 / 3;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.trust-group-label-performance {
  grid-column: 3 / 5;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
  padding-bottom: 4px;
}
.stats-trust-item .stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin-bottom: 4px; }
.stats-trust-item .stat-val   { font-size: 20px; font-weight: 700; }
.oos-check { font-size: 16px; font-weight: 900; margin-right: 3px; }

/* Row 3 – Details (two side-by-side blocks) */
.stats-details-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stats-detail-block {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.stats-detail-block-title {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
  opacity: 0.7;
}
.stats-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
.stats-detail-item .stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 2px; }
.stats-detail-item .stat-val   { font-size: 14px; font-weight: 700; }

/* Hover states */
.stats-hero-item.modal-card:hover,
.stats-trust-item.modal-card:hover,
.stats-detail-item.modal-card:hover { transform: none; box-shadow: none; border-color: transparent; background: rgba(255,255,255,.05); border-radius: 6px; }

@media (max-width: 600px) {
  .stats-trust-row    { grid-template-columns: repeat(2, 1fr); }
  .trust-group-label-robustness { grid-column: 1 / 3; }
  .trust-group-label-performance { grid-column: 1 / 3; }
  .stats-details-row  { grid-template-columns: 1fr; }
}

/* ── IS/OOS callout ─────────────────────────────────────────── */
.oos-callout {
  border-left: 3px solid var(--green);
  background: var(--surface);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 20px;
}

/* ── Performance highlight (index.html) ─────────────────────── */
.perf-highlight { padding: 32px 0 0; }
.perf-highlight-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}
.perf-stats-row {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
}
.perf-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.perf-stat-val {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -1px;
}
.perf-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}
.perf-disclaimer {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

/* ── FAQ ────────────────────────────────────────────────────── */
.faq-list {
  max-width: 720px;
  margin: 38px auto 0;
}

.faq-search-wrap {
  position: relative;
  margin-bottom: 24px;
}
.faq-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 16px 11px 42px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s;
}
.faq-search-input:focus { border-color: var(--blue); }
.faq-search-input::placeholder { color: var(--muted); }
.faq-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.faq-acc { border-top: 1px solid var(--border); }
.faq-item {
  border-bottom: 1px solid var(--border);
}
.faq-item.hidden { display: none; }
.faq-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 18px 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 15px;
  font-weight: 600;
  transition: color .15s;
}
.faq-btn:hover { color: var(--blue); }
.faq-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--muted);
  transition: transform .2s, color .2s, border-color .2s;
}
.faq-item.open .faq-icon { transform: rotate(45deg); color: var(--blue); border-color: var(--blue); }
.faq-body {
  display: none;
  padding: 0 24px 18px 0;
}
.faq-item.open .faq-body { display: block; }
.faq-body p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.faq-noresult {
  display: none;
  text-align: center;
  padding: 36px 0;
  color: var(--muted);
  font-size: 14px;
}

/* ── Scroll-to-top ─────────────────────────────────────────── */
#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, border-color .15s;
  color: var(--muted);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}
#scroll-top.visible { opacity: .75; pointer-events: auto; }
#scroll-top:hover   { opacity: 1; border-color: var(--blue); color: var(--blue); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .nav .btn-ghost   { display: none; }
  .steps            { grid-template-columns: 1fr; gap: 32px; }
  .tiers-grid       { grid-template-columns: 1fr; max-width: 400px; }
  .stats-grid       { grid-template-columns: repeat(2, 1fr); }
  .hero             { padding: 64px 0 56px; }
  .section          { padding: 45px 0; }
  .cta-box          { padding: 48px 24px; }
  .perf-stats-row   { gap: 28px; }
}

/* ── Strategy index cards ───────────────────────────────────── */
.strategy-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:24px; max-width:720px; margin:48px auto 0; }
.strategy-card { background:var(--surface); border:1px solid var(--border); border-radius:12px; padding:28px; transition:border-color .15s; }
.strategy-card:hover:not(.strategy-card-soon) { border-color:var(--blue); }
.strategy-card-soon { opacity:0.4; pointer-events:none; }
.strategy-tag  { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:.8px; color:var(--blue); margin-bottom:8px; }
.strategy-pair { font-size:22px; font-weight:700; margin-bottom:4px; }
.strategy-period { font-size:13px; color:var(--muted); margin-bottom:20px; }
.strategy-stat-row { display:flex; justify-content:space-between; font-size:14px; padding:6px 0; border-bottom:1px solid var(--border); }
.strategy-stat-row:last-of-type { border-bottom:none; }
.strategy-stat-row .slabel { color:var(--muted); }
.strategy-cta  { margin-top:20px; }

/* ── Monthly P&L heatmap ────────────────────────────────────── */
.monthly-wrap   { overflow-x:auto; }
.monthly-grid   { display:grid; grid-template-columns:44px repeat(12,1fr); gap:3px; min-width:540px; }
.monthly-cell   { padding:4px 2px; border-radius:3px; text-align:center; font-size:10px; font-variant-numeric:tabular-nums; }
.monthly-header { color:var(--muted); font-size:10px; font-weight:600; text-align:center; padding:3px 0; }
.monthly-year   { color:var(--muted); font-size:11px; font-weight:600; display:flex; align-items:center; }

@media (max-width: 768px) {
  .strategy-grid { grid-template-columns:1fr; max-width:400px; }
}

@media (max-width: 480px) {
  .hero-title       { letter-spacing: -1px; }
  .hero-cta         { flex-direction: column; align-items: center; }
  .stats-grid       { grid-template-columns: 1fr 1fr; }
  .stat-value       { font-size: 26px; }
}
