/* Tom Sosnoff 11 Core Strategy — doc site styles */
:root {
  color-scheme: light;
  --surface-1: #fcfcfb;
  --page: #f9f9f7;
  --sidebar: #f4f3ef;
  --text-primary: #0b0b0b;
  --text-secondary: #52514e;
  --muted: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11,11,11,0.10);
  --series-1: #2a78d6;   /* blue */
  --series-2: #008300;   /* green */
  --series-3: #e87ba4;   /* magenta */
  --series-6: #eb6834;   /* orange */
  --good: #0ca30c;
  --critical: #d03b3b;
  --warning: #eda100;
  --accent: #2a78d6;
  --accent-soft: rgba(42,120,214,0.10);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 8px 24px rgba(0,0,0,0.04);
  --radius: 12px;
  --sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
:root[data-theme="dark"], :root:where(:not([data-theme="light"])) {
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --surface-1: #1a1a19;
    --page: #0d0d0d;
    --sidebar: #151514;
    --text-primary: #ffffff;
    --text-secondary: #c3c2b7;
    --muted: #898781;
    --grid: #2c2c2a;
    --baseline: #383835;
    --border: rgba(255,255,255,0.10);
    --series-1: #3987e5;
    --series-2: #22a022;
    --series-3: #d55181;
    --series-6: #d95926;
    --good: #0ca30c;
    --critical: #e06060;
    --accent: #3987e5;
    --accent-soft: rgba(57,135,229,0.14);
    --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --surface-1: #1a1a19;
  --page: #0d0d0d;
  --sidebar: #151514;
  --text-primary: #ffffff;
  --text-secondary: #c3c2b7;
  --muted: #898781;
  --grid: #2c2c2a;
  --baseline: #383835;
  --border: rgba(255,255,255,0.10);
  --series-1: #3987e5;
  --series-2: #22a022;
  --series-3: #d55181;
  --series-6: #d95926;
  --good: #0ca30c;
  --critical: #e06060;
  --accent: #3987e5;
  --accent-soft: rgba(57,135,229,0.14);
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--page);
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px;
  flex: 0 0 272px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 20px 16px 40px;
}
.content-wrap { flex: 1 1 auto; min-width: 0; display: flex; justify-content: center; }
.content { width: 100%; max-width: 860px; padding: 40px 40px 100px; }

/* ---------- Sidebar nav ---------- */
.brand { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; padding: 0 8px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; flex: 0 0 34px;
  background: linear-gradient(135deg, var(--series-1), var(--series-6));
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px;
}
.brand-title { font-weight: 700; font-size: 15px; line-height: 1.25; }
.brand-sub { font-size: 11.5px; color: var(--muted); }
.nav-group { margin-top: 18px; }
.nav-group h4 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); margin: 0 0 6px; padding: 0 8px; font-weight: 700;
}
.nav a {
  display: flex; gap: 8px; align-items: baseline;
  padding: 7px 8px; border-radius: 8px;
  color: var(--text-secondary); text-decoration: none; font-size: 13.5px;
}
.nav a .n { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; min-width: 15px; }
.nav a:hover { background: var(--accent-soft); color: var(--text-primary); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a .star { color: var(--warning); }

.theme-toggle {
  margin: 16px 8px 0; display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 1px solid var(--border); color: var(--text-secondary);
  padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 12.5px; font-family: var(--sans);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Content typography ---------- */
.content h1 { font-size: 30px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.01em; }
.content h2 {
  font-size: 21px; margin: 40px 0 14px; padding-top: 14px;
  border-top: 1px solid var(--grid); letter-spacing: -0.005em;
}
.content h2:first-of-type { border-top: none; padding-top: 0; }
.content h3 { font-size: 16.5px; margin: 26px 0 10px; color: var(--text-primary); }
.content p { margin: 12px 0; }
.content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; }
.content a:hover { border-bottom-color: var(--accent); }
.content ul, .content ol { padding-left: 22px; margin: 12px 0; }
.content li { margin: 5px 0; }
.content strong { font-weight: 700; color: var(--text-primary); }
.content code {
  background: var(--accent-soft); color: var(--text-primary);
  padding: 1.5px 6px; border-radius: 5px; font-size: 0.88em;
  font-family: "SF Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
}
.content hr { border: none; border-top: 1px solid var(--grid); margin: 32px 0; }

/* blockquote / callout */
.content blockquote {
  margin: 18px 0; padding: 14px 18px;
  background: var(--surface-1); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0; color: var(--text-secondary);
  box-shadow: var(--shadow); font-size: 15px;
}
.content blockquote strong { color: var(--text-primary); }

/* tables */
.table-scroll { overflow-x: auto; margin: 18px 0; border-radius: var(--radius); border: 1px solid var(--border); }
.content table { border-collapse: collapse; width: 100%; font-size: 13.8px; background: var(--surface-1); }
.content th, .content td { padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--grid); vertical-align: top; }
.content th { background: var(--sidebar); font-weight: 700; font-size: 12.5px; white-space: nowrap; position: sticky; top: 0; }
.content tr:last-child td { border-bottom: none; }
.content td:first-child { font-weight: 600; white-space: nowrap; }

