/* =====================================================
   Home and login pages
   ===================================================== */

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f8;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: #141b26;
  line-height: 1.5;
}

.site {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 16px;
}

.site.narrow { max-width: 420px; }

.hero { margin-bottom: 40px; }

.eyebrow {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1b7a3a;
}

h1 { margin: 0 0 16px; font-size: clamp(28px, 5vw, 40px); line-height: 1.15; }
h2 { margin: 0 0 6px; font-size: 18px; }

.lead { margin: 0 0 24px; font-size: 18px; color: #3b4452; max-width: 640px; }

.button {
  display: inline-block;
  padding: 12px 20px;
  border: 0;
  border-radius: 10px;
  background: #1b7a3a;
  color: #fff;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: #146c2e; }

.points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.points > div {
  padding: 18px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e3e7ec;
}

.points p { margin: 0 0 8px; color: #3b4452; }
.note { font-size: 13px; color: #5b6573; }

.site-footer { margin-top: 40px; padding-top: 16px; border-top: 1px solid #dde2e8; }

.disclaimer { font-size: 13px; color: #5b6573; }

.login { display: grid; gap: 12px; margin: 16px 0; }
.login label { display: grid; gap: 6px; font-weight: 600; }
.login input[type="password"],
.login input[type="text"] {
  padding: 10px 12px;
  border: 1px solid #b9c2cc;
  border-radius: 8px;
  font: inherit;
}

.form-error { color: #a63138; font-weight: 600; }

a { color: #245da8; }

/* ---------- Top bar (Log In / Register always visible, also on phones) ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

.brand { font-size: 22px; font-weight: 800; color: #141b26; text-decoration: none; letter-spacing: 0.02em; }
.topnav { display: flex; gap: 10px; flex-wrap: wrap; }
.topnav .button { padding: 10px 18px; }

.button.secondary { background: #fff; color: #1b7a3a; border: 2px solid #1b7a3a; padding: 8px 16px; }
.button.secondary:hover { background: #f1faf3; }

.notice {
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff4d6;
  border: 1px solid #e3c45c;
  color: #6b4d00;
  font-weight: 600;
}

/* ---------- Homepage ---------- */

.toplinks { display: flex; gap: 18px; font-size: 15px; font-weight: 600; }
.toplinks a { color: #1b5e30; text-decoration: none; }
.toplinks a:hover { text-decoration: underline; }

.site.home { max-width: 1120px; padding-top: 8px; }
.home .hero { margin-bottom: 8px; }
.home .hero h1 { font-size: clamp(32px, 5.4vw, 52px); max-width: 860px; }
.home .lead { max-width: 820px; margin-bottom: 14px; }

.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 22px 0 28px; }
.text-link { font-weight: 700; color: #1b5e30; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.results { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.result { background: #fff; border: 1px solid #e3e7ec; border-radius: 14px; padding: 16px 18px; }
.result-k { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #4a5563; margin-bottom: 6px; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 3px 0; }
.result-row .who { font-size: 14px; color: #3b4452; white-space: nowrap; }
.result-row .num { font-size: clamp(22px, 2.6vw, 28px); font-weight: 800; color: #141b26; white-space: nowrap; font-variant-numeric: tabular-nums; }
.result-row .num small { font-size: 15px; font-weight: 600; color: #5b6573; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }
.dot-v13 { background: #2a6fd6; }
.dot-bh { background: #d4661f; }
.results-note { font-size: 13px; color: #4a5563; margin: 12px 0 0; }

.block { margin-top: 56px; padding-top: 32px; border-top: 1px solid #dde2e8; }
.block h2 { font-size: clamp(24px, 3vw, 30px); margin-bottom: 6px; }
.meta-line { color: #4a5563; font-size: 14px; margin: 0 0 18px; }

.chart-title { font-size: 19px; margin: 26px 0 2px; }
.chart-sub { margin: 0 0 8px; color: #3b4452; font-size: 15px; }
.key { white-space: nowrap; margin-left: 12px; }
.sw { display: inline-block; width: 12px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw-v13 { background: #2a6fd6; }
.sw-bh { background: #d4661f; }

.chart { position: relative; background: #fff; border: 1px solid #e3e7ec; border-radius: 12px; padding: 8px 6px 2px; min-height: 240px; }
.chart svg { display: block; }
.chart-tip {
  position: absolute; z-index: 2; width: 170px; padding: 7px 9px; font-size: 12.5px; line-height: 1.5;
  background: #fff; border: 1px solid #d5dbe2; border-radius: 8px; box-shadow: 0 4px 14px rgba(20, 30, 45, 0.12); pointer-events: none;
}
.chart-tip .sw { width: 10px; height: 10px; border-radius: 50%; }

.lag-strip { list-style: none; margin: 4px 0 18px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.lag-strip li { display: grid; padding: 6px 10px; border-radius: 10px; background: #fff; border: 1px solid #e3e7ec; min-width: 92px; }
.lag-strip .yr { font-size: 13px; font-weight: 700; color: #3b4452; }
.lag-strip .pt { font-size: 15px; font-weight: 700; color: #141b26; }
.lag-strip li.lag { background: #fdf2f3; border-color: #f0c9cc; }
.lag-strip li.ahead { background: #f1faf3; border-color: #bfe5c9; }

.assumptions { background: #fff; border: 1px solid #e3e7ec; border-radius: 12px; padding: 12px 16px; }
.assumptions summary { cursor: pointer; font-weight: 700; }
.assumptions ul { margin: 10px 0 2px; padding-left: 20px; color: #3b4452; font-size: 14px; display: grid; gap: 6px; }
.report-link { margin: 18px 0 0; }

.how { list-style: none; counter-reset: how; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.how li { counter-increment: how; background: #fff; border: 1px solid #e3e7ec; border-radius: 14px; padding: 16px 18px; display: grid; gap: 4px; }
.how li::before { content: counter(how); width: 28px; height: 28px; border-radius: 50%; background: #1b7a3a; color: #fff;
  display: grid; place-items: center; font-weight: 800; margin-bottom: 6px; }
.how span { color: #3b4452; }

.example-caption { color: #4a5563; font-size: 14px; margin: 0 0 18px; }
.example-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 600px); gap: 32px; align-items: start; }

/* Walkthrough panel */
.wt-intro { margin: 0 0 12px; color: #3b4452; }
.wt-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.wt-step { background: #fff; border: 1px solid #dde2e8; border-radius: 12px; }
.wt-step.is-open { border-color: #2a6fd6; box-shadow: 0 0 0 2px rgba(42, 111, 214, 0.15); }
.wt-head { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; font-weight: 700; }
.wt-head:focus-visible { outline: 3px solid #2a6fd6; outline-offset: 2px; border-radius: 12px; }
.wt-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #e7f0fc; color: #1e4885; display: grid; place-items: center; font-size: 14px; }
.wt-step.is-open .wt-num { background: #2a6fd6; color: #fff; }
.wt-body { padding: 0 14px 12px 52px; color: #3b4452; }
.wt-body p { margin: 0; }
.walkthrough.is-js .wt-step:not(.is-open) .wt-body { display: none; }
.wt-controls { display: none; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.walkthrough.is-js .wt-controls { display: flex; }
.wt-btn { font: inherit; font-weight: 700; padding: 8px 14px; border-radius: 10px; border: 1px solid #c3ccd6; background: #fff; color: #141b26; cursor: pointer; }
.wt-btn:disabled { opacity: 0.4; cursor: default; }
.wt-count { color: #4a5563; font-size: 14px; }
.walkthrough [hidden] { display: none !important; }

/* Walkthrough markers and highlight on the example card (the card itself is unchanged) */
.home-page .card .wt-area { position: relative; transition: opacity 0.2s; }
.home-page .card.wt-on .wt-area:not(.wt-active) { opacity: 0.35; }
.home-page .card .wt-area.wt-active { outline: 3px solid #2a6fd6; outline-offset: 4px; border-radius: 12px; }
.wt-marker {
  position: absolute; top: -12px; left: -12px; z-index: 1; width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid #fff; background: #2a6fd6; color: #fff; font: 800 13px/1 "Segoe UI", system-ui, sans-serif; cursor: pointer;
  box-shadow: 0 1px 4px rgba(20, 30, 45, 0.25);
}
.wt-marker.at-right { left: auto; right: -12px; }
.wt-marker.is-current { background: #1e4885; transform: scale(1.12); }
.wt-marker:focus-visible { outline: 3px solid #141b26; outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .home-page .card .wt-area { transition: none; } .wt-marker.at-right { left: auto; right: -12px; }
.wt-marker.is-current { transform: none; } }

.assumption-list { padding-left: 20px; color: #3b4452; display: grid; gap: 6px; }
.daily { margin: 12px 0 14px; padding-left: 22px; display: grid; gap: 8px; color: #3b4452; }

/* Public backtest page */
.site.report { max-width: 1120px; padding-top: 8px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e3e7ec; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { padding: 9px 12px; border-bottom: 1px solid #eef0f3; text-align: right; white-space: nowrap; }
.data-table th:first-child { text-align: left; }
.data-table thead th { font-size: 13px; color: #4a5563; background: #f7f8fa; }
.data-table small { color: #5b6573; font-weight: 400; }
.data-table tr.lag .diff { color: #a63138; font-weight: 700; }
.data-table tr.ahead .diff { color: #146c2e; font-weight: 700; }
.table-scroll { overflow-x: auto; border-radius: 12px; }

@media (max-width: 960px) {
  .results, .how { grid-template-columns: minmax(0, 1fr); }
  .example-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .example-grid #card-root { order: -1; }   /* the card first on phones, the explanation below it */
}

@media (max-width: 480px) {
  .key { display: inline-block; margin: 2px 12px 0 0; }
  .wt-body { padding-left: 14px; }
}
