/* oracle.css: the public Oracle page (/oracle) and its login-gated technical
   page (/oracle/research). Loaded after landing.css, which owns the palette,
   the nav, the buttons and the base table. Classes here use the orc- prefix
   for the public page and the orx- prefix for the technical page. */

/* ===================== public page (/oracle) ===================== */

.orc-hero { align-items: start; }
.orc-kicker {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 12px;
}
.orc-note { margin: 12px 0 0; font-size: 13px; color: var(--text-dim); }

.orc-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  padding: 22px 24px; box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.orc-card h2 { margin: 0 0 14px; font-size: 16px; color: #fff; }
.orc-list { margin: 0; padding-left: 18px; }
.orc-list li { margin: 0 0 10px; font-size: 14px; color: var(--text-2); }
.orc-list li b { color: #fff; font-weight: 600; }
.orc-card-foot { margin: 16px 0 0; font-size: 12.5px; color: var(--text-dim); }

.orc-steps-3 { grid-template-columns: repeat(3, 1fr); }

/* Headline stat cards of the gold-standard block. */
.orc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 4px 0 22px; }
.orc-stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px;
}
.orc-stat-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.orc-stat-v { font-size: 30px; color: #fff; font-variant-numeric: tabular-nums; margin: 6px 0 3px; }
.orc-stat-n { font-size: 12.5px; color: var(--text-2); }
.orc-features-4 { grid-template-columns: repeat(4, 1fr); }

.orc-risk {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid #ef5350;
  border-radius: 12px; padding: 18px 22px;
}
.orc-risk p { margin: 0 0 12px; font-size: 14px; color: var(--text-2); max-width: 78em; }
.orc-risk p:last-child { margin-bottom: 0; }
.orc-risk b { color: #fff; }
.orc-cta-end { margin-top: 20px; }

@media (max-width: 960px) {
  .orc-steps-3, .orc-features-4, .orc-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .orc-steps-3, .orc-features-4, .orc-stats { grid-template-columns: 1fr; }
}

/* ================ technical page (/oracle/research) ================ */

.orx-layout {
  max-width: 1280px; margin: 0 auto; padding: 28px 24px 60px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 32px; align-items: start;
}
/* Collapsed: the rail shrinks to the width of the "Show contents" button, so
   the control that brings the list back never overlaps the body. */
.orx-layout.is-collapsed { grid-template-columns: auto minmax(0, 1fr); gap: 16px; }
.orx-layout.is-collapsed .orx-toc-inner { display: none; }

/* ----- side table of contents ----- */
.orx-toc { position: sticky; top: 74px; }
.orx-toc-inner {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 8px 14px 14px; max-height: calc(100vh - 110px); overflow-y: auto;
}
.orx-toc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 8px;
}
.orx-toc-title {
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-dim);
}
.orx-toc-list { list-style: none; margin: 0; padding: 0; }
.orx-toc-list a {
  display: block; padding: 5px 8px; border-radius: 6px; font-size: 13px;
  color: var(--text-2); text-decoration: none; border-left: 2px solid transparent;
}
.orx-toc-list a:hover { background: var(--panel-2); color: #fff; }
.orx-toc-list a.is-active { color: #fff; border-left-color: var(--accent); background: var(--panel-2); }

.orx-toc-toggle {
  background: var(--panel-2); border: 1px solid var(--border-2); color: var(--text-2);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; font-family: var(--font);
  cursor: pointer; white-space: nowrap;
}
.orx-toc-toggle:hover { background: var(--panel-hover); color: #fff; }
.orx-toc-show {
  position: sticky; top: 74px; z-index: 4; margin-bottom: 12px; display: none;
}
.orx-layout.is-collapsed .orx-toc-show { display: block; }

/* ----- body ----- */
.orx-body { min-width: 0; }
.orx-head { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 8px; }
.orx-head h1 { margin: 6px 0 12px; font-size: 32px; color: #fff; letter-spacing: -.4px; }
.orx-head p { margin: 0; color: var(--text-2); max-width: 62em; }

.orx-sec { padding: 30px 0 6px; scroll-margin-top: 80px; }
.orx-sec h2 {
  font-size: 21px; color: #fff; margin: 0 0 6px; letter-spacing: -.2px;
}
.orx-sec h3 { font-size: 15px; color: #fff; margin: 22px 0 8px; }
.orx-sec p { color: var(--text-2); font-size: 14px; margin: 0 0 12px; max-width: 78em; }
.orx-sec ul, .orx-sec ol { color: var(--text-2); font-size: 14px; margin: 0 0 12px; padding-left: 20px; max-width: 78em; }
.orx-sec li { margin: 0 0 7px; }
.orx-sec b { color: #fff; font-weight: 600; }
.orx-sub { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.orx-src { color: var(--text-dim); font-size: 12.5px; margin: 10px 0 0; }

/* ----- stat strip ----- */
.orx-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0 20px; }
.orx-stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px;
}
.orx-stat-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.orx-stat-v { font-size: 22px; color: #fff; font-variant-numeric: tabular-nums; margin: 4px 0 2px; }
.orx-stat-n { font-size: 12.5px; color: var(--text-2); }

/* ----- stage cards ----- */
.orx-stages { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 4px 0 16px; }
.orx-stage {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px; border-top: 3px solid var(--border-2);
}
.orx-stage.s-ignition { border-top-color: #26a69a; }
.orx-stage.s-rising   { border-top-color: #66bb6a; }
.orx-stage.s-peaking  { border-top-color: #ffa726; }
.orx-stage.s-falling  { border-top-color: #ef5350; }
.orx-stage.s-bust     { border-top-color: #b71c1c; }
.orx-stage.s-dormant  { border-top-color: #787b86; }
.orx-stage h4 { margin: 0 0 6px; font-size: 14px; color: #fff; }
.orx-stage p { margin: 0; font-size: 13px; color: var(--text-2); }
.orx-stage .orx-stage-num { color: #fff; font-variant-numeric: tabular-nums; }

/* ----- callouts ----- */
.orx-call {
  background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 14px 18px; margin: 14px 0 16px;
}
.orx-call.is-warn { border-left-color: #ef5350; }
.orx-call p { margin: 0 0 8px; }
.orx-call p:last-child { margin-bottom: 0; }

/* ----- tables ----- */
.orx-tools {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 12px 0 8px;
}
.orx-tools label { font-size: 12.5px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 6px; }
.orx-tools input, .orx-tools select {
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 6px;
  padding: 6px 9px; color: var(--text); font-size: 13px; font-family: var(--font);
}
.orx-tools input:focus, .orx-tools select:focus { outline: none; border-color: var(--accent); }
.orx-count { font-size: 12.5px; color: var(--text-dim); }

.orx-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 13.5px; }
.orx-table th, .orx-table td {
  padding: 9px 13px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top;
}
.orx-table thead th {
  color: var(--text-dim); font-weight: 600; font-size: 12px; letter-spacing: .02em;
  text-transform: uppercase; white-space: nowrap; cursor: pointer; user-select: none;
  position: sticky; top: 0; background: var(--panel-2); z-index: 1;
}
.orx-table thead th:hover { color: #fff; }
.orx-table thead th::after { content: ' \2195'; opacity: .35; }
.orx-table thead th.sort-asc::after { content: ' \25B2'; opacity: 1; color: var(--accent); }
.orx-table thead th.sort-desc::after { content: ' \25BC'; opacity: 1; color: var(--accent); }
.orx-table tbody tr:last-child td { border-bottom: 0; }
.orx-table td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.orx-table td b { color: #fff; }
.orx-tall { max-height: 620px; overflow-y: auto; }

.orx-link { color: var(--accent); text-decoration: none; }
.orx-link:hover { text-decoration: underline; }

@media (max-width: 1040px) {
  .orx-layout, .orx-layout.is-collapsed { grid-template-columns: 1fr; gap: 16px; }
  .orx-toc { position: static; }
  .orx-toc-inner { max-height: 260px; }
  .orx-stats { grid-template-columns: repeat(2, 1fr); }
  .orx-stages { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .orx-layout { padding: 20px 16px 44px; }
  .orx-stats, .orx-stages { grid-template-columns: 1fr; }
  .orx-head h1 { font-size: 25px; }
}

/* The Oracle feature cards carry substance, so they read at body brightness. */
.orc-features-4 .lp-feature p { color: var(--text-2); }

/* ============= book pages (/books/<slug>) and their landing links =============
   The pages reuse the lp- and orc- styles. These rules cover the two things
   those styles do not carry: the book link in the landing backtest table and
   the "this book" row of a numbers table. */

.lp-book-link { display: block; color: var(--accent); text-decoration: none; }
.lp-book-link:hover { text-decoration: underline; }

.bk-self td { background: var(--panel-2); color: #fff; }
.bk-window { white-space: nowrap; }
.bk-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 5px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 600;
  letter-spacing: .02em; text-transform: uppercase; vertical-align: 1px;
}