/* ---------- Hero (index) ---------- */
.hero {
  background: linear-gradient(135deg, var(--accent-soft), transparent 70%);
  border: 1px solid var(--border); border-radius: 16px; padding: 28px 30px; margin-bottom: 8px;
}
.hero .eyebrow { color: var(--accent); font-weight: 700; font-size: 12.5px; letter-spacing: .05em; text-transform: uppercase; }
.hero h1 { font-size: 33px; margin: 8px 0 10px; }
.hero .meta { color: var(--muted); font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.hero .meta a { color: var(--accent); }

/* ---------- Stat tiles ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin: 22px 0; }
.stat {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow);
}
.stat .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 20px; font-weight: 700; margin-top: 3px; line-height: 1.2; }
.stat .value.sm { font-size: 15px; }
.stat.good .value { color: var(--good); }
.stat.risk-undef .value { color: var(--series-6); }
.stat.risk-def .value { color: var(--accent); }

/* ---------- Figures / charts ---------- */
figure.chart {
  margin: 24px 0; padding: 18px 18px 12px; background: var(--surface-1);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
figure.chart .chart-title { font-weight: 700; font-size: 14.5px; margin-bottom: 2px; }
figure.chart figcaption { color: var(--muted); font-size: 12.5px; margin-top: 8px; line-height: 1.5; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-secondary); margin: 4px 0 2px; }
.legend .item { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.legend .swatch.line { height: 3px; border-radius: 2px; width: 16px; }

/* tooltip */
.viz-tip {
  position: fixed; pointer-events: none; z-index: 50;
  background: var(--text-primary); color: var(--surface-1);
  padding: 6px 9px; border-radius: 7px; font-size: 12px; line-height: 1.45;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); opacity: 0; transition: opacity .08s; white-space: nowrap;
}
.viz-tip .k { opacity: .7; }
.viz-tip b { font-variant-numeric: tabular-nums; }

/* page nav (prev/next) */
.pagenav { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; }
.pagenav a {
  flex: 1 1 0; text-decoration: none; color: var(--text-secondary);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; background: var(--surface-1);
}
.pagenav a:hover { border-color: var(--accent); color: var(--accent); }
.pagenav .dir { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pagenav .ttl { font-weight: 600; font-size: 14px; margin-top: 2px; }
.pagenav a.next { text-align: right; }
.pagenav a.disabled { visibility: hidden; }

/* top-of-page mini TOC */
.toc { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; margin: 20px 0 8px; }
.toc .toc-h { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.toc a { font-size: 13px; color: var(--text-secondary); text-decoration: none; }
.toc a:hover { color: var(--accent); }

.disclaimer { color: var(--muted); font-size: 12px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--grid); line-height: 1.6; }

/* pill tags */
.pill { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 20px; font-weight: 600; }
.pill.bull { background: rgba(0,131,0,.12); color: var(--series-2); }
.pill.bear { background: rgba(235,104,52,.14); color: var(--series-6); }
.pill.neutral { background: var(--accent-soft); color: var(--accent); }
.pill.undef { background: rgba(208,59,59,.12); color: var(--critical); }
.pill.def { background: var(--accent-soft); color: var(--accent); }

/* rolling decision flowchart */
.flow { display: flex; flex-direction: column; align-items: center; margin: 22px 0; }
.flow-node { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 11px 18px; font-weight: 700; font-size: 14px; text-align: center; box-shadow: var(--shadow); max-width: 560px; }
.flow-node.start { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.flow-conn { color: var(--muted); font-size: 20px; line-height: 1.1; margin: 4px 0; }
.flow-conn small { display: block; font-size: 11px; }
.flow-gate { background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow); width: 100%; max-width: 620px; margin: 2px 0; }
.flow-gate .q { font-weight: 700; font-size: 14.5px; margin-bottom: 9px; }
.flow-gate .q .num { color: var(--accent); margin-right: 6px; }
.branch { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; padding: 8px 12px; border-radius: 8px; margin: 5px 0; line-height: 1.5; }
.branch .ico { flex: 0 0 auto; font-weight: 700; }
.branch.good { background: rgba(10,143,10,.10); color: var(--text-primary); border-left: 3px solid var(--good); }
.branch.bad { background: rgba(208,59,59,.10); color: var(--text-primary); border-left: 3px solid var(--critical); }
.branch.stop { background: rgba(235,104,52,.12); color: var(--text-primary); border-left: 3px solid var(--series-6); }
.branch.pass { background: transparent; color: var(--text-secondary); border-left: 3px solid var(--grid); font-weight: 600; }
.branch b { color: var(--text-primary); }

/* study-plan progress checklist */
.studybox { background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); margin: 20px 0; }
.studybox .chart-title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.studybox .sub { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; }
.task { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; font-size: 13.8px; cursor: pointer; }
.task:hover { background: var(--accent-soft); }
.task input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }
.task .d { font-weight: 700; color: var(--accent); margin-right: 4px; }
.task.done { color: var(--muted); }
.task.done .d { color: var(--muted); }
.task.done .txt { text-decoration: line-through; }
.study-prog { font-size: 12px; color: var(--muted); margin-top: 8px; font-weight: 600; }

/* mobile menu */
.menu-btn { display: none; }
@media (max-width: 900px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static; height: auto; width: 100%; flex-basis: auto;
    border-right: none; border-bottom: 1px solid var(--border);
  }
  .nav-wrap { display: none; }
  .nav-wrap.open { display: block; }
  .menu-btn {
    display: inline-flex; align-items: center; gap: 8px; background: transparent;
    border: 1px solid var(--border); border-radius: 8px; padding: 7px 12px; margin-top: 10px;
    color: var(--text-secondary); font-family: var(--sans); font-size: 13px; cursor: pointer;
  }
  .content { padding: 24px 18px 80px; }
  .content h1 { font-size: 25px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 26px; }
}
